Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into try/dbauth-s…
Browse files Browse the repository at this point in the history
…sr-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)
  ...
  • Loading branch information
dac09 committed Nov 15, 2023
2 parents 2b66173 + bbe2226 commit 4bb543a
Show file tree
Hide file tree
Showing 374 changed files with 10,142 additions and 6,668 deletions.
18 changes: 7 additions & 11 deletions .github/actions/actionsLib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export function projectCopy(redwoodProjectCwd) {
}

/**
* @param {{ baseKeyPrefix: string, distKeyPrefix: string }} options
* @param {{ baseKeyPrefix: string, distKeyPrefix: string, canary: boolean }} options
*/
export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix, canary }) {
const baseKey = [
baseKeyPrefix,
process.env.RUNNER_OS,
Expand All @@ -76,7 +76,7 @@ export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
baseKey,
'dependencies',
await hashFiles(['yarn.lock', '.yarnrc.yml'].join('\n')),
].join('-')
].join('-') + (canary ? '-canary' : '')

const distKey = [
dependenciesKey,
Expand All @@ -91,7 +91,7 @@ export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
'lerna.json',
'packages',
].join('\n'))
].join('-')
].join('-') + (canary ? '-canary' : '')

return {
baseKey,
Expand Down Expand Up @@ -151,17 +151,13 @@ export async function setUpRscTestProject(
console.log(`Installing node_modules in ${testProjectPath}`)
await execInProject('yarn install')

console.log(`Building project in ${testProjectPath}`)
await execInProject(`node ${rwBinPath} build -v`)
console.log()

console.log(`Copying over framework files to ${testProjectPath}`)
await execInProject(`node ${rwfwBinPath} project:copy`, {
env: { RWFW_PATH: REDWOOD_FRAMEWORK_PATH },
})
console.log()

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

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 @@ -2,7 +2,7 @@
"name": "check_test_project_fixture",
"private": true,
"dependencies": {
"@actions/core": "1.10.0",
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@3.6.3"
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/check_create_redwood_app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ __metadata:
version: 6
cacheKey: 8c0

"@actions/core@npm:1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
"@actions/core@npm:1.10.1":
version: 1.10.1
resolution: "@actions/core@npm:1.10.1"
dependencies:
"@actions/http-client": ^2.0.1
uuid: ^8.3.2
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
languageName: node
linkType: hard

Expand Down Expand Up @@ -44,7 +44,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "check_test_project_fixture@workspace:."
dependencies:
"@actions/core": 1.10.0
"@actions/core": 1.10.1
"@actions/exec": 1.1.1
languageName: unknown
linkType: soft
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/check_test_project_fixture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "check_test_project_fixture",
"private": true,
"dependencies": {
"@actions/core": "1.10.0",
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@3.6.3"
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/check_test_project_fixture/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ __metadata:
version: 6
cacheKey: 8c0

"@actions/core@npm:1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
"@actions/core@npm:1.10.1":
version: 1.10.1
resolution: "@actions/core@npm:1.10.1"
dependencies:
"@actions/http-client": ^2.0.1
uuid: ^8.3.2
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
languageName: node
linkType: hard

Expand Down Expand Up @@ -44,7 +44,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "check_test_project_fixture@workspace:."
dependencies:
"@actions/core": 1.10.0
"@actions/core": 1.10.1
"@actions/exec": 1.1.1
languageName: unknown
linkType: soft
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/detect-changes/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Detect Changes
description: Determines what areas of the framework have been changed

outputs:
docs:
description: If *only* docs have changed
rsc:
description: If RSC-related changes have been made
ssr:
description: If SSR-related changes have been made

runs:
using: node20
main: detectChanges.mjs
33 changes: 33 additions & 0 deletions .github/actions/detect-changes/cases/onlydocs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Detects if there are only changes to the documentation
*
* @param {string[]} changedFiles The list of files which git has listed as changed
* @returns {boolean} True if there are changes, false if not
*/
export function onlyDocsChanged(changedFiles){
for (const changedFile of changedFiles) {
if (changedFile.startsWith('docs')) {
continue
}

for (const fileToIgnore of [
'CHANGELOG.md',
'CODE_OF_CONDUCT.md',
'CONTRIBUTING.md',
'CONTRIBUTORS.md',
'LICENSE',
'README.md',
'SECURITY.md',
]) {
if (changedFile === fileToIgnore) {
continue
}
}

console.log('Non-docs change detected:', changedFile)
return false
}

console.log('Only docs changes')
return true
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import core from '@actions/core'
import { exec, getExecOutput } from '@actions/exec'

async function main() {
const branch = process.env.GITHUB_BASE_REF

// If there is no branch, we're not in a pull request
if (!branch) {
core.setOutput('rsc-related-changes', false)
return
}

await exec(`git fetch origin ${branch}`)

const { stdout } = await getExecOutput(
`git diff origin/${branch} --name-only`
)

const changedFiles = stdout.toString().trim().split('\n').filter(Boolean)

/**
* Detects if there are RSC changes
*
* @param {string[]} changedFiles The list of files which git has listed as changed
* @returns {boolean} True if there are changes, false if not
*/
export function rscChanged(changedFiles){
for (const changedFile of changedFiles) {
console.log('changedFile', changedFile)

// As the RSC implementation changes, this list will need to be updated.
// Also, I could be much more specific here, but then I'd also have to
// update this list much more often. So this'll serve as a good enough
Expand All @@ -32,18 +17,16 @@ async function main() {
changedFile.startsWith('.github/actions/set-up-rsa-project/') ||
changedFile.startsWith('.github/actions/set-up-rsc-external-packages-project/') ||
changedFile.startsWith('.github/actions/set-up-rsc-project/') ||
changedFile.startsWith('github/actions/rsc_related_changes/') ||
changedFile.startsWith('packages/internal/') ||
changedFile.startsWith('packages/project-config/') ||
changedFile.startsWith('packages/web/') ||
changedFile.startsWith('packages/vite/')
) {
core.setOutput('rsc-related-changes', true)
return
console.log('RSC change detected:', changedFile)
return true
}
}

core.setOutput('rsc-related-changes', false)
console.log('No RSC changes')
return false
}

main()
26 changes: 26 additions & 0 deletions .github/actions/detect-changes/cases/ssr.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Detects if there are SSR changes
*
* @param {string[]} changedFiles The list of files which git has listed as changed
* @returns {boolean} True if there are changes, false if not
*/
export function ssrChanged(changedFiles){
for (const changedFile of changedFiles) {
if (
changedFile.startsWith('tasks/smoke-tests/streaming-ssr') ||
changedFile.startsWith('tasks/smoke-tests/basePlaywright.config.ts') ||
changedFile.startsWith('packages/internal/') ||
changedFile.startsWith('packages/project-config/') ||
changedFile.startsWith('packages/web/') ||
changedFile.startsWith('packages/router/') ||
changedFile.startsWith('packages/web-server/') ||
changedFile.startsWith('packages/vite/')
) {
console.log('SSR change detected:', changedFile)
return true
}
}

console.log('No SSR changes')
return false
}
37 changes: 37 additions & 0 deletions .github/actions/detect-changes/detectChanges.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import core from '@actions/core'
import { exec, getExecOutput } from '@actions/exec'
import { onlyDocsChanged } from './cases/onlydocs.mjs'
import { rscChanged } from './cases/rsc.mjs'
import { ssrChanged } from './cases/ssr.mjs'

async function main() {
const branch = process.env.GITHUB_BASE_REF

// If there's no branch, we're not in a pull request.
if (!branch) {
core.setOutput('onlydocs', false)
core.setOutput('rsc', false)
core.setOutput('ssr', false)
return
}

await exec(`git fetch origin ${branch}`)

const { stdout } = await getExecOutput(`git diff origin/${branch} --name-only`)
const changedFiles = stdout.toString().trim().split('\n').filter(Boolean)
console.log(`${changedFiles.length} changed files`)

const onlyDocs = onlyDocsChanged(changedFiles)
if(onlyDocs){
core.setOutput('onlydocs', true)
core.setOutput('rsc', false)
core.setOutput('ssr', false)
return
}

core.setOutput('onlydocs', false)
core.setOutput('rsc', rscChanged(changedFiles))
core.setOutput('ssr', ssrChanged(changedFiles))
}

main()
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "only_doc_changes",
"name": "detect-changes",
"private": true,
"dependencies": {
"@actions/core": "1.10.0",
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@3.6.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ __metadata:
version: 6
cacheKey: 8c0

"@actions/core@npm:1.10.0":
version: 1.10.0
resolution: "@actions/core@npm:1.10.0"
"@actions/core@npm:1.10.1":
version: 1.10.1
resolution: "@actions/core@npm:1.10.1"
dependencies:
"@actions/http-client": ^2.0.1
uuid: ^8.3.2
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
languageName: node
linkType: hard

Expand Down Expand Up @@ -40,11 +40,11 @@ __metadata:
languageName: node
linkType: hard

"only_doc_changes@workspace:.":
"detect-changes@workspace:.":
version: 0.0.0-use.local
resolution: "only_doc_changes@workspace:."
resolution: "detect-changes@workspace:."
dependencies:
"@actions/core": 1.10.0
"@actions/core": 1.10.1
"@actions/exec": 1.1.1
languageName: unknown
linkType: soft
Expand Down
8 changes: 0 additions & 8 deletions .github/actions/only_doc_changes/action.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/actions/only_doc_changes/only_doc_changes.mjs

This file was deleted.

Loading

0 comments on commit 4bb543a

Please sign in to comment.