vite-plus 0.3.2 → 1.0.0-rc.0

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 (149) hide show
  1. package/LICENSE +35 -146
  2. package/README.md +3 -3
  3. package/binding/index.cjs +140 -55
  4. package/binding/index.d.cts +49 -0
  5. package/dist/{agent-C59HKB4Y.js → agent-Dinpyd-k.js} +6 -5
  6. package/dist/bin.js +48 -18
  7. package/dist/config/bin.js +2 -2
  8. package/dist/constants-CiKwrA0v.js +356 -0
  9. package/dist/create/bin.js +96 -71
  10. package/dist/{define-config-DPNEJxPz.d.ts → define-config-B9usMnEa.d.ts} +51 -10
  11. package/dist/{define-config-DpAPETDf.cjs → define-config-CBccpane.cjs} +173 -44
  12. package/dist/{define-config-DAaCa0U_.js → define-config-jhuYJ7Tb.js} +158 -42
  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/documentation-DqcZSthV.js +11 -0
  17. package/dist/{editor-QOIGtmH4.js → editor-DMBczTdj.js} +216 -152
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
  22. package/dist/lint-plugins.cjs +1 -1
  23. package/dist/migration/bin.js +3122 -15
  24. package/dist/{oxlint-plugin-config-BU42tr8y.js → oxlint-plugin-config-BgsDA6ua.js} +1 -1
  25. package/dist/oxlint-plugin.js +9 -7
  26. package/dist/pack-bin.js +1 -1
  27. package/dist/{package-BB-Jh_z3.js → package-B85H2Nw0.js} +6 -2
  28. package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
  29. package/dist/{prompts-CujFOJXu.js → prompts-CQobX7uP.js} +2 -2
  30. package/dist/{resolve-vite-config-CHHjsjKJ.js → resolve-vite-config-BUFUmi8h.js} +2 -2
  31. package/dist/{resolve-vite-config-6Nox70uP.js → resolve-vite-config-I8fmpR7I.js} +1 -1
  32. package/dist/staged/bin.js +1205 -3317
  33. package/dist/sync-versions/bin.js +3 -2
  34. package/dist/sync-versions/bin.mjs +17 -2
  35. package/dist/test/browser/context.js +1 -1
  36. package/dist/test/browser/providers/playwright/context.js +1 -1
  37. package/dist/test/browser/providers/preview/context.js +1 -1
  38. package/dist/test/browser-playwright/context.js +1 -1
  39. package/dist/test/browser-preview/context.js +1 -1
  40. package/dist/test/context.d.ts +2 -942
  41. package/dist/test/context.js +1 -1
  42. package/dist/test/internal/traces.js +1 -0
  43. package/dist/test/locators.d.ts +2 -294
  44. package/dist/test/matchers.d.ts +2 -29
  45. package/dist/test/mocker.d.ts +2 -0
  46. package/dist/test/mocker.js +1 -0
  47. package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
  48. package/dist/test/plugins/browser-context.js +1 -1
  49. package/dist/test/plugins/browser-locators.d.ts +2 -0
  50. package/dist/test/plugins/browser-playwright.d.ts +2 -0
  51. package/dist/test/plugins/browser-preview.d.ts +2 -0
  52. package/dist/test/plugins/browser.d.ts +2 -0
  53. package/dist/test/plugins/mocker-automock.d.ts +2 -0
  54. package/dist/test/plugins/mocker-browser.d.ts +2 -0
  55. package/dist/test/plugins/mocker-node.d.ts +2 -0
  56. package/dist/test/plugins/mocker-redirect.d.ts +2 -0
  57. package/dist/test/plugins/mocker-register.d.ts +2 -0
  58. package/dist/test/plugins/mocker-transforms.d.ts +2 -0
  59. package/dist/test/plugins/mocker.d.ts +2 -0
  60. package/dist/test/plugins/pretty-format.d.ts +2 -0
  61. package/dist/test/plugins/snapshot-environment.d.ts +2 -0
  62. package/dist/test/plugins/snapshot-manager.d.ts +2 -0
  63. package/dist/test/plugins/snapshot.d.ts +2 -0
  64. package/dist/test/plugins/spy.d.ts +2 -0
  65. package/dist/test/plugins/utils-constants.d.ts +2 -0
  66. package/dist/test/plugins/utils-diff.d.ts +2 -0
  67. package/dist/test/plugins/utils-display.d.ts +2 -0
  68. package/dist/test/plugins/utils-error.d.ts +2 -0
  69. package/dist/test/plugins/utils-helpers.d.ts +2 -0
  70. package/dist/test/plugins/utils-offset.d.ts +2 -0
  71. package/dist/test/plugins/utils-resolver.d.ts +2 -0
  72. package/dist/test/plugins/utils-serialize.d.ts +2 -0
  73. package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
  74. package/dist/test/plugins/utils-source-map.d.ts +2 -0
  75. package/dist/test/plugins/utils-timers.d.ts +2 -0
  76. package/dist/test/plugins/utils.d.ts +2 -0
  77. package/dist/toolchain.js +10 -10
  78. package/dist/toolchain.json +10 -10
  79. package/dist/{tsconfig-DCtWfQPA.js → tsconfig-Buo0RSzz.js} +8 -4
  80. package/dist/{tsconfig-MXktI3SX.js → tsconfig-C1VeTG9k.js} +1 -1
  81. package/dist/version.js +5 -3
  82. package/dist/versions.js +5 -5
  83. package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
  84. package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
  85. package/docs/config/fmt.md +2 -2
  86. package/docs/config/lint.md +2 -2
  87. package/docs/config/run.md +1 -1
  88. package/docs/config/staged.md +1 -2
  89. package/docs/guide/check.md +2 -0
  90. package/docs/guide/ci.md +28 -31
  91. package/docs/guide/commit-hooks.md +18 -34
  92. package/docs/guide/create.md +1 -2
  93. package/docs/guide/docker.md +20 -68
  94. package/docs/guide/env.md +47 -32
  95. package/docs/guide/fmt.md +4 -2
  96. package/docs/guide/global-cli.md +426 -0
  97. package/docs/guide/ide-integration.md +1 -2
  98. package/docs/guide/implode.md +14 -1
  99. package/docs/guide/index.md +38 -35
  100. package/docs/guide/install.md +18 -20
  101. package/docs/guide/lint.md +6 -10
  102. package/docs/guide/local-cli.md +123 -0
  103. package/docs/guide/migrate-rules.md +104 -297
  104. package/docs/guide/migrate.md +82 -59
  105. package/docs/guide/monorepo.md +5 -1
  106. package/docs/guide/run.md +1 -1
  107. package/docs/guide/test.md +2 -0
  108. package/docs/guide/troubleshooting.md +6 -11
  109. package/docs/guide/upgrade-project.md +61 -0
  110. package/docs/guide/upgrade.md +17 -62
  111. package/docs/guide/vitest-v5.md +221 -0
  112. package/package.json +67 -90
  113. package/bin/oxfmt +0 -33
  114. package/bin/oxlint +0 -38
  115. package/dist/cli-truncate-Bg3RDXpi.js +0 -865
  116. package/dist/constants-IhOditRA.js +0 -80
  117. package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
  118. package/dist/log-update-CoW8Z4Dl.js +0 -491
  119. package/dist/strip-ansi-C3wrWz9t.js +0 -853
  120. package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
  121. package/dist/test/browser/providers/webdriverio/context.js +0 -1
  122. package/dist/test/browser/providers/webdriverio.d.ts +0 -77
  123. package/dist/test/browser/providers/webdriverio.js +0 -1
  124. package/dist/test/browser-webdriverio/context.d.ts +0 -1
  125. package/dist/test/browser-webdriverio.d.ts +0 -77
  126. package/dist/test/browser-webdriverio.js +0 -1
  127. package/dist/test/coverage.d.ts +0 -2
  128. package/dist/test/coverage.js +0 -1
  129. package/dist/test/environments.d.ts +0 -2
  130. package/dist/test/environments.js +0 -1
  131. package/dist/test/plugins/browser-webdriverio.js +0 -1
  132. package/dist/test/plugins/expect.js +0 -1
  133. package/dist/test/plugins/runner-types.js +0 -1
  134. package/dist/test/plugins/runner-utils.js +0 -1
  135. package/dist/test/plugins/runner.js +0 -1
  136. package/dist/test/reporters.d.ts +0 -2
  137. package/dist/test/reporters.js +0 -1
  138. package/dist/test/runners.d.ts +0 -2
  139. package/dist/test/runners.js +0 -1
  140. package/dist/test/snapshot.d.ts +0 -2
  141. package/dist/test/snapshot.js +0 -1
  142. package/dist/test/suite.d.ts +0 -2
  143. package/dist/test/suite.js +0 -1
  144. package/dist/tsgolint-path-CbDReEOx.js +0 -34
  145. package/dist/tsgolint-path.d.ts +0 -7
  146. package/dist/tsgolint-path.js +0 -2
  147. package/dist/wrap-ansi-DNjkuBEp.js +0 -157
  148. package/dist/wrap-ansi-DUi52C6W.js +0 -2
  149. package/docs/guide/installer-env-vars.md +0 -286
@@ -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
 
@@ -22,9 +26,7 @@ The positional `PATH` argument is optional.
22
26
 
23
27
  - If omitted, `vp migrate` migrates the current directory
24
28
  - If provided, it migrates that target directory instead
25
- - For a monorepo, the target must be the workspace root. Vite+ cannot
26
- migrate one workspace member, because migration updates the package-manager
27
- configuration, the catalogs, and the lockfiles that all members share.
29
+ - For a monorepo, the target must be the workspace root. Vite+ cannot migrate one workspace member, because migration updates the package-manager configuration, the catalogs, and the lockfiles that all members share.
28
30
 
29
31
  ```bash
30
32
  vp migrate
@@ -53,16 +55,17 @@ The `migrate` command is designed to move existing projects onto Vite+ quickly.
53
55
  - Can write agent and editor configuration files
54
56
  - Formats the migrated project
55
57
 
56
- See [Migration Rules](./migrate-rules.md) for the exact dependency, source
57
- rewrite, and package-manager behavior.
58
+ See [Migration Rules](./migrate-rules.md) for the exact dependency, source rewrite, and package-manager behavior.
58
59
 
59
60
  Most projects will require further manual adjustments after running `vp migrate`.
60
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
+
61
64
  ## Recommended Workflow
62
65
 
63
66
  Before running the migration:
64
67
 
65
- - 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
66
69
  - Make sure you understand any existing lint, format, or test setup that should be preserved
67
70
 
68
71
  After running the migration:
@@ -72,74 +75,89 @@ After running the migration:
72
75
  - Run `vp test`
73
76
  - Run `vp build` (or `vp pack` if you are building a library)
74
77
 
75
- ## Manual Installation & Migration
78
+ ## Migration Prompt
76
79
 
77
- If you are manually migrating a project to Vite+, install these dev dependencies first:
80
+ View and copy this prompt into your coding agent to migrate an existing project to Vite+:
78
81
 
79
- ```bash
80
- vp install -D vite-plus
81
- ```
82
+ <CopyPrompt :prompt="migrationPrompt" label="View Migration Prompt" />
82
83
 
83
- You need to add overrides to your package manager so that other packages resolve the Vite+ versions: alias `vite` to `@voidzero-dev/vite-plus-core`, and pin `vitest` to the version Vite+ bundles (run `vp --version`) so the whole project shares a single Vitest copy with `vp test`. Without the `vitest` pin, a dependency or workspace package can pull a different Vitest than the bundled runner, splitting Vitest's internals (mocks, `expect`, runner state):
84
+ ## Upgrade from Vite+ 0.3 to 1.0
84
85
 
85
- ```json
86
- "overrides": {
87
- "vite": "npm:@voidzero-dev/vite-plus-core@latest",
88
- "vitest": "4.1.11"
89
- }
90
- ```
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.
91
89
 
92
- If you are using `pnpm`, add this to your `pnpm-workspace.yaml`:
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
93
+
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).
95
+
96
+ ### Without the Global CLI
97
+
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.0` release:
99
+
100
+ ::: code-group
101
+
102
+ ```bash [pnpm]
103
+ pnpm dlx --package=vite-plus@1.0.0-rc.0 vp migrate --no-interactive
104
+ ```
93
105
 
94
- ```yaml
95
- overrides:
96
- vite: npm:@voidzero-dev/vite-plus-core@latest
97
- vitest: 4.1.11
106
+ ```bash [npm]
107
+ npx --package=vite-plus@1.0.0-rc.0 vp migrate --no-interactive
98
108
  ```
99
109
 
100
- Or, if you are using Yarn:
110
+ :::
101
111
 
102
- ```json
103
- "resolutions": {
104
- "vite": "npm:@voidzero-dev/vite-plus-core@latest",
105
- "vitest": "4.1.11"
106
- }
112
+ Replace `1.0.0-rc.0` 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
107
123
  ```
108
124
 
109
- ## Migration Prompt
125
+ ```bash [npm]
126
+ npm install
127
+ npm exec -- vp check
128
+ npm exec -- vp test
129
+ npm exec -- vp build
130
+ ```
110
131
 
111
- If you want to hand this work to a coding agent (or the reader is a coding agent!), use this migration prompt:
132
+ :::
112
133
 
113
- ```md
114
- 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.
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.
115
135
 
116
- After the migration:
136
+ ### Review the Upgrade
117
137
 
118
- - Confirm `vite` imports were rewritten to `vite-plus` where needed
119
- - Confirm `vitest` imports were rewritten to `vite-plus/test` (and `@vitest/browser*` to `vite-plus/test/browser*`) where needed
120
- - 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
121
- - Move remaining tool-specific config into the appropriate blocks in `vite.config.ts`
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.
122
139
 
123
- Command mapping to keep in mind:
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.
124
141
 
125
- - `vp run <script>` is the equivalent of `pnpm run <script>`
126
- - `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`
127
- - `vp install`, `vp add`, and `vp remove` delegate through the package manager declared by `packageManager`
128
- - `vp dev`, `vp build`, `vp preview`, `vp lint`, `vp fmt`, `vp check`, and `vp pack` replace the corresponding standalone tools
129
- - Prefer `vp check` for validation loops
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.
130
143
 
131
- Finally, verify the migration by running: `vp install`, `vp check`, `vp test`, and `vp build`
144
+ ### Copy Prompt
132
145
 
133
- Summarize the migration at the end and report any manual follow-up still required.
134
- ```
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" />
135
149
 
136
150
  ## Tool-Specific Migrations
137
151
 
138
152
  ### Vitest
139
153
 
140
- 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.
141
155
 
142
- 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.
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`).
157
+
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).
143
161
 
144
162
  If you are migrating manually, update all the imports to `vite-plus/test*` instead:
145
163
 
@@ -163,6 +181,17 @@ const { page } = await import('vite-plus/test/browser/context');
163
181
 
164
182
  ### tsdown
165
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
+
166
195
  If your project uses a `tsdown.config.ts`, move its options into the `pack` block in `vite.config.ts`:
167
196
 
168
197
  ```ts [tsdown.config.ts] {4-6}
@@ -205,19 +234,13 @@ export default defineConfig({
205
234
  });
206
235
  ```
207
236
 
208
- When no existing hook policy owns the workflow, `vp migrate` can move supported lint-staged rules
209
- and remove the old configuration and dependency. If an existing hook tool is preserved, keep
210
- lint-staged in place until you convert that hook policy manually. See the
211
- [Commit hooks guide](/guide/commit-hooks) and [Staged config reference](/config/staged) for details.
237
+ When no existing hook policy owns the workflow, `vp migrate` can move supported lint-staged rules and remove the old configuration and dependency. If an existing hook tool is preserved, keep lint-staged in place until you convert that hook policy manually. See the [Commit hooks guide](/guide/commit-hooks) and [Staged config reference](/config/staged) for details.
212
238
 
213
239
  ### Git hook tools
214
240
 
215
- The `vp migrate` command does not automatically convert Husky setups. When Husky is detected,
216
- Vite+ leaves its hooks, lifecycle scripts, configuration, and dependencies unchanged and shows a
217
- warning. You can migrate the project manually using the [Commit hooks guide](/guide/commit-hooks).
241
+ The `vp migrate` command does not automatically convert Husky setups. When Husky is detected, Vite+ leaves its hooks, lifecycle scripts, configuration, and dependencies unchanged and shows a warning. You can migrate the project manually using the [Commit hooks guide](/guide/commit-hooks).
218
242
 
219
- Existing project-owned Vite+ hooks are also preserved. The default staged workflow is introduced
220
- only when no existing hook policy is found.
243
+ Existing project-owned Vite+ hooks are also preserved. The default staged workflow is introduced only when no existing hook policy is found.
221
244
 
222
245
  If your project currently uses `lefthook`, `simple-git-hooks`, or `yorkie`, `vp migrate` will leave your existing configuration alone and show a warning. This happens even if you choose to set up hooks during the prompt or include the `--hooks` flag.
223
246
 
@@ -6,7 +6,11 @@ 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`, `vp fmt`, and `vp check` still use the root `lint` and `fmt` blocks. Package configs cannot replace root format settings, lint rules, or type-check options. File arguments remain relative to the package working directory.
12
+
13
+ Use `-c <path>` or `--config <path>` with `vp lint` or `vp fmt` to select another config. If the root config has no block for that tool, the tool uses native discovery from the working directory.
10
14
 
11
15
  Use `lint.overrides` for Oxlint rules that only apply to some packages:
12
16
 
package/docs/guide/run.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Run
2
2
 
3
- `vp run` runs `package.json` scripts and tasks defined in `vite.config.ts`. It works like `pnpm run`, with caching, dependency ordering, and workspace-aware execution built in.
3
+ `vp run` runs `package.json` scripts and tasks defined in `vite.config.ts`. It works like `pnpm run`, with caching, dependency ordering, and workspace-aware execution built in. The task runner is available from both the [global CLI](/guide/global-cli) and the [project-local CLI](/guide/local-cli).
4
4
 
5
5
  ::: tip
6
6
  `vpr` is available as a standalone shorthand for `vp run`. All examples below work with both `vp run` and `vpr`.
@@ -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.
@@ -15,28 +15,24 @@ Vite+ expects modern upstream tool versions.
15
15
 
16
16
  If you are migrating an existing project and it still depends on older Vite or Vitest versions, upgrade those first before adopting Vite+.
17
17
 
18
- Run `vp toolchain` to show the versions from the local Vite+ package.
19
- Run `vp toolchain --global` to show the versions from the global Vite+ release.
18
+ Run `vp toolchain` to show the versions from the local Vite+ package. Run `vp toolchain --global` to show the versions from the global Vite+ release.
20
19
 
21
20
  ## `vp check` does not run type-aware lint rules or type checks
22
21
 
23
22
  - Confirm that `lint.options.typeAware` and `lint.options.typeCheck` are enabled in `vite.config.ts`
24
23
  - Check whether your `tsconfig.json` still uses `compilerOptions.baseUrl`
25
24
 
26
- The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`.
27
- `vp migrate` and `vp lint --init` try to run the `vp dlx @andrewbranch/ts5to6 --fixBaseUrl .`
28
- fix before enabling type-aware linting. If that fix fails or is declined, Vite+
29
- skips `typeAware` and `typeCheck`.
25
+ The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`. `vp migrate` and `vp lint --init` try to run the `vp dlx @andrewbranch/ts5to6 --fixBaseUrl .` fix before enabling type-aware linting. If that fix fails or is declined, Vite+ skips `typeAware` and `typeCheck`.
30
26
 
31
27
  ## Nested lint or format config is not applied
32
28
 
33
- 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. Commands run from a package directory still use 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. If the root config has no block for that tool, the tool uses native discovery from the working directory.
34
30
 
35
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.
36
32
 
37
- 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.
38
34
 
39
- 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.
40
36
 
41
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.
42
38
 
@@ -76,8 +72,7 @@ If `vp staged` fails or your pre-commit hook does not run:
76
72
  - if status shows `Preference: disabled (local)`, re-enable with `vp hooks enable`
77
73
  - check whether hooks were skipped intentionally through `VP_GIT_HOOKS=0`
78
74
 
79
- To stop hooks in this clone without deleting project policy files, run `vp hooks disable`.
80
- See the [Commit hooks guide](/guide/commit-hooks) for the full workflow.
75
+ To stop hooks in this clone without deleting project policy files, run `vp hooks disable`. See the [Commit hooks guide](/guide/commit-hooks) for the full workflow.
81
76
 
82
77
  A minimal staged config looks like this:
83
78
 
@@ -0,0 +1,61 @@
1
+ # Update Vite+
2
+
3
+ Updating `vite-plus` and its related project dependencies. To upgrade the global `vp` binary, see [Upgrading Vite+](/guide/upgrade).
4
+
5
+ ## Update with Migrate
6
+
7
+ The recommended way to update a project is to use `vp migrate`, which keeps the toolchain dependencies aligned.
8
+
9
+ After updating the project's `vite-plus` dependency, run the local CLI to align the toolchain versions:
10
+
11
+ ```bash
12
+ ./node_modules/.bin/vp migrate
13
+ ```
14
+
15
+ If your global CLI is newer than the project's version, running `vp migrate` upgrades the project to that global version instead:
16
+
17
+ ```bash
18
+ vp migrate
19
+ ```
20
+
21
+ On a project that is already on Vite+, migrate does a toolchain version upgrade only: it re-pins `vite-plus`, the `vite` -> `@voidzero-dev/vite-plus-core` alias, and the `vitest` pin to the versions bundled with the CLI running the migration, across every workspace package. It skips the first-time setup steps (git hooks, editor and agent files, lint migration), so a version bump does not re-touch things you already configured. Pass `--full` to also run that setup.
22
+
23
+ ## Manually Updating
24
+
25
+ Update `vite-plus` and the `vite` alias to `@voidzero-dev/vite-plus-core` together, keeping the core version aligned with `vite-plus`. Update these entries wherever they are declared in your workspace, including overrides or catalogs, then install dependencies to refresh the lockfile. Also [update the Vitest pin](#updating-the-vitest-pin) to match the bundled version.
26
+
27
+ Without the global CLI, run the `vp` commands on this page through your package manager, for example `pnpm exec vp toolchain vitest`.
28
+
29
+ ### Updating the Vitest Pin
30
+
31
+ If you migrated with `vp migrate`, your project pins `vitest` to an exact version so the whole project shares a single Vitest copy with the bundled `vp test` runner. The pin lives in your package manager's override block:
32
+
33
+ - **npm / Bun:** a `vitest` entry under `overrides` in `package.json`
34
+ - **Yarn:** a `vitest` entry under `resolutions` in `package.json`
35
+ - **pnpm:** a `vitest@*` entry under `overrides` in `pnpm-workspace.yaml`. If your `package.json` already has a `pnpm` field, the entry lives under `pnpm.overrides` in `package.json` instead. pnpm ignores `pnpm-workspace.yaml` overrides when `package.json` defines `pnpm.overrides`.
36
+
37
+ A Vite+ release can bump the bundled Vitest. Because that pin also applies to `vite-plus`'s own `vitest` dependency, an out-of-date pin keeps installing the previous runner even after you upgrade `vite-plus` — splitting Vitest's internals (mocks, `expect`, runner state) between the pinned copy and the one `vp test` loads.
38
+
39
+ After upgrading `vite-plus`, re-pin `vitest` to the version Vite+ now bundles. Check that version with:
40
+
41
+ ```bash
42
+ vp toolchain vitest
43
+ ```
44
+
45
+ Then set the `vitest` override to that exact version and reinstall dependencies.
46
+
47
+ ::: details Why pnpm overrides use `@*`
48
+ Under pnpm the managed 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:`. The `@*` range keeps the override on the semver ranges that transitive and peer declarations use, and leaves `catalog:` references intact. `vp up` therefore no longer rewrites them to a concrete version.
49
+ :::
50
+
51
+ ## Preview Builds
52
+
53
+ After [installing a preview build of the global CLI](/guide/upgrade#global-vp-preview), run migrate in the project to move its local `vite-plus` onto the same build:
54
+
55
+ ```bash
56
+ vp migrate
57
+ ```
58
+
59
+ Migrate writes the bridge registry to `.npmrc`. For Yarn Berry, it writes the registry to `.yarnrc.yml`. It pins `vite-plus` and the `vite` alias to the matching `0.0.0-commit.<sha>` version. The `vite` alias points to `@voidzero-dev/vite-plus-core`. Commit the registry line if the project CI must test the preview.
60
+
61
+ After the install, run `vp toolchain` to show the selected versions. After testing, set `vite-plus` to `latest`. Remove the bridge `registry` line from `.npmrc` or `.yarnrc.yml`. Then run `vp install`.
@@ -1,13 +1,13 @@
1
1
  # Upgrading Vite+
2
2
 
3
- Use `vp upgrade` to update the global `vp` binary, and use Vite+'s package management commands to update the local `vite-plus` package in a project.
3
+ Use `vp upgrade` to update the global `vp` binary. To update the local `vite-plus` package in a project, see [Update Vite+](/guide/upgrade-project).
4
4
 
5
5
  ## Overview
6
6
 
7
7
  There are two parts to upgrading Vite+:
8
8
 
9
9
  - The global `vp` command installed on your machine
10
- - The local `vite-plus` package used by an individual project
10
+ - The [local `vite-plus` package](/guide/upgrade-project) used by an individual project
11
11
 
12
12
  You can upgrade both of them independently.
13
13
 
@@ -22,20 +22,18 @@ vp toolchain vite rolldown oxc
22
22
  vp toolchain --json
23
23
  ```
24
24
 
25
- The command uses the local `vite-plus` package when the project has one. Use
26
- `--global` to show the release for the global `vp` command:
25
+ The command uses the local `vite-plus` package when the project has one. Use `--global` to show the release for the global `vp` command:
27
26
 
28
27
  ```bash
29
28
  vp toolchain --global
30
29
  ```
31
30
 
32
- `vp why <package>` shows the dependency graph from the package manager. It
33
- cannot show code bundled into `@voidzero-dev/vite-plus-core`. It also cannot
34
- show engines compiled into Vite+. Use `vp toolchain` to show those versions and
35
- relationships.
31
+ `vp why <package>` shows the dependency graph from the package manager. It cannot show code bundled into `@voidzero-dev/vite-plus-core`. It also cannot show engines compiled into Vite+. Use `vp toolchain` to show those versions and relationships.
36
32
 
37
33
  ## Global `vp`
38
34
 
35
+ Update the global CLI with:
36
+
39
37
  ```bash
40
38
  vp upgrade # upgrade to the latest version
41
39
  vp upgrade --check # check for updates without installing
@@ -45,27 +43,14 @@ vp upgrade --registry <registry> # use a custom npm registry
45
43
 
46
44
  ### Move an Existing Install to the Split Directory Layout
47
45
 
48
- Vite+ 0.3.0 is the first release that supports the split directory layout.
49
- Vite+ 0.2.x and earlier use the single-root layout for fresh installs and
50
- upgrades.
46
+ Vite+ 0.3.0 is the first release that supports the split directory layout. Vite+ 0.2.x and earlier use the single-root layout for fresh installs and upgrades.
51
47
 
52
- `vp upgrade` keeps an existing default install in `~/.vite-plus` on Unix or
53
- `%USERPROFILE%\.vite-plus` on Windows. The command upgrades the CLI in that
54
- directory. It does not move the install to the split platform directories. You
55
- can continue to use the existing layout.
48
+ `vp upgrade` keeps an existing default install in `~/.vite-plus` on Unix or `%USERPROFILE%\.vite-plus` on Windows. The command upgrades the CLI in that directory. It does not move the install to the split platform directories. You can continue to use the existing layout.
56
49
 
57
- To use the split layout now, remove the existing install. Then install Vite+
58
- again. Run `vp implode` in a shell that uses the current install. The command
59
- removes the generated environment file and shell profile entries. It does not
60
- unset directory variables in the current shell. Unset all Vite+ directory
61
- variables before you run the installer. This can include values from an earlier
62
- preview environment file. Alternatively, start a new shell after `vp implode`.
63
- Then run the installer in the new shell.
50
+ To use the split layout now, remove the existing install. Then install Vite+ again. Run `vp implode` in a shell that uses the current install. The command removes the generated environment file and shell profile entries. It does not unset directory variables in the current shell. Unset all Vite+ directory variables before you run the installer. This can include values from an earlier preview environment file. Alternatively, start a new shell after `vp implode`. Then run the installer in the new shell.
64
51
 
65
52
  ::: warning
66
- `vp implode` removes all Vite+-managed Node.js runtimes, global packages,
67
- configuration, and caches. Keep the existing layout if you do not want to
68
- recreate that data.
53
+ `vp implode` removes all Vite+-managed Node.js runtimes, global packages, configuration, and caches. Keep the existing layout if you do not want to recreate that data.
69
54
  :::
70
55
 
71
56
  ```bash
@@ -82,11 +67,7 @@ Remove-Item Env:\VP_HOME, Env:\VP_DATA_DIR, Env:\VP_BIN_DIR, Env:\VP_CACHE_DIR -
82
67
  irm https://vite.plus/ps1 | iex
83
68
  ```
84
69
 
85
- Also remove persistent definitions of `VP_HOME`, `VP_DATA_DIR`, `VP_BIN_DIR`,
86
- and `VP_CACHE_DIR` from your shell profile or system environment. A fresh
87
- install uses `VP_HOME` or a complete `VP_*_DIR` group that remains set.
88
- `VP_HOME` selects the single-root layout. If you install Vite+ 0.2.x or earlier,
89
- the installer also uses this layout. The installer prints a notice.
70
+ Also remove persistent definitions of `VP_HOME`, `VP_DATA_DIR`, `VP_BIN_DIR`, and `VP_CACHE_DIR` from your shell profile or system environment. A fresh install uses `VP_HOME` or a complete `VP_*_DIR` group that remains set. `VP_HOME` selects the single-root layout. If you install Vite+ 0.2.x or earlier, the installer also uses this layout. The installer prints a notice.
90
71
 
91
72
  ### Rollback
92
73
 
@@ -98,35 +79,17 @@ vp upgrade --rollback
98
79
 
99
80
  Older versions are pruned automatically after each upgrade. The active version and the previous version are always kept, so a rollback target is never removed.
100
81
 
101
- ## Local `vite-plus`
82
+ ### Homebrew
102
83
 
103
- The recommended way to upgrade an existing Vite+ project is `vp migrate`:
84
+ Homebrew owns its installed binary and JavaScript package. Update them with:
104
85
 
105
86
  ```bash
106
- vp migrate
87
+ brew upgrade vite-plus
107
88
  ```
108
89
 
109
- On a project that is already on Vite+, migrate does a toolchain version upgrade only: it re-pins `vite-plus`, the `vite` -> `@voidzero-dev/vite-plus-core` alias, and the `vitest` pin to the versions the global `vp` now bundles, across every workspace package. It skips the first-time setup steps (git hooks, editor and agent files, lint migration), so a version bump does not re-touch things you already configured. Pass `--full` to also run that setup.
110
-
111
- ### Updating the Vitest Pin
112
-
113
- If you migrated with `vp migrate`, your project pins `vitest` to an exact version so the whole project shares a single Vitest copy with the bundled `vp test` runner. The pin lives in your package manager's override block:
114
-
115
- - **npm / Bun:** a `vitest` entry under `overrides` in `package.json`
116
- - **Yarn:** a `vitest` entry under `resolutions` in `package.json`
117
- - **pnpm:** a `vitest@*` entry under `overrides` in `pnpm-workspace.yaml`. If your `package.json` already has a `pnpm` field, the entry lives under `pnpm.overrides` in `package.json` instead. pnpm ignores `pnpm-workspace.yaml` overrides when `package.json` defines `pnpm.overrides`.
90
+ `vp upgrade` detects Homebrew installations and directs you to this command without downloading or installing another version. This also applies to `--force`, a specific version, and `--rollback`. Use Homebrew to manage these installations.
118
91
 
119
- Under pnpm the managed 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:`. The `@*` range keeps the override on the semver ranges that transitive and peer declarations use, and leaves `catalog:` references intact. `vp up` therefore no longer rewrites them to a concrete version.
120
-
121
- A Vite+ release can bump the bundled Vitest. Because that pin also applies to `vite-plus`'s own `vitest` dependency, an out-of-date pin keeps installing the previous runner even after you upgrade `vite-plus` — splitting Vitest's internals (mocks, `expect`, runner state) between the pinned copy and the one `vp test` loads.
122
-
123
- After upgrading `vite-plus`, re-pin `vitest` to the version Vite+ now bundles. Check that version with:
124
-
125
- ```bash
126
- vp toolchain vitest
127
- ```
128
-
129
- Then set the `vitest` override to that exact version, or rerun `vp migrate` to update the pin for you.
92
+ `vp upgrade --check` directs you to `brew outdated vite-plus`. Automatic npm update checks and notices are disabled for Homebrew installations.
130
93
 
131
94
  ## Preview Builds
132
95
 
@@ -160,12 +123,4 @@ The installer uses the registry bridge to resolve the ref to a `0.0.0-commit.<sh
160
123
 
161
124
  ### Local `vite-plus` Preview
162
125
 
163
- After installing the preview global CLI above, run migrate in the project to move its local `vite-plus` onto the same build:
164
-
165
- ```bash
166
- vp migrate
167
- ```
168
-
169
- Migrate writes the bridge registry to `.npmrc`. For Yarn Berry, it writes the registry to `.yarnrc.yml`. It pins `vite-plus` and the `vite` alias to the matching `0.0.0-commit.<sha>` version. The `vite` alias points to `@voidzero-dev/vite-plus-core`. Commit the registry line if the project CI must test the preview.
170
-
171
- After the install, run `vp toolchain` to show the selected versions. After testing, set `vite-plus` to `latest`. Remove the bridge `registry` line from `.npmrc` or `.yarnrc.yml`. Then run `vp install`.
126
+ To use the same preview in a project, follow [Update Vite+](/guide/upgrade-project#preview-builds).