Commit ff44fc1
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest@4.1.5
Delete the bundled `@voidzero-dev/vite-plus-test` wrapper and consume
upstream `vitest@4.1.5` (plus `@vitest/browser*`) directly. The vite
redirection that the wrapper used to provide is now handled cleanly
by package-manager overrides (`vite` -> `@voidzero-dev/vite-plus-core`),
so the bundle was dead weight that lagged upstream vitest releases.
Public API contract preserved:
- `vite-plus/test*` IS the public test API. Existing vite-plus user
code (e.g. `import { vi } from 'vite-plus/test'`) is NEVER rewritten —
the imports stay exactly as authored.
- New vite-plus users do NOT install `vitest` or `@vitest/*` directly.
They install `vite-plus`; vitest and the browser providers come in
transitively as direct deps of the CLI package.
- `vp migrate` on an upstream-vitest project still rewrites bare
`vitest`, `vitest/*`, `@vitest/browser*`, declare-module specifiers
and `/// <reference types>` directives to the `vite-plus/test*`
surface (one-time forward migration).
Implementation:
- packages/cli/build.ts `syncTestPackageExports` auto-generates
`./test/*` shims from `vitest`'s own exports map, plus
`./test/<provider>` and `./test/browser/providers/<short>` shims
projected from each `@vitest/browser-*` package's exports.
- packages/cli/package.json adds `@vitest/browser`,
`@vitest/browser-playwright`, `@vitest/browser-preview`,
`@vitest/browser-webdriverio` as direct catalog deps pinned to
4.1.5 alongside `vitest`.
- crates/vite_global_cli/src/commands/version.rs version ToolSpec
points at the `vitest` package directly.
- packages/cli/src/resolve-test.ts resolves `vitest/package.json`
and reads `bin.vitest` so `vp test` invokes upstream vitest.
- packages/cli/src/utils/constants.ts drops `vitest` from
`VITE_PLUS_OVERRIDE_PACKAGES`; only `vite` remains a managed key.
- packages/cli/src/migration/migrator.ts adds an `isVitestAdjacent`
flag that flips `needVitePlus = true` for projects with packages
like `vitest-browser-svelte` even when no vite/oxlint/tsdown dep
is being migrated; adds a `pruneLegacyWrapperAliases` /
`pruneYamlMapLegacyWrapperAliases` sweep that rewrites stale
`vitest: npm:@voidzero-dev/vite-plus-test@*` aliases to `^4.1.5`
in package.json overrides/resolutions/pnpm.overrides, in
pnpm-workspace.yaml catalog/catalogs/overrides, and in bun
workspaces.catalog / workspaces.catalogs.
- packages/cli/src/migration/bin.ts adds a `handleInstallResult`
helper so failed reinstalls warn the user, append to
`report.warnings`, and flip `process.exitCode` instead of being
silently reported as success.
Verification:
- cargo test -p vite_migration --lib: 167 tests pass
- pnpm exec vitest run (packages/cli): 355 tests pass
- pnpm bootstrap-cli + snap-test-global + snap-test-local: all
fixtures regenerated; expected diffs only (forward import
rewrites, `@vitest/browser*` removed from user devDeps,
`playwright`/`webdriverio` preserved as peers, stale
`vite-plus-test` catalog aliases normalized to `^4.1.5`).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 99d3e41 commit ff44fc1
115 files changed
Lines changed: 900 additions & 5469 deletions
File tree
- .github
- scripts
- workflows
- crates
- vite_global_cli/src/commands
- vite_migration/src
- docs/guide
- ecosystem-ci
- packages
- cli
- snap-tests-global
- migration-add-git-hooks
- migration-auto-create-vite-config
- migration-baseurl-tsconfig
- migration-chained-lint-staged-pre-commit
- migration-composed-husky-custom-dir
- migration-composed-husky-prepare
- migration-env-prefix-lint-staged
- migration-eslint-lint-staged
- migration-eslint-lintstagedrc
- migration-eslint-npx-wrapper
- migration-eslint
- migration-existing-husky-lint-staged
- migration-existing-husky-v8-hooks
- migration-existing-husky-v8-multi-hooks
- migration-existing-husky
- migration-existing-lint-staged-config
- migration-existing-pnpm-exec-lint-staged
- migration-existing-prepare-script
- migration-from-tsdown-json-config
- migration-from-tsdown
- migration-from-vitest-config
- migration-from-vitest-files
- migration-hooks-skip-on-existing-hookspath
- migration-husky-latest-dist-tag-v9-installed
- migration-husky-latest-dist-tag
- migration-husky-or-prepare
- migration-husky-semicolon-prepare
- migration-husky-v8-preserves-lint-staged
- migration-lint-staged-in-scripts
- migration-lint-staged-merge-fail
- migration-lint-staged-ts-config
- migration-lintstagedrc-json
- migration-lintstagedrc-merge-fail
- migration-lintstagedrc-not-support
- migration-lintstagedrc-staged-exists
- migration-merge-vite-config-js
- migration-merge-vite-config-ts
- migration-monorepo-bun
- migration-monorepo-pnpm-overrides-dependency-selector
- migration-monorepo-pnpm
- migration-monorepo-yarn4
- migration-no-git-repo
- migration-no-hooks-with-husky
- migration-no-hooks
- migration-other-hook-tool
- migration-oxlintrc-json-with-comments
- migration-oxlintrc-jsonc
- migration-partially-migrated-pre-commit
- migration-prettier-eslint-combo
- migration-prettier-ignore-unknown
- migration-prettier-lint-staged
- migration-prettier-pkg-json
- migration-prettier
- migration-rewrite-declare-module
- migration-skip-vite-dependency
- migration-skip-vite-peer-dependency
- migration-standalone-npm
- migration-standalone-pnpm
- migration-subpath
- migration-tsconfig-esmoduleinterop
- migration-vite-version
- migration-vitest-peer-dep
- new-vite-monorepo-bun
- new-vite-monorepo
- snap-tests
- command-helper
- create-org-bundled-monorepo
- test-inline-snapshot-indent
- vite-plugins-async-test
- src
- src
- __tests__
- migration
- __tests__
- utils
- test
- __tests__
- tools
- src/__tests__
- rfcs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
| |||
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | 254 | | |
280 | 255 | | |
281 | 256 | | |
| |||
430 | 405 | | |
431 | 406 | | |
432 | 407 | | |
433 | | - | |
434 | 408 | | |
435 | 409 | | |
436 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
| |||
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
177 | 175 | | |
178 | 176 | | |
179 | 177 | | |
| |||
222 | 220 | | |
223 | 221 | | |
224 | 222 | | |
225 | | - | |
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
155 | | - | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
| 196 | + | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
| |||
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
212 | 210 | | |
213 | | - | |
214 | | - | |
| 211 | + | |
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 50 | + | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
167 | | - | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
110 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
0 commit comments