Repository navigation
test(repo): test all packages against their earliest supported rollup versions #2035
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
Open
lukastaegert
wants to merge
43
commits into
master
Choose a base branch
from
test-earliest-supported-rollup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14,113
−1,068
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
9724408
chore(repo): add infrastructure to test against earliest supported ro…
lukastaegert b84de80
chore(repo): redirect all declared earliest dependencies in earliest …
lukastaegert 3ab43a2
chore(repo): support version-specific snapshots in earliest mode
lukastaegert 19332ff
chore(repo): define catalog version of rollup
lukastaegert a210ef7
test(alias): test against earliest supported rollup
lukastaegert 3813491
test(virtual): test against earliest supported rollup
lukastaegert 7de81f3
test(dsv): test against earliest supported rollup
lukastaegert f54efc2
test(image): test against earliest supported rollup
lukastaegert 8cbce64
test(data-uri): test against earliest supported rollup
lukastaegert 77f4487
test(graphql): test against earliest supported rollup
lukastaegert 42180e3
test(buble): test against earliest supported rollup
lukastaegert 45b4a5e
test(legacy): test against earliest supported rollup
lukastaegert bbc17a0
test(yaml): test against earliest supported rollup
lukastaegert 2c2326e
test(pluginutils): test against earliest supported rollup
lukastaegert 96d20ae
test(strip): test against earliest supported rollup
lukastaegert 57d4b3c
test(inject): test against earliest supported rollup
lukastaegert 4dab471
test(run): test against earliest supported rollup
lukastaegert 1ec2d71
test(swc): test against earliest supported rollup
lukastaegert ca6262f
test(multi-entry): test against earliest supported rollup
lukastaegert 08faa64
test(terser): test against earliest supported rollup
lukastaegert 007ec07
test(sucrase): test against earliest supported rollup
lukastaegert e8912f8
test(esm-shim): test against earliest supported rollup
lukastaegert 2be6960
test(wasm): test against earliest supported rollup
lukastaegert 3b6b9f5
test(replace): test against earliest supported rollup
lukastaegert f246e0a
test(json): test against earliest supported rollup
lukastaegert 48ae3e0
test(eslint): test against earliest supported rollup
lukastaegert a86ec54
test(babel): test against earliest supported rollup
lukastaegert fda135c
test(auto-install): test against earliest supported rollup
lukastaegert 4055509
test(commonjs): test against earliest supported rollup
lukastaegert a124f3a
test(typescript): test against earliest supported rollup
lukastaegert 8d89c12
test(dynamic-import-vars): test against earliest supported rollup
lukastaegert 0af4f8b
test(url): test against earliest supported rollup
lukastaegert 1710ba5
test(html): test against earliest supported rollup
lukastaegert dc6a172
test(node-resolve): test against earliest supported rollup
lukastaegert fac1c8b
test(beep): test against earliest supported rollup
lukastaegert 98bd40d
chore(repo): test against the earliest supported rollup in CI
lukastaegert f79b4a2
test(auto-install): prevent pnpm workspace resolution in fixture tests
lukastaegert 02a74a2
test(repo): increase the test timeout for slow CI runners
lukastaegert 313c38d
test(auto-install): run the fixture cleanup even when the guard fails
lukastaegert 4609c55
test(virtual): enable lib checks in the types test
lukastaegert 0a6eb17
test(html): make the unloaded dynamic import emit a separate chunk
lukastaegert 8f04f20
chore(repo): remove the stale html snapshot copy
lukastaegert 31966b0
test(typescript): await restoring the fixture file
lukastaegert 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
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,26 @@ | ||
| import { existsSync, readFileSync } from 'node:fs'; | ||
| import { join } from 'node:path'; | ||
|
|
||
| const EARLIEST_SUFFIX = '-earliest'; | ||
|
|
||
| export function getEarliestDependencies() { | ||
| const packageJsonPath = join(process.cwd(), 'package.json'); | ||
| const { devDependencies = {} } = JSON.parse(readFileSync(packageJsonPath, 'utf8')); | ||
| const dependencies = Object.keys(devDependencies) | ||
| .filter((name) => name.endsWith(EARLIEST_SUFFIX)) | ||
| .map((name) => ({ | ||
| name: name.slice(0, -EARLIEST_SUFFIX.length), | ||
| path: join(process.cwd(), 'node_modules', name) | ||
| })); | ||
| if (!dependencies.some(({ name }) => name === 'rollup')) { | ||
| throw new Error(`Missing "rollup-earliest" devDependency in ${packageJsonPath}.`); | ||
| } | ||
| for (const { path } of dependencies) { | ||
| if (!existsSync(path)) { | ||
| throw new Error( | ||
| `Missing "${path}". Run "pnpm install" to test against the earliest supported versions.` | ||
| ); | ||
| } | ||
| } | ||
| return dependencies; | ||
| } |
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,35 @@ | ||
| // The vite aliases in vitest.config.mts redirect ESM imports of the aliased dependencies to | ||
| // their earliest supported versions, but they do not affect require(...). Patch the Node | ||
| // module resolution so CommonJS tests resolve the same versions. | ||
| import Module from 'node:module'; | ||
|
|
||
| import { getEarliestDependencies } from './vitest.earliest.mts'; | ||
|
|
||
| type ResolveFilename = ( | ||
| request: string, | ||
| parent?: unknown, | ||
| isMain?: boolean, | ||
| options?: unknown | ||
| ) => string; | ||
|
|
||
| const earliestPaths = new Map( | ||
| getEarliestDependencies().map(({ name, path }) => [name, path] as const) | ||
| ); | ||
|
|
||
| const originalResolveFilename = (Module as { _resolveFilename?: ResolveFilename })._resolveFilename; | ||
|
|
||
| if ( | ||
| originalResolveFilename && | ||
| !originalResolveFilename.name.includes('redirectEarliestDependencies') | ||
| ) { | ||
| (Module as { _resolveFilename: ResolveFilename })._resolveFilename = | ||
| function redirectEarliestDependencies(this: unknown, request, parent, isMain, options) { | ||
| return originalResolveFilename.call( | ||
| this, | ||
| earliestPaths.get(request) ?? request, | ||
| parent, | ||
| isMain, | ||
| options | ||
| ); | ||
| }; | ||
| } |
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
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 |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ packages/yaml/test/fixtures/**/* | |
| **/dist/ | ||
| **/fixtures/ | ||
| **/snapshots/ | ||
| **/snapshots-earliest/ | ||
| pnpm-lock.yaml | ||
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
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
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,3 @@ | ||
| # pnpm refuses to add dependencies at a workspace root without an explicit opt-in; | ||
| # this also means the root .npmrc no longer applies here, which is fine for this fixture | ||
| ignore-workspace-root-check=true |
2 changes: 2 additions & 0 deletions
2
packages/auto-install/test/fixtures/pnpm-bare/pnpm-workspace.yaml
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,2 @@ | ||
| # Anchor pnpm workspace detection to this fixture so that package installs spawned here do not | ||
| # operate on the monorepo workspace root and regenerate its lockfile. |
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,3 @@ | ||
| # pnpm refuses to add dependencies at a workspace root without an explicit opt-in; | ||
| # this also means the root .npmrc no longer applies here, which is fine for this fixture | ||
| ignore-workspace-root-check=true |
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,2 @@ | ||
| # Anchor pnpm workspace detection to this fixture so that package installs spawned here do not | ||
| # operate on the monorepo workspace root and regenerate its lockfile. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.