vite-plus 0.2.9 → 0.3.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 (98) hide show
  1. package/LICENSE +29 -29
  2. package/README.md +6 -5
  3. package/binding/index.cjs +63 -55
  4. package/binding/index.d.cts +218 -14
  5. package/dist/{agent-DQU8uS6P.js → agent-C5jMYVfB.js} +3 -2
  6. package/dist/bin.js +101 -60
  7. package/dist/cli-parse-DHE8NrBU.js +13 -0
  8. package/dist/client/bundledDevClient.mjs +1 -1
  9. package/dist/client/client.mjs +1 -1
  10. package/dist/client/env.mjs +1 -1
  11. package/dist/client.d.ts +1 -1
  12. package/dist/command-CLJK5jGW.js +2 -0
  13. package/dist/command-CguLh2KL.js +471 -0
  14. package/dist/config/bin.js +85 -55
  15. package/dist/{constants-CG513DRa.js → constants-0IAVgpox.js} +5 -3
  16. package/dist/create/bin.d.ts +13 -5
  17. package/dist/create/bin.js +55 -232
  18. package/dist/{define-config-DyNLA_f0.cjs → define-config-DIE9de46.cjs} +2 -2
  19. package/dist/{define-config-DWoAkNdp.d.ts → define-config-DPNEJxPz.d.ts} +5 -9
  20. package/dist/{define-config-CV4bQG_8.js → define-config-U3_xg7i-.js} +2 -2
  21. package/dist/define-config.cjs +1 -1
  22. package/dist/define-config.d.ts +1 -1
  23. package/dist/define-config.js +1 -1
  24. package/dist/dist-DfmT__Aw.js +619 -0
  25. package/dist/{editor-g4PosU99.js → editor-B5-lvRaU.js} +619 -88
  26. package/dist/{terminal-Bz-ps6rJ.js → help-BmKpeOP9.js} +1 -38
  27. package/dist/hooks/bin.js +9 -113
  28. package/dist/{hooks-pNCBWtFT.js → hooks-C-4gykWR.js} +5 -2
  29. package/dist/index.cjs +2 -2
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.js +2 -2
  32. package/dist/internal.d.ts +1 -1
  33. package/dist/internal.js +1 -1
  34. package/dist/migration/bin.js +76 -146
  35. package/dist/migration/compat/worker.js +1 -1
  36. package/dist/module-runner.d.ts +1 -1
  37. package/dist/module-runner.js +1 -1
  38. package/dist/{oxlint-plugin-config-BEZ9IUf7.js → oxlint-plugin-config-Drdl67Xp.js} +1 -1
  39. package/dist/oxlint-plugin.d.ts +2 -2
  40. package/dist/oxlint-plugin.js +1 -1
  41. package/dist/{pack-PvUg_xpv.d.ts → pack-BK38MLVZ.d.ts} +1 -1
  42. package/dist/pack-bin.d.ts +2 -3
  43. package/dist/pack-bin.js +9 -625
  44. package/dist/pack-client.d.ts +1 -1
  45. package/dist/pack.d.ts +2 -2
  46. package/dist/pack.js +1 -1
  47. package/dist/{package-B4T8RGMG.js → package-BZz2Ij68.js} +2 -2
  48. package/dist/{prompts-CHz_98bJ.js → prompts-CtzEgFY-.js} +7 -1872
  49. package/dist/{report-BS7ULx7A.js → report-CK5TnTsr.js} +2 -0
  50. package/dist/{resolve-vite-config-Dmeyeyj-.js → resolve-vite-config-CGks1xR7.js} +3 -3
  51. package/dist/resolve-vite-config-Dnmc-lBc.js +2 -0
  52. package/dist/semver-CaDAb8vV.js +1400 -0
  53. package/dist/staged/bin.js +82 -187
  54. package/dist/sync-versions/bin.d.ts +1 -0
  55. package/dist/sync-versions/bin.js +3884 -0
  56. package/dist/sync-versions/bin.mjs +13323 -0
  57. package/dist/terminal-MKGAuy-p.js +39 -0
  58. package/dist/toolchain.js +11 -11
  59. package/dist/toolchain.json +11 -11
  60. package/dist/{tsconfig-7v_BHagU.js → tsconfig-CUggNuJR.js} +5 -4
  61. package/dist/tsconfig-VAbm4ZzJ.js +2 -0
  62. package/dist/tsgolint-path.d.ts +3 -4
  63. package/dist/types/customEvent.d.ts +1 -1
  64. package/dist/types/hmrPayload.d.ts +1 -1
  65. package/dist/types/hot.d.ts +1 -1
  66. package/dist/types/import-meta.d.ts +1 -1
  67. package/dist/types/importGlob.d.ts +1 -1
  68. package/dist/types/importMeta.d.ts +1 -1
  69. package/dist/types/metadata.d.ts +1 -1
  70. package/dist/version.d.ts +2 -3
  71. package/dist/version.js +4 -3
  72. package/dist/versions.js +6 -6
  73. package/dist/vitest-ecosystem-BiRqcaRI.js +23 -0
  74. package/docs/guide/check.md +1 -0
  75. package/docs/guide/ci.md +42 -2
  76. package/docs/guide/env.md +136 -50
  77. package/docs/guide/ide-integration.md +14 -2
  78. package/docs/guide/index.md +1 -1
  79. package/docs/guide/install.md +5 -2
  80. package/docs/guide/installer-env-vars.md +51 -5
  81. package/docs/guide/migrate-rules.md +66 -2
  82. package/docs/guide/migrate.md +5 -5
  83. package/docs/guide/test.md +8 -0
  84. package/docs/guide/upgrade.md +48 -1
  85. package/package.json +34 -37
  86. package/dist/lib-L3DWSRQp.js +0 -75
  87. package/docs/_data/team.ts +0 -131
  88. package/docs/package.json +0 -30
  89. package/docs/pnpm-lock.yaml +0 -4003
  90. package/docs/pnpm-workspace.yaml +0 -13
  91. package/docs/public/checkmark.svg +0 -1
  92. package/docs/public/cta-background.jpg +0 -0
  93. package/docs/public/favicon.svg +0 -1
  94. package/docs/public/icon.svg +0 -1
  95. package/docs/public/logo.svg +0 -1
  96. package/docs/public/og.jpg +0 -0
  97. package/docs/vite.config.ts +0 -20
  98. package/dist/{json-qlK6UH0r.js → json-cULBl7Pi.js} +107 -107
package/docs/guide/env.md CHANGED
@@ -1,10 +1,23 @@
1
1
  # Environment
2
2
 
3
- `vp env` manages Node.js versions globally and per project.
3
+ `vp env` manages the complete JavaScript environment: one Node.js runtime and one selected package manager. npm, pnpm, Yarn, and Bun are peer package-manager families.
4
4
 
5
5
  ## Overview
6
6
 
7
- Managed mode is on by default, so `node`, `npm`, and related shims resolve through Vite+ and pick the right Node.js version for the current project.
7
+ Managed mode is on by default, so Node.js and configured package-manager shims resolve through Vite+ and pick the right versions for the current project. Fresh installers record managed mode for npm, pnpm, Yarn, and Bun after the user enables environment management.
8
+
9
+ When an upgrade adds a package-manager shim that has no recorded mode, its first interactive invocation asks what to do only when the corresponding system binary is already on PATH. The current family defaults to managed mode; choosing a system tool or applying a choice to every family remains explicit. Non-interactive invocations use managed mode without recording a choice.
10
+
11
+ Most commands operate on both components when no selector is given. Add `node`, `pm`, `npm`, `pnpm`, `yarn`, or `bun` to narrow the command. `pm` means all four families for listing and cleanup, but the single selected package manager for project operations.
12
+
13
+ Unqualified versions remain Node.js versions for compatibility:
14
+
15
+ ```bash
16
+ vp env pin 22.0.0 # Node.js only
17
+ vp env pin pnpm@10.18.0 # pnpm only
18
+ vp env pin node@24 pnpm@12 # Both components
19
+ vp env pin 22.0.0 pnpm@10.18.0 # Also both components
20
+ ```
8
21
 
9
22
  Vite+ checks the current directory first, then walks up through its parents. The nearest directory
10
23
  with a supported declaration wins. Within each directory, sources are checked in this order:
@@ -19,9 +32,36 @@ latest LTS.
19
32
 
20
33
  `devEngines.runtime` ranks above `engines.node` because it declares the development-environment requirement, while `engines.node` is a consumer-facing support range. `vp env doctor` warns when declared sources conflict.
21
34
 
22
- When a project declares `packageManager` (or `devEngines.packageManager`) in `package.json`, matching package-manager shims also use that package-manager version. For example, `packageManager: "npm@10.9.4"` makes both `npm` and `npx` run through npm 10.9.4. Alias pairs follow the installed package-manager shims: `npm`/`npx`, `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Vite+ does not translate mismatched commands, so a project pinned to `pnpm` still lets `npm` fall back to the npm that comes with the resolved Node.js runtime.
35
+ ::: tip Using pnpm with Vite+ runtime management
36
+ pnpm can also manage the runtime declared in `devEngines.runtime`. When both pnpm and Vite+ manage Node.js, they can download the same version separately or select different versions, causing inconsistent behavior between commands.
37
+
38
+ If you want Vite+ to manage Node.js, pnpm 11+ supports disabling pnpm's automatic runtime management globally with [`runtimeOnFail`](https://pnpm.io/settings/cli#runtimeonfail):
39
+
40
+ ```bash
41
+ pnpm config set --global runtimeOnFail ignore
42
+ ```
43
+
44
+ This setting also disables pnpm's automatic management of other declared runtimes, including Bun and Deno. Consider whether any of your projects rely on that behavior before setting it globally.
45
+ :::
46
+
47
+ Package-manager selection uses this priority:
48
+
49
+ 1. Explicit command override
50
+ 2. `VP_PACKAGE_MANAGER` or the shell-session override
51
+ 3. Top-level `packageManager`
52
+ 4. `devEngines.packageManager`
53
+ 5. Lockfile or manager-specific configuration
54
+ 6. The named package manager's global default version
55
+ 7. The named shim's latest release
23
56
 
24
- By default, Vite+ stores its managed runtime and related files in `~/.vite-plus`. If needed, you can override that location with `VP_HOME`.
57
+ A selected manager controls only its named shims. For example, pnpm controls `pnpm` and `pnpx`; invoking `npm` still resolves npm independently. Alias pairs are `npm`/`npx`, `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Without a matching project selection, a named shim uses its configured default version and otherwise uses the latest release without prompting. The resolved version is cached for one hour and an expired cache remains available when the registry cannot be reached. The directly invoked npm shim keeps its Node-bundled fallback, while an explicit `vp env ... npm` family scope uses standalone npm's latest release.
58
+
59
+ A fresh install uses the split platform layout by default. On Unix, Vite+
60
+ stores managed runtimes and related files in `~/.local/share/vite-plus`. It
61
+ stores executables in the Vite+-owned `~/.local/share/vite-plus/bin` directory.
62
+ On Windows, Vite+ uses `%LOCALAPPDATA%\vite-plus\data` for data and
63
+ `%LOCALAPPDATA%\vite-plus\bin` for executables. Vite+ does not move an existing
64
+ `~/.vite-plus` install. `VP_HOME` puts all categories under one custom root.
25
65
 
26
66
  If you want to keep that behavior, run:
27
67
 
@@ -29,7 +69,14 @@ If you want to keep that behavior, run:
29
69
  vp env on
30
70
  ```
31
71
 
32
- This enables managed mode, where the shims always use the Vite+-managed Node.js installation.
72
+ This enables managed mode for both components. Their modes can also be changed independently, including one package-manager family:
73
+
74
+ ```bash
75
+ vp env on node
76
+ vp env off pm
77
+ vp env off pnpm
78
+ vp env on bun
79
+ ```
33
80
 
34
81
  If you do not want Vite+ to manage Node.js first, run:
35
82
 
@@ -37,23 +84,27 @@ If you do not want Vite+ to manage Node.js first, run:
37
84
  vp env off
38
85
  ```
39
86
 
40
- This switches to system-first mode, where the shims prefer your system Node.js and only fall back to the Vite+-managed runtime when needed.
87
+ This switches both components to system-first mode. Vite+ prefers system tools and falls back to managed installations. Mixed configurations compose: a system package-manager launcher receives the Node.js selected by the Node mode.
88
+
89
+ Using `pm` records the selected mode for all currently supported package managers and replaces their individual choices. An unscoped `on` or `off` does the same while also changing Node.js. A family without a recorded mode remains undecided until its shim is first used or an `on` / `off` command configures it.
41
90
 
42
91
  ## Commands
43
92
 
44
93
  ### Setup
45
94
 
46
- - `vp env setup` creates or updates shims in `VP_HOME/bin` (and writes the per-shell setup scripts under `VP_HOME`)
47
- - `vp env on` enables managed mode so shims always use Vite+-managed Node.js
48
- - `vp env off` enables system-first mode so shims prefer system Node.js first
49
- - `vp env print` prints the shell snippet for the current session
95
+ - `vp env setup` creates or updates the `node`, `npm`, `npx`, `pnpm`, `pnpx`, `yarn`, `yarnpkg`, `bun`, `bunx`, `vpx`, and `vpr` shims in the resolved bin directory. It writes shell setup scripts in the config directory.
96
+ - `vp env on` / `vp env off` changes both modes; append `node`, `pm`, `npm`, `pnpm`, `yarn`, or `bun` to narrow the change
97
+ - `vp env print` prints PATH setup for both components; append a selector to print one
50
98
 
51
99
  PowerShell needs to dot-source the generated setup script in the current shell before `vp env use` can affect only that shell session:
52
100
 
53
101
  ```powershell
54
- . "$env:USERPROFILE\.vite-plus\env.ps1"
102
+ . "$env:APPDATA\vite-plus\env.ps1"
55
103
  ```
56
104
 
105
+ If an older Vite+ install uses `%USERPROFILE%\.vite-plus`, source the `env.ps1`
106
+ file in that directory instead.
107
+
57
108
  Add that line to the end of your PowerShell `$PROFILE` to apply it automatically in new shells. It does not require elevated privileges.
58
109
 
59
110
  Create the profile file if it does not already exist:
@@ -76,29 +127,31 @@ node --version
76
127
  vp-use --unset
77
128
  ```
78
129
 
79
- Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` under `VP_HOME/bin` on Windows.
130
+ Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` in the bin directory on Windows.
80
131
 
81
- In CI, `vp env use` can still run without shell initialization. It writes a temporary session file under `VP_HOME` so later shim calls in the same job can resolve the selected Node.js version.
132
+ In CI, `vp env use` can run without shell initialization. It writes a temporary
133
+ Node.js or package-manager session file in the resolved state directory. Later
134
+ shim calls in the same job use these files to resolve the same environment.
82
135
 
83
136
  ### Manage
84
137
 
85
- - `vp env default` sets or shows the global default Node.js version
86
- - `vp env pin` pins a Node.js version in the current directory: an existing `.node-version` keeps being updated; otherwise the pin is written to `package.json#devEngines.runtime`; `.node-version` is only created when the directory has no `package.json`. Use `--target node-version` or `--target dev-engines` to choose explicitly. An existing `engines.node` is never modified.
87
- - `vp env unpin` removes the pin from the same source `vp env pin` would write
88
- - `vp env use` sets a Node.js version for the current shell session
89
- - `vp env install` installs a Node.js version
90
- - `vp env uninstall` removes an installed Node.js version
91
- - `vp env clean` removes unused managed Node.js runtimes, all downloaded package managers, and the Corepack cache.
92
- - `vp env exec` runs a command with a specific Node.js version
93
- - `vp node` runs a Node.js script shorthand for `vp env exec node`
138
+ - `vp env default` shows the global Node.js default and each configured package-manager version. Bare versions set Node.js; qualified specs such as `pnpm@10.18.0` set that package manager's shim default without replacing the defaults for Bun, Yarn, or npm. `--unset` clears all defaults unless scoped.
139
+ - `vp env pin` shows or writes project pins. Existing `.node-version` and top-level `packageManager` fields keep being updated for compatibility; otherwise Vite+ writes the matching `devEngines` entry. Use `--target node-version`, `--target dev-engines`, or `--target package-manager` to choose explicitly.
140
+ - `vp env unpin` removes both effective pins by default; append a selector to remove one. Lower-priority declarations are not deleted.
141
+ - `vp env use` activates the complete project environment. Explicit specs override selected components; `--unset` clears both unless scoped.
142
+ - `vp env install` installs the complete resolved environment, a selected component, or explicit specs.
143
+ - `vp env uninstall` removes explicit exact Node.js or qualified package-manager versions.
144
+ - `vp env clean` removes unused installs. Use `clean node`, `clean pm`, or a concrete manager. Current and configured-default versions are preserved.
145
+ - `vp env exec` runs a command in the resolved environment. Use `--node` and `--package-manager`; `--npm` is an alias for `--package-manager npm@…`.
146
+ - `vp node` uses the resolved Node.js runtime and exposes the selected package-manager path to child processes.
94
147
 
95
148
  ### Inspect
96
149
 
97
150
  - `vp env current` shows the current resolved environment
98
151
  - `vp env doctor` runs environment diagnostics
99
152
  - `vp env which` shows which tool path will be used
100
- - `vp env list` shows locally installed Node.js versions
101
- - `vp env list-remote` shows available Node.js versions from the registry
153
+ - `vp env list` shows separate Node.js, npm, pnpm, Yarn, and Bun sections; selectors narrow output
154
+ - `vp env list-remote` fetches Node.js and all four PM registries concurrently; selectors narrow network work. `--lts` implicitly selects Node.js.
102
155
 
103
156
  ## Project Setup
104
157
 
@@ -110,50 +163,83 @@ In CI, `vp env use` can still run without shell initialization. It writes a temp
110
163
 
111
164
  ```bash
112
165
  # Setup
113
- vp env setup # Create shims for node, npm, npx, corepack
114
- vp env on # Use Vite+ managed Node.js
115
- vp env print # Print shell snippet for this session
166
+ vp env setup # Create Node.js and package-manager shims
167
+ vp env on # Manage Node.js and package managers
168
+ vp env off pm # Prefer system package managers only
169
+ vp env off pnpm # Prefer system pnpm only
170
+ vp env print # Print PATH setup for both components
116
171
 
117
172
  # Manage
118
- vp env pin lts # Pin the project to the latest LTS release
119
- vp env install # Install the version from .node-version, package.json, or .nvmrc
120
- vp env default lts # Set the global default version
121
- vp env use 20 # Use Node.js 20 for the current shell session
122
- vp env use --unset # Remove the session override
123
- vp env clean # Remove unused managed caches
173
+ vp env pin lts pnpm@10 # Pin both project components to exact versions
174
+ vp env install # Install the complete resolved environment
175
+ vp env default node@24 # Set the global Node.js default
176
+ vp env default pnpm@10 # Set pnpm's global default version
177
+ vp env use 20 pnpm@10 # Override both components for this shell
178
+ vp env use --unset pm # Remove only the PM session override
179
+ vp env clean # Remove unused managed Node.js and package manager versions
124
180
 
125
181
  # Inspect
126
182
  vp env current # Show current resolved environment
127
183
  vp env current --json # JSON output for automation
128
184
  vp env which node # Show which node binary will be used
129
185
  vp env which npx # Show pinned package-manager alias when packageManager matches
130
- vp env list-remote --lts # List only LTS versions
186
+ vp env list # Show every locally installed component
187
+ vp env list node # Show only Node.js installations
188
+ vp env list-remote --lts # List only Node.js LTS versions
131
189
 
132
190
  # Execute
133
- vp env exec --node lts npm i # Execute npm with latest LTS
191
+ vp env exec --node lts --package-manager pnpm@10 pnpm install
134
192
  vp env exec node -v # Use shim mode with automatic version resolution
135
193
  vp node script.js # Shorthand: run a Node.js script with the resolved version
136
194
  vp node -e "console.log(1+1)" # Shorthand: forward any node flag or argument
137
195
  ```
138
196
 
139
- ## Corepack
140
-
141
- Vite+ creates a `corepack` shim by default, so corepack works without a system Node.js installation:
142
-
143
- - On Node.js 24 and earlier, the shim runs the corepack bundled with the resolved Node.js version.
144
- - On Node.js 25 and later, where corepack is no longer bundled, Vite+ installs corepack as a managed global package on first use. Only the `corepack` binary is linked; run `vp install -g corepack` yourself if you also want the package's pnpm/yarn launchers exposed directly.
145
- - If you install corepack explicitly with `vp install -g corepack`, that installation is always preferred.
146
-
147
- `corepack enable` normally creates `pnpm`/`yarn` launchers next to the corepack binary, which under Vite+ would not be on `PATH`. The shim fixes this by defaulting `--install-directory` to `VP_HOME/bin`, so after `corepack enable` the launchers are available everywhere and still resolve the project's Node.js and package-manager versions:
148
-
149
- ```bash
150
- corepack enable # pnpm and yarn now resolve via corepack
151
- corepack disable # Remove the pnpm/yarn launchers again
197
+ ## JSON output
198
+
199
+ The JSON output for `current`, `list`, and `list-remote` is organized by component. `current --json` returns sibling `node` and `package_manager` objects:
200
+
201
+ ```json
202
+ {
203
+ "node": {
204
+ "version": "22.0.0",
205
+ "source": "devEngines.runtime",
206
+ "source_path": "/project/package.json",
207
+ "project_root": "/project",
208
+ "bin_path": "/home/.vite-plus/js_runtime/node/22.0.0/bin/node",
209
+ "installed": true,
210
+ "mode": "managed"
211
+ },
212
+ "package_manager": {
213
+ "name": "pnpm",
214
+ "version": "10.18.0",
215
+ "source": "packageManager",
216
+ "source_path": "/project/package.json",
217
+ "project_root": "/project",
218
+ "bin_paths": {
219
+ "pnpm": "/home/.vite-plus/package_manager/pnpm/10.18.0/pnpm/bin/pnpm",
220
+ "pnpx": "/home/.vite-plus/package_manager/pnpm/10.18.0/pnpm/bin/pnpx"
221
+ },
222
+ "installed": true,
223
+ "mode": "managed"
224
+ }
225
+ }
152
226
  ```
153
227
 
154
- The launchers reference the corepack copy that created them. If that copy is later removed (for example by uninstalling the Node.js version it shipped with), rerun `corepack enable` to recreate them.
228
+ `list --json` and `list-remote --json` group the component arrays:
229
+
230
+ ```json
231
+ {
232
+ "node": [],
233
+ "package_managers": {
234
+ "npm": [],
235
+ "pnpm": [],
236
+ "yarn": [],
237
+ "bun": []
238
+ }
239
+ }
240
+ ```
155
241
 
156
- Shims owned by Vite+ (`npm`, `npx`, and binaries installed with `vp install -g`) are protected: if corepack removes or replaces them, Vite+ restores them and prints a warning.
242
+ Selectors omit unselected top-level fields or PM families. Registry listing is all-or-error: Vite+ prints no partial human or JSON result when any selected registry request fails.
157
243
 
158
244
  ## Custom Node.js Mirror
159
245
 
@@ -82,14 +82,26 @@ You can also manually set up the Zed config:
82
82
  "JavaScript": {
83
83
  "format_on_save": "on",
84
84
  "prettier": { "allowed": false },
85
- "formatter": [{ "language_server": { "name": "oxfmt" } }],
86
- "code_action": "source.fixAll.oxc"
85
+ "formatter": [
86
+ { "language_server": { "name": "oxfmt" } },
87
+ { "code_action": "source.fixAll.oxc" }
88
+ ]
89
+ },
90
+ "JSX": {
91
+ "format_on_save": "on",
92
+ "prettier": { "allowed": false },
93
+ "formatter": [{ "language_server": { "name": "oxfmt" } }]
87
94
  },
88
95
  "TypeScript": {
89
96
  "format_on_save": "on",
90
97
  "prettier": { "allowed": false },
91
98
  "formatter": [{ "language_server": { "name": "oxfmt" } }]
92
99
  },
100
+ "TSX": {
101
+ "format_on_save": "on",
102
+ "prettier": { "allowed": false },
103
+ "formatter": [{ "language_server": { "name": "oxfmt" } }]
104
+ },
93
105
  "Vue.js": {
94
106
  "format_on_save": "on",
95
107
  "prettier": { "allowed": false },
@@ -96,7 +96,7 @@ Vite+ can handle the entire local frontend development cycle from starting a pro
96
96
  - [`vp hooks`](/guide/commit-hooks) manages the Git hook dispatcher (`enable`, `disable`, `status`).
97
97
  - [`vp staged`](/guide/commit-hooks) runs checks on staged files.
98
98
  - [`vp install`](/guide/install) installs dependencies with the right package manager.
99
- - [`vp env`](/guide/env) manages Node.js versions.
99
+ - [`vp env`](/guide/env) manages Node.js and package-manager environments.
100
100
 
101
101
  ### Develop
102
102
 
@@ -19,7 +19,9 @@ Vite+ detects the package manager from the workspace root in this order:
19
19
  9. `bunfig.toml`
20
20
  10. `yarn.config.cjs`
21
21
 
22
- If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran. When detection comes from lockfiles or config files, the resolved version is written to `devEngines.packageManager` so future runs are deterministic; projects that already declare `packageManager` or `devEngines.packageManager` are left as-is.
22
+ If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran, but package-manager detection never rewrites `package.json`. Use `vp env pin <package-manager>@<version>` when the project should declare an exact version explicitly.
23
+
24
+ After selecting the package manager, Vite+ forwards the command without separately validating whether `package.json` exists. Missing-manifest behavior therefore matches the selected package manager.
23
25
 
24
26
  The [`devEngines.packageManager`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines) field accepts a single object or an array of objects, and its `version` may be a semver range:
25
27
 
@@ -81,7 +83,8 @@ Updates keep the version spec a package was installed with: a package installed
81
83
  ::: warning
82
84
  These commands do **NOT** interact with the underlying package manager's global installation directory.
83
85
 
84
- Instead, Vite+ manages its own global packages under `VP_HOME/packages`, allowing them to remain available across different Node.js versions.
86
+ Instead, Vite+ stores its global packages in `packages/` under the resolved data
87
+ directory. These packages remain available across different Node.js versions.
85
88
 
86
89
  As a result, commands such as `vp link` do not affect Vite+'s global packages and will not appear in `vp list -g`.
87
90
  :::
@@ -11,6 +11,10 @@ These variables control the installer scripts and the standalone Windows install
11
11
  - **Purpose**: Version to install
12
12
  - **Default**: `latest`
13
13
  - **CLI equivalent**: `--version`
14
+ - **Note**: Vite+ 0.2.x and earlier do not support the split directory layout.
15
+ The installer always puts these releases in the monolithic root (`VP_HOME` or
16
+ `~/.vite-plus`). This rule also applies to a fresh machine. The installer
17
+ checks the downloaded binary and prints a notice.
14
18
  - **Example**:
15
19
 
16
20
  ```bash
@@ -25,9 +29,15 @@ These variables control the installer scripts and the standalone Windows install
25
29
 
26
30
  ### `VP_HOME`
27
31
 
28
- - **Purpose**: Installation directory; the installed CLI reads the same variable as the Vite+ home directory (see [Environment](/guide/env))
29
- - **Default**: `~/.vite-plus` (Unix) or `%USERPROFILE%\.vite-plus` (Windows)
30
- - **CLI equivalent**: `--install-dir`
32
+ - **Purpose**: Optional pin for the single-root layout. Set it to an absolute
33
+ path. Vite+ then puts bin, data, cache, config, and state under that directory.
34
+ The installed CLI reads the same variable. See [Environment](/guide/env).
35
+ - **Default**: unset. Vite+ reuses an existing install in `~/.vite-plus` on
36
+ Unix or `%USERPROFILE%\.vite-plus` on Windows. The directory must contain a
37
+ `current` link. Otherwise, a fresh install uses the split platform layout. On
38
+ Unix, it uses `~/.local/share/vite-plus` and its Vite+-owned `bin`
39
+ subdirectory. On Windows, it uses `%LOCALAPPDATA%\vite-plus\data` and
40
+ `%LOCALAPPDATA%\vite-plus\bin`.
31
41
  - **Example**:
32
42
 
33
43
  ```bash
@@ -40,6 +50,25 @@ These variables control the installer scripts and the standalone Windows install
40
50
  $env:VP_HOME = "D:\vite-plus"; irm https://vite.plus/ps1 | iex
41
51
  ```
42
52
 
53
+ ### `VP_BIN_DIR` / `VP_DATA_DIR` / `VP_CACHE_DIR`
54
+
55
+ - **Purpose**: Internal absolute directory overrides for integrations that
56
+ must pin a split install. Set all three variables together. The installer
57
+ rejects an incomplete group. Vite+ ignores the group when `VP_HOME` is set
58
+ or when it reuses an existing `~/.vite-plus` install.
59
+ - **Default**: unset (XDG / platform defaults)
60
+ - **Persistence**: The generated environment file does not export these
61
+ variables. An integration that uses them must provide the complete group to
62
+ each Vite+ process.
63
+ - **Example**:
64
+
65
+ ```bash
66
+ export VP_DATA_DIR=$HOME/vite-plus-data
67
+ export VP_BIN_DIR=$VP_DATA_DIR/bin
68
+ export VP_CACHE_DIR=$HOME/.cache/vite-plus
69
+ curl -fsSL https://vite.plus | bash
70
+ ```
71
+
43
72
  ### `NPM_CONFIG_REGISTRY`
44
73
 
45
74
  - **Purpose**: Custom npm registry URL
@@ -71,7 +100,12 @@ These variables control the installer scripts and the standalone Windows install
71
100
 
72
101
  ### Development variables
73
102
 
74
- When developing Vite+ itself, `VP_LOCAL_TGZ` (path to a local `vite-plus.tgz`) and `VP_LOCAL_BINARY` (path to a local `vp` binary) feed the installer a local build. The installers also set `VP_INSTALL_STOP` themselves; do not set it manually.
103
+ Use `VP_LOCAL_TGZ` and `VP_LOCAL_BINARY` when you develop Vite+ itself.
104
+ `VP_LOCAL_TGZ` specifies a local `vite-plus.tgz` file. `VP_LOCAL_BINARY`
105
+ specifies a local `vp` binary. The installers use these files for the local
106
+ build. They use `VP_DUMP_DIRS=1` to get the layout mode and all five `EnvConfig`
107
+ category roots from the selected binary. They do not resolve the directory
108
+ variables. The installers set `VP_INSTALL_STOP`; do not set it manually.
75
109
 
76
110
  ## Runtime Variables
77
111
 
@@ -93,6 +127,16 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
93
127
  VP_NODE_VERSION=22 vp env exec node -v
94
128
  ```
95
129
 
130
+ ### `VP_PACKAGE_MANAGER`
131
+
132
+ - **Purpose**: Override the selected package manager and version
133
+ - **Default**: None (resolved from the project or global default)
134
+ - **Format**: `npm|pnpm|yarn|bun@<version>`
135
+ - **Example**:
136
+ ```bash
137
+ VP_PACKAGE_MANAGER=pnpm@10.18.0 vp install
138
+ ```
139
+
96
140
  ### `VP_NODE_SKIP_SIGNATURE_VERIFY`
97
141
 
98
142
  - **Purpose**: Skip PGP signature verification of Node.js downloads
@@ -161,6 +205,8 @@ Vite+ sets additional `VP_*` variables during shim dispatch and shell integratio
161
205
  ### `VP_LOG`
162
206
 
163
207
  - **Purpose**: Log filter string for `tracing_subscriber`
208
+ - **Installer behavior**: When `CI=true`, `install.sh` hides shell file errors.
209
+ Set `VP_LOG=trace` to show these errors.
164
210
  - **Default**: None
165
211
  - **Example**:
166
212
  ```bash
@@ -195,7 +241,7 @@ Vite+ also respects these standard environment variables:
195
241
  ### `HOME` / `USERPROFILE`
196
242
 
197
243
  - **Purpose**: User home directory
198
- - **Effect**: Base for the default `~/.vite-plus` path
244
+ - **Effect**: Base for the existing-install probe (`~/.vite-plus`) and for split platform defaults
199
245
 
200
246
  ## Precedence
201
247
 
@@ -39,6 +39,52 @@ When a default upgrade skips setup actions that would apply, it prints a hint
39
39
  to run `vp migrate --full`. Fresh (non Vite+) projects always run the full
40
40
  migration.
41
41
 
42
+ ## Pack Configuration
43
+
44
+ `vp migrate` updates static `pack` objects in `vite.config.*` and exported
45
+ objects in `tsdown.config.*` for [tsdown 0.23](https://github.com/rolldown/tsdown/releases/tag/v0.23.0).
46
+ This also runs on existing Vite+ projects without `--full`, including workspace
47
+ packages. Arrays and direct objects returned by `defineConfig` callbacks are
48
+ supported. JSON tsdown configs receive the same updates after they merge into
49
+ `vite.config.ts`.
50
+
51
+ | Previous option | Updated option |
52
+ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
53
+ | `bundle: false` | `unbundle: true` |
54
+ | `bundle: true` | Removed; bundling remains the default |
55
+ | `outExtension` | `outExtensions` |
56
+ | `publicDir` | `copy` |
57
+ | `removeNodeProtocol: true` | `nodeProtocol: 'strip'` |
58
+ | `injectStyle` | `css.inject` |
59
+ | `inlineOnly` / `deps.onlyAllowBundle` | `deps.onlyBundle` |
60
+ | `noExternal` | `deps.alwaysBundle` |
61
+ | `skipNodeModulesBundle: true` / `deps.skipNodeModulesBundle: true` | `deps.neverBundle: true` |
62
+ | `dts.tsgo` / `dts.oxc` | Select with `dts.generator`; retain generator option objects and remove boolean flags |
63
+ | `dts.cjsReexport` | Removed; tsdown generates CJS declarations separately |
64
+ | `--public-dir` in `tsdown` or `vp pack` scripts | `--copy` |
65
+
66
+ Migration preserves the previous defaults by setting `deps.resolveDepSubpath`
67
+ to `true` when absent. Enabled ATTW checks receive `profile: 'strict'` when
68
+ no profile is set. Explicit values, including `false`, remain unchanged.
69
+
70
+ `noExternal` moves to `deps.alwaysBundle`, preserving matcher expressions,
71
+ references, and callback methods. Existing `deps.alwaysBundle` values remain
72
+ unchanged.
73
+
74
+ When `external` accompanies either `skipNodeModulesBundle` form, static matchers
75
+ and references to local constants move to `inputOptions.external` before
76
+ `deps.neverBundle` is set. Constant declarations and references stay intact.
77
+ This preserves the original matching rules, including external file paths. Unsupported matchers,
78
+ conflicting `inputOptions`, and declaration-specific dependency rules leave the
79
+ pack object unchanged and produce a manual-migration warning.
80
+
81
+ The transform does not evaluate configuration code. Objects with spreads,
82
+ computed keys, or duplicate keys, and conflicting old and new options require
83
+ manual review. Dynamic boolean selectors remain unchanged. Unrelated Vite and
84
+ plugin options remain unchanged. Run `vp pack` after migration to check the
85
+ result. Node.js requirements, TypeScript module resolution, and programmatic
86
+ `build()` return values require separate review.
87
+
42
88
  ## Dependency Rules
43
89
 
44
90
  What happens to each toolchain dependency, at a glance:
@@ -82,6 +128,14 @@ Related rules:
82
128
  - A direct `vite` declaration is never removed merely because a root override
83
129
  exists.
84
130
  - Plain or stale aliases are normalized; named catalog references are kept.
131
+ - Under pnpm the managed override keys use an explicit `@*` range (`vite@*`,
132
+ `vitest@*`). pnpm applies an override by replacing the declared spec on every
133
+ manifest, importer manifests included. A bare key matches any spec, including
134
+ `catalog:`, and `vp up` then rewrites that reference to a concrete version.
135
+ The `@*` range keeps the override on the semver ranges that transitive and
136
+ peer declarations use. It leaves `catalog:` references to the catalog, which
137
+ already resolves them to Vite+ core. Migration re-keys a project that still
138
+ holds the bare key, and keeps its named-catalog choice.
85
139
  - The direct-entry rule above is pnpm-specific. Bun mirrors its core alias as
86
140
  a direct dependency for its peer resolver, and npm browser-provider layouts
87
141
  may need a top-level `vite` edge so nested Vitest packages can resolve
@@ -228,6 +282,7 @@ scripts while preserving their arguments:
228
282
  | `lint-staged` | `vp staged` |
229
283
  | `eslint` | `vp lint`, when its optional migration runs |
230
284
  | `prettier` | `vp fmt`, when its optional migration runs |
285
+ | `tsup` | `vp pack`, when its optional migration runs |
231
286
 
232
287
  For commands launched through `bunx`, migration preserves `bunx` and its
233
288
  `--bun` flag (keeping the user's chosen runtime) and rewrites only the managed
@@ -243,6 +298,14 @@ as `run` or `--`:
243
298
 
244
299
  Unrelated `bunx` commands and other package-executor forms remain unchanged.
245
300
 
301
+ ## Continuous Integration Rules
302
+
303
+ Migration replaces exact `voidzero-dev/setup-vp@v1` references in GitHub
304
+ Actions workflows and composite actions under `.github` with the latest exact
305
+ `setup-vp` release known to that Vite+ version. The frozen `v1` tag does not
306
+ receive new releases. Existing exact versions and commit SHAs are left
307
+ unchanged.
308
+
246
309
  ## Node.js Version Rules
247
310
 
248
311
  Migration converts legacy Node.js version-manager files to `.node-version`,
@@ -254,8 +317,9 @@ migrations run it unconditionally.
254
317
  existing `.node-version` is kept.
255
318
  - When `.nvmrc` is removed, any `actions/setup-node` `node-version-file:
256
319
  .nvmrc` reference in `.github/workflows/*.{yml,yaml}` and composite actions
257
- (`.github/actions/**/action.{yml,yaml}`) is repointed to `.node-version` so
258
- CI does not fail with "node version file ... does not exist".
320
+ under `.github` (`.github/**/action.{yml,yaml}`) is repointed to
321
+ `.node-version` so CI does not fail with "node version file ... does not
322
+ exist".
259
323
 
260
324
  ## Package-Manager Rules
261
325
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Overview
6
6
 
7
- This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, and Prettier setups into Vite+.
7
+ This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, and tsup setups into Vite+.
8
8
 
9
9
  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
10
 
@@ -70,7 +70,7 @@ After running the migration:
70
70
  - Run `vp install`
71
71
  - Run `vp check`
72
72
  - Run `vp test`
73
- - Run `vp build`
73
+ - Run `vp build` (or `vp pack` if you are building a library)
74
74
 
75
75
  ## Manual Installation & Migration
76
76
 
@@ -85,7 +85,7 @@ You need to add overrides to your package manager so that other packages resolve
85
85
  ```json
86
86
  "overrides": {
87
87
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
88
- "vitest": "4.1.10"
88
+ "vitest": "4.1.11"
89
89
  }
90
90
  ```
91
91
 
@@ -94,7 +94,7 @@ If you are using `pnpm`, add this to your `pnpm-workspace.yaml`:
94
94
  ```yaml
95
95
  overrides:
96
96
  vite: npm:@voidzero-dev/vite-plus-core@latest
97
- vitest: 4.1.10
97
+ vitest: 4.1.11
98
98
  ```
99
99
 
100
100
  Or, if you are using Yarn:
@@ -102,7 +102,7 @@ Or, if you are using Yarn:
102
102
  ```json
103
103
  "resolutions": {
104
104
  "vite": "npm:@voidzero-dev/vite-plus-core@latest",
105
- "vitest": "4.1.10"
105
+ "vitest": "4.1.11"
106
106
  }
107
107
  ```
108
108
 
@@ -6,6 +6,14 @@
6
6
 
7
7
  `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.
8
8
 
9
+ Vitest APIs are available from `vite-plus/test`, so a single `vite-plus` install is enough — you do not need to install `vitest` directly:
10
+
11
+ ```ts [src/example.test.ts]
12
+ import { describe, expect, it, vi } from 'vite-plus/test';
13
+ ```
14
+
15
+ For the browser mode subpaths (`vite-plus/test/browser*`), see [Migrating Vitest](/guide/migrate#vitest).
16
+
9
17
  ::: info
10
18
  `vp test` always runs the built-in Vitest command. If your project also has a `test` script in `package.json`, run `vp run test` when you want to run that script instead. See [Built-in Commands vs Scripts](/guide/run#built-in-commands-vs-scripts).
11
19
  :::