Skip to content

Commit 4bb543a

Browse files
committed
Merge branch 'main' of github.com:redwoodjs/redwood into try/dbauth-ssr-updated
* 'main' of github.com:redwoodjs/redwood: (80 commits) fix(deps): update dependency @fastify/http-proxy to v9.3.0 (redwoodjs#9451) fix(deps): update dependency @fastify/static to v6.12.0 (redwoodjs#9452) chore: migrate type tests to TSTyche (redwoodjs#9394) fix(deps): update dependency @testing-library/user-event to v14.5.1 (redwoodjs#9455) fix(deps): update dependency @vitejs/plugin-react to v4.1.1 (redwoodjs#9456) fix(deps): update dependency pino to v8.16.1 (redwoodjs#9459) fix(deps): update dependency firebase-admin to v11.11.0 (redwoodjs#9458) chore(deps): update dependency firebase to v10.6.0 (redwoodjs#9449) fix(deps): update dependency @fastify/url-data to v5.4.0 (redwoodjs#9453) fix(deps): update dependency @simplewebauthn/browser to v7.4.0 (redwoodjs#9454) chore(deps): update actions/setup-node action to v4 (redwoodjs#9461) chore(deps): update actions/checkout action to v4 (redwoodjs#9460) fix(deps): update dependency @graphql-yoga/plugin-graphql-sse to v2.0.5 (redwoodjs#9440) fix(deps): update prisma monorepo to v5.6.0 (redwoodjs#9447) fix(deps): update dependency nodemailer to v6.9.7 (redwoodjs#9444) chore(deps): update dependency esbuild to v0.19.5 (redwoodjs#9359) fix(deps): update dependency @envelop/on-resolve to v3.0.3 (redwoodjs#9436) fix(deps): update dependency semver to v7.5.4 (redwoodjs#9445) fix(deps): update dependency jsonwebtoken to v9.0.2 (redwoodjs#9443) fix(deps): update dependency systeminformation to v5.21.17 (redwoodjs#9446) ...
2 parents 2b66173 + bbe2226 commit 4bb543a

File tree

374 files changed

+10142
-6668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+10142
-6668
lines changed

.github/actions/actionsLib.mjs

+7-11
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export function projectCopy(redwoodProjectCwd) {
6262
}
6363

6464
/**
65-
* @param {{ baseKeyPrefix: string, distKeyPrefix: string }} options
65+
* @param {{ baseKeyPrefix: string, distKeyPrefix: string, canary: boolean }} options
6666
*/
67-
export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
67+
export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix, canary }) {
6868
const baseKey = [
6969
baseKeyPrefix,
7070
process.env.RUNNER_OS,
@@ -76,7 +76,7 @@ export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
7676
baseKey,
7777
'dependencies',
7878
await hashFiles(['yarn.lock', '.yarnrc.yml'].join('\n')),
79-
].join('-')
79+
].join('-') + (canary ? '-canary' : '')
8080

8181
const distKey = [
8282
dependenciesKey,
@@ -91,7 +91,7 @@ export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
9191
'lerna.json',
9292
'packages',
9393
].join('\n'))
94-
].join('-')
94+
].join('-') + (canary ? '-canary' : '')
9595

9696
return {
9797
baseKey,
@@ -151,17 +151,13 @@ export async function setUpRscTestProject(
151151
console.log(`Installing node_modules in ${testProjectPath}`)
152152
await execInProject('yarn install')
153153

154-
console.log(`Building project in ${testProjectPath}`)
155-
await execInProject(`node ${rwBinPath} build -v`)
156-
console.log()
157-
158154
console.log(`Copying over framework files to ${testProjectPath}`)
159155
await execInProject(`node ${rwfwBinPath} project:copy`, {
160156
env: { RWFW_PATH: REDWOOD_FRAMEWORK_PATH },
161157
})
162158
console.log()
163159

164-
// await cache.saveCache([testProjectPath], dependenciesKey)
165-
// console.log(`Cache saved with key: ${dependenciesKey}`)
160+
console.log(`Building project in ${testProjectPath}`)
161+
await execInProject(`node ${rwBinPath} build -v`)
162+
console.log()
166163
}
167-

.github/actions/check_create_redwood_app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "check_test_project_fixture",
33
"private": true,
44
"dependencies": {
5-
"@actions/core": "1.10.0",
5+
"@actions/core": "1.10.1",
66
"@actions/exec": "1.1.1"
77
},
88
"packageManager": "yarn@3.6.3"

.github/actions/check_create_redwood_app/yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ __metadata:
55
version: 6
66
cacheKey: 8c0
77

8-
"@actions/core@npm:1.10.0":
9-
version: 1.10.0
10-
resolution: "@actions/core@npm:1.10.0"
8+
"@actions/core@npm:1.10.1":
9+
version: 1.10.1
10+
resolution: "@actions/core@npm:1.10.1"
1111
dependencies:
1212
"@actions/http-client": ^2.0.1
1313
uuid: ^8.3.2
14-
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
14+
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
1515
languageName: node
1616
linkType: hard
1717

@@ -44,7 +44,7 @@ __metadata:
4444
version: 0.0.0-use.local
4545
resolution: "check_test_project_fixture@workspace:."
4646
dependencies:
47-
"@actions/core": 1.10.0
47+
"@actions/core": 1.10.1
4848
"@actions/exec": 1.1.1
4949
languageName: unknown
5050
linkType: soft

.github/actions/check_test_project_fixture/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "check_test_project_fixture",
33
"private": true,
44
"dependencies": {
5-
"@actions/core": "1.10.0",
5+
"@actions/core": "1.10.1",
66
"@actions/exec": "1.1.1"
77
},
88
"packageManager": "yarn@3.6.3"

.github/actions/check_test_project_fixture/yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ __metadata:
55
version: 6
66
cacheKey: 8c0
77

8-
"@actions/core@npm:1.10.0":
9-
version: 1.10.0
10-
resolution: "@actions/core@npm:1.10.0"
8+
"@actions/core@npm:1.10.1":
9+
version: 1.10.1
10+
resolution: "@actions/core@npm:1.10.1"
1111
dependencies:
1212
"@actions/http-client": ^2.0.1
1313
uuid: ^8.3.2
14-
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
14+
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
1515
languageName: node
1616
linkType: hard
1717

@@ -44,7 +44,7 @@ __metadata:
4444
version: 0.0.0-use.local
4545
resolution: "check_test_project_fixture@workspace:."
4646
dependencies:
47-
"@actions/core": 1.10.0
47+
"@actions/core": 1.10.1
4848
"@actions/exec": 1.1.1
4949
languageName: unknown
5050
linkType: soft
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Detect Changes
2+
description: Determines what areas of the framework have been changed
3+
4+
outputs:
5+
docs:
6+
description: If *only* docs have changed
7+
rsc:
8+
description: If RSC-related changes have been made
9+
ssr:
10+
description: If SSR-related changes have been made
11+
12+
runs:
13+
using: node20
14+
main: detectChanges.mjs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Detects if there are only changes to the documentation
3+
*
4+
* @param {string[]} changedFiles The list of files which git has listed as changed
5+
* @returns {boolean} True if there are changes, false if not
6+
*/
7+
export function onlyDocsChanged(changedFiles){
8+
for (const changedFile of changedFiles) {
9+
if (changedFile.startsWith('docs')) {
10+
continue
11+
}
12+
13+
for (const fileToIgnore of [
14+
'CHANGELOG.md',
15+
'CODE_OF_CONDUCT.md',
16+
'CONTRIBUTING.md',
17+
'CONTRIBUTORS.md',
18+
'LICENSE',
19+
'README.md',
20+
'SECURITY.md',
21+
]) {
22+
if (changedFile === fileToIgnore) {
23+
continue
24+
}
25+
}
26+
27+
console.log('Non-docs change detected:', changedFile)
28+
return false
29+
}
30+
31+
console.log('Only docs changes')
32+
return true
33+
}
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
import core from '@actions/core'
2-
import { exec, getExecOutput } from '@actions/exec'
3-
4-
async function main() {
5-
const branch = process.env.GITHUB_BASE_REF
6-
7-
// If there is no branch, we're not in a pull request
8-
if (!branch) {
9-
core.setOutput('rsc-related-changes', false)
10-
return
11-
}
12-
13-
await exec(`git fetch origin ${branch}`)
14-
15-
const { stdout } = await getExecOutput(
16-
`git diff origin/${branch} --name-only`
17-
)
18-
19-
const changedFiles = stdout.toString().trim().split('\n').filter(Boolean)
20-
1+
/**
2+
* Detects if there are RSC changes
3+
*
4+
* @param {string[]} changedFiles The list of files which git has listed as changed
5+
* @returns {boolean} True if there are changes, false if not
6+
*/
7+
export function rscChanged(changedFiles){
218
for (const changedFile of changedFiles) {
22-
console.log('changedFile', changedFile)
23-
249
// As the RSC implementation changes, this list will need to be updated.
2510
// Also, I could be much more specific here, but then I'd also have to
2611
// update this list much more often. So this'll serve as a good enough
@@ -32,18 +17,16 @@ async function main() {
3217
changedFile.startsWith('.github/actions/set-up-rsa-project/') ||
3318
changedFile.startsWith('.github/actions/set-up-rsc-external-packages-project/') ||
3419
changedFile.startsWith('.github/actions/set-up-rsc-project/') ||
35-
changedFile.startsWith('github/actions/rsc_related_changes/') ||
3620
changedFile.startsWith('packages/internal/') ||
3721
changedFile.startsWith('packages/project-config/') ||
3822
changedFile.startsWith('packages/web/') ||
3923
changedFile.startsWith('packages/vite/')
4024
) {
41-
core.setOutput('rsc-related-changes', true)
42-
return
25+
console.log('RSC change detected:', changedFile)
26+
return true
4327
}
4428
}
4529

46-
core.setOutput('rsc-related-changes', false)
30+
console.log('No RSC changes')
31+
return false
4732
}
48-
49-
main()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Detects if there are SSR changes
3+
*
4+
* @param {string[]} changedFiles The list of files which git has listed as changed
5+
* @returns {boolean} True if there are changes, false if not
6+
*/
7+
export function ssrChanged(changedFiles){
8+
for (const changedFile of changedFiles) {
9+
if (
10+
changedFile.startsWith('tasks/smoke-tests/streaming-ssr') ||
11+
changedFile.startsWith('tasks/smoke-tests/basePlaywright.config.ts') ||
12+
changedFile.startsWith('packages/internal/') ||
13+
changedFile.startsWith('packages/project-config/') ||
14+
changedFile.startsWith('packages/web/') ||
15+
changedFile.startsWith('packages/router/') ||
16+
changedFile.startsWith('packages/web-server/') ||
17+
changedFile.startsWith('packages/vite/')
18+
) {
19+
console.log('SSR change detected:', changedFile)
20+
return true
21+
}
22+
}
23+
24+
console.log('No SSR changes')
25+
return false
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import core from '@actions/core'
2+
import { exec, getExecOutput } from '@actions/exec'
3+
import { onlyDocsChanged } from './cases/onlydocs.mjs'
4+
import { rscChanged } from './cases/rsc.mjs'
5+
import { ssrChanged } from './cases/ssr.mjs'
6+
7+
async function main() {
8+
const branch = process.env.GITHUB_BASE_REF
9+
10+
// If there's no branch, we're not in a pull request.
11+
if (!branch) {
12+
core.setOutput('onlydocs', false)
13+
core.setOutput('rsc', false)
14+
core.setOutput('ssr', false)
15+
return
16+
}
17+
18+
await exec(`git fetch origin ${branch}`)
19+
20+
const { stdout } = await getExecOutput(`git diff origin/${branch} --name-only`)
21+
const changedFiles = stdout.toString().trim().split('\n').filter(Boolean)
22+
console.log(`${changedFiles.length} changed files`)
23+
24+
const onlyDocs = onlyDocsChanged(changedFiles)
25+
if(onlyDocs){
26+
core.setOutput('onlydocs', true)
27+
core.setOutput('rsc', false)
28+
core.setOutput('ssr', false)
29+
return
30+
}
31+
32+
core.setOutput('onlydocs', false)
33+
core.setOutput('rsc', rscChanged(changedFiles))
34+
core.setOutput('ssr', ssrChanged(changedFiles))
35+
}
36+
37+
main()

.github/actions/rsc_related_changes/package.json .github/actions/detect-changes/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "only_doc_changes",
2+
"name": "detect-changes",
33
"private": true,
44
"dependencies": {
5-
"@actions/core": "1.10.0",
5+
"@actions/core": "1.10.1",
66
"@actions/exec": "1.1.1"
77
},
88
"packageManager": "yarn@3.6.3"

.github/actions/rsc_related_changes/yarn.lock .github/actions/detect-changes/yarn.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ __metadata:
55
version: 6
66
cacheKey: 8c0
77

8-
"@actions/core@npm:1.10.0":
9-
version: 1.10.0
10-
resolution: "@actions/core@npm:1.10.0"
8+
"@actions/core@npm:1.10.1":
9+
version: 1.10.1
10+
resolution: "@actions/core@npm:1.10.1"
1111
dependencies:
1212
"@actions/http-client": ^2.0.1
1313
uuid: ^8.3.2
14-
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
14+
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
1515
languageName: node
1616
linkType: hard
1717

@@ -40,11 +40,11 @@ __metadata:
4040
languageName: node
4141
linkType: hard
4242

43-
"only_doc_changes@workspace:.":
43+
"detect-changes@workspace:.":
4444
version: 0.0.0-use.local
45-
resolution: "only_doc_changes@workspace:."
45+
resolution: "detect-changes@workspace:."
4646
dependencies:
47-
"@actions/core": 1.10.0
47+
"@actions/core": 1.10.1
4848
"@actions/exec": 1.1.1
4949
languageName: unknown
5050
linkType: soft

.github/actions/only_doc_changes/action.yml

-8
This file was deleted.

.github/actions/only_doc_changes/only_doc_changes.mjs

-45
This file was deleted.

0 commit comments

Comments
 (0)