-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Build: Fix ecosystem CI resolution handling #33277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e4773eb
remove test-runner tests in ecosystem-ci
JReinhold 1e10bdf
use shell scripts for ecosystem-ci, fix resolution copying to sandboxes
JReinhold 94747c7
use set for resolution list
JReinhold bfc0763
improve test name
JReinhold e0a00da
Merge branch 'next' into disable-ecosystem-ci-test-runner
JReinhold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -26,16 +26,16 @@ | |
| "nx": "nx", | ||
| "pretty-docs": "cd scripts; yarn install >/dev/null; yarn docs:prettier:write", | ||
| "start": "yarn task --task dev --template react-vite/default-ts --start-from=install", | ||
| "svelte-ecosystem-ci:before-test": "STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes node ./scripts/ecosystem-ci/before-test.js svelte-kit/skeleton-ts && cd ./storybook-sandboxes/svelte-kit-skeleton-ts && STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn install", | ||
| "svelte-ecosystem-ci:build": "yarn task --task install && yarn --cwd code build svelte && STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn task --task sandbox --template svelte-kit/skeleton-ts --start-from=compile --no-link --skip-cache", | ||
| "svelte-ecosystem-ci:test": "STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn task --task test-runner --template svelte-kit/skeleton-ts --start-from=build --no-link --skip-cache && STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn task --task vitest-integration --template svelte-kit/skeleton-ts --start-from=vitest-integration --no-link --skip-cache", | ||
| "svelte-ecosystem-ci:before-test": "./scripts/ecosystem-ci/before-test.sh svelte-kit/skeleton-ts", | ||
| "svelte-ecosystem-ci:build": "./scripts/ecosystem-ci/build.sh svelte-kit/skeleton-ts svelte", | ||
| "svelte-ecosystem-ci:test": "./scripts/ecosystem-ci/test.sh svelte-kit/skeleton-ts", | ||
| "task": "yarn --cwd=./scripts task", | ||
| "test": "cd code; yarn test", | ||
| "test:watch": "cd code; yarn test:watch", | ||
| "upload-bench": "cd scripts; yarn upload-bench", | ||
| "vite-ecosystem-ci:before-test": "STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes node ./scripts/ecosystem-ci/before-test.js react-vite/default-ts && cd ./storybook-sandboxes/react-vite-default-ts && yarn install", | ||
| "vite-ecosystem-ci:build": "STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn task --task sandbox --template react-vite/default-ts --start-from=install --skip-cache", | ||
| "vite-ecosystem-ci:test": "STORYBOOK_SANDBOX_ROOT=./storybook-sandboxes yarn task --task test-runner-dev --template react-vite/default-ts --start-from=dev && yarn task --task test-runner --template react-vite/default-ts --start-from=build && yarn task --task vitest-integration --template react-vite/default-ts --start-from=vitest-integration" | ||
| "vite-ecosystem-ci:before-test": "./scripts/ecosystem-ci/before-test.sh react-vite/default-ts", | ||
| "vite-ecosystem-ci:build": "./scripts/ecosystem-ci/build.sh react-vite/default-ts", | ||
| "vite-ecosystem-ci:test": "./scripts/ecosystem-ci/test.sh react-vite/default-ts" | ||
| }, | ||
| "packageManager": "[email protected]", | ||
| "engines": { | ||
|
|
||
This file contains hidden or 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 hidden or 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,12 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| TEMPLATE=${1:?Usage: $0 <template>} | ||
| SANDBOX_NAME=${TEMPLATE//\//-} | ||
|
|
||
| # Run the before-test script to copy resolutions and set up Playwright | ||
| node ./scripts/ecosystem-ci/before-test.js "$TEMPLATE" | ||
|
|
||
| # Install dependencies in the sandbox | ||
| cd "../storybook-sandboxes/$SANDBOX_NAME" | ||
| yarn install |
This file contains hidden or 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,21 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| TEMPLATE=${1:?Usage: $0 <template> [renderer]} | ||
| RENDERER=${2:-} | ||
|
|
||
| # Install all dependencies | ||
| yarn task --task install | ||
|
|
||
| # If a renderer is specified, build it so it uses the resolution set by the ecosystem-ci | ||
| if [ -n "$RENDERER" ]; then | ||
| yarn --cwd code build "$RENDERER" | ||
| fi | ||
|
|
||
| # Create the storybook-sandboxes directory with a package.json that specifies Yarn as the package manager. | ||
| # This is required because the ecosystem-ci repo uses pnpm, and yarn refuses to install in the sandbox dir | ||
| # if it sees a different packageManager field higher up in the directory tree. | ||
| mkdir -p ../storybook-sandboxes | ||
| echo "{ \"packageManager\": \"yarn@$(yarn -v)\" }" > ../storybook-sandboxes/package.json | ||
|
|
||
| yarn task build --template "$TEMPLATE" --start-from=compile --no-link --skip-cache |
This file contains hidden or 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,29 @@ | ||
| /** | ||
| * Set of resolutions from the root package.json that should NOT be copied to sandbox package.json. | ||
| * These are the "existing" resolutions that Storybook maintains, as opposed to resolutions that | ||
| * might be injected by ecosystem-ci repos. | ||
| * | ||
| * This set must stay in sync with the resolutions in the root package.json. Run the test in | ||
| * before-test.test.ts to verify they match. | ||
| */ | ||
| export const EXISTING_RESOLUTIONS = new Set([ | ||
| '@babel/runtime', | ||
| '@babel/traverse', | ||
| '@babel/types', | ||
| '@playwright/test', | ||
| '@testing-library/user-event@npm:^14.4.0', | ||
| '@testing-library/user-event@npm:^14.6.1', | ||
| '@types/babel__traverse@npm:*', | ||
| '@types/babel__traverse@npm:^7.18.0', | ||
| '@types/node', | ||
| '@types/react', | ||
| '@vitest/expect@npm:3.2.4', | ||
| '[email protected]', | ||
| 'esbuild', | ||
| 'playwright', | ||
| 'playwright-core', | ||
| 'react', | ||
| 'serialize-javascript', | ||
| 'type-fest', | ||
| 'typescript', | ||
| ]); |
This file contains hidden or 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,23 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| import rootPkgJson from '../../package.json'; | ||
| import { EXISTING_RESOLUTIONS } from './existing-resolutions'; | ||
|
|
||
| /* | ||
| If this test is failing for you, it means that you have changed the list of resolutions | ||
| in the root package.json, but you have not updated the EXISTING_RESOLUTIONS set in | ||
| scripts/ecosystem-ci/existing-resolutions.ts. | ||
|
|
||
| The purpose of this test is to ensure that any changes to the resolutions in package.json | ||
| are reflected in the EXISTING_RESOLUTIONS set, which is used by the ecosystem-ci before-test | ||
| script to copy the resolutions into the sandbox package.json files. | ||
| */ | ||
|
|
||
| describe('ecosystem-ci', () => { | ||
| it('EXISTING_RESOLUTIONS should match all keys in package.json resolutions', () => { | ||
| const actualKeys = new Set(Object.keys(rootPkgJson.resolutions)); | ||
| const difference = actualKeys.symmetricDifference(EXISTING_RESOLUTIONS); | ||
|
|
||
| expect(difference.size).toBe(0); | ||
| }); | ||
| }); | ||
This file contains hidden or 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,7 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| TEMPLATE=${1:?Usage: $0 <template>} | ||
|
|
||
| # Run Vitest integration tests | ||
| yarn task --task vitest-integration --template "$TEMPLATE" --start-from=vitest-integration --no-link --skip-cache |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.