-
Notifications
You must be signed in to change notification settings - Fork 184
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest@4.1.5 #1588
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
base: main
Are you sure you want to change the base?
Changes from all commits
d4ba570
b695f3c
6bd650f
7bc53d4
f01e062
39efcbf
f8adb26
7bc7c25
9e103b0
5e5ae3f
61289fb
2fceee5
2b6add8
c79dc86
b888329
74511c4
0cd1f1e
d69fe03
5515f0b
5d5ecb6
895e4db
21937c5
fe1dd74
b6b5b8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,8 +155,13 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise<voi | |
| const entries: PnpmWorkspaceEntry[] = [ | ||
| { | ||
| name: 'vitest', | ||
| pattern: /vitest-dev: npm:vitest@\^([\d.]+(?:-[\w.]+)?)/, | ||
| replacement: `vitest-dev: npm:vitest@^${versions.vitest}`, | ||
| // The `@voidzero-dev/vite-plus-test` wrapper (which used to be aliased | ||
| // here via `vitest-dev: npm:vitest@^…`) has been removed. Vitest is now | ||
| // a plain catalog entry pinned to an exact version (`vitest: x.y.z`), | ||
| // so match that shape directly. The leading newline anchor disambiguates | ||
| // from neighbouring keys like `vitepress-*` and `@vitest/browser`. | ||
| pattern: /\n {2}vitest: ([\d.]+(?:-[\w.]+)?)\n/, | ||
| replacement: `\n vitest: ${versions.vitest}\n`, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgrade script skips @vitest/* catalog entries on bumpMedium Severity The Reviewed by Cursor Bugbot for commit b6b5b8b. Configure here. |
||
| newVersion: versions.vitest, | ||
| }, | ||
| { | ||
|
|
@@ -246,36 +251,6 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise<voi | |
| console.log('Updated pnpm-workspace.yaml'); | ||
| } | ||
|
|
||
| // ============ Update packages/test/package.json ============ | ||
| async function updateTestPackage(vitestVersion: string): Promise<void> { | ||
| const filePath = path.join(ROOT, 'packages/test/package.json'); | ||
| const pkg: PackageJson = readJsonFile(filePath); | ||
| const devDependencies = pkg.devDependencies; | ||
| if (!devDependencies) { | ||
| throw new Error('packages/test/package.json is missing devDependencies'); | ||
| } | ||
|
|
||
| // Update all @vitest/* devDependencies | ||
| for (const dep of Object.keys(devDependencies)) { | ||
| if (dep.startsWith('@vitest/')) { | ||
| devDependencies[dep] = vitestVersion; | ||
| } | ||
| } | ||
|
|
||
| // Update vitest-dev devDependency | ||
| if (devDependencies['vitest-dev']) { | ||
| devDependencies['vitest-dev'] = `^${vitestVersion}`; | ||
| } | ||
|
|
||
| // Update @vitest/ui peerDependency if present | ||
| if (pkg.peerDependencies?.['@vitest/ui']) { | ||
| pkg.peerDependencies['@vitest/ui'] = vitestVersion; | ||
| } | ||
|
|
||
| fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2) + '\n'); | ||
| console.log('Updated packages/test/package.json'); | ||
| } | ||
|
|
||
| // ============ Update packages/core/package.json ============ | ||
| async function updateCorePackage(devtoolsVersion: string): Promise<void> { | ||
| const filePath = path.join(ROOT, 'packages/core/package.json'); | ||
|
|
@@ -430,7 +405,6 @@ await updatePnpmWorkspace({ | |
| oxcParser: oxcParserVersion, | ||
| oxcTransform: oxcTransformVersion, | ||
| }); | ||
| await updateTestPackage(vitestVersion); | ||
| await updateCorePackage(devtoolsVersion); | ||
|
|
||
| writeMetaFiles(); | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this refactor,
pnpm-workspace.yamlnow pins@vitest/browser,@vitest/browser-playwright,@vitest/browser-preview, and@vitest/browser-webdriverio, butupdatePnpmWorkspace()only updates thevitestkey. The daily upgrade workflow can therefore advance Vitest while leaving browser packages stale, creating version skew in published deps and avoidable install/peer-resolution breakage in CI and release automation.Useful? React with 👍 / 👎.