-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ds-crwa/esm-and-tests
- Loading branch information
Showing
449 changed files
with
57,255 additions
and
33,917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Check create redwood app | ||
description: Determines if the create redwood app JS template should be rebuilt | ||
runs: | ||
# `node18` isn't supported yet | ||
using: node16 | ||
main: check_create_redwood_app.mjs | ||
inputs: | ||
labels: | ||
required: true |
55 changes: 55 additions & 0 deletions
55
.github/actions/check_create_redwood_app/check_create_redwood_app.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* eslint-env es6, node */ | ||
import { getInput } from '@actions/core' | ||
|
||
// If the PR has the "crwa-ok" label, just pass. | ||
const { labels } = JSON.parse(getInput('labels')) | ||
const hasCRWA_OkLabel = labels.some((label) => label.name === 'crwa-ok') | ||
|
||
if (hasCRWA_OkLabel) { | ||
console.log('Skipping check because of the "crwa-ok" label') | ||
} else { | ||
// Check if the PR rebuilds the fixture. If it does, that's enough. | ||
const { exec, getExecOutput } = await import('@actions/exec') | ||
await exec('git fetch origin main') | ||
const { stdout } = await getExecOutput('git diff origin/main --name-only') | ||
const changedFiles = stdout.toString().trim().split('\n').filter(Boolean) | ||
const didRebuildJS_Template = changedFiles.some((file) => | ||
file.startsWith('packages/create-redwood-app/templates/js') | ||
) | ||
|
||
if (didRebuildJS_Template) { | ||
console.log( | ||
[ | ||
// Empty space here (and in subsequent console logs) | ||
// because git fetch origin main prints to stdout. | ||
'', | ||
"The create redwood app JS template's been rebuilt", | ||
].join('\n') | ||
) | ||
} else { | ||
// If it doesn't, does it need to be rebuilt? If not, no problem. Otherwise, throw. | ||
const shouldRebuildJS_Template = changedFiles.some( | ||
(file) => | ||
file.startsWith('packages/create-redwood-app/templates/ts') | ||
) | ||
|
||
if (!shouldRebuildJS_Template) { | ||
console.log(['', "The create redwood app JS template doesn't need to be rebuilt"].join('\n')) | ||
} else { | ||
console.log( | ||
[ | ||
'', | ||
'This PR changes the create-redwood-app TS template.', | ||
'That usually means the JS template needs to be rebuilt.', | ||
`If you know that it doesn't, add the "crwa-ok" label. Otherwise, rebuild the JS template and commit the changes:`, | ||
'', | ||
' cd packages/create-redwood-app', | ||
' yarn ts-to-js', | ||
'', | ||
].join('\n') | ||
) | ||
|
||
process.exitCode = 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "check_test_project_fixture", | ||
"private": true, | ||
"dependencies": { | ||
"@actions/core": "1.10.0", | ||
"@actions/exec": "1.1.1" | ||
}, | ||
"packageManager": "yarn@3.5.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This file is generated by running "yarn install" inside your project. | ||
# Manual changes might be lost - proceed with caution! | ||
|
||
__metadata: | ||
version: 6 | ||
cacheKey: 8c0 | ||
|
||
"@actions/core@npm:1.10.0": | ||
version: 1.10.0 | ||
resolution: "@actions/core@npm:1.10.0" | ||
dependencies: | ||
"@actions/http-client": ^2.0.1 | ||
uuid: ^8.3.2 | ||
checksum: 9214d1e0cf5cf2a5d48b8f3b12488c6be9f6722ea60f2397409226e8410b5a3e12e558d9b66c93469d180399865ec20180119408a1770f026bd9ecac6965fcda | ||
languageName: node | ||
linkType: hard | ||
|
||
"@actions/exec@npm:1.1.1": | ||
version: 1.1.1 | ||
resolution: "@actions/exec@npm:1.1.1" | ||
dependencies: | ||
"@actions/io": ^1.0.1 | ||
checksum: 4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a | ||
languageName: node | ||
linkType: hard | ||
|
||
"@actions/http-client@npm:^2.0.1": | ||
version: 2.0.1 | ||
resolution: "@actions/http-client@npm:2.0.1" | ||
dependencies: | ||
tunnel: ^0.0.6 | ||
checksum: b58987ba2f53d7988f612ede7ff834573a3360c21f8fdea9fea92f26ada0fd0efafb22aa7d83f49c18965a5b765775d5253e2edb8d9476d924c4b304ef726b67 | ||
languageName: node | ||
linkType: hard | ||
|
||
"@actions/io@npm:^1.0.1": | ||
version: 1.1.2 | ||
resolution: "@actions/io@npm:1.1.2" | ||
checksum: 61c871bbee1cf58f57917d9bb2cf6bb7ea4dc40de3f65c7fb4ec619ceff57fc98f56be9cca2d476b09e7a96e1cba0d88cd125c4f690d384b9483935186f256c1 | ||
languageName: node | ||
linkType: hard | ||
|
||
"check_test_project_fixture@workspace:.": | ||
version: 0.0.0-use.local | ||
resolution: "check_test_project_fixture@workspace:." | ||
dependencies: | ||
"@actions/core": 1.10.0 | ||
"@actions/exec": 1.1.1 | ||
languageName: unknown | ||
linkType: soft | ||
|
||
"tunnel@npm:^0.0.6": | ||
version: 0.0.6 | ||
resolution: "tunnel@npm:0.0.6" | ||
checksum: e27e7e896f2426c1c747325b5f54efebc1a004647d853fad892b46d64e37591ccd0b97439470795e5262b5c0748d22beb4489a04a0a448029636670bfd801b75 | ||
languageName: node | ||
linkType: hard | ||
|
||
"uuid@npm:^8.3.2": | ||
version: 8.3.2 | ||
resolution: "uuid@npm:8.3.2" | ||
bin: | ||
uuid: dist/bin/uuid | ||
checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54 | ||
languageName: node | ||
linkType: hard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check create-redwood-app | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
# Cancel in-progress runs of this workflow. | ||
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-create-redwood-app: | ||
name: Check create redwood app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: yarn install | ||
working-directory: ./.github/actions/check_create_redwood_app | ||
|
||
- name: Check create redwood app | ||
uses: ./.github/actions/check_create_redwood_app | ||
with: | ||
labels: '{ "labels": ${{ toJSON(github.event.pull_request.labels) }} }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.