Skip to content

Commit

Permalink
Merge branch 'feat/rsc-build' of github.com:dac09/redwood into feat/c…
Browse files Browse the repository at this point in the history
…onsolidate-vite-settings-rsc-builds

* 'feat/rsc-build' of github.com:dac09/redwood:
  Update jsdoc for ScenarioData type (redwoodjs#10066)
  fix(deps): update opentelemetry-js monorepo (redwoodjs#10065)
  @tobbe.dev/rsc-test@0.0.5
  @tobbe.dev/rsc-test@0.0.4
  • Loading branch information
dac09 committed Feb 27, 2024
2 parents 0eed940 + 87d0daf commit c99ba77
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 141 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

## Unreleased

- Update jsdoc for ScenarioData type (#29166)

Fix formatting of JSDocs in `scenario.ts`

- fix(deps): update opentelemetry-js monorepo (#10065)

Updates our opentelemetry packages. This is a breaking change for users of
our experimental opentelemetry support. This is what their changelog says is
breaking:

* fix(exporter-metrics-otlp-grpc): programmatic headers take precedence over
environment variables #2370 @Vunovati
* fix(exporter-metrics-otlp-http): programmatic headers take precedence over
environment variables #2370 @Vunovati
* fix(exporter-metrics-otlp-proto): programmatic headers take precedence over
environment variables #2370 @Vunovati
* fix(otlp-exporter-base)!: decrease default concurrency limit to 30 #4211
@pichlermarc
* fixes a memory leak on prolonged collector unavailability
* this change is marked as breaking as it changes defaults
* fix(instrumentation)!: pin import-in-the-middle@1.7.1 #4441
* Fixes a bug where, in some circumstances, ESM instrumentation packages
would try to instrument CJS exports on ESM, causing the end-user
application to crash.
* This breaking change only affects users that are using the experimental
@opentelemetry/instrumentation/hook.mjs loader hook AND Node.js 18.19 or
later:
* This reverts back to an older version of import-in-the-middle due to
DataDog/import-in-the-middle#57
* This version does not support Node.js 18.19 or later

- Add support for additional env var files (#9961)

Fixes #9877. This PR adds a new middleware step to the CLI that looks for an `--include-env-files` flag and includes `.env.[file]` to the list of dotfiles to load. This PR also introduces functionality so that `.env.[file]` files are loaded based on `NODE_ENV`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@redwoodjs/forms": "7.0.0-canary.1011",
"@redwoodjs/router": "7.0.0-canary.1011",
"@redwoodjs/web": "7.0.0-canary.1011",
"@tobbe.dev/rsc-test": "0.0.3",
"@tobbe.dev/rsc-test": "0.0.5",
"client-only": "0.0.1",
"react": "0.0.0-experimental-e5205658f-20230913",
"react-dom": "0.0.0-experimental-e5205658f-20230913",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"@babel/runtime-corejs3": "7.23.9",
"@iarna/toml": "2.2.5",
"@opentelemetry/api": "1.7.0",
"@opentelemetry/core": "1.18.1",
"@opentelemetry/exporter-trace-otlp-http": "0.45.1",
"@opentelemetry/resources": "1.18.1",
"@opentelemetry/sdk-trace-node": "1.18.1",
"@opentelemetry/semantic-conventions": "1.18.1",
"@opentelemetry/core": "1.21.0",
"@opentelemetry/exporter-trace-otlp-http": "0.48.0",
"@opentelemetry/resources": "1.21.0",
"@opentelemetry/sdk-trace-node": "1.21.0",
"@opentelemetry/semantic-conventions": "1.21.0",
"@prisma/internals": "5.9.1",
"@redwoodjs/api-server": "7.0.0",
"@redwoodjs/cli-helpers": "7.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/create-redwood-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"@babel/core": "^7.22.20",
"@babel/plugin-transform-typescript": "^7.22.15",
"@opentelemetry/api": "1.7.0",
"@opentelemetry/exporter-trace-otlp-http": "0.45.1",
"@opentelemetry/resources": "1.18.1",
"@opentelemetry/sdk-trace-node": "1.18.1",
"@opentelemetry/semantic-conventions": "1.18.1",
"@opentelemetry/exporter-trace-otlp-http": "0.48.0",
"@opentelemetry/resources": "1.21.0",
"@opentelemetry/sdk-trace-node": "1.21.0",
"@opentelemetry/semantic-conventions": "1.21.0",
"@redwoodjs/framework-tools": "7.0.0",
"@redwoodjs/tui": "7.0.0",
"@types/babel__core": "7.20.4",
Expand Down
80 changes: 43 additions & 37 deletions packages/testing/src/api/scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,51 @@ import type { A } from 'ts-toolbelt'

/**
* Use this function to define your scenario.
*
* @example
* export const standard = defineScenario({
user: {
dom: {
name: 'Dom Saadi',
email: 'dom@redwoodjs.com'
}
},
})
/* @example
* export const standard = defineScenario<Prisma.CreateUserArgs>({
user: {
dom: {
name: 'Dom Saadi',
email: 'dom@redwoodjs.com'
}
},
})
*/
* user: {
* dom: {
* name: 'Dom Saadi',
* email: 'dom@redwoodjs.com',
* },
* },
* })
*
* @example
* export const standard = defineScenario<Prisma.CreateUserArgs>({
* user: {
* dom: {
* name: 'Dom Saadi',
* email: 'dom@redwoodjs.com',
* },
* },
* })
*/
export const defineScenario: DefineScenario = (data) => {
return data
}

/**
* @example {
* dannyUser: {data :{
* id: 1,
* name: 'Danny',}
* }}
*
* @example
* krisUser: (scenario) => {
* return {
* data: {
* id: 2,
* name: 'Kris',
* }
* }
* {
* dannyUser: {
* data: {
* id: 1,
* name: 'Danny',
* },
* },
* }
*
* @example
* krisUser: (scenario) => {
* return {
* data: {
* id: 2,
* name: 'Kris',
* },
* }
* }
*/
type ScenarioDefinitionMap<
PrismaCreateType extends { data: any },
Expand Down Expand Up @@ -85,20 +91,20 @@ export interface DefineScenario {
* import { Product } from '@prisma/client'
*
* // If you scenario looks like this:
* * export const standard = defineScenario({
* product: {
* shirt: {
* id: 55,
* price: 10
* }
* export const standard = defineScenario({
* product: {
* shirt: {
* id: 55,
* price: 10,
* },
* },
* })
*
* // Export the StandardScenario type as
* export StandardScenario = ScenarioData<Product, 'product'>
*
* // You can also define each of the keys in your scenario, so you get stricter type checking
* export StandardScenario = ScenarioData<Product, 'product', 'shirt'>
*
*/
export declare type ScenarioData<
TModel, // the prisma model, imported from @prisma/client e.g. "Product"
Expand Down
Loading

0 comments on commit c99ba77

Please sign in to comment.