Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into chore/web-pa…
Browse files Browse the repository at this point in the history
…ckage-cjsonly-new-build

* 'main' of github.com:redwoodjs/redwood: (66 commits)
  chore(testing dbAuth): Add "yes" prompt testing for WebAuthn (redwoodjs#10823)
  chore(testing dbAuth): Mock console.log to silence test output (redwoodjs#10821)
  chore(testing dbAuth): Remove duplicated tests (redwoodjs#10822)
  chore(testing dbAuth): Remove outdated code (redwoodjs#10820)
  chore(testing dbAuth): Consistent naming and fix blue squiggles (redwoodjs#10819)
  chore(testing dbAuth): provide mock implementations (redwoodjs#10818)
  feat(dbAuth): Only suggest dbAuth setup if needed (redwoodjs#10793)
  chore(dbAuth): Fix test for webauthn prompt in `g dbAuth` (redwoodjs#10814)
  fix(dbAuth): Print the correct "post message" after generation (redwoodjs#10813)
  fix(dbauth): Fix spacing issue in task titles (redwoodjs#10811)
  deps(docs): update braces package (redwoodjs#10809)
  chore(deps): bump braces from 3.0.2 to 3.0.3 in /tasks/check (redwoodjs#10808)
  chore(deps): update yarn to v4.3.0 (redwoodjs#10801)
  chore(deps): update dependency tsx to v4.15.2 (redwoodjs#10800)
  chore(deps): update dependency @clerk/types to v3.65.2 (redwoodjs#10795)
  chore(deps): update dependency firebase to v10.12.2 (redwoodjs#10802)
  chore(deps): update dependency rollup to v4.18.0 (redwoodjs#10799)
  chore(deps): update dependency jsdom to v24.1.0 (redwoodjs#10798)
  chore(deps): update dependency @types/vscode to v1.90.0 (redwoodjs#10796)
  chore(deps): update dependency @clerk/clerk-react to v4.32.2 (redwoodjs#10794)
  ...
  • Loading branch information
dac09 committed Jun 17, 2024
2 parents 88877ca + 8b40ed2 commit d853319
Show file tree
Hide file tree
Showing 174 changed files with 3,023 additions and 1,306 deletions.
3 changes: 3 additions & 0 deletions .changesets/10739.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Updates seeds script to be more generic, no more errors throw on first run (#10739) by @cannikin

Updated the template seed script to not contain any actual seed data, just comments about how to use it when the time comes. The first time you migrate the console message will point you to the file, and the file will point you to a new docs page which goes into much more detail on usage.
3 changes: 3 additions & 0 deletions .changesets/10761.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- feat(cli): react compiler lint only setting (#10761) by @Josh-Walker-GM

You can now add `lintOnly = true` within your `[experimental.reactCompiler]` TOML settings to enable the react compiler linting rules without the compiler itself enabled during code compilation. See [here](https://community.redwoodjs.com/t/react-compiler-setup-experimental/7128) for more details.
3 changes: 3 additions & 0 deletions .changesets/10788.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(dbauth): Combine react imports (#10788) by @Tobbe

Clean up imports in `g dbAuth` templates
3 changes: 3 additions & 0 deletions .changesets/10791.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(dbauth): Don't duplicate authDecoder creation (#10791) by @Tobbe

Make it possible to run the dbAuth setup command more than once without getting invalid code
3 changes: 3 additions & 0 deletions .changesets/10793.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- feat(dbAuth): Only suggest dbAuth setup if needed (#10793) by @Tobbe

Detect if dbAuth is already setup, and don't suggest setting it up if it is.
3 changes: 3 additions & 0 deletions .changesets/10811.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(dbauth): Fix spacing issue in task titles (#10811) by @Tobbe

Fix double space issue in `yarn rw generate dbAuth` output
5 changes: 5 additions & 0 deletions .changesets/10813.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- fix(dbAuth): Print the correct "post message" after setup (#10813) by @Tobbe

After running `yarn rw generate dbAuth` the correct message describing the
needed manual steps is now printed if the user choses to enable WebAuthn
support
2 changes: 1 addition & 1 deletion .github/actions/check_changesets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"@actions/exec": "1.1.1",
"@actions/github": "6.0.0"
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.3.0"
}
2 changes: 1 addition & 1 deletion .github/actions/check_create_redwood_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.3.0"
}
2 changes: 1 addition & 1 deletion .github/actions/detect-changes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@4.2.2"
"packageManager": "yarn@4.3.0"
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"Flightcontrol",
"graphiql",
"memfs",
"mojombo",
"OGIMAGE",
"opentelemetry",
"pino",
Expand Down
44 changes: 16 additions & 28 deletions __fixtures__/empty-project/scripts/seed.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
import type { Prisma } from '@prisma/client'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { db } from 'api/src/lib/db'

// Manually apply seeds via the `yarn rw prisma db seed` command.
//
// Seeds automatically run the first time you run the `yarn rw prisma migrate dev`
// command and every time you run the `yarn rw prisma migrate reset` command.
//
// See https://redwoodjs.com/docs/database-seeds for more info

export default async () => {
try {
// Create your database records here! For example, seed some users:
//
// Manually seed via `yarn rw prisma db seed`
// Seeds automatically with `yarn rw prisma migrate dev` and `yarn rw prisma migrate reset`
//
// Update "const data = []" to match your data model and seeding needs
// const users = [
// { name: 'Alice', email: '[email protected] },
// { name: 'Bob', email: '[email protected] },
// ]
//
const data: Prisma.UserExampleCreateArgs['data'][] = [
// To try this example data with the UserExample model in schema.prisma,
// uncomment the lines below and run 'yarn rw prisma migrate dev'
//
// { name: 'alice', email: '[email protected]' },
// { name: 'mark', email: '[email protected]' },
// { name: 'jackie', email: '[email protected]' },
// { name: 'bob', email: '[email protected]' },
]
console.log(
"\nUsing the default './scripts/seed.{js,ts}' template\nEdit the file to add seed data\n"
)
// await db.user.createMany({ data: users })

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
await Promise.all(
//
// Change to match your data model and seeding needs
//
data.map(async (data: Prisma.UserExampleCreateArgs['data']) => {
const record = await db.userExample.create({ data })
console.log(record)
})
console.info(
'\n No seed data, skipping. See scripts/seed.ts to start seeding your database!\n'
)
} catch (error) {
console.warn('Please define your seed data.')
console.error(error)
}
}
58 changes: 8 additions & 50 deletions __fixtures__/fragment-test-project/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,61 +135,19 @@ export default async () => {
}

try {
// Create your database records here! For example, seed some users:
//
// Manually seed via `yarn rw prisma db seed`
// Seeds automatically with `yarn rw prisma migrate dev` and `yarn rw prisma migrate reset`
// const users = [
// { name: 'Alice', email: '[email protected] },
// { name: 'Bob', email: '[email protected] },
// ]
//
// Update "const data = []" to match your data model and seeding needs
//
const data: Prisma.UserExampleCreateArgs['data'][] = [
// To try this example data with the UserExample model in schema.prisma,
// uncomment the lines below and run 'yarn rw prisma migrate dev'
//
// { name: 'alice', email: '[email protected]' },
// { name: 'mark', email: '[email protected]' },
// { name: 'jackie', email: '[email protected]' },
// { name: 'bob', email: '[email protected]' },
]
console.log(
"\nUsing the default './scripts/seed.ts' template\nEdit the file to add seed data\n"
)
// await db.user.createMany({ data: users })

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
await Promise.all(
//
// Change to match your data model and seeding needs
//
data.map(async (data: Prisma.UserExampleCreateArgs['data']) => {
const record = await db.userExample.create({ data })
console.log(record)
})
console.info(
'\n No seed data, skipping. See scripts/seed.ts to start seeding your database!\n'
)

// If using dbAuth and seeding users, you'll need to add a `hashedPassword`
// and associated `salt` to their record. Here's how to create them using
// the same algorithm that dbAuth uses internally:
//
// import { hashPassword } from '@redwoodjs/auth-dbauth-api'
//
// const users = [
// { name: 'john', email: '[email protected]', password: 'secret1' },
// { name: 'jane', email: '[email protected]', password: 'secret2' }
// ]
//
// for (const user of users) {
// const [hashedPassword, salt] = hashPassword(user.password)
// await db.user.create({
// data: {
// name: user.name,
// email: user.email,
// hashedPassword,
// salt
// }
// })
// }
} catch (error) {
console.warn('Please define your seed data.')
console.error(error)
}
}
67 changes: 16 additions & 51 deletions __fixtures__/test-project-rsa/scripts/seed.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,28 @@
import type { Prisma } from '@prisma/client'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { db } from 'api/src/lib/db'

// Manually apply seeds via the `yarn rw prisma db seed` command.
//
// Seeds automatically run the first time you run the `yarn rw prisma migrate dev`
// command and every time you run the `yarn rw prisma migrate reset` command.
//
// See https://redwoodjs.com/docs/database-seeds for more info

export default async () => {
try {
// Create your database records here! For example, seed some users:
//
// Manually seed via `yarn rw prisma db seed`
// Seeds automatically with `yarn rw prisma migrate dev` and `yarn rw prisma migrate reset`
//
// Update "const data = []" to match your data model and seeding needs
// const users = [
// { name: 'Alice', email: '[email protected] },
// { name: 'Bob', email: '[email protected] },
// ]
//
const data: Prisma.UserExampleCreateArgs['data'][] = [
// To try this example data with the UserExample model in schema.prisma,
// uncomment the lines below and run 'yarn rw prisma migrate dev'
//
// { name: 'alice', email: '[email protected]' },
// { name: 'mark', email: '[email protected]' },
// { name: 'jackie', email: '[email protected]' },
// { name: 'bob', email: '[email protected]' },
]
console.log(
"\nUsing the default './scripts/seed.{js,ts}' template\nEdit the file to add seed data\n"
)
// await db.user.createMany({ data: users })

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
//
// Change to match your data model and seeding needs
//
data.map(async (data: Prisma.UserExampleCreateArgs['data']) => {
const record = await db.userExample.create({ data })
console.log(record)
})
console.info(
'\n No seed data, skipping. See scripts/seed.ts to start seeding your database!\n'
)

// If using dbAuth and seeding users, you'll need to add a `hashedPassword`
// and associated `salt` to their record. Here's how to create them using
// the same algorithm that dbAuth uses internally:
//
// import { hashPassword } from '@redwoodjs/auth-dbauth-api'
//
// const users = [
// { name: 'john', email: '[email protected]', password: 'secret1' },
// { name: 'jane', email: '[email protected]', password: 'secret2' }
// ]
//
// for (const user of users) {
// const [hashedPassword, salt] = hashPassword(user.password)
// await db.user.create({
// data: {
// name: user.name,
// email: user.email,
// hashedPassword,
// salt
// }
// })
// }
} catch (error) {
console.warn('Please define your seed data.')
console.error(error)
}
}
12 changes: 5 additions & 7 deletions __fixtures__/test-project-rsa/web/src/entry.server.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import type { TagDescriptor } from '@redwoodjs/web/dist/components/htmlTags'

import App from './App'
import { Document } from './Document'
import Routes from './Routes'

interface Props {
css: string[]
meta?: TagDescriptor[]
location: {
pathname: string
hash?: string
search?: string
}
}

export const ServerEntry: React.FC<Props> = ({ css, meta, location }) => {
export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
return (
<Document css={css} meta={meta}>
<Routes location={location} />
<App>
<Routes />
</App>
</Document>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@ import Routes from './Routes'
interface Props {
css: string[]
meta?: TagDescriptor[]
location: {
pathname: string
hash?: string
search?: string
}
}

export const ServerEntry: React.FC<Props> = ({ css, meta, location }) => {
export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
return (
<Document css={css} meta={meta}>
<App>
<Routes location={location} />
<Routes />
</App>
</Document>
)
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prisma": {
"seed": "yarn rw exec seed"
},
"packageManager": "yarn@4.2.2",
"packageManager": "yarn@4.3.0",
"resolutions": {
"@storybook/react-dom-shim@npm:7.6.17": "https://verdaccio.tobbe.dev/@storybook/react-dom-shim/-/react-dom-shim-8.0.8.tgz",
"@apollo/client/rehackt": "0.1.0",
Expand Down
Loading

0 comments on commit d853319

Please sign in to comment.