Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
510d5b0
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest@4…
Brooooooklyn May 15, 2026
03d2490
fix(migration): re-pin vite-plus in force-override mode, fix lint/for…
Brooooooklyn May 15, 2026
b18f1e1
fix(migration): pass --no-frozen-lockfile to pnpm/yarn reinstall afte…
Brooooooklyn May 15, 2026
41d3671
fix(migration): preserve vitest declare-module, route browser-provide…
Brooooooklyn May 15, 2026
0672ed4
fix(migration): emit bunfig.toml with peer = false to unblock bun ins…
Brooooooklyn May 15, 2026
2159a19
docs: align migrate guide and bundling notes with actual rewrite/shim…
Brooooooklyn May 15, 2026
1578ca3
fix(ci): bump core tgz version for bun, sync declare-module snap
Brooooooklyn May 15, 2026
a3c6ebf
fix(ci): use a separate bumped-version core tgz for VP_OVERRIDE_PACKAGES
Brooooooklyn May 15, 2026
d58322f
fix(ci): pack core/cli with synthetic 7.99.0 version for bun peer-dep
Brooooooklyn May 16, 2026
f60e002
docs(cli): reformat BUNDLING.md provider-exports table
Brooooooklyn May 16, 2026
dd16440
fix(migration): mirror vite override as devDep on bun
Brooooooklyn May 16, 2026
21b62e6
fix(ci): pack a vite-7.99.0.tgz alias so bun's name+version check passes
Brooooooklyn May 16, 2026
b7e393c
fix(ci): post-process core tgz into vite alias instead of name-swappi…
Brooooooklyn May 16, 2026
09f65d4
fix(ci): use core tgz for vite override except where bun is the target
Brooooooklyn May 16, 2026
7400223
chore: vp check --fix
Brooooooklyn May 16, 2026
3cf5fa9
fix(migration): override vitest + @vitest/* family to single version
Brooooooklyn May 16, 2026
a9572c5
fix(cli): accept `test` field in defineConfig type signature
Brooooooklyn May 16, 2026
73ad4b3
fix(cli): inject vitest specifier rewrite plugin into defineConfig
Brooooooklyn May 16, 2026
10cc1c4
fix(cli): resolve mergeConfig star-export conflict between core and v…
Brooooooklyn May 16, 2026
4d14555
test(snap): redact transient network warnings in snap output
Brooooooklyn May 16, 2026
f3d9a74
fix(migration): override @vitest/coverage-* family
Brooooooklyn May 16, 2026
d1eb9b5
fix(migration): rewrite `from 'vite-plus/test'` -> `from 'vitest'`
Brooooooklyn May 16, 2026
cf12ee4
style(migration): cargo fmt
Brooooooklyn May 16, 2026
fc38ae2
revert(migration): restore `'vitest' -> 'vite-plus/test'` forward rew…
Brooooooklyn May 16, 2026
aeb834e
chore: retrigger CI after empty period
Brooooooklyn May 16, 2026
426224b
fix(cli): re-export vitest/config types (ViteUserConfig, etc.)
Brooooooklyn May 16, 2026
e9a8fd3
test(snap): drop leading whitespace on pnpm10 Packages line
Brooooooklyn May 16, 2026
40ed602
fix(cli): propagate vite-plus/test rewrite plugin into test.projects
Brooooooklyn May 16, 2026
51caa6b
chore: apply oxfmt formatting
Brooooooklyn May 16, 2026
2d5756e
fix(cli): drop redundant type assertions in project injector
Brooooooklyn May 16, 2026
95b71c8
fix(cli): add runtime targets for browser provider context exports
Brooooooklyn May 16, 2026
8f1e604
fix(migration): don't let initial install's failure mask final instal…
Brooooooklyn May 16, 2026
b7737a6
ci(test-vp-create): include vitest family in VP_OVERRIDE_PACKAGES
Brooooooklyn May 16, 2026
79c2254
chore: keep VITEST_VERSION + @vitest/browser* catalog in sync on bumps
Brooooooklyn May 16, 2026
a7859fd
fix(cli): use es-module-lexer to scope vite-plus/test rewrites to rea…
Brooooooklyn May 16, 2026
ef3b17a
fix(migration): pin legacy wrapper fallback to exact VITEST_VERSION
Brooooooklyn May 16, 2026
ca6e3ab
chore(upgrade-deps): bump vitest pins in test-vp-create.yml too
Brooooooklyn May 16, 2026
b4dde84
fix(cli): preserve quotes when rewriting dynamic import specifiers
Brooooooklyn May 18, 2026
b9d62d9
fix(deps): patch @vitest/mocker to hoist vite-plus/test imports
Brooooooklyn May 18, 2026
b327596
fix(cli): fall back to regex rewrite when es-module-lexer rejects JSX…
Brooooooklyn May 18, 2026
eb733d8
fix(cli): restore missing test/* subpaths and auto-inline matcher pac…
Brooooooklyn May 18, 2026
72c4898
style: format build.ts and define-config.ts to oxfmt rules
Brooooooklyn May 18, 2026
3fd73c5
fix(cli): align CJS index.cts allowlist with ESM index.ts
Brooooooklyn May 18, 2026
079a696
style(cli): apply vp check --fix to define-config.ts and build.ts
Brooooooklyn May 18, 2026
8d3239d
fix(cli): use oxc-parser for TSX rewrite fallback, cover re-exports
Brooooooklyn May 19, 2026
b07ea84
chore: pnpm dedupe after adding oxc-parser dependency
Brooooooklyn May 20, 2026
cf43391
fix(cli): resolve vitest family for browser-mode in transitive-dep pr…
Brooooooklyn May 20, 2026
c1c7cb3
chore(deps): upgrade vitest to 4.1.7
Brooooooklyn May 20, 2026
b2efc18
fix(migration): align @vitest/browser subpath rewrites with vite-plus…
Brooooooklyn May 20, 2026
40272f1
fix(ci): pin packed package versions to 0.0.0 for stable tgz names
Brooooooklyn May 20, 2026
07af786
fix(tools): drop deleted packages/test from snap-test relink map
Brooooooklyn May 20, 2026
aef9c85
fix(ci): use npm pkg set to pin packed versions
Brooooooklyn May 20, 2026
62c3d5e
fix(ci): expect 0.0.0 in ecosystem-ci verify-install
Brooooooklyn May 20, 2026
9b451f4
fix(cli): handle default+named imports in external dts type-only fix
Brooooooklyn May 20, 2026
632f215
fix(cli): externalize postcss/lightningcss from the dts bundle
Brooooooklyn May 20, 2026
c9513a3
ci(upgrade-deps): sync @vitest/mocker patch entry on vitest bumps
Brooooooklyn May 20, 2026
2d88fd9
fix(cli): externalize vitest/@vitest from the dts bundle
Brooooooklyn May 20, 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
145 changes: 121 additions & 24 deletions .github/scripts/upgrade-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,31 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise<voi
let content = fs.readFileSync(filePath, 'utf8');

// oxlint's trailing \n in the pattern disambiguates from oxlint-tsgolint.
const vitestBrowserPackages = [
'@vitest/browser',
'@vitest/browser-playwright',
'@vitest/browser-preview',
'@vitest/browser-webdriverio',
];
const vitestBrowserEntries: PnpmWorkspaceEntry[] = vitestBrowserPackages.map((pkg) => ({
name: pkg,
pattern: new RegExp(`'${pkg.replace('/', '\\/')}': ([\\d.]+(?:-[\\w.]+)?)`),
replacement: `'${pkg}': ${versions.vitest}`,
newVersion: versions.vitest,
}));
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,
},
...vitestBrowserEntries,
{
name: 'tsdown',
pattern: /tsdown: \^([\d.]+(?:-[\w.]+)?)/,
Expand Down Expand Up @@ -246,34 +264,111 @@ 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;
for (const key of vitestKeys) {
const pattern = new RegExp(`"${key.replace('/', '\\/')}":"([\\d.]+(?:-[\\w.]+)?)"`);
let matched = false;
updated = updated.replace(pattern, (_match: string, _captured: string) => {
matched = true;
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);
console.log('Updated .github/workflows/test-vp-create.yml');
}

// Update vitest-dev devDependency
if (devDependencies['vitest-dev']) {
devDependencies['vitest-dev'] = `^${vitestVersion}`;
// ============ Update the @vitest/mocker pnpm patch entry ============
// `pnpm-workspace.yaml` patches `@vitest/mocker` so the static `vi.mock()`
// hoister recognizes the public `vite-plus/test` specifier. pnpm keys
// `patchedDependencies` by EXACT version (`@vitest/mocker@x.y.z`) and errors
// hard (`ERR_PNPM_PATCHED_PKG_DOES_NOT_MATCH`) when the key drifts from the
// installed version, so a daily vitest bump would otherwise break every
// auto-upgrade PR. Rewrite the key + patch-file path and rename the patch file
// to the new version. The patch file is kept version-suffixed (rather than
// switching to a name-only key) because its diff context is version-specific:
// if upstream changes `dist/chunk-hoistMocks.js`, the rename surfaces a loud
// patch-apply failure that a human must resolve — which is the desired signal.
async function updateVitestMockerPatch(vitestVersion: string): Promise<void> {
const filePath = path.join(ROOT, 'pnpm-workspace.yaml');
const content = fs.readFileSync(filePath, 'utf8');
const pattern =
/'@vitest\/mocker@([\d.]+(?:-[\w.]+)?)': patches\/@vitest__mocker@[\d.]+(?:-[\w.]+)?\.patch/;
let oldVersion: string | undefined;
const updated = content.replace(pattern, (_match: string, captured: string) => {
oldVersion = captured;
return `'@vitest/mocker@${vitestVersion}': patches/@vitest__mocker@${vitestVersion}.patch`;
});
if (oldVersion === undefined) {
throw new Error(
`Failed to match the @vitest/mocker patchedDependencies entry in ${filePath} — ` +
`the pattern ${pattern} is stale, please update it in .github/scripts/upgrade-deps.ts`,
);
}

// Update @vitest/ui peerDependency if present
if (pkg.peerDependencies?.['@vitest/ui']) {
pkg.peerDependencies['@vitest/ui'] = vitestVersion;
if (oldVersion !== vitestVersion) {
const oldPatch = path.join(ROOT, 'patches', `@vitest__mocker@${oldVersion}.patch`);
const newPatch = path.join(ROOT, 'patches', `@vitest__mocker@${vitestVersion}.patch`);
if (!fs.existsSync(oldPatch)) {
throw new Error(
`Expected patch file ${oldPatch} to exist before renaming — ` +
`the @vitest/mocker patch may have been moved or removed.`,
);
}
fs.renameSync(oldPatch, newPatch);
fs.writeFileSync(filePath, updated);
console.log(`Renamed @vitest/mocker patch ${oldVersion} -> ${vitestVersion}`);
}

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

// ============ Update packages/core/package.json ============
Expand Down Expand Up @@ -430,7 +525,9 @@ await updatePnpmWorkspace({
oxcParser: oxcParserVersion,
oxcTransform: oxcTransformVersion,
});
await updateTestPackage(vitestVersion);
await updateVitestVersionConstant(vitestVersion);
await updateTestVpCreateWorkflow(vitestVersion);
await updateVitestMockerPatch(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 @@ -108,9 +108,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.7 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 @@ -154,7 +154,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 @@ -170,7 +169,6 @@ jobs:
### Published Packages

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

### Installation
Expand Down Expand Up @@ -219,7 +217,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 @@ -93,9 +93,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.7 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 @@ -152,6 +177,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 @@ -168,22 +200,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 @@ -193,6 +215,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.7","@vitest/expect":"4.1.7","@vitest/runner":"4.1.7","@vitest/snapshot":"4.1.7","@vitest/spy":"4.1.7","@vitest/utils":"4.1.7","@vitest/mocker":"4.1.7","@vitest/pretty-format":"4.1.7","@vitest/coverage-v8":"4.1.7","@vitest/coverage-istanbul":"4.1.7"}'
run: |
vp create ${{ matrix.template.create-args }} \
--no-interactive \
Expand Down Expand Up @@ -266,10 +290,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
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,11 @@ If you are manually migrating a project to Vite+, install these dev dependencies
npm install -D vite-plus @voidzero-dev/vite-plus-core@latest
```

You need to add overrides to your package manager for `vite` and `vitest` so that other packages depending on Vite and Vitest will use the Vite+ versions:
You need to add overrides to your package manager for `vite` so that other packages depending on Vite (including Vitest) will use the Vite+ version:

```json
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
"vite": "npm:@voidzero-dev/vite-plus-core@latest"
}
```

Expand All @@ -203,15 +202,13 @@ If you are using `pnpm`, add this to your `pnpm-workspace.yaml`:
```yaml
overrides:
vite: npm:@voidzero-dev/vite-plus-core@latest
vitest: npm:@voidzero-dev/vite-plus-test@latest
```

Or, if you are using Yarn:

```json
"resolutions": {
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
"vite": "npm:@voidzero-dev/vite-plus-core@latest"
}
```

Expand Down
6 changes: 1 addition & 5 deletions crates/vite_global_cli/src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ const TOOL_SPECS: [ToolSpec; 7] = [
package_name: "@voidzero-dev/vite-plus-core",
bundled_version_key: Some("rolldown"),
},
ToolSpec {
display_name: "vitest",
package_name: "@voidzero-dev/vite-plus-test",
bundled_version_key: Some("vitest"),
},
ToolSpec { display_name: "vitest", package_name: "vitest", bundled_version_key: None },
ToolSpec { display_name: "oxfmt", package_name: "oxfmt", bundled_version_key: None },
ToolSpec { display_name: "oxlint", package_name: "oxlint", bundled_version_key: None },
ToolSpec {
Expand Down
Loading
Loading