Skip to content

Commit

Permalink
Merge branch 'main' into tobbe-baremetal-df
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Sep 25, 2024
2 parents 4e53e95 + 943fdaa commit 2b964fe
Show file tree
Hide file tree
Showing 560 changed files with 152,321 additions and 3,216 deletions.
3 changes: 3 additions & 0 deletions .changesets/11531.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(auth0): avoid use of undefined global in browser environment (#11531) by @Josh-Walker-GM

The Auth0 auth provider was failing in the browser due to trying to access `global`. This change corrects this and fixes Auth0 usage in the browser.
3 changes: 3 additions & 0 deletions .changesets/11533.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [gh11385] Updated the generated page template (#11533) by @ahaywood

This change alters the default content produced when you generate page with `yarn rw g page`. Previously our generated content contained code that would error out if you had a route parameter in your page - because the link we automatically generated would not contain a value for that parameter.
3 changes: 3 additions & 0 deletions .changesets/11534.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(cli): handle both single and double quotes during dbAuth setup (#11534) by @Josh-Walker-GM

If you had changed your prettier config to use double quotes instead of the default single quotes then the `yarn rw setup auth dbAuth` would fail. This change fixes that command to work regardless of quote flavour.
5 changes: 5 additions & 0 deletions .changesets/11540.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- fix(graphql): Allow including 'File' scalar by default to be disabled (#11540) by @Josh-Walker-GM

As of v8.0.0 a `File` scalar was added to your graphql schema by default. This could be problematic if you wanted to define your own `File` scalar.

With this change it is now possible to disable including this scalar by default. To see how to do so look at the `Default Scalar` section of the `Graphql` docs [here](https://docs.redwoodjs.com/docs/graphql#default-scalars)
5 changes: 5 additions & 0 deletions .changesets/11542.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- feat(cli): Make scaffolded layout routing type-safe (#11542) by @Tobbe

With this feature we now make sure only valid route names are passed as `titleTo` and `buttonTo` props to the scaffolded layout.

This also means you get helpful code completion when typing out the prop values
3 changes: 3 additions & 0 deletions .changesets/11572.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Default NODE_ENV to "development" if it's `undefined` when starting jobs worker (#11572) by @cannikin

This mimics the behavior of `yarn rw dev` where `NODE_ENV` will equal `development` if you don't set it explicitly.
1 change: 1 addition & 0 deletions .changesets/11578.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes `yarn rw jobs clear` command (#11578) by @cannikin
36 changes: 36 additions & 0 deletions .changesets/11587.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- fix `NODE_OPTIONS` env forwarding (#11587) by @cometkim

This change updates how we pass through any `NODE_OPTIONS` when you run the API side development server with `yarn rw dev`. Previously there may have been issues like unescaped spaces in paths which would have produced errors like:

```
api | node:events:497
api | throw er; // Unhandled 'error' event
api | ^
api |
api | Error: spawn space.js --enable-source-maps ENOENT
api | at ChildProcess._handle.onexit (node:internal/child_process:286:19)
api | at onErrorNT (node:internal/child_process:484:16)
api | at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
api | Emitted 'error' event on ChildProcess instance at:
api | at ChildProcess._handle.onexit (node:internal/child_process:292:12)
api | at onErrorNT (node:internal/child_process:484:16)
api | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
api | errno: -2,
api | code: 'ENOENT',
api | syscall: 'spawn space.js --enable-source-maps',
api | path: 'space.js --enable-source-maps',
api | spawnargs: [
api | 'yarn',
api | 'nodemon',
api | '--quiet',
api | '--watch',
api | '/Users/jgmw/Development/redwood/rw-test/node_options_fix/redwood.toml',
api | '--exec',
api | 'yarn rw-api-server-watch --port 8911 --debug-port 18911 | rw-log-formatter'
api | ]
api | }
api |
api | Node.js v20.17.0
```

Now these sort of error should no longer occur.
3 changes: 3 additions & 0 deletions .changesets/11591.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- fix(router): Add missing dependency for RSC (#11591) by @Tobbe

Adding missing dependency `react-server-dom-webpack` to the `@redwoodjs/router` package. This should fix an error some people were seeing when trying to use RSC.
19 changes: 19 additions & 0 deletions .changesets/11593.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- Fix storybook-vite not starting when `auth.ts` contains named imports after `createAuth` (#11593) by @Philzen

This change fixes an issue with our internal storybook mocks. Previous to this you might find that your storybook would fail with an error like:

```
3:49:51 PM [vite] Internal server error: Transform failed with 1 error:
…/web/src/auth.ts:2:9: ERROR: Expected identifier but found ","
Plugin: vite:esbuild
File: …/web/src/auth.ts:3:6
Expected identifier but found ","
1 | import { createAuthentication as createAuth } from '@redwoodjs/testing/dist/web/mockAuth.js'
2 | import { , createDbAuthClient } from '@redwoodjs/auth-dbauth-web';
| ^
3 | const dbAuthClient = createDbAuthClient();
4 | export const {
```

This was due to a bug in our handling of imports which this change fixes.
20 changes: 20 additions & 0 deletions .changesets/11605.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- fix(dbAuth): Fix WebAuthn when authModelAccessor is set to a custom value (#11605) by @antonmoiseev

Previously if you had setup dbAuth with WebAuthn support and had chosen to rename the `User` and `UserCredential` models to some other name, such as `Account` and `AccountCredential` then dbAuth would have failed with an error something like:

```
{
"error": "this.dbCredentialAccessor.findFirst(...).user is not a function"
}
```

This change fixes the database access so that it correctly takes into account the configured `authModelAccessor`.

**Note**: You should ensure your WebAuthn table has a unique index applied on the configured `id` column. Something like what our setup command generates will work great:

```
model UserCredential {
id String @id // <-- Note the index!
...
}
```
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ jobs:
- name: 🔎 Lint
run: yarn lint

- name: 🥡 Check packaging and attw
run: yarn check:package
# TODO(jgmw): Re-enable when it doesn't hang
# - name: 🥡 Check packaging and attw
# run: yarn check:package

- name: 🌡 Test Types
run: yarn test:types
Expand Down Expand Up @@ -849,7 +850,7 @@ jobs:
PROJECT_PATH: ${{ env.PROJECT_PATH }}

- name: ⬢ Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: 18

Expand All @@ -860,7 +861,7 @@ jobs:
PROJECT_PATH: ${{ env.PROJECT_PATH }}

- name: ⬢ Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: 21

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -61,7 +61,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
uses: github/codeql-action/autobuild@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -75,4 +75,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3
2 changes: 1 addition & 1 deletion .github/workflows/publish-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: corepack enable

- name: ⬢ Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: ⬢ Set up Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: 20

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
persist-credentials: false

- name: 'Run analysis'
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
with:
results_file: results.sarif
results_format: sarif
Expand Down Expand Up @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions __fixtures__/fragment-test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@redwoodjs/router": "7.0.0",
"@redwoodjs/web": "7.0.0",
"humanize-string": "2.1.0",
"react": "19.0.0-rc-8269d55d-20240802",
"react-dom": "19.0.0-rc-8269d55d-20240802"
"react": "19.0.0-rc-f2df5694-20240916",
"react-dom": "19.0.0-rc-f2df5694-20240916"
},
"devDependencies": {
"@redwoodjs/vite": "7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/rsc-caching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@apollo/client-react-streaming/superjson": "^1.12.2",
"react-is": "19.0.0-rc-8269d55d-20240802"
"react-is": "19.0.0-rc-f2df5694-20240916"
}
}
4 changes: 2 additions & 2 deletions __fixtures__/rsc-caching/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@redwoodjs/web": "8.0.0-canary.1102",
"@tobbe.dev/rsc-test": "0.0.5",
"client-only": "0.0.1",
"react": "19.0.0-rc-8269d55d-20240802",
"react-dom": "19.0.0-rc-8269d55d-20240802"
"react": "19.0.0-rc-f2df5694-20240916",
"react-dom": "19.0.0-rc-f2df5694-20240916"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0-canary.1102",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const CachingOnePage = () => {
Find me in{' '}
<code>./web/src/pages/CachingOnePage/CachingOnePage.tsx</code>
</p>
<p>
{/*
My default route is named <code>cachingOne</code>, link to me with `
<Link to={routes.cachingOne()}>CachingOne</Link>`
</p>
*/}
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const CachingTwoPage = () => {
Find me in{' '}
<code>./web/src/pages/CachingTwoPage/CachingTwoPage.tsx</code>
</p>
<p>
{/*
My default route is named <code>cachingTwo</code>, link to me with `
<Link to={routes.cachingTwo()}>CachingTwo</Link>`
</p>
*/}
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project-rsa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@apollo/client-react-streaming/superjson": "^1.12.2",
"react-is": "19.0.0-rc-8269d55d-20240802"
"react-is": "19.0.0-rc-f2df5694-20240916"
}
}
4 changes: 2 additions & 2 deletions __fixtures__/test-project-rsa/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@redwoodjs/forms": "8.0.0-canary.144",
"@redwoodjs/router": "8.0.0-canary.144",
"@redwoodjs/web": "8.0.0-canary.144",
"react": "19.0.0-rc-8269d55d-20240802",
"react-dom": "19.0.0-rc-8269d55d-20240802"
"react": "19.0.0-rc-f2df5694-20240916",
"react-dom": "19.0.0-rc-f2df5694-20240916"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0-canary.144",
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project-rsc-kitchen-sink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"packageManager": "yarn@4.1.1",
"resolutions": {
"@apollo/client-react-streaming/superjson": "^1.12.2",
"react-is": "19.0.0-rc-8269d55d-20240802"
"react-is": "19.0.0-rc-f2df5694-20240916"
}
}
4 changes: 2 additions & 2 deletions __fixtures__/test-project-rsc-kitchen-sink/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@redwoodjs/web": "8.0.0-canary.861",
"@tobbe.dev/rsc-test": "0.0.5",
"client-only": "0.0.1",
"react": "19.0.0-rc-8269d55d-20240802",
"react-dom": "19.0.0-rc-8269d55d-20240802"
"react": "19.0.0-rc-f2df5694-20240916",
"react-dom": "19.0.0-rc-f2df5694-20240916"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0-canary.861",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@
& > main {
display: flex;
flex-grow: 1;

& > div {
width: 100%;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const BlogPage = () => {
<p>
Find me in <code>./web/src/pages/BlogPage/BlogPage.tsx</code>
</p>
<p>
{/*}
My default route is named <code>blog</code>, link to me with `
<Link to={routes.blog()}>Blog</Link>`
</p>
*/}
</>
)
}
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 @@ -23,6 +23,6 @@
"packageManager": "yarn@4.4.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",
"react-is": "19.0.0-rc-8269d55d-20240802"
"react-is": "19.0.0-rc-f2df5694-20240916"
}
}
8 changes: 4 additions & 4 deletions __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
"@redwoodjs/router": "8.0.0",
"@redwoodjs/web": "8.0.0",
"humanize-string": "2.1.0",
"react": "19.0.0-rc-8269d55d-20240802",
"react-dom": "19.0.0-rc-8269d55d-20240802"
"react": "19.0.0-rc-f2df5694-20240916",
"react-dom": "19.0.0-rc-f2df5694-20240916"
},
"devDependencies": {
"@redwoodjs/vite": "8.0.0",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.45",
"postcss": "^8.4.47",
"postcss-loader": "^8.1.1",
"prettier-plugin-tailwindcss": "^0.5.12",
"tailwindcss": "^3.4.10"
"tailwindcss": "^3.4.13"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No contacts yet. '}
No contacts yet.{' '}
<Link to={routes.newContact()} className="rw-link">
{'Create one?'}
Create one?
</Link>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No posts yet. '}
No posts yet.{' '}
<Link to={routes.newPost()} className="rw-link">
{'Create one?'}
Create one?
</Link>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Toaster } from '@redwoodjs/web/toast'

type LayoutProps = {
title: string
titleTo: string
titleTo: keyof typeof routes
buttonLabel: string
buttonTo: string
buttonTo: keyof typeof routes
children: React.ReactNode
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// import { Link, routes } from '@redwoodjs/router'
import { Metadata } from '@redwoodjs/web'

type BlogPostPageProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Metadata } from '@redwoodjs/web'

import { useAuth } from 'src/auth'
// import { Link, routes } from '@redwoodjs/router'

const ProfilePage = () => {
const { currentUser, isAuthenticated, hasRole, loading } = useAuth()
Expand Down
2 changes: 1 addition & 1 deletion docs/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.17.0
Loading

0 comments on commit 2b964fe

Please sign in to comment.