You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/migrate-existing-projects.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,15 @@ When PnP is active, interactive migration prints the incompatibility and asks wh
45
45
46
46
Force-override/CI mode (`VP_OVERRIDE_PACKAGES`) is respected: when `vitest` is not a managed key there, the project's own `vitest` is never stripped and its `@vitest/*` ecosystem dependencies are not realigned. Object-valued nested npm/Bun overrides are user-owned scopes rather than managed version pins and are preserved.
47
47
48
+
Legacy browser-provider usage must be detected before source imports are
49
+
rewritten. Projects that aliased `vitest` to the removed
50
+
`@voidzero-dev/vite-plus-test` package can import Playwright or WebdriverIO from
51
+
`vitest/browser-<provider>`, `vitest/browser/providers/<provider>`, or
52
+
`vitest/plugins/browser-<provider>`. Migration treats all three forms as opt-in
53
+
provider usage, installs the matching `@vitest/browser-<provider>` package and
54
+
framework peer, and then rewrites the import to the equivalent
55
+
`vite-plus/test*` surface.
56
+
48
57
## `@nuxt/test-utils` compatibility
49
58
50
59
`@nuxt/test-utils`'s transform detects an existing `vi` import only when its module specifier is exactly `vitest`. When a test uses `mockNuxtImport` or `mockComponent`, changing that import to `vite-plus/test` makes the transform inject a second `vi` import and can fail compilation with a duplicate identifier. Requiring users to know which individual files exercise that transform is brittle, so the migration uses one package-level rule instead.
@@ -96,7 +105,7 @@ How each package the `vitest` ecosystem rule covers is handled, verified against
96
105
|`packages/cli/src/migration/{migrator,npm-reinstall,bin}.ts`| Yarn PnP preflight and `node-modules` conversion; usage-aware managed override set; per-package dependency reconciliation; `vitest` removal across every sink; full `@vitest/*` alignment; browser-provider restoration; behind `vite-plus`/`vite` re-pin; empty/unrelated-`pnpm` routing fix; stale npm Vite install cleanup; package-level Nuxt dependency detection and retained Vitest provisioning. |
97
106
| Oxlint `prefer-vite-plus-imports` rule | Apply the same Nuxt package-level `vitest` / `vitest/*` exception so diagnostics and autofix preserve the migration's compatible result. |
98
107
99
-
Covered by unit tests in `migrator.spec.ts` (vitest removal, required-peer provisioning, ecosystem alignment, browser-provider restoration, workspace localization, behind re-pin, empty-`pnpm` reconciliation), `npm-reinstall.spec.ts` (stale npm install and lock cleanup), and a routing test in `vite_global_cli`.
108
+
Covered by unit tests in `migrator.spec.ts` (vitest removal, required-peer provisioning, ecosystem alignment, browser-provider restoration including legacy wrapper import paths, workspace localization, behind re-pin, empty-`pnpm` reconciliation), `npm-reinstall.spec.ts` (stale npm install and lock cleanup), and a routing test in `vite_global_cli`.
0 commit comments