Skip to content

Commit bb0b36e

Browse files
committed
Merge branch 'main' of github.com:redwoodjs/redwood into try/dbauth-ssr
* 'main' of github.com:redwoodjs/redwood: (26 commits) fix(api-server): copy fallback fix from redwoodjs#9272 (redwoodjs#9369) fix(deps): update dependency concurrently to v8.2.2 (redwoodjs#9361) chore(k6): Fix function context test (redwoodjs#9368) feat(cli): Setup command for mailer (redwoodjs#9335) feature: Support defer and stream GraphQL Directives in RedwoodRealtime (redwoodjs#9235) chore(deps): update dependency rimraf to v5.0.5 (redwoodjs#9360) chore(k6): Fix function context test (redwoodjs#9358) chore(deps): bump undici from 5.22.1 to 5.26.3 (redwoodjs#9307) fix(babel): Fix opentelemetry api wrapping and allow it to be disabled (redwoodjs#9298) chore(api-server): remove server survey tests in CI (redwoodjs#9348) chore(deps): update babel monorepo to v7.23.2 (redwoodjs#9344) chore(deps): bump @babel/traverse from 7.18.9 to 7.23.2 in /docs (redwoodjs#9311) chore(deps): update dependency @tsconfig/docusaurus to v2 (redwoodjs#9347) fix(deps): update dependency react-player to v2.13.0 (redwoodjs#9346) fix(deps): update docusaurus monorepo to v2.4.3 (redwoodjs#9345) fix(deps): update dependency @babel/traverse to v7.23.2 [security] (redwoodjs#9322) chore: increase server test timeout, fix `yarn build:clean` (redwoodjs#9336) feature: Adds utility functions to add envars and update Redwood toml for plugin packages to cli helpers for use in simplifying CLI setup commands (redwoodjs#9324) fix(cli): Tailwind setup updates `scaffold.css` when needed (redwoodjs#9290) fix(cli): Exit with non-zero exit code when `yarn rw g types` has errors (redwoodjs#9280) ...
2 parents 5f1deed + 7ab07a2 commit bb0b36e

292 files changed

Lines changed: 10697 additions & 1922 deletions

File tree

Some content is hidden

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

.github/actions/actionsLib.mjs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-env node */
22
// @ts-check
33

4+
import fs from 'node:fs'
45
import path from 'node:path'
56
import { fileURLToPath } from 'node:url'
67

@@ -98,3 +99,69 @@ export async function createCacheKeys({ baseKeyPrefix, distKeyPrefix }) {
9899
distKey
99100
}
100101
}
102+
103+
/**
104+
* @callback ExecInProject
105+
* @param {string} commandLine command to execute (can include additional args). Must be correctly escaped.
106+
* @param {Omit<ExecOptions, "cwd">=} options exec options. See ExecOptions
107+
* @returns {Promise<unknown>} exit code
108+
*/
109+
110+
/**
111+
* @param {string} testProjectPath
112+
* @param {string} fixtureName
113+
* @param {Object} core
114+
* @param {(key: string, value: string) => void} core.setOutput
115+
* @param {ExecInProject} execInProject
116+
* @returns {Promise<void>}
117+
*/
118+
export async function setUpRscTestProject(
119+
testProjectPath,
120+
fixtureName,
121+
core,
122+
execInProject
123+
) {
124+
core.setOutput('test-project-path', testProjectPath)
125+
126+
console.log('rwPath', REDWOOD_FRAMEWORK_PATH)
127+
console.log('testProjectPath', testProjectPath)
128+
129+
const fixturePath = path.join(
130+
REDWOOD_FRAMEWORK_PATH,
131+
'__fixtures__',
132+
fixtureName
133+
)
134+
const rwBinPath = path.join(
135+
REDWOOD_FRAMEWORK_PATH,
136+
'packages/cli/dist/index.js'
137+
)
138+
const rwfwBinPath = path.join(
139+
REDWOOD_FRAMEWORK_PATH,
140+
'packages/cli/dist/rwfw.js'
141+
)
142+
143+
console.log(`Creating project at ${testProjectPath}`)
144+
console.log()
145+
fs.cpSync(fixturePath, testProjectPath, { recursive: true })
146+
147+
console.log(`Adding framework dependencies to ${testProjectPath}`)
148+
await projectDeps(testProjectPath)
149+
console.log()
150+
151+
console.log(`Installing node_modules in ${testProjectPath}`)
152+
await execInProject('yarn install')
153+
154+
console.log(`Building project in ${testProjectPath}`)
155+
await execInProject(`node ${rwBinPath} build -v`)
156+
console.log()
157+
158+
console.log(`Copying over framework files to ${testProjectPath}`)
159+
await execInProject(`node ${rwfwBinPath} project:copy`, {
160+
env: { RWFW_PATH: REDWOOD_FRAMEWORK_PATH },
161+
})
162+
console.log()
163+
164+
// await cache.saveCache([testProjectPath], dependenciesKey)
165+
// console.log(`Cache saved with key: ${dependenciesKey}`)
166+
}
167+

.github/actions/check_create_redwood_app/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Check create redwood app
22
description: Determines if the create redwood app JS template should be rebuilt
33
runs:
4-
# `node18` isn't supported yet
5-
using: node16
4+
using: node20
65
main: check_create_redwood_app.mjs
76
inputs:
87
labels:

.github/actions/check_test_project_fixture/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Check test project fixture
22
description: Determines if the test project fixture should be rebuilt
33
runs:
4-
# `node18` isn't supported yet
5-
using: node16
4+
using: node20
65
main: check_test_project_fixture.mjs
76
inputs:
87
labels:

.github/actions/only_doc_changes/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ outputs:
44
only-doc-changes:
55
description: If the PR only changes docs
66
runs:
7-
# `node18` isn't supported yet
8-
using: node16
7+
using: node20
98
main: only_doc_changes.mjs

.github/actions/require-milestone/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ name: Require milestone
22
description: Ensures that a PR has a valid milestone
33

44
runs:
5-
# `node18` isn't supported yet
6-
using: node16
5+
using: node20
76
main: requireMilestone.mjs

.github/actions/rsc_related_changes/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ outputs:
44
rsc-related-changes:
55
description: If the PR makes any RSC related changes
66
runs:
7-
# `node18` isn't supported yet
8-
using: node16
7+
using: node20
98
main: rsc_related_changes.mjs

.github/actions/rsc_related_changes/rsc_related_changes.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ async function main() {
2929
changedFile.startsWith('tasks/smoke-tests/rsc/') ||
3030
changedFile.startsWith('tasks/smoke-tests/rsa/') ||
3131
changedFile.startsWith('tasks/smoke-tests/basePlaywright.config.ts') ||
32+
changedFile.startsWith('.github/actions/set-up-rsa-project/') ||
33+
changedFile.startsWith('.github/actions/set-up-rsc-external-packages-project/') ||
3234
changedFile.startsWith('.github/actions/set-up-rsc-project/') ||
3335
changedFile.startsWith('github/actions/rsc_related_changes/') ||
3436
changedFile.startsWith('packages/internal/') ||

.github/actions/set-up-rsc-from-fixture/README.md renamed to .github/actions/set-up-rsa-project/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ Go into the github actions folder
1212
`cd .github/actions`
1313

1414
Then run the following command to execute the action
15-
`node set-up-rsc-from-fixture/setUpRscFixtureLocally.mjs`
15+
`node set-up-rsa-project/setUpRsaProjectLocally.mjs`
1616

1717
## Design
1818

19-
The main logic of the action is in the `setUpRscFixture.mjs` file. To be able
20-
to run that code both on GitHub and locally it uses dependency injection. The
21-
injection is done by `setupRscFixtureLocally.mjs` for when you want to run
22-
the action on your own machine and by `setupRscFixtureGitHib.mjs` when it's
19+
The main logic of the action is in the `../actionsLib.mjs` file. To be able to
20+
run that code both on GitHub and locally it uses dependency injection. The
21+
injection is done by `setupRsaProjectLocally.mjs` for when you want to run the
22+
action on your own machine and by `setupRsaProjectGitHib.mjs` when it's
2323
triggered by GitHub CI.
2424

2525
When doing further changes to the code here it's very important to keep the
2626
DI scripts as light on logic as possible. Ideally all logic is kept to
27-
`setUpRscFixture.mjs` so that the same logic is used both locally and on
28-
GitHub.
27+
`../actionsLib.mjs` so that the same logic is used both locally and on GitHub.
28+
Do note though that more actions share that code, so make sure not to break
29+
the other actions when making changes there.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Set up RSA test project from fixture
2+
description: Sets up an RSA project for smoke-tests
3+
4+
runs:
5+
using: node20
6+
main: 'setUpRsaProjectGitHub.mjs'
7+
8+
outputs:
9+
test-project-path:
10+
description: Path to the test project
File renamed without changes.

0 commit comments

Comments
 (0)