Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
41fea26
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest@4…
Brooooooklyn May 15, 2026
51301c7
fix(migration): re-pin vite-plus in force-override mode, fix lint/for…
Brooooooklyn May 15, 2026
1321e34
fix(migration): pass --no-frozen-lockfile to pnpm/yarn reinstall afte…
Brooooooklyn May 15, 2026
49ce6de
fix(migration): preserve vitest declare-module, route browser-provide…
Brooooooklyn May 15, 2026
151cced
fix(migration): emit bunfig.toml with peer = false to unblock bun ins…
Brooooooklyn May 15, 2026
5fdf82f
docs: align migrate guide and bundling notes with actual rewrite/shim…
Brooooooklyn May 15, 2026
0530c89
fix(ci): bump core tgz version for bun, sync declare-module snap
Brooooooklyn May 15, 2026
de830c7
fix(ci): use a separate bumped-version core tgz for VP_OVERRIDE_PACKAGES
Brooooooklyn May 15, 2026
9eafedb
fix(ci): pack core/cli with synthetic 7.99.0 version for bun peer-dep
Brooooooklyn May 16, 2026
1259edb
docs(cli): reformat BUNDLING.md provider-exports table
Brooooooklyn May 16, 2026
c99a7f7
fix(migration): mirror vite override as devDep on bun
Brooooooklyn May 16, 2026
d39434c
fix(ci): pack a vite-7.99.0.tgz alias so bun's name+version check passes
Brooooooklyn May 16, 2026
450f962
fix(ci): post-process core tgz into vite alias instead of name-swappi…
Brooooooklyn May 16, 2026
332ec7d
fix(ci): use core tgz for vite override except where bun is the target
Brooooooklyn May 16, 2026
13ee709
chore: vp check --fix
Brooooooklyn May 16, 2026
cad0b56
fix(migration): override vitest + @vitest/* family to single version
Brooooooklyn May 16, 2026
4c44eb3
fix(cli): accept `test` field in defineConfig type signature
Brooooooklyn May 16, 2026
49aaa4d
fix(cli): inject vitest specifier rewrite plugin into defineConfig
Brooooooklyn May 16, 2026
50a7f93
fix(cli): resolve mergeConfig star-export conflict between core and v…
Brooooooklyn May 16, 2026
9625f89
test(snap): redact transient network warnings in snap output
Brooooooklyn May 16, 2026
a4d7d4c
fix(migration): override @vitest/coverage-* family
Brooooooklyn May 16, 2026
c71cf00
fix(migration): rewrite `from 'vite-plus/test'` -> `from 'vitest'`
Brooooooklyn May 16, 2026
da6a812
style(migration): cargo fmt
Brooooooklyn May 16, 2026
b3d234b
revert(migration): restore `'vitest' -> 'vite-plus/test'` forward rew…
Brooooooklyn May 16, 2026
816225f
chore: retrigger CI after empty period
Brooooooklyn May 16, 2026
c2786ae
fix(cli): re-export vitest/config types (ViteUserConfig, etc.)
Brooooooklyn May 16, 2026
13b7b55
test(snap): drop leading whitespace on pnpm10 Packages line
Brooooooklyn May 16, 2026
23ac248
fix(cli): propagate vite-plus/test rewrite plugin into test.projects
Brooooooklyn May 16, 2026
765cdec
chore: apply oxfmt formatting
Brooooooklyn May 16, 2026
7f5877a
fix(cli): drop redundant type assertions in project injector
Brooooooklyn May 16, 2026
6a8dcc8
fix(cli): add runtime targets for browser provider context exports
Brooooooklyn May 16, 2026
23cccb5
fix(migration): don't let initial install's failure mask final instal…
Brooooooklyn May 16, 2026
365f181
ci(test-vp-create): include vitest family in VP_OVERRIDE_PACKAGES
Brooooooklyn May 16, 2026
0a8f5de
chore: keep VITEST_VERSION + @vitest/browser* catalog in sync on bumps
Brooooooklyn May 16, 2026
52a8a0f
fix(cli): use es-module-lexer to scope vite-plus/test rewrites to rea…
Brooooooklyn May 16, 2026
884467b
fix(migration): pin legacy wrapper fallback to exact VITEST_VERSION
Brooooooklyn May 16, 2026
b2bd4fd
chore(upgrade-deps): bump vitest pins in test-vp-create.yml too
Brooooooklyn May 16, 2026
389a359
fix(cli): preserve quotes when rewriting dynamic import specifiers
Brooooooklyn May 18, 2026
d2cba0b
fix(deps): patch @vitest/mocker to hoist vite-plus/test imports
Brooooooklyn May 18, 2026
b53b12f
fix(cli): fall back to regex rewrite when es-module-lexer rejects JSX…
Brooooooklyn May 18, 2026
e6c7c8d
fix(cli): restore missing test/* subpaths and auto-inline matcher pac…
Brooooooklyn May 18, 2026
9477667
style: format build.ts and define-config.ts to oxfmt rules
Brooooooklyn May 18, 2026
57f7f66
fix(cli): align CJS index.cts allowlist with ESM index.ts
Brooooooklyn May 18, 2026
998f5b0
style(cli): apply vp check --fix to define-config.ts and build.ts
Brooooooklyn May 18, 2026
4e8ab92
fix(cli): use oxc-parser for TSX rewrite fallback, cover re-exports
Brooooooklyn May 19, 2026
71e4879
fix(cli): resolve vitest family for browser-mode in transitive-dep pr…
Brooooooklyn May 20, 2026
5ec6608
chore(deps): upgrade vitest to 4.1.7
Brooooooklyn May 20, 2026
5f538b7
fix(migration): align @vitest/browser subpath rewrites with vite-plus…
Brooooooklyn May 20, 2026
e582ed0
fix(ci): pin packed package versions to 0.0.0 for stable tgz names
Brooooooklyn May 20, 2026
a32c2b7
fix(tools): drop deleted packages/test from snap-test relink map
Brooooooklyn May 20, 2026
67b9cc8
fix(ci): use npm pkg set to pin packed versions
Brooooooklyn May 20, 2026
2f8cb92
fix(ci): expect 0.0.0 in ecosystem-ci verify-install
Brooooooklyn May 20, 2026
815ef46
fix(cli): handle default+named imports in external dts type-only fix
Brooooooklyn May 20, 2026
5a08b7b
fix(cli): externalize postcss/lightningcss from the dts bundle
Brooooooklyn May 20, 2026
0fae6fc
ci(upgrade-deps): sync @vitest/mocker patch entry on vitest bumps
Brooooooklyn May 20, 2026
7626e1d
fix(cli): externalize vitest/@vitest from the dts bundle
Brooooooklyn May 20, 2026
b065db3
fix(cli): add direct vitest dep for browser-mode packages on migration
Brooooooklyn May 21, 2026
9091a83
fix(ci): harden upgrade-deps script for slash-escaping and mocker pat…
Brooooooklyn May 26, 2026
5072398
chore(deps): sync lockfile to rebased workspace catalog and whitelist…
Brooooooklyn May 26, 2026
235e50b
fix(tools): preserve root patchedDependencies on sync-remote + scrub …
Brooooooklyn May 26, 2026
5befea7
fix(cli): keep declare-module on vitest family unrewritten in oxlint …
Brooooooklyn May 26, 2026
be9a339
fix(ci): use extend-identifiers for PnP and update lint snap for decl…
Brooooooklyn May 26, 2026
dcefa85
fix(migration): rewrite CJS require() specifiers alongside ESM imports
Brooooooklyn May 26, 2026
840aa9b
chore: re-trigger CI dispatch
Brooooooklyn May 26, 2026
e820db8
fix(migration): rewrite re-export specifiers alongside imports
Brooooooklyn May 27, 2026
74e8726
style: rustfmt new export-statement rewrite tests
Brooooooklyn May 27, 2026
22edba7
fix(core): rewrite CJS require() via AST walk to skip template literals
Brooooooklyn May 27, 2026
cd65681
fix(migration): rewrite dynamic import('@vitest/*') and TS import-typ…
Brooooooklyn May 27, 2026
e7fef1e
feat(cli): restore ./test/plugins/* surface from removed wrapper
Brooooooklyn May 27, 2026
01d6a4c
style(cli): drop duplicate comment above plugins shim loop
Brooooooklyn May 27, 2026
0f5fd77
style: apply rustfmt and oxfmt to recent commits
Brooooooklyn May 27, 2026
f7b3b14
fix(migration): exclude vitest/package.json from rewrite rules
Brooooooklyn May 27, 2026
805b3d6
fix(migration): treat config-only browser-mode setups as browser mode
Brooooooklyn May 27, 2026
c9f24d7
fix(ci): hardcode vite-plus tgz path to 0.0.0
Brooooooklyn May 27, 2026
4f602be
fix(core): only inline installed matcher packages
Brooooooklyn May 27, 2026
5f0c776
fix(test): rename capturedFroms to avoid typos false-positive
Brooooooklyn May 27, 2026
1a2807a
fix(core): preserve sourcemaps in vite-plus/test rewrite plugin
Brooooooklyn May 28, 2026
6277e50
fix(migration): exclude vitest/config from subpath rewrite rules expl…
Brooooooklyn May 28, 2026
1f793a0
fix(snap-tests): update stale @voidzero-dev/vite-plus-test imports
Brooooooklyn May 28, 2026
cdac93d
chore(snap-tests): regenerate test-managed-package-manager-path snap
Brooooooklyn May 28, 2026
3556936
fix(cli): declare @vitest/* shim targets as direct deps
Brooooooklyn May 28, 2026
3c8738c
fix(ci): include @vitest/* core deps in upgrade-deps catalog update
Brooooooklyn May 28, 2026
5e16596
chore(snap-tests): correct snap.txt files after fixture changes
Brooooooklyn May 28, 2026
e04d2c8
refactor(ci): rename vitestBrowserEntries to vitestExactVersionEntries
Brooooooklyn May 28, 2026
12edc4a
fix(migration): gate vitest-adjacent signal on missing vite-plus
Brooooooklyn May 28, 2026
96601c9
fix(migration): auto-write pnpm allowBuilds for browser-provider post…
Brooooooklyn May 28, 2026
f2887ab
chore(snap-tests): regenerate pnpm migration snaps for allowBuilds en…
Brooooooklyn May 28, 2026
560ff56
chore(snap-tests): regenerate create-org-bundled-monorepo snap for al…
Brooooooklyn May 28, 2026
a396f4b
chore(snap-tests): restore env-dependent snaps clobbered during regen…
Brooooooklyn May 28, 2026
0c5629c
style(migration): apply oxfmt formatting to allowBuilds additions
Brooooooklyn May 28, 2026
9bb1db8
fix(migration): gate "Dependencies installed" line on final install s…
Brooooooklyn May 28, 2026
782a368
fix(migration): treat @vitest/browser-webdriverio as webdriverio allo…
Brooooooklyn May 28, 2026
7cbde7f
fix(migration): scan peerDependencies for webdriverio allow signal
Brooooooklyn May 28, 2026
116b83d
fix(migration): drop stale @vitest/browser* overrides from workspace …
Brooooooklyn May 28, 2026
17525ac
fix(migration): also drop selector-shaped @vitest/browser* overrides
Brooooooklyn May 28, 2026
3f9b55a
style(migration): satisfy eslint(curly) in extractOverrideTargetName
Brooooooklyn May 28, 2026
7e0ae78
fix(migration): preserve direct driver deps and strip selector-shaped…
Brooooooklyn May 28, 2026
4217276
fix(lint): don't rewrite vitest/package.json in prefer-vite-plus-imports
Brooooooklyn May 29, 2026
1a5c45b
test(cli): guard vite-plus root stays a superset of vitest/config exp…
Brooooooklyn May 29, 2026
04a05da
fix(migration): collect direct driver deps across monorepo packages
Brooooooklyn May 29, 2026
2822610
fix(migration): auto-allow user-owned driver builds when webdriverio …
Brooooooklyn May 30, 2026
cbb6240
feat(migration): make @vitest/browser-webdriverio an opt-in provider
Brooooooklyn May 30, 2026
025e814
fix(test): reword comment to satisfy crate-ci/typos (mis -> parsed)
Brooooooklyn May 30, 2026
bcab255
fix(migration): detect migrated bare browser shims as browser mode
Brooooooklyn May 30, 2026
7de8895
fix(test): pin vp test runner and vitest-family imports to the bundle…
Brooooooklyn May 30, 2026
1f01cc1
fix(migration): recurse into nested npm/bun overrides when dropping p…
Brooooooklyn May 31, 2026
b598281
style(test): satisfy oxfmt and correct the CJS-stub comment scope
Brooooooklyn May 31, 2026
3aaa7e1
fix(test): hoist namedValueExports to module scope to satisfy oxlint
Brooooooklyn May 31, 2026
0aed75e
fix(migration): only drop provider override pins that reach vite-plus…
Brooooooklyn May 31, 2026
19002fd
fix(test): repair type errors from rebase onto main
Brooooooklyn Jun 12, 2026
bac6151
style(test): apply oxfmt import ordering to rebased tools specs
Brooooooklyn Jun 12, 2026
bb85fc4
fix(tools): scrub pnpm's supply-chain verification line from snapshots
Brooooooklyn Jun 12, 2026
6498ca6
chore(snap-tests): regenerate main-added migration snaps for pruned w…
Brooooooklyn Jun 12, 2026
c2049dc
fix(migration): drop provider pins reached through owned provider anc…
Brooooooklyn Jun 12, 2026
3f832e5
fix(cli): keep vite-plus external in the dts bundle to avoid leaking …
Brooooooklyn Jun 12, 2026
5d7dbce
chore(snap-tests): drop pnpm supply-chain line baked into snaps by main
Brooooooklyn Jun 12, 2026
c78656d
chore(deps): bump vitest to 4.1.9 and drop the mocker patch + specifi…
Brooooooklyn Jun 15, 2026
cc52822
fix(migration): restore --no-frozen-lockfile for pnpm/yarn in consoli…
Brooooooklyn Jun 15, 2026
cef4118
test(migration): align main-added bootstrap tests with the vitest ove…
Brooooooklyn Jun 15, 2026
483e168
chore(deps): regenerate pnpm-lock.yaml after rebase onto main
Brooooooklyn Jun 15, 2026
28fe475
chore(snap-tests): regenerate create-approve-builds snaps for the vit…
Brooooooklyn Jun 15, 2026
ade4885
chore(snap-tests): regenerate global migration snaps for the vitest o…
Brooooooklyn Jun 15, 2026
1f7a556
fix(migration): repair bootstrap pnpm-workspace call and dedupe vites…
Brooooooklyn Jun 15, 2026
7ed01a5
fix(migration): funnel early-return install through handleInstallResult
Brooooooklyn Jun 15, 2026
e50937c
fix(migration): preapprove vitest family in generated .yarnrc.yml
Brooooooklyn Jun 15, 2026
9f3566c
fix(cli): gate vitest resolver to the browser server; finish provider…
Brooooooklyn Jun 15, 2026
c21ce04
Merge remote-tracking branch 'origin/main' into refactor/replace-vite…
Brooooooklyn Jun 15, 2026
34290ff
fix(cli): keep vitest resolver unconditional; fix Yarn/npm ecosystem …
Brooooooklyn Jun 15, 2026
5b139a4
fix(cli): resolve effective Yarn hoisting config (env/ancestor/home) …
Brooooooklyn Jun 15, 2026
3920c80
test(cli): isolate the home-rc hoisting test on Windows (os.homedir u…
Brooooooklyn Jun 15, 2026
711dcd9
fix(cli): refresh stale pnpm allowBuilds driver denials on re-migration
Brooooooklyn Jun 16, 2026
2bdd4d9
fix(migration): stop overriding indirect @vitest/* deps; guard covera…
Brooooooklyn Jun 16, 2026
23c264a
test(ecosystem-ci): align @vitest/coverage-* with the forced vitest i…
Brooooooklyn Jun 16, 2026
fb307be
fix(migration): exempt the vitest family from pnpm/yarn release-age g…
Brooooooklyn Jun 16, 2026
6a3475b
docs(readme): pin vitest alongside vite in manual-migration overrides
Brooooooklyn Jun 16, 2026
d21d56d
docs(readme): sync generated packages/cli/README.md
Brooooooklyn Jun 16, 2026
59aa22c
fix(migration): only manage pnpm allowBuilds when webdriverio is used
Brooooooklyn Jun 16, 2026
9b59731
fix(migration): resolve 4 reviewer threads on vitest pinning & snap s…
Brooooooklyn Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 150 additions & 25 deletions .github/scripts/upgrade-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,41 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise<voi
let content = fs.readFileSync(filePath, 'utf8');

// oxlint's trailing \n in the pattern disambiguates from oxlint-tsgolint.
// All @vitest/* catalog entries (browser + core direct deps) must stay pinned
// to the same exact version as `vitest` itself, otherwise the catalog drifts
// from VITEST_VERSION.
const vitestExactVersionPackages = [
'@vitest/browser',
'@vitest/browser-playwright',
'@vitest/browser-preview',
'@vitest/browser-webdriverio',
Comment thread
Brooooooklyn marked this conversation as resolved.
'@vitest/expect',
'@vitest/mocker',
'@vitest/pretty-format',
'@vitest/runner',
'@vitest/snapshot',
'@vitest/spy',
'@vitest/utils',
];
const vitestExactVersionEntries: PnpmWorkspaceEntry[] = vitestExactVersionPackages.map((pkg) => ({
name: pkg,
pattern: new RegExp(`'${pkg.replaceAll('/', '\\/')}': ([\\d.]+(?:-[\\w.]+)?)`),
replacement: `'${pkg}': ${versions.vitest}`,
newVersion: versions.vitest,
}));
Comment thread
Brooooooklyn marked this conversation as resolved.
Comment thread
Brooooooklyn marked this conversation as resolved.
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`,
Comment thread
Brooooooklyn marked this conversation as resolved.
Comment thread
cursor[bot] marked this conversation as resolved.
newVersion: versions.vitest,
},
...vitestExactVersionEntries,
{
name: 'tsdown',
pattern: /tsdown: \^([\d.]+(?:-[\w.]+)?)/,
Expand Down Expand Up @@ -246,34 +274,129 @@ 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 VITEST_VERSION constant ============
// Keeps the TypeScript source-of-truth (`packages/cli/src/utils/constants.ts`)
// in sync with the `vitest:` catalog entry in pnpm-workspace.yaml. The
// constant is consumed by both `packages/cli` and `ecosystem-ci/patch-project.ts`
// (which re-imports it), so daily upstream bumps must update it here too.
async function updateVitestVersionConstant(vitestVersion: string): Promise<void> {
const filePath = path.join(ROOT, 'packages/cli/src/utils/constants.ts');
const content = fs.readFileSync(filePath, 'utf8');
const pattern = /export const VITEST_VERSION = '([\d.]+(?:-[\w.]+)?)';/;
let oldVersion: string | undefined;
const updated = content.replace(pattern, (_match: string, captured: string) => {
oldVersion = captured;
return `export const VITEST_VERSION = '${vitestVersion}';`;
});
if (oldVersion === undefined) {
throw new Error(
`Failed to match VITEST_VERSION in ${filePath} — the pattern ${pattern} is stale, ` +
`please update it in .github/scripts/upgrade-deps.ts`,
);
}
fs.writeFileSync(filePath, updated);
recordChange('VITEST_VERSION constant', oldVersion, vitestVersion);
console.log('Updated packages/cli/src/utils/constants.ts');
}

// Update all @vitest/* devDependencies
for (const dep of Object.keys(devDependencies)) {
if (dep.startsWith('@vitest/')) {
devDependencies[dep] = vitestVersion;
// ============ Update .github/workflows/test-vp-create.yml ============
// The `vp create` smoke-test workflow pins every vitest-family package via the
// `VP_OVERRIDE_PACKAGES` env var so that template installs use the bundled
// version. Daily upstream bumps must rewrite those pins so the workflow does
// not drift behind the rest of the repo.
async function updateTestVpCreateWorkflow(vitestVersion: string): Promise<void> {
const filePath = path.join(ROOT, '.github/workflows/test-vp-create.yml');
const content = fs.readFileSync(filePath, 'utf8');
const vitestKeys = [
'vitest',
'@vitest/expect',
'@vitest/runner',
'@vitest/snapshot',
'@vitest/spy',
'@vitest/utils',
'@vitest/mocker',
'@vitest/pretty-format',
'@vitest/coverage-v8',
'@vitest/coverage-istanbul',
];
let updated = content;
let oldVersion: string | undefined;
for (const key of vitestKeys) {
const pattern = new RegExp(`"${key.replaceAll('/', '\\/')}":"([\\d.]+(?:-[\\w.]+)?)"`);
let matched = false;
updated = updated.replace(pattern, (_match: string, captured: string) => {
matched = true;
oldVersion ??= captured;
return `"${key}":"${vitestVersion}"`;
});
if (!matched) {
throw new Error(
`Failed to match "${key}" in ${filePath} — the pattern ${pattern} is stale, ` +
`please update it in .github/scripts/upgrade-deps.ts`,
);
}
}
fs.writeFileSync(filePath, updated);
recordChange('test-vp-create workflow', oldVersion ?? null, vitestVersion);
console.log('Updated .github/workflows/test-vp-create.yml');
Comment thread
cursor[bot] marked this conversation as resolved.
}

// 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;
// ============ Update README.md manual-migration vitest pins ============
// The manual-migration guide pins `vitest` to an exact version in three places —
// the npm/Bun `overrides` block, the pnpm-workspace `overrides` block, and the
// Yarn `resolutions` block — so a hand-migrated project shares one Vitest copy
// with the bundled `vp test`. Those literals are NOT interpolated from
// VITEST_VERSION, so a daily bump must rewrite them or the guide drifts behind the
// bundled version. The packages/cli/README.md mirror (refreshed from the root
// README's suffix at build time) is kept in sync here too so the daily PR stays
// self-consistent without depending on a build step running first.
async function updateReadmeVitestPins(vitestVersion: string): Promise<void> {
const readmePaths = [path.join(ROOT, 'README.md'), path.join(ROOT, 'packages/cli/README.md')];
// JSON form: `"vitest": "4.1.9"` — npm/Bun `overrides` + Yarn `resolutions` (2 blocks)
const jsonPattern = /("vitest": ")[\d.]+(?:-[\w.]+)?(")/g;
// YAML form: ` vitest: 4.1.9` — pnpm-workspace `overrides` (1 block)
const yamlPattern = /(\n\s*vitest: )[\d.]+(?:-[\w.]+)?(\n)/g;
// Both READMEs carry the same three manual-migration pins (the cli copy mirrors the
// root's suffix). Assert the exact shape so a daily run fails loudly — like every
// other updater here — if a block is reworded or removed, instead of silently
// shipping a README where only some pins were bumped.
const EXPECTED_JSON = 2;
const EXPECTED_YAML = 1;
let oldVersion: string | undefined;
const capture = (match: string): void => {
const found = /(\d[\d.]*(?:-[\w.]+)?)/.exec(match)?.[1];
if (found && oldVersion === undefined) {
oldVersion = found;
}
};
for (const filePath of readmePaths) {
if (!fs.existsSync(filePath)) {
continue;
}
const content = fs.readFileSync(filePath, 'utf8');
let jsonMatched = 0;
let yamlMatched = 0;
let updated = content.replace(jsonPattern, (match: string, pre: string, post: string) => {
jsonMatched++;
capture(match);
return `${pre}${vitestVersion}${post}`;
});
updated = updated.replace(yamlPattern, (match: string, pre: string, post: string) => {
yamlMatched++;
capture(match);
return `${pre}${vitestVersion}${post}`;
});
if (jsonMatched !== EXPECTED_JSON || yamlMatched !== EXPECTED_YAML) {
throw new Error(
`Expected ${EXPECTED_JSON} JSON + ${EXPECTED_YAML} YAML vitest pins in ${filePath}, ` +
`found ${jsonMatched} + ${yamlMatched} — the manual-migration section changed, ` +
`please update updateReadmeVitestPins in .github/scripts/upgrade-deps.ts`,
);
}
fs.writeFileSync(filePath, updated);
console.log(`Updated ${path.relative(ROOT, filePath)}`);
}

fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2) + '\n');
console.log('Updated packages/test/package.json');
recordChange('README vitest pins', oldVersion ?? null, vitestVersion);
}

// ============ Update packages/core/package.json ============
Expand Down Expand Up @@ -430,7 +553,9 @@ await updatePnpmWorkspace({
oxcParser: oxcParserVersion,
oxcTransform: oxcTransformVersion,
});
await updateTestPackage(vitestVersion);
await updateVitestVersionConstant(vitestVersion);
await updateTestVpCreateWorkflow(vitestVersion);
await updateReadmeVitestPins(vitestVersion);
await updateCorePackage(devtoolsVersion);

writeMetaFiles();
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,32 @@ jobs:
- name: Pack packages into tgz
run: |
mkdir -p tmp/tgz
# Every tgz consumer below references fixed `*-0.0.0.tgz` filenames.
# A release commit can leave `packages/{core,cli}` at a published
# version (e.g. 0.1.22), which would make `pnpm pack` emit
# `*-0.1.22.tgz` instead. Pin both to 0.0.0 so the names stay stable.
(cd packages/core && npm pkg set version=0.0.0)
(cd packages/cli && npm pkg set version=0.0.0)
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
# Bun is uniquely strict about peer-dep resolution:
# 1. It checks the *resolved target's* package name and version
# against the peer range (vitest 4.1.9 declares peer
# `vite ^6 || ^7 || ^8`).
# 2. A file: override pointing at the vite-plus-core tgz fails
# both the name check (target is `@voidzero-dev/vite-plus-core`,
# not `vite`) and the version check (0.0.0 is outside `^6|^7|^8`).
# pnpm/npm/yarn don't enforce either, and using the same core tgz as
# the file: target for both `vite` and `@voidzero-dev/vite-plus-core`
# is the only configuration they install cleanly. See
# https://github.com/oven-sh/bun/issues/8406.
#
# Generate a sibling vite-7.99.0.tgz: a copy of the core tgz with
# `package.json#name` rewritten to "vite" and `version` to 7.99.0.
# ecosystem-ci/patch-project.ts points its vite override at this
# tgz only for bun-based projects (e.g. bun-vite-template); pnpm-,
# npm- and yarn-based ecosystem projects use the real core tgz.
pnpm exec tool repack-vite-tgz tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz tmp/tgz/vite-7.99.0.tgz vite 7.99.0
# Copy vp binary for e2e-test job (findVpBinary expects it in target/)
cp target/${{ matrix.target }}/release/vp tmp/tgz/vp 2>/dev/null || cp target/${{ matrix.target }}/release/vp.exe tmp/tgz/vp.exe 2>/dev/null || true
cp target/${{ matrix.target }}/release/vp-shim.exe tmp/tgz/vp-shim.exe 2>/dev/null || true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
}
update_json packages/cli/package.json
update_json packages/core/package.json
update_json packages/test/package.json
update_toml packages/cli/binding/Cargo.toml
update_toml crates/vite_global_cli/Cargo.toml
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish-to-pkg.pr.new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,4 @@ jobs:
'./packages/cli/cli-npm/*' \
'./packages/cli' \
'./packages/core' \
'./packages/prompts' \
'./packages/test'
'./packages/prompts'
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ jobs:
- name: Publish
run: |
pnpm publish --filter=./packages/core --tag latest --access public --no-git-checks
pnpm publish --filter=./packages/test --tag latest --access public --no-git-checks
pnpm publish --filter=./packages/cli --tag latest --access public --no-git-checks

- name: Create release body
Expand All @@ -177,7 +176,6 @@ jobs:
### Published Packages

- \`@voidzero-dev/vite-plus-core@${VERSION}\`
- \`@voidzero-dev/vite-plus-test@${VERSION}\`
- \`vite-plus@${VERSION}\`

### Installation
Expand Down Expand Up @@ -228,7 +226,6 @@ jobs:

**Published Packages:**
• @voidzero-dev/vite-plus-core@${{ env.VERSION }}
• @voidzero-dev/vite-plus-test@${{ env.VERSION }}
• vite-plus@${{ env.VERSION }}

**Install:**
Expand Down
53 changes: 38 additions & 15 deletions .github/workflows/test-vp-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,34 @@ jobs:
- name: Pack packages into tgz
run: |
mkdir -p tmp/tgz
# Every tgz consumer below references fixed `*-0.0.0.tgz` filenames.
# A release commit can leave `packages/{core,cli}` at a published
# version (e.g. 0.1.22), which would make `pnpm pack` emit
# `*-0.1.22.tgz` instead. Pin both to 0.0.0 so the names stay stable.
(cd packages/core && npm pkg set version=0.0.0)
(cd packages/cli && npm pkg set version=0.0.0)
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
# Bun is uniquely strict about peer-dep resolution:
# 1. It checks the *resolved target's* package name and version
# against the peer range (vitest 4.1.9 declares peer
# `vite ^6 || ^7 || ^8`).
# 2. A file: override pointing at the vite-plus-core tgz fails
# both the name check (target is `@voidzero-dev/vite-plus-core`,
# not `vite`) and the version check (0.0.0 is outside `^6|^7|^8`).
# pnpm/npm/yarn don't enforce either, and using the same core tgz as
# the file: target for both `vite` and `@voidzero-dev/vite-plus-core`
# is the only configuration they install cleanly. See
# https://github.com/oven-sh/bun/issues/8406.
#
# Generate a sibling vite-7.99.0.tgz: a copy of the core tgz with
# `package.json#name` rewritten to "vite" and `version` to 7.99.0.
# Only the bun matrix entry below points its vite override at this
# alias tgz; pnpm/npm/yarn keep pointing at the real core tgz so
# pnpm's workspace resolver doesn't trip on a "vite@<version>"
# registry lookup (the renamed tgz makes pnpm register the dep as
# vite@7.99.0 and then probe npmjs.org to validate the version).
pnpm exec tool repack-vite-tgz tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz tmp/tgz/vite-7.99.0.tgz vite 7.99.0
Comment thread
Brooooooklyn marked this conversation as resolved.
# Copy vp binary for test jobs
cp target/x86_64-unknown-linux-gnu/release/vp tmp/tgz/vp
ls -la tmp/tgz
Expand Down Expand Up @@ -154,6 +179,13 @@ jobs:
- yarn
- bun
env:
# Bun's strict peer check requires the `vite` override target's tgz to be
# named "vite" with a version satisfying vitest's `peer vite ^6 || ^7 || ^8`.
# The bun matrix entry uses the masquerade tgz (vite-7.99.0.tgz). pnpm/npm/yarn
# point at the real core tgz — anything else trips a registry lookup for
# vite@<version> when sub-package and override targets are both file: tgz aliases.
VITE_OVERRIDE_TGZ: ${{ matrix.package-manager == 'bun' && 'vite-7.99.0.tgz' || 'voidzero-dev-vite-plus-core-0.0.0.tgz' }}
VP_VERSION: 'file:${{ github.workspace }}/tmp/tgz/vite-plus-0.0.0.tgz'
# Force full dependency rewriting so the library template's existing
# vite-plus dep gets overridden with the local tgz
VP_FORCE_MIGRATE: '1'
Expand All @@ -170,22 +202,12 @@ jobs:
name: vite-plus-packages
path: tmp/tgz

- name: Resolve tgz paths
run: |
CLI_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/vite-plus-[0-9]*.tgz | head -n1)
CORE_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/voidzero-dev-vite-plus-core-[0-9]*.tgz | head -n1)
TEST_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/voidzero-dev-vite-plus-test-[0-9]*.tgz | head -n1)
echo "CLI_TGZ=$CLI_TGZ" >> $GITHUB_ENV
echo "VP_VERSION=file:$CLI_TGZ" >> $GITHUB_ENV
printf 'VP_OVERRIDE_PACKAGES={"vite":"file:%s","vitest":"file:%s","@voidzero-dev/vite-plus-core":"file:%s","@voidzero-dev/vite-plus-test":"file:%s"}\n' \
"$CORE_TGZ" "$TEST_TGZ" "$CORE_TGZ" "$TEST_TGZ" >> $GITHUB_ENV

- name: Install vp CLI
run: |
mkdir -p target/release
cp tmp/tgz/vp target/release/vp
chmod +x target/release/vp
node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz "$CLI_TGZ"
node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz $GITHUB_WORKSPACE/tmp/tgz/vite-plus-0.0.0.tgz
echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH

- name: Verify vp installation
Expand All @@ -195,6 +217,8 @@ jobs:

- name: Run vp create ${{ matrix.template.name }} with ${{ matrix.package-manager }}
working-directory: ${{ runner.temp }}
env:
VP_OVERRIDE_PACKAGES: '{"vite":"file:${{ github.workspace }}/tmp/tgz/${{ env.VITE_OVERRIDE_TGZ }}","@voidzero-dev/vite-plus-core":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz","vitest":"4.1.9","@vitest/expect":"4.1.9","@vitest/runner":"4.1.9","@vitest/snapshot":"4.1.9","@vitest/spy":"4.1.9","@vitest/utils":"4.1.9","@vitest/mocker":"4.1.9","@vitest/pretty-format":"4.1.9","@vitest/coverage-v8":"4.1.9","@vitest/coverage-istanbul":"4.1.9"}'
run: |
vp create ${{ matrix.template.create-args }} \
--no-interactive \
Expand Down Expand Up @@ -268,10 +292,9 @@ jobs:
run: |
node -e "
const path = require('path');
const expected = require('$GITHUB_WORKSPACE/packages/cli/package.json').version;
const pkg = require(path.resolve('node_modules/vite-plus/package.json'));
if (pkg.version !== expected) {
console.error('Expected vite-plus@' + expected + ', got ' + pkg.version);
if (pkg.version !== '0.0.0') {
console.error('Expected vite-plus@0.0.0, got ' + pkg.version);
process.exit(1);
}
console.log('✓ vite-plus@' + pkg.version + ' installed correctly');
Expand Down
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ PUNICODE = "PUNICODE"
Jod = "Jod" # Node.js v22 LTS codename
flate = "flate" # flate2 crate name (gzip/deflate compression)

[default.extend-identifiers]
# Yarn Plug'n'Play — tokenizer splits `PnP` into the word `Pn`, which typos
# otherwise wants to autocorrect to `On`. Whitelist the full identifier so
# the parts aren't tokenized.
PnP = "PnP"

[files]
extend-exclude = [
"**/snap-tests/**/snap.txt",
Expand Down
Loading
Loading