vite-plus 0.3.3 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE +35 -146
  2. package/README.md +6 -4
  3. package/binding/index.cjs +58 -54
  4. package/binding/index.d.cts +36 -4
  5. package/dist/{agent-Cu6-tXIP.js → agent-DIwEez_1.js} +6 -5
  6. package/dist/bin.js +75 -35
  7. package/dist/config/bin.js +3 -3
  8. package/dist/constants-BAsBfS1J.js +356 -0
  9. package/dist/create/bin.js +19 -13
  10. package/dist/{define-config-IgzmnvvV.js → define-config-Bz6dc3fm.js} +165 -43
  11. package/dist/{define-config-D0mevyb3.cjs → define-config-CAeeMTvb.cjs} +179 -44
  12. package/dist/{define-config-DPNEJxPz.d.ts → define-config-Cf_5GHmY.d.ts} +71 -25
  13. package/dist/define-config.cjs +1 -1
  14. package/dist/define-config.d.ts +1 -1
  15. package/dist/define-config.js +1 -1
  16. package/dist/dist-BWiANxFS.js +8052 -0
  17. package/dist/{dist-BDYZP12R.js → dist-BsAzy8OW.js} +109 -105
  18. package/dist/documentation-DqcZSthV.js +11 -0
  19. package/dist/{editor-4sjlHmUh.js → editor-DWgrWTbN.js} +246 -159
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
  24. package/dist/lint-plugins.cjs +1 -1
  25. package/dist/migration/bin.js +3127 -18
  26. package/dist/migration/compat/worker.js +1 -1
  27. package/dist/{oxlint-plugin-config-BVqEe9KY.js → oxlint-plugin-config-B-P1a_0g.js} +1 -1
  28. package/dist/oxlint-plugin.js +9 -7
  29. package/dist/pack-bin.js +1 -1
  30. package/dist/{package-CHH8jWan.js → package-BrupPpWA.js} +6 -2
  31. package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
  32. package/dist/{prompts-k14KgthC.js → prompts-BW7_fDGJ.js} +3 -4
  33. package/dist/{report-CK5TnTsr.js → report-NhQk8VHb.js} +1 -0
  34. package/dist/{resolve-vite-config-CTOTuqTi.js → resolve-vite-config-D3XIVT6s.js} +1 -1
  35. package/dist/{resolve-vite-config-BqvS2P98.js → resolve-vite-config-DcsMQaYy.js} +2 -2
  36. package/dist/staged/bin.js +1206 -3318
  37. package/dist/sync-versions/bin.js +4 -4
  38. package/dist/sync-versions/bin.mjs +17 -2
  39. package/dist/test/browser/context.js +1 -1
  40. package/dist/test/browser/providers/playwright/context.js +1 -1
  41. package/dist/test/browser/providers/preview/context.js +1 -1
  42. package/dist/test/browser-playwright/context.js +1 -1
  43. package/dist/test/browser-preview/context.js +1 -1
  44. package/dist/test/context.d.ts +2 -942
  45. package/dist/test/context.js +1 -1
  46. package/dist/test/internal/traces.js +1 -0
  47. package/dist/test/locators.d.ts +2 -294
  48. package/dist/test/matchers.d.ts +2 -29
  49. package/dist/test/mocker.d.ts +2 -0
  50. package/dist/test/mocker.js +1 -0
  51. package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
  52. package/dist/test/plugins/browser-context.js +1 -1
  53. package/dist/test/plugins/browser-locators.d.ts +2 -0
  54. package/dist/test/plugins/browser-playwright.d.ts +2 -0
  55. package/dist/test/plugins/browser-preview.d.ts +2 -0
  56. package/dist/test/plugins/browser.d.ts +2 -0
  57. package/dist/test/plugins/mocker-automock.d.ts +2 -0
  58. package/dist/test/plugins/mocker-browser.d.ts +2 -0
  59. package/dist/test/plugins/mocker-node.d.ts +2 -0
  60. package/dist/test/plugins/mocker-redirect.d.ts +2 -0
  61. package/dist/test/plugins/mocker-register.d.ts +2 -0
  62. package/dist/test/plugins/mocker-transforms.d.ts +2 -0
  63. package/dist/test/plugins/mocker.d.ts +2 -0
  64. package/dist/test/plugins/pretty-format.d.ts +2 -0
  65. package/dist/test/plugins/snapshot-environment.d.ts +2 -0
  66. package/dist/test/plugins/snapshot-manager.d.ts +2 -0
  67. package/dist/test/plugins/snapshot.d.ts +2 -0
  68. package/dist/test/plugins/spy.d.ts +2 -0
  69. package/dist/test/plugins/utils-constants.d.ts +2 -0
  70. package/dist/test/plugins/utils-diff.d.ts +2 -0
  71. package/dist/test/plugins/utils-display.d.ts +2 -0
  72. package/dist/test/plugins/utils-error.d.ts +2 -0
  73. package/dist/test/plugins/utils-helpers.d.ts +2 -0
  74. package/dist/test/plugins/utils-offset.d.ts +2 -0
  75. package/dist/test/plugins/utils-resolver.d.ts +2 -0
  76. package/dist/test/plugins/utils-serialize.d.ts +2 -0
  77. package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
  78. package/dist/test/plugins/utils-source-map.d.ts +2 -0
  79. package/dist/test/plugins/utils-timers.d.ts +2 -0
  80. package/dist/test/plugins/utils.d.ts +2 -0
  81. package/dist/toolchain.js +11 -11
  82. package/dist/toolchain.json +11 -11
  83. package/dist/{tsconfig-euB-GmIE.js → tsconfig-DESFDzWP.js} +1 -1
  84. package/dist/{tsconfig-C3h9CVTA.js → tsconfig-piorpNV7.js} +8 -4
  85. package/dist/version.js +5 -3
  86. package/dist/versions.js +6 -6
  87. package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
  88. package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
  89. package/docs/config/fmt.md +4 -2
  90. package/docs/config/lint.md +4 -2
  91. package/docs/config/run.md +62 -26
  92. package/docs/guide/automatic-data-tracking.md +20 -15
  93. package/docs/guide/cache.md +12 -8
  94. package/docs/guide/check.md +2 -0
  95. package/docs/guide/commit-hooks.md +8 -1
  96. package/docs/guide/env.md +18 -13
  97. package/docs/guide/fmt.md +6 -2
  98. package/docs/guide/index.md +1 -1
  99. package/docs/guide/install.md +1 -1
  100. package/docs/guide/lint.md +5 -1
  101. package/docs/guide/local-cli.md +3 -3
  102. package/docs/guide/migrate-rules.md +58 -12
  103. package/docs/guide/migrate.md +86 -20
  104. package/docs/guide/monorepo.md +7 -1
  105. package/docs/guide/run.md +3 -1
  106. package/docs/guide/test.md +2 -0
  107. package/docs/guide/troubleshooting.md +3 -3
  108. package/docs/guide/vitest-v5.md +221 -0
  109. package/package.json +64 -87
  110. package/bin/oxfmt +0 -33
  111. package/bin/oxlint +0 -38
  112. package/dist/cli-truncate-Bg3RDXpi.js +0 -865
  113. package/dist/constants-C2dTOTe-.js +0 -80
  114. package/dist/dist-Dqv1-Clg.js +0 -3
  115. package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
  116. package/dist/log-update-CoW8Z4Dl.js +0 -491
  117. package/dist/semver-CaDAb8vV.js +0 -1400
  118. package/dist/strip-ansi-C3wrWz9t.js +0 -853
  119. package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
  120. package/dist/test/browser/providers/webdriverio/context.js +0 -1
  121. package/dist/test/browser/providers/webdriverio.d.ts +0 -77
  122. package/dist/test/browser/providers/webdriverio.js +0 -1
  123. package/dist/test/browser-webdriverio/context.d.ts +0 -1
  124. package/dist/test/browser-webdriverio.d.ts +0 -77
  125. package/dist/test/browser-webdriverio.js +0 -1
  126. package/dist/test/coverage.d.ts +0 -2
  127. package/dist/test/coverage.js +0 -1
  128. package/dist/test/environments.d.ts +0 -2
  129. package/dist/test/environments.js +0 -1
  130. package/dist/test/plugins/browser-webdriverio.js +0 -1
  131. package/dist/test/plugins/expect.js +0 -1
  132. package/dist/test/plugins/runner-types.js +0 -1
  133. package/dist/test/plugins/runner-utils.js +0 -1
  134. package/dist/test/plugins/runner.js +0 -1
  135. package/dist/test/reporters.d.ts +0 -2
  136. package/dist/test/reporters.js +0 -1
  137. package/dist/test/runners.d.ts +0 -2
  138. package/dist/test/runners.js +0 -1
  139. package/dist/test/snapshot.d.ts +0 -2
  140. package/dist/test/snapshot.js +0 -1
  141. package/dist/test/suite.d.ts +0 -2
  142. package/dist/test/suite.js +0 -1
  143. package/dist/tsgolint-path-CbDReEOx.js +0 -34
  144. package/dist/tsgolint-path.d.ts +0 -7
  145. package/dist/tsgolint-path.js +0 -2
  146. package/dist/wrap-ansi-DNjkuBEp.js +0 -157
  147. package/dist/wrap-ansi-DUi52C6W.js +0 -2
@@ -39,7 +39,7 @@ A range resolves to an already-downloaded satisfying version when possible, othe
39
39
 
40
40
  Vite+ currently downloads the declared package manager (the `onFail: "download"` behavior); the other `onFail` values are accepted but not yet differentiated.
41
41
 
42
- The explicit `packageManager` field (or the `devEngines.packageManager` declaration) also affects matching package-manager shims. If a project has `packageManager: "npm@10.9.4"`, `npm` and `npx` use npm 10.9.4. Other generated alias pairs behave the same way: `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Mismatched tools are not translated; `npm` in a `pnpm` project still resolves as npm.
42
+ The explicit `packageManager` field (or the `devEngines.packageManager` declaration) also affects matching package-manager shims. If a project has `packageManager: "npm@10.9.4"`, `npm` and `npx` use npm 10.9.4. Other generated aliases behave the same way: `pnpm`/`pnpx`/`pn`/`pnx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Mismatched tools are not translated; `npm` in a `pnpm` project still resolves as npm.
43
43
 
44
44
  ## Usage
45
45
 
@@ -20,7 +20,11 @@ vp lint --type-aware
20
20
 
21
21
  Put lint configuration directly in the `lint` block in the root `vite.config.ts` so all your configuration stays in one place. We do not recommend using `oxlint.config.ts` or `.oxlintrc.json` with Vite+.
22
22
 
23
- Vite+ does not currently support nested lint configuration. For now, use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) in the root `vite.config.ts` for file- or package-specific rules. The long-term behavior is open for discussion; [share your use case and expectations](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) to help shape it.
23
+ `vp lint` finds its config from the working directory, so package directories without their own `lint` block use the root config. Relative file arguments retain their meaning. Use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) for file- or package-specific rules instead of adding `lint` blocks to package configs.
24
+
25
+ `vp check` uses the workspace-root `lint` block when it exists, including from a package directory. Package configs cannot replace those lint settings in `vp check`.
26
+
27
+ An explicit `vp lint -c <path>` or `vp lint --config <path>` selects another config. Otherwise, Oxlint discovers the nearest `vite.config.*` file with a `lint` block. Supported extensions are `.js`, `.mjs`, `.ts`, `.cjs`, `.mts`, and `.cts`. Nested configs do not override settings for individual files.
24
28
 
25
29
  For the upstream rule set, options, and compatibility details, see the [Oxlint docs](https://oxc.rs/docs/guide/usage/linter.html).
26
30
 
@@ -52,20 +52,20 @@ You need to add overrides to your package manager so that other packages resolve
52
52
  ```yaml [pnpm-workspace.yaml]
53
53
  overrides:
54
54
  vite: npm:@voidzero-dev/vite-plus-core@latest
55
- vitest: 4.1.11
55
+ vitest: 5.0.1
56
56
  ```
57
57
 
58
58
  ```json [npm / Bun package.json]
59
59
  "overrides": {
60
60
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
61
- "vitest": "4.1.11"
61
+ "vitest": "5.0.1"
62
62
  }
63
63
  ```
64
64
 
65
65
  ```json [Yarn package.json]
66
66
  "resolutions": {
67
67
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
68
- "vitest": "4.1.11"
68
+ "vitest": "5.0.1"
69
69
  }
70
70
  ```
71
71
 
@@ -44,23 +44,67 @@ When a default upgrade skips setup actions that would apply, it prints a hint to
44
44
 
45
45
  Migration preserves the previous defaults by setting `deps.resolveDepSubpath` to `true` when absent. Enabled ATTW checks receive `profile: 'strict'` when no profile is set. Explicit values, including `false`, remain unchanged.
46
46
 
47
+ The inserted settings include comments with documentation links and instructions for adopting the new defaults. Remove `deps.resolveDepSubpath: true` to [preserve external subpath imports as written](https://tsdown.dev/options/dependencies#deps-resolvedepsubpath). Remove the inserted `attw.profile: 'strict'` to use the new `esm-only` [resolution profile](https://tsdown.dev/options/lint#profiles). This skips `node10` and CommonJS resolution checks. Keep either setting if your package requires the previous behavior. Migration does not add these comments to explicit settings.
48
+
47
49
  `noExternal` moves to `deps.alwaysBundle`, preserving matcher expressions, references, and callback methods. Existing `deps.alwaysBundle` values remain unchanged.
48
50
 
49
51
  When `external` accompanies either `skipNodeModulesBundle` form, static matchers and references to local constants move to `inputOptions.external` before `deps.neverBundle` is set. Constant declarations and references stay intact. This preserves the original matching rules, including external file paths. Unsupported matchers, conflicting `inputOptions`, and declaration-specific dependency rules leave the pack object unchanged and produce a manual-migration warning.
50
52
 
51
53
  The transform does not evaluate configuration code. Objects with spreads, computed keys, or duplicate keys, and conflicting old and new options require manual review. Dynamic boolean selectors remain unchanged. Unrelated Vite and plugin options remain unchanged. Run `vp pack` after migration to check the result. Node.js requirements, TypeScript module resolution, and programmatic `build()` return values require separate review.
52
54
 
55
+ ## Task Cache Configuration
56
+
57
+ `vp migrate` moves `env`, `untrackedEnv`, `input`, and `output` from the top level of each task into the task's [`cache`](/config/run#cache) object. It updates static `run.tasks` objects in `vite.config.*`. This also runs on existing Vite+ projects without `--full`, including workspace packages.
58
+
59
+ | Previous task config | Updated task config |
60
+ | -------------------- | ---------------------------------------------- |
61
+ | No `cache` | Adds `cache` with the moved settings |
62
+ | `cache: true` | Replaces `true` with the moved settings |
63
+ | `cache: { ... }` | Adds the moved settings to the existing object |
64
+
65
+ ```ts
66
+ // Before
67
+ build: {
68
+ command: 'vp build',
69
+ env: ['NODE_ENV'],
70
+ input: [{ auto: true }, '!dist/**'],
71
+ },
72
+
73
+ // After
74
+ build: {
75
+ command: 'vp build',
76
+ cache: {
77
+ env: ['NODE_ENV'],
78
+ input: [{ auto: true }, '!dist/**'],
79
+ },
80
+ },
81
+ ```
82
+
83
+ Moved settings keep their text and indentation, and the formatting step described in [After the Migration](#after-the-migration) indents them inside `cache`. Comments on their own line above a moved setting, and `//` comments that follow it on the same line, move with it.
84
+
85
+ The transform does not evaluate configuration code. It leaves a task unchanged and prints a manual-migration warning when the task has:
86
+
87
+ - spreads, or computed, escaped, or duplicate keys;
88
+ - a moved setting written as a method, such as `input() { ... }`;
89
+ - a comment between a moved setting and its comma, or after the last setting in `cache`;
90
+ - a moved setting that already exists in `cache`;
91
+ - a `cache` value other than `true` or an object literal.
92
+
93
+ It also warns about tasks in a `vite.config.*` object that is not the exported config itself, such as a variable the config refers to or an object passed to `mergeConfig`. Tasks created in other modules, for example by a shared helper function, are not detected. Move their settings by hand; `vp run` lists every task that still needs it.
94
+
95
+ With `cache: false`, the moved settings would have no effect, so decide whether to remove them or enable caching. On a project that is otherwise up to date, `vp migrate` prints these warnings without running the rest of the migration.
96
+
53
97
  ## Dependency Rules
54
98
 
55
99
  What happens to each toolchain dependency, at a glance:
56
100
 
57
- | Dependency | What happens |
58
- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59
- | `vite-plus` | Added where the package is migrated; plain ranges re-pinned to the concrete target, directly or through a catalog. |
60
- | `vite` | Existing declarations kept and pointed at the core alias. Under pnpm, added as a direct dev dependency wherever needed (see [Vite and Overrides](#vite-and-overrides)). |
61
- | `vitest` | Removed in the common node-mode case because `vite-plus` provides it transitively. Kept or added only when [directly required](#when-vitest-is-directly-required). |
62
- | `@vitest/*` | Directly installed lockstep packages aligned to the bundled Vitest version (see [Vitest Ecosystem Packages](#vitest-ecosystem-packages)). |
63
- | `@voidzero-dev/vite-plus-test` | Removed everywhere: dependencies, overrides, resolutions, and catalog aliases. Imports are rewritten to the current `vite-plus/test*` surface. |
101
+ | Dependency | What happens |
102
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
103
+ | `vite-plus` | Added where the package is migrated; plain ranges re-pinned to the concrete target, directly or through a catalog. |
104
+ | `vite` | Existing declarations kept and pointed at the core alias. pnpm packages that use only `vite-plus` need no new `vite` entry (see [Vite and Overrides](#vite-and-overrides)). |
105
+ | `vitest` | Removed in the common node-mode case because `vite-plus` provides it transitively. Kept or added only when [directly required](#when-vitest-is-directly-required). |
106
+ | `@vitest/*` | Directly installed lockstep packages aligned to the bundled Vitest version (see [Vitest Ecosystem Packages](#vitest-ecosystem-packages)). |
107
+ | `@voidzero-dev/vite-plus-test` | Removed everywhere: dependencies, overrides, resolutions, and catalog aliases. Imports are rewritten to the current `vite-plus/test*` surface. |
64
108
 
65
109
  ### Version Selection
66
110
 
@@ -72,14 +116,14 @@ What happens to each toolchain dependency, at a glance:
72
116
 
73
117
  ### Vite and Overrides
74
118
 
75
- Package-manager overrides do not create dependency edges by themselves. Under pnpm, a package that lists `vite-plus` in `dependencies` or `devDependencies` but has no `vite` entry anywhere (`dependencies`, `devDependencies`, `optionalDependencies`, or `peerDependencies`) lets pnpm auto-install upstream Vite to satisfy Vitest's required `vite` peer, splitting the project across separate Vite+, Vite, and Vitest instances. To prevent this, `vp migrate` adds the missing `vite` entry to `devDependencies` of every such package; the workspace override then redirects it to Vite+ core.
119
+ You can use `vite-plus` in a pnpm package without declaring `vite`. The `vite-plus` package includes a `vite` dependency aliased to its core, which provides Vitest's required peer. Migration keeps the workspace override for other Vite consumers but does not add `vite` to a package solely because it uses `vite-plus`.
76
120
 
77
121
  Related rules:
78
122
 
79
123
  - A direct `vite` declaration is never removed merely because a root override exists.
80
124
  - Plain or stale aliases are normalized; named catalog references are kept.
81
125
  - Under pnpm the managed override keys use an explicit `@*` range (`vite@*`, `vitest@*`). pnpm applies an override by replacing the declared spec on every manifest, importer manifests included. A bare key matches any spec, including `catalog:`, and `vp up` then rewrites that reference to a concrete version. The `@*` range keeps the override on the semver ranges that transitive and peer declarations use. It leaves `catalog:` references to the catalog, which already resolves them to Vite+ core. Migration re-keys a project that still holds the bare key, and keeps its named-catalog choice.
82
- - The direct-entry rule above is pnpm-specific. Bun mirrors its core alias as a direct dependency for its peer resolver, and npm browser-provider layouts may need a top-level `vite` edge so nested Vitest packages can resolve `vite`.
126
+ - Bun mirrors its core alias as a direct dependency for its peer resolver, and npm browser-provider layouts may need a top-level `vite` edge so nested Vitest packages can resolve `vite`.
83
127
 
84
128
  ### When Vitest Is Directly Required
85
129
 
@@ -114,9 +158,11 @@ Packages that are **not** aligned:
114
158
  - `@vitest/coverage-c8` stopped at an older release and has no Vitest 4 version; and
115
159
  - third-party `vitest-*` integrations keep their own compatible versions, though their required Vitest peer may still trigger [direct provisioning](#when-vitest-is-directly-required).
116
160
 
117
- For browser mode, the base `@vitest/browser` runtime and `@vitest/browser-preview` are bundled by Vite+ and are removed as direct dependencies. The Playwright and WebdriverIO providers stay opt-in: a kept or injected provider is referenced through the preferred toolchain catalog at the bundled Vitest version (or written concretely when catalogs are unsupported), and its `playwright` or `webdriverio` peer is installed alongside.
161
+ For browser mode, Vite+ bundles the base `@vitest/browser` runtime and `@vitest/browser-preview`; migration removes their direct dependency entries. The Playwright provider stays opt-in. Migration uses the bundled Vitest version for `@vitest/browser-playwright`, through the preferred toolchain catalog or the dependency entry, and installs its `playwright` peer alongside.
162
+
163
+ Migration detects Playwright usage before it rewrites imports, including legacy `vitest/browser-playwright`, `vitest/browser/providers/playwright`, and `vitest/plugins/browser-playwright` aliases.
118
164
 
119
- Providers are detected before imports are rewritten. This covers legacy projects that aliased `vitest` to `@voidzero-dev/vite-plus-test` and import from `vitest/browser-<provider>`, `vitest/browser/providers/<provider>`, or `vitest/plugins/browser-<provider>`: those imports still install the corresponding `@vitest/browser-playwright` or `@vitest/browser-webdriverio` dependency and its framework peer.
165
+ `vp migrate` restores removed Vite+ WebDriverIO aliases to `@vitest/browser-webdriverio` and adds `^5.0.0` if the provider is missing. It upgrades older versions, narrows ranges that allow versions below `5.0.0`, updates referenced catalog entries, and removes overrides that force an older provider. Versions and ranges that meet the minimum stay unchanged. Migration ensures the required `webdriverio` peer and adds an `@vitest/browser` override matching bundled Vitest (`resolutions` for Yarn). You manage later community provider upgrades. See [Community WebDriverIO provider](./vitest-v5.md#community-webdriverio-provider).
120
166
 
121
167
  Object-valued nested npm and Bun overrides are preserved: they are user-defined scopes rather than scalar version pins.
122
168
 
@@ -225,7 +271,7 @@ Migration converts legacy Node.js version-manager files to `.node-version`, the
225
271
 
226
272
  **Other rules.**
227
273
 
228
- - Each package that declares `vite-plus` also gets a direct `vite` dev dependency (see [Vite and Overrides](#vite-and-overrides)).
274
+ - Packages that use `vite-plus` without a direct `vite` declaration keep that layout (see [Vite and Overrides](#vite-and-overrides)).
229
275
  - Unrelated selector-shaped and object-valued overrides are preserved.
230
276
 
231
277
  ### npm
@@ -1,10 +1,14 @@
1
+ <script setup lang="ts">
2
+ import { migrationPrompt, upgradePrompt } from '../.vitepress/theme/data/migration-prompts.ts';
3
+ </script>
4
+
1
5
  # Migrate to Vite+
2
6
 
3
7
  `vp migrate` helps move existing projects onto Vite+.
4
8
 
5
9
  ## Overview
6
10
 
7
- This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, and tsup setups into Vite+.
11
+ This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, and tsup setups into Vite+.
8
12
 
9
13
  Use it when you want to take an existing project and move it onto the Vite+ defaults instead of wiring each tool by hand.
10
14
 
@@ -55,11 +59,13 @@ See [Migration Rules](./migrate-rules.md) for the exact dependency, source rewri
55
59
 
56
60
  Most projects will require further manual adjustments after running `vp migrate`.
57
61
 
62
+ For the Vitest v5 upgrade, read the [compatibility settings and review checklist](./vitest-v5.md) and the [upstream Vitest migration guide](https://vitest.dev/guide/migration/). The preflight checks your original runner version and Node runtime before dependency updates. Keep the original lockfile available and resolve blocking findings before retrying.
63
+
58
64
  ## Recommended Workflow
59
65
 
60
66
  Before running the migration:
61
67
 
62
- - Upgrade to Vite 8+ and Vitest 4.1+ first
68
+ - For projects that do not use Vite+ yet, upgrade to Vite 8+ and Vitest 4.1+ first
63
69
  - Make sure you understand any existing lint, format, or test setup that should be preserved
64
70
 
65
71
  After running the migration:
@@ -71,38 +77,87 @@ After running the migration:
71
77
 
72
78
  ## Migration Prompt
73
79
 
74
- If you want to hand this work to a coding agent (or the reader is a coding agent!), use this migration prompt:
80
+ View and copy this prompt into your coding agent to migrate an existing project to Vite+:
81
+
82
+ <CopyPrompt :prompt="migrationPrompt" label="View Migration Prompt" />
83
+
84
+ ## Upgrade from Vite+ 0.3 to 1.0
85
+
86
+ Vite+ 1.0 includes the breaking changes in Vitest 5. Read the [Vite+ compatibility guide](./vitest-v5.md) alongside the [upstream migration guide](https://vitest.dev/guide/migration/).
87
+
88
+ Library builds also use tsdown 0.23. Review the [pack configuration migration rules](./migrate-rules.md#pack-configuration) and [upstream release notes](https://github.com/rolldown/tsdown/releases/tag/v0.23.0) for option changes and new defaults.
89
+
90
+ Keep your project's original dependencies and lockfile until migration identifies the old runner. Updating the project dependencies first can prevent the migration from preserving v4 behavior. Use one of the following paths from the workspace root.
91
+
92
+ ### With the Global CLI
75
93
 
76
- ```md
77
- Migrate this project to Vite+. Vite+ replaces the current split tooling around runtime management, package management, dev/build/test commands, linting, formatting, and packaging. Run `vp help` to understand Vite+ capabilities and `vp help migrate` before making changes. Use `vp migrate --no-interactive` in the workspace root. Make sure the project is using Vite 8+ and Vitest 4.1+ before migrating.
94
+ Upgrade the [global CLI](./upgrade.md#global-vp) to your target 1.0 release, then run `vp migrate --no-interactive`. For a preview, follow the [preview installation instructions](./upgrade.md#global-vp-preview).
78
95
 
79
- After the migration:
96
+ ### Without the Global CLI
80
97
 
81
- - Confirm `vite` imports were rewritten to `vite-plus` where needed
82
- - Confirm `vitest` imports were rewritten to `vite-plus/test` (and `@vitest/browser*` to `vite-plus/test/browser*`) where needed
83
- - On pnpm, keep the `vite`, `vitest` dependency entries configured by `vp migrate` so the workspace aliases and overrides stay effective; with other package managers, you can remove them once those rewrites are confirmed
84
- - Move remaining tool-specific config into the appropriate blocks in `vite.config.ts`
98
+ Use an existing Node.js runtime that satisfies `^22.18.0 || ^24.11.0 || >=26.0.0`. Run the target migrator through your package manager without adding it to the project first. For the `1.0.0-rc.1` release:
85
99
 
86
- Command mapping to keep in mind:
100
+ ::: code-group
87
101
 
88
- - `vp run <script>` is the equivalent of `pnpm run <script>`
89
- - `vp dev` and `vp test` always run the built-ins; `vp run dev` and `vp run test` run the `dev` and `test` scripts from `package.json`
90
- - `vp install`, `vp add`, and `vp remove` delegate through the package manager declared by `packageManager`
91
- - `vp dev`, `vp build`, `vp preview`, `vp lint`, `vp fmt`, `vp check`, and `vp pack` replace the corresponding standalone tools
92
- - Prefer `vp check` for validation loops
102
+ ```bash [pnpm]
103
+ pnpm dlx --package=vite-plus@1.0.0-rc.1 vp migrate --no-interactive
104
+ ```
105
+
106
+ ```bash [npm]
107
+ npx --package=vite-plus@1.0.0-rc.1 vp migrate --no-interactive
108
+ ```
109
+
110
+ :::
93
111
 
94
- Finally, verify the migration by running: `vp install`, `vp check`, `vp test`, and `vp build`
112
+ Replace `1.0.0-rc.1` with your target release. For a preview, use the version from the PR and pass `--registry=https://registry-bridge.viteplus.dev` to `pnpm` or `npx` before the `vp` command. Keep the version in `--package` explicit so you run the target migrator rather than the old local CLI.
113
+
114
+ After migration, finish dependency installation and validate with the updated local CLI:
115
+
116
+ ::: code-group
117
+
118
+ ```bash [pnpm]
119
+ pnpm install
120
+ pnpm exec vp check
121
+ pnpm exec vp test
122
+ pnpm exec vp build
123
+ ```
95
124
 
96
- Summarize the migration at the end and report any manual follow-up still required.
125
+ ```bash [npm]
126
+ npm install
127
+ npm exec -- vp check
128
+ npm exec -- vp test
129
+ npm exec -- vp build
97
130
  ```
98
131
 
132
+ :::
133
+
134
+ Use `vp pack` in place of `vp build` for a library that uses the pack command. Run configured browser, coverage, and benchmark suites as well.
135
+
136
+ ### Review the Upgrade
137
+
138
+ On an existing Vite+ project, use the default upgrade flow. Add `--full` if you also want to repeat project setup. Resolve blockers and review the file-specific report before committing. See [Upgrade vs. Full Setup](./migrate-rules.md#upgrade-vs-full-setup) for the scope of each mode.
139
+
140
+ After the migrated project passes validation, [check whether you can remove the generated v4 compatibility settings](./vitest-v5.md#remove-unneeded-compatibility-settings) with no code changes or small, localized fixes. Keep compatibility for now if removal requires extensive test changes or you cannot validate the result.
141
+
142
+ For libraries, review the generated [tsdown compatibility settings](#tsdown) after a successful `vp pack` run. Follow their documentation links before adopting the new defaults, and check the emitted imports and declarations with your package's consumers.
143
+
144
+ ### Copy Prompt
145
+
146
+ View and copy this prompt into your coding agent to upgrade an existing Vite+ 0.3 project:
147
+
148
+ <CopyPrompt :prompt="upgradePrompt" label="View Upgrade Prompt" />
149
+
99
150
  ## Tool-Specific Migrations
100
151
 
101
152
  ### Vitest
102
153
 
103
- Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@4.x` under `vite-plus/test*`, so for node-mode tests a single `vite-plus` install is enough — you no longer need to install `vitest` directly.
154
+ Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.0.1` under `vite-plus/test*`, so for node-mode tests a single `vite-plus` install is enough — you no longer need to install `vitest` directly.
155
+
156
+ For browser mode, you can use the base browser runtime (`@vitest/browser`) and Preview provider (`@vitest/browser-preview`) included in `vite-plus`. To use Playwright or WebDriverIO, you also need the opt-in provider (`@vitest/browser-playwright` or `@vitest/browser-webdriverio`) and its framework peer (`playwright` or `webdriverio`).
104
157
 
105
- Browser mode is more nuanced. `vite-plus` bundles the base browser runtime (`@vitest/browser`) and the preview provider (`@vitest/browser-preview`), but the **Playwright** and **WebdriverIO** providers stay opt-in: `@vitest/browser-playwright` (with its `playwright` peer) and `@vitest/browser-webdriverio` (with its `webdriverio` peer) are **not** shipped with `vite-plus`, so non-browser projects never pull them in. `vp migrate` detects the provider you actually use and adds it — pinned to the bundled vitest version — together with its framework. If you migrate manually and use one of these providers, install the provider package and its framework yourself so `vite-plus/test/browser-playwright` / `vite-plus/test/browser-webdriverio` can resolve.
158
+ `vp migrate` adds the Playwright provider at the bundled Vitest version and ensures its framework peer. You can import it from `vite-plus/test/browser-playwright`.
159
+
160
+ For WebDriverIO, import from the community-maintained `@vitest/browser-webdriverio`. Migration restores legacy Vite+ provider imports, ensures a provider version of at least `5.0.0`, and adds an `@vitest/browser` override that matches the bundled runner. Manage later provider upgrades and framework peers yourself. See [Community WebDriverIO provider](./vitest-v5.md#community-webdriverio-provider).
106
161
 
107
162
  If you are migrating manually, update all the imports to `vite-plus/test*` instead:
108
163
 
@@ -126,6 +181,17 @@ const { page } = await import('vite-plus/test/browser/context');
126
181
 
127
182
  ### tsdown
128
183
 
184
+ `vp migrate` updates supported static options in `pack` blocks and `tsdown.config.*` for tsdown 0.23. This also runs for existing Vite+ projects and workspace packages without `--full`. See [Pack Configuration](./migrate-rules.md#pack-configuration) for the option mappings and cases that require manual review.
185
+
186
+ The transform preserves earlier defaults by inserting `deps.resolveDepSubpath: true` and, when ATTW checks are enabled, `attw.profile: 'strict'` if these settings are absent. Each inserted setting includes a `tsdown <0.23 compatibility` comment with a documentation link and removal guidance. Explicit settings remain unchanged.
187
+
188
+ Keep these settings for the first `vp pack` run. After validation, review whether your package can adopt the new defaults:
189
+
190
+ - Removing `deps.resolveDepSubpath: true` [preserves external subpath imports as written](https://tsdown.dev/options/dependencies#deps-resolvedepsubpath). Check that consumers can resolve the emitted imports.
191
+ - Removing the inserted `attw.profile: 'strict'` selects the `esm-only` [resolution profile](https://tsdown.dev/options/lint#profiles). This skips `node10` and CommonJS resolution checks. Keep `strict` if your package requires those checks.
192
+
193
+ Remove each accepted setting's generated comment too. Run `vp pack` and your package's consumer checks after each change. Keep the setting when you cannot validate the result.
194
+
129
195
  If your project uses a `tsdown.config.ts`, move its options into the `pack` block in `vite.config.ts`:
130
196
 
131
197
  ```ts [tsdown.config.ts] {4-6}
@@ -6,7 +6,13 @@ Because `vite.config.ts` is just JavaScript, you can choose to put your entire c
6
6
 
7
7
  ## Root Config With Overrides
8
8
 
9
- Vite+ does not currently support nested lint or format configuration. Package-level `lint` and `fmt` blocks are not automatically applied. For now, define file- or package-specific settings with overrides in the root `vite.config.ts`. The long-term behavior is open for discussion; [share your use case and expectations](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) to help shape it.
9
+ Run `vp lint`, `vp fmt`, and `vp check` from the workspace root to apply the root lint and format settings across packages. These commands do not apply nested configs to individual files. Define file- or package-specific settings with overrides in the root `vite.config.ts`.
10
+
11
+ When run from a package directory, `vp lint` and `vp fmt` still use the root settings unless the package config defines its own `lint` or `fmt` block. We do not recommend package-level blocks; use overrides in the root config instead. File arguments remain relative to the package working directory.
12
+
13
+ `vp check` uses the root `lint` and `fmt` blocks when they exist. Package configs cannot replace root format settings, lint rules, or type-check options in `vp check`.
14
+
15
+ Use `-c <path>` or `--config <path>` with `vp lint` or `vp fmt` to select another config explicitly.
10
16
 
11
17
  Use `lint.overrides` for Oxlint rules that only apply to some packages:
12
18
 
package/docs/guide/run.md CHANGED
@@ -95,7 +95,9 @@ export default defineConfig({
95
95
  build: {
96
96
  command: 'vp build',
97
97
  dependsOn: ['lint'],
98
- env: ['NODE_ENV'],
98
+ cache: {
99
+ env: ['NODE_ENV'],
100
+ },
99
101
  },
100
102
  deploy: {
101
103
  command: 'deploy-script --prod',
@@ -2,6 +2,8 @@
2
2
 
3
3
  `vp test` runs tests with [Vitest](https://vitest.dev).
4
4
 
5
+ The bundled runner uses Vitest `5.0.1` and requires Node `^22.18.0 || ^24.11.0 || >=26.0.0`. For existing projects, follow [Upgrade to Vitest 5](./vitest-v5.md) before updating dependencies.
6
+
5
7
  ## Overview
6
8
 
7
9
  `vp test` is built on [Vitest](https://vitest.dev/), so you get a Vite-native test runner that reuses your Vite config and plugins, supports Jest-style expectations, snapshots, and coverage, and handles modern ESM, TypeScript, and JSX projects cleanly.
@@ -26,13 +26,13 @@ The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`. `
26
26
 
27
27
  ## Nested lint or format config is not applied
28
28
 
29
- Vite+ does not currently support nested lint or format configuration. When running `vp lint`, `vp fmt`, or `vp check` from the workspace root, do not rely on configs in subdirectories or on `lint` and `fmt` blocks in package-level `vite.config.ts` files to override the root settings.
29
+ When running `vp lint`, `vp fmt`, or `vp check`, configs in subdirectories do not override settings for individual files. `vp lint` and `vp fmt` let Oxlint and Oxfmt discover configuration from the working directory, so a `lint` or `fmt` block in a package config takes effect when run from that package, which we do not recommend. `vp check` selects the workspace-root `lint` and `fmt` blocks when they exist. Use `-c <path>` or `--config <path>` with `vp lint` or `vp fmt` to select another config explicitly.
30
30
 
31
31
  Keep lint and format settings in the root `vite.config.ts`. Use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) and [`fmt.overrides`](/guide/monorepo#format-overrides) for file- or package-specific settings. You can also [import configuration objects](/guide/monorepo#composing-configuration-files) into the root config to keep settings in separate files.
32
32
 
33
- For IDE integration, we have `disableNestedConfig` and `fmt.disableNestedConfig` config to disable nested lint and format configs and keep editor behavior aligned with the root Vite+ config. See [IDE Integration](/guide/ide-integration) for setup instructions for your editor.
33
+ For IDE integration, `disableNestedConfig` and `fmt.disableNestedConfig` disable per-file nested lint and format configs. See [IDE Integration](/guide/ide-integration) for setup instructions for your editor.
34
34
 
35
- We're holding off on nested config support for now. Some of the factors we're considering are how implicit config discovery affects the predictability of linting and formatting, what context AI agents need to understand the settings that apply, and the potential performance cost of finding and loading multiple configs. At the same time, we recognize that keeping package-specific context close to the code may have benefits. The use cases we've heard so far haven't given us a strong enough reason to commit to those semantics. Waiting leaves room to add support later, and we'd like to hear why your project needs nested configs, especially where root-level overrides fall short.
35
+ We're holding off on applying nested configs to individual files for now. Some of the factors we're considering are how implicit config discovery affects the predictability of linting and formatting, what context AI agents need to understand the settings that apply, and the potential performance cost of finding and loading multiple configs. At the same time, we recognize that keeping package-specific context close to the code may have benefits. The use cases we've heard so far haven't given us a strong enough reason to commit to those semantics. Waiting leaves room to add support later, and we'd like to hear why your project needs nested configs, especially where root-level overrides fall short.
36
36
 
37
37
  Do you need nested configs? [Share your use case and opinion on GitHub](https://github.com/voidzero-dev/vite-plus/discussions/2669), including your project structure, the reason why you want them and whether root-level overrides meet your needs.
38
38