vite-plus 1.3.0 → 1.5.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.
- package/AGENTS.md +4 -0
- package/LICENSE +1 -878
- package/README.md +1 -1
- package/bin/vpx +9 -0
- package/binding/index.cjs +59 -54
- package/binding/index.d.cts +159 -2
- package/dist/{agent-97KmGCyL.js → agent-DkQD3xqe.js} +5 -7
- package/dist/bin.js +35 -34
- package/dist/{cli-parse-DHE8NrBU.js → cli-parse-aeUeFDlC.js} +2 -3
- package/dist/command-TjS_6y9O.js +1 -0
- package/dist/{command-CdMBoZFD.js → command-rY79K5NI.js} +28 -30
- package/dist/{comparison-CmVirWIW-DUGaiYqF.js → comparison-CmVirWIW-UlEf2maz.js} +1 -2
- package/dist/config/bin.js +8 -10
- package/dist/{constants-DR55DpRm.js → constants-D2P2aVKb.js} +8 -6
- package/dist/create/bin.d.ts +4 -8
- package/dist/create/bin.js +151 -120
- package/dist/{define-config-Bexdd6RZ.d.ts → define-config-BrvHRi-G.d.ts} +31 -13
- package/dist/{define-config-BxDc_9BK.cjs → define-config-CwtQqYC1.cjs} +41 -14
- package/dist/{define-config-CvE5pHqB.js → define-config-wR57OZG_.js} +34 -12
- package/dist/define-config.cjs +2 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +1 -1
- package/dist/{dist-DIpm7mot.js → dist-Bs0SObNC.js} +73 -145
- package/dist/{dist-Cqz8OtiO.js → dist-CdkMvIiQ.js} +11 -5
- package/dist/dist-zDZV5eEc.js +3 -0
- package/dist/{documentation-DqcZSthV.js → documentation-cv_y0Auv.js} +1 -2
- package/dist/{editor-CtJGQP7C.js → editor-aOy1T15H.js} +2735 -5072
- package/dist/{help-BmKpeOP9.js → help-B03t_iQ4.js} +1 -2
- package/dist/hooks/bin.js +4 -5
- package/dist/{hooks-DhwsWb46.js → hooks-w_e2whkQ.js} +45 -25
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{json-JP24qHUF.js → json-kl84kDyH.js} +9 -18
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +1782 -256
- package/dist/migration/compat/worker.js +4 -6
- package/dist/{oxlint-plugin-config-BIzrO2y2.js → oxlint-plugin-config-CHsI_zKo.js} +3 -4
- package/dist/oxlint-plugin.d.ts +0 -2
- package/dist/oxlint-plugin.js +33 -9
- package/dist/{pack-BK38MLVZ.d.ts → pack-ARPFMefW.d.ts} +0 -2
- package/dist/pack-bin.d.ts +1 -3
- package/dist/pack-bin.js +4 -5
- package/dist/pack.d.ts +1 -1
- package/dist/{package-CQDXTm6j.js → package-DfFo6-E-.js} +10 -95
- package/dist/{package-overrides-D1RcXSFl.js → package-overrides-Ci8GXouY.js} +5 -8
- package/dist/picomatch-DEUoj81q.js +1916 -0
- package/dist/{prompts-1xNz_ne0.js → prompts-C7DI63WP.js} +30 -50
- package/dist/{protocol-D99W10Qi.js → protocol-CkNmY-Mr.js} +1 -2
- package/dist/register.d.ts +1 -0
- package/dist/register.js +12 -0
- package/dist/{report-NhQk8VHb.js → report-BEdpIQvC.js} +4 -2
- package/dist/resolve-vite-config-33bzSaeT.js +1 -0
- package/dist/{resolve-vite-config-BVr1SUNg.js → resolve-vite-config-Cx3cnVVI.js} +9 -25
- package/dist/{rolldown-runtime-kJ_i4yPo.js → rolldown-runtime-DegdyBIC.js} +1 -2
- package/dist/script-esm-hooks.d.ts +11 -0
- package/dist/script-esm-hooks.js +27 -0
- package/dist/script-hooks-9Fof5UMY.js +176 -0
- package/dist/script-preload.cjs +491 -0
- package/dist/script-register.d.ts +1 -0
- package/dist/script-register.js +27 -0
- package/dist/script-watch.d.ts +1 -0
- package/dist/script-watch.js +2002 -0
- package/dist/staged/bin.js +53 -2011
- package/dist/sync-versions/bin.js +26 -48
- package/dist/sync-versions/bin.mjs +109 -217
- package/dist/{terminal-MKGAuy-p.js → terminal-BcuPUy-j.js} +1 -2
- package/dist/toolchain.js +38 -12
- package/dist/toolchain.json +38 -12
- package/dist/{tsconfig-zWgHiQ3X.js → tsconfig-BE3Wj9OX.js} +1 -1
- package/dist/{tsconfig-BZu7kl-x.js → tsconfig-shNmmCE_.js} +8 -10
- package/dist/version.d.ts +1 -3
- package/dist/version.js +5 -6
- package/dist/versions.js +7 -7
- package/dist/{vitest-ecosystem-BU0AqZq-.js → vitest-ecosystem-BeEYz-qF.js} +1 -2
- package/dist/{vitest-v5-entry-points-DthU1e_O.js → vitest-v5-entry-points-NyJsFeux.js} +1 -2
- package/dist/vpx-bin.d.ts +1 -0
- package/dist/vpx-bin.js +232 -0
- package/dist/vpx-script-EXgV5QOf.js +434 -0
- package/docs/config/check.md +2 -0
- package/docs/config/fmt.md +1 -1
- package/docs/config/lint.md +1 -1
- package/docs/config/run.md +10 -2
- package/docs/config/staged.md +1 -1
- package/docs/guide/check.md +6 -1
- package/docs/guide/ci.md +13 -3
- package/docs/guide/create.md +1 -1
- package/docs/guide/env.md +11 -4
- package/docs/guide/global-cli.md +59 -3
- package/docs/guide/homebrew.md +127 -0
- package/docs/guide/ide-integration.md +1 -3
- package/docs/guide/implode.md +5 -3
- package/docs/guide/local-cli.md +21 -0
- package/docs/guide/migrate-rules.md +120 -18
- package/docs/guide/migrate.md +9 -9
- package/docs/guide/package-management.md +1 -1
- package/docs/guide/run.md +23 -1
- package/docs/guide/test.md +1 -1
- package/docs/guide/troubleshooting.md +1 -1
- package/docs/guide/upgrade.md +12 -6
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +210 -9
- package/package.json +43 -34
- package/dist/command-DVTILtS-.js +0 -1
- package/dist/dist-Dhu07wmN.js +0 -3
- package/dist/resolve-vite-config-7WDtXO4G.js +0 -1
package/docs/guide/global-cli.md
CHANGED
|
@@ -71,6 +71,10 @@ irm https://vite.plus/ps1 | iex
|
|
|
71
71
|
|
|
72
72
|
On Windows, you can instead download and run [`vp-setup.exe`](https://setup.viteplus.dev).
|
|
73
73
|
|
|
74
|
+
For macOS and Linux, see the [Homebrew tap guide](/guide/homebrew) for installation instructions.
|
|
75
|
+
|
|
76
|
+
The installer uses the Node.js version pinned in the Vite+ repository's [`.node-version`](https://github.com/voidzero-dev/vite-plus/blob/main/.node-version) to install its JavaScript dependencies. Each Vite+ release embeds this version at build time. Development and CI use the same file, which the dependency-upgrade workflow keeps up to date. CI integrations can select another compatible version through [`VP_SETUP_NODE_VERSION`](#vp-setup-node-version).
|
|
77
|
+
|
|
74
78
|
After installation, open a new shell and run:
|
|
75
79
|
|
|
76
80
|
```bash
|
|
@@ -105,6 +109,47 @@ These variables control the installer scripts and the standalone Windows install
|
|
|
105
109
|
$env:VP_VERSION = "1.2.3"; irm https://vite.plus/ps1 | iex
|
|
106
110
|
```
|
|
107
111
|
|
|
112
|
+
#### `VP_SETUP_NODE_VERSION`
|
|
113
|
+
|
|
114
|
+
- **Purpose**: Select the Node.js version used to install the global CLI's JavaScript dependencies. CI integrations such as [`setup-vp`](/guide/ci#node-js-during-installation) set this variable to reuse the project's runtime.
|
|
115
|
+
- **Values**: An exact version, a version range, or an alias such as `22.23.1`, `22`, `^22.18.0`, `lts`, or `latest`. The installer resolves the value once to an exact version.
|
|
116
|
+
- **Default**: Unset or empty (use the embedded Node.js default). Project files, `VP_NODE_VERSION`, session overrides, and the user-level default do not change this default.
|
|
117
|
+
- **Compatibility**: The resolved version must meet the Node.js requirements of both the global CLI and its pinned `pnpm`. Otherwise, the installer uses the embedded default. An invalid or unresolvable value causes an error.
|
|
118
|
+
- **Scope**: Initial dependency installation only. This variable does not set a project pin, session override, or global default. [`vp upgrade`](/guide/upgrade#global-vp) does not use this variable.
|
|
119
|
+
|
|
120
|
+
#### `VP_SETUP_NODE_VERSION_FILE`
|
|
121
|
+
|
|
122
|
+
- **Purpose**: Optional output file for integrations that need the exact version resolved from `VP_SETUP_NODE_VERSION`.
|
|
123
|
+
- **Contents**: The resolved version, such as `22.23.1`, written after successful dependency installation. If compatibility requires the embedded default for installation, the file still contains the requested version's resolution.
|
|
124
|
+
- **Default**: Unset (write no file). The installer also writes no file when `VP_SETUP_NODE_VERSION` is unset or empty, or when dependency installation is skipped.
|
|
125
|
+
|
|
126
|
+
`setup-vp` manages this file automatically. Use its Node.js inputs to configure CI jobs.
|
|
127
|
+
|
|
128
|
+
#### `VP_SETUP_SKIP_INSTALL_LOCKFILE`
|
|
129
|
+
|
|
130
|
+
Set this variable to `1` to recover from a lockfile-related error during global CLI installation or `vp upgrade`. All other values, including unset or empty, keep the published installation lockfile enabled.
|
|
131
|
+
|
|
132
|
+
The installer prints a warning and resolves dependencies without reading or recovering the installation lockfile. The requested CLI version stays pinned, but its dependency versions can differ from the release lockfile. Registry, authentication, and proxy settings remain in effect. This option does not affect project installations such as `vp install`.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Retry installation without the bundled lockfile.
|
|
136
|
+
curl -fsSL https://vite.plus | VP_SETUP_SKIP_INSTALL_LOCKFILE=1 bash
|
|
137
|
+
|
|
138
|
+
# Or retry an upgrade, including the currently installed version.
|
|
139
|
+
VP_SETUP_SKIP_INSTALL_LOCKFILE=1 vp upgrade --force
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
```powershell
|
|
143
|
+
$env:VP_SETUP_SKIP_INSTALL_LOCKFILE = "1"
|
|
144
|
+
try {
|
|
145
|
+
irm https://vite.plus/ps1 | iex
|
|
146
|
+
} finally {
|
|
147
|
+
Remove-Item Env:VP_SETUP_SKIP_INSTALL_LOCKFILE
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Keep this override temporary. Later installations and upgrades use the published lockfile again when the variable is unset. To reinstall an affected version with its lockfile, unset the variable and run `vp upgrade <version> --force`.
|
|
152
|
+
|
|
108
153
|
#### `VP_HOME`
|
|
109
154
|
|
|
110
155
|
- **Purpose**: Optional pin for the single-root layout. Set it to an absolute path. Vite+ then puts bin, data, cache, config, and state under that directory. The installed CLI reads the same variable. See [Environment](/guide/env).
|
|
@@ -227,6 +272,7 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
|
|
|
227
272
|
|
|
228
273
|
- **Purpose**: Override Node.js version
|
|
229
274
|
- **Default**: None (auto-detected)
|
|
275
|
+
- **Scope**: Runtime commands. For the installer's dependency installation, use [`VP_SETUP_NODE_VERSION`](#vp-setup-node-version).
|
|
230
276
|
- **Example**:
|
|
231
277
|
```bash
|
|
232
278
|
# Run a command with a specific Node.js version
|
|
@@ -347,6 +393,14 @@ source ~/.config/vite-plus/env.nu
|
|
|
347
393
|
|
|
348
394
|
For a custom `XDG_CONFIG_HOME`, use the absolute path to `<XDG_CONFIG_HOME>/vite-plus/env.nu` as resolved during installation. For an installation under `VP_HOME` or an existing `~/.vite-plus` installation, use `<VP_HOME>/env.nu` or `~/.vite-plus/env.nu` instead. Replace placeholders with actual paths and quote paths containing spaces. Open a new Nushell session and run `vp help` to verify the configuration.
|
|
349
395
|
|
|
396
|
+
#### Nushell version
|
|
397
|
+
|
|
398
|
+
Use Nushell 0.112.1 or later. In Nushell, a custom command or alias can have the same name as a built-in command, for example `def update []`. Nushell reads the Vite+ `env.nu` after your configuration. Thus, `env.nu` must call the built-in commands with the [`%` sigil](https://www.nushell.sh/lang-guide/chapters/custom_commands.html#calling-custom-commands), which Nushell 0.112.1 added.
|
|
399
|
+
|
|
400
|
+
`vp env setup` checks the `nu` on `PATH`. With an earlier Nushell, it writes `env.nu` without the sigil. That `env.nu` still works, but a custom command with the name of a built-in command can stop Nushell at startup with `nu::parser::extra_positional` or a similar parse error. After you upgrade Nushell, run `vp env setup` again.
|
|
401
|
+
|
|
402
|
+
If you have more than one Nushell installation, make sure that the `nu` on `PATH` during `vp env setup` is the Nushell that you start. A Nushell earlier than 0.112.1 cannot parse an `env.nu` that `vp env setup` wrote for a later version.
|
|
403
|
+
|
|
350
404
|
#### `CI`
|
|
351
405
|
|
|
352
406
|
- **Purpose**: Indicates running in CI environment
|
|
@@ -374,7 +428,7 @@ For example, `VP_VERSION=1.0.0 vp-setup.exe --version 2.0.0` installs version 2.
|
|
|
374
428
|
|
|
375
429
|
### Homebrew
|
|
376
430
|
|
|
377
|
-
|
|
431
|
+
The [official Homebrew tap](/guide/homebrew) installs the native CLI. The first `vp` command installs matching JavaScript dependencies in your data directory and sets up your shell, shims, and environment-management preferences. Setup stores its state in your directories without writing to the Homebrew prefix.
|
|
378
432
|
|
|
379
433
|
Later commands reuse that setup while the installed binary remains unchanged. Generated shims follow Homebrew's public `vp` entrypoint when Homebrew replaces a version. Setup preserves your saved management preferences during this replacement.
|
|
380
434
|
|
|
@@ -384,11 +438,13 @@ To prefer your existing Node.js and package managers during the first run, use:
|
|
|
384
438
|
VP_NODE_MANAGER=no VP_PM_MANAGER=no vp help
|
|
385
439
|
```
|
|
386
440
|
|
|
387
|
-
After setup, use `vp env off` to change this preference. Commands that need missing runtimes or project dependencies can
|
|
441
|
+
After setup, use `vp env off` to change this preference. The tap still prepares its pinned Node.js and pnpm to install CLI dependencies. Commands that need missing runtimes or project dependencies can also download them.
|
|
388
442
|
|
|
389
443
|
Use Homebrew to [upgrade](/guide/upgrade#homebrew) or [remove](/guide/implode#homebrew) its package.
|
|
390
444
|
|
|
391
|
-
`vp env doctor` identifies the Homebrew
|
|
445
|
+
`vp env doctor` identifies the Homebrew source, formula name, and binary path. It checks the `vp` command and the user shim directory on `PATH` separately. If only the shim directory is missing, follow its shell setup instructions to enable the shims.
|
|
446
|
+
|
|
447
|
+
See the [official tap guide](/guide/homebrew) for registry configuration and migration instructions.
|
|
392
448
|
|
|
393
449
|
## Use It Without a Local Package
|
|
394
450
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Homebrew tap
|
|
2
|
+
|
|
3
|
+
The official tap supports macOS and glibc Linux on ARM64 and x64. Homebrew manages the native `vp` executable; `vp` manages its JavaScript dependencies, downloaded Node.js versions, package managers, and settings in your user directories.
|
|
4
|
+
Stable installation downloads the executable and its dependency lockfile from GitHub Releases. This step needs no existing Node.js or package manager installation, or npm registry access.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
Install the tap:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
brew tap voidzero-dev/vite-plus https://github.com/voidzero-dev/vite-plus
|
|
12
|
+
brew install voidzero-dev/vite-plus/vp
|
|
13
|
+
vp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The explicit repository URL is required because the formula is part of the Vite+ repository.
|
|
17
|
+
If you already use Vite+, follow the [migration steps](#switch-an-existing-installation).
|
|
18
|
+
|
|
19
|
+
## First use
|
|
20
|
+
|
|
21
|
+
On first use, `vp` installs its matching CLI dependencies and configures your shell and tool-management preferences. This step needs access to Node.js downloads and your npm registry.
|
|
22
|
+
Setup uses the release's pinned Node.js and pnpm versions, even if you choose to prefer system tools. A compatible [`VP_SETUP_NODE_VERSION`](/guide/global-cli#vp-setup-node-version) can override the installation runtime without changing Node.js selection for your projects.
|
|
23
|
+
`vp` stores dependencies in `<DATA>/cli-packages/<version>/<platform>`.
|
|
24
|
+
`<DATA>` comes from the [Vite+ directory configuration](/guide/global-cli#installation-variables).
|
|
25
|
+
|
|
26
|
+
Open a new terminal after setup so the shims are available on `PATH`. Later invocations reuse the completed setup.
|
|
27
|
+
Use [`vp env on` and `vp env off`](/guide/env) to change which tools `vp` manages.
|
|
28
|
+
|
|
29
|
+
## Custom npm registry
|
|
30
|
+
|
|
31
|
+
First-run setup reads `~/.npmrc`, including npm-compatible authentication:
|
|
32
|
+
|
|
33
|
+
```ini
|
|
34
|
+
registry=https://registry.example.com/repository/npm/
|
|
35
|
+
//registry.example.com/repository/npm/:_authToken=${NPM_TOKEN}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Export `NPM_TOKEN` before running `vp`. The native pnpm downloader and pnpm dependency installation both use this configuration.
|
|
39
|
+
You can select another file with `NPM_CONFIG_USERCONFIG` or override the registry with `NPM_CONFIG_REGISTRY`.
|
|
40
|
+
Relative user-config paths resolve from your current directory. No Homebrew-specific npm variables are required.
|
|
41
|
+
|
|
42
|
+
Authentication failures stop setup. Fix the configuration and run `vp` again; setup preserves your management choices.
|
|
43
|
+
|
|
44
|
+
## Recover from failed setup
|
|
45
|
+
|
|
46
|
+
Run `vp env doctor` to inspect the executable, dependency directory, and shims. Its CLI dependency check reads local files and does not install or repair dependencies. Other checks can fetch Node.js version metadata.
|
|
47
|
+
|
|
48
|
+
Fix the reported configuration, access, or disk-space problem, then run `vp --help` to retry setup.
|
|
49
|
+
For a lockfile error, the [installer recovery option](/guide/global-cli#vp-setup-skip-install-lockfile) also works with Homebrew:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
VP_SETUP_SKIP_INSTALL_LOCKFILE=1 vp --help
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This resolves dependencies without the published lockfile. A later invocation without the override restores the normal lockfile checks and can reinstall those dependencies.
|
|
56
|
+
If pnpm fails, the reported log contains its exit code and recognized error codes, without raw package-manager output.
|
|
57
|
+
Configured tool shims can run cached Node.js, package managers, and global packages independently of CLI dependency repair.
|
|
58
|
+
|
|
59
|
+
## Switch an existing installation
|
|
60
|
+
|
|
61
|
+
Keep your existing directory settings. Migration preserves your preferences, runtimes, and global packages, and updates their shims to Homebrew's public `vp` command.
|
|
62
|
+
Do not run `vp implode`: it removes that user data. Open a new terminal after switching.
|
|
63
|
+
|
|
64
|
+
### Switch from the script installer
|
|
65
|
+
|
|
66
|
+
Run the `brew tap` and `brew install` commands above. Then invoke Homebrew's executable directly, so an existing script-install shim cannot take precedence:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
"$(brew --prefix)/bin/vp" env setup --refresh
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Switch from Homebrew Core
|
|
73
|
+
|
|
74
|
+
The `vite-plus` formula provides the same commands and must be removed before installing the tap:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
brew tap voidzero-dev/vite-plus https://github.com/voidzero-dev/vite-plus
|
|
78
|
+
brew uninstall vite-plus
|
|
79
|
+
brew install voidzero-dev/vite-plus/vp
|
|
80
|
+
"$(brew --prefix)/bin/vp" env setup --refresh
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Upgrade or remove
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
brew upgrade voidzero-dev/vite-plus/vp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Run `vp` after upgrading to prepare its matching dependencies. Setup preserves your preferences.
|
|
90
|
+
`vp upgrade` identifies the official tap and directs you to `brew upgrade voidzero-dev/vite-plus/vp`.
|
|
91
|
+
|
|
92
|
+
For complete removal, remove your user data before uninstalling the executable:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
vp implode
|
|
96
|
+
brew uninstall voidzero-dev/vite-plus/vp
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`brew uninstall` alone keeps user data. On a shared machine, each operating-system account can remove its own data with `vp implode` before the executable is removed.
|
|
100
|
+
|
|
101
|
+
## Test a preview build
|
|
102
|
+
|
|
103
|
+
Set `HOMEBREW_VP_PR_VERSION` to a PR number or full commit SHA. The PR must have a published `preview-build` that includes Homebrew tap support. Use a full SHA to keep installation and verification on the same commit:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
brew tap voidzero-dev/vite-plus https://github.com/voidzero-dev/vite-plus
|
|
107
|
+
HOMEBREW_VP_PR_VERSION="<full-commit-sha>" brew install voidzero-dev/vite-plus/vp
|
|
108
|
+
HOMEBREW_VP_PR_VERSION="<full-commit-sha>" brew test voidzero-dev/vite-plus/vp
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Use `brew reinstall` instead of `brew install` to replace an installed tap build. If the `vite-plus` formula is installed, run `brew uninstall vite-plus` first; this keeps your user data.
|
|
112
|
+
`brew test` uses temporary user data and does not change your shell configuration. Run `vp` afterward to set up the preview for your account. If switching from the script installer, [refresh its shims](#switch-from-the-script-installer) to use the Homebrew executable.
|
|
113
|
+
|
|
114
|
+
Homebrew downloads only the native preview package from the registry bridge and verifies its checksum. It resolves PR numbers to the latest published commit, which can differ from the current PR head.
|
|
115
|
+
First launch installs the matching dependencies from the bridge. An explicit `NPM_CONFIG_REGISTRY` must point to a registry that also serves those preview packages.
|
|
116
|
+
|
|
117
|
+
The selector is specific to this tap. It does not change other Homebrew formulae, and no npm client is needed during `brew install`.
|
|
118
|
+
To test changes to the formula itself, first check out the PR in the tap repository. Set `HOMEBREW_NO_AUTO_UPDATE=1` for these commands to keep that checkout.
|
|
119
|
+
|
|
120
|
+
To return to a stable release, clear the overrides, restore the tap's `main` branch if you changed its checkout, and update it before reinstalling:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
unset HOMEBREW_VP_PR_VERSION HOMEBREW_NO_AUTO_UPDATE
|
|
124
|
+
git -C "$(brew --repository voidzero-dev/vite-plus)" switch main
|
|
125
|
+
brew update
|
|
126
|
+
brew reinstall voidzero-dev/vite-plus/vp
|
|
127
|
+
```
|
package/docs/guide/implode.md
CHANGED
|
@@ -26,13 +26,15 @@ vp implode --yes
|
|
|
26
26
|
|
|
27
27
|
## Homebrew
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
For the [official Homebrew tap](/guide/homebrew), run `vp implode` first to remove Vite+-managed runtimes, global packages, configuration, shims, and shell entries. Then remove the Homebrew package:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
vp implode
|
|
33
|
-
brew uninstall vite-plus
|
|
33
|
+
brew uninstall voidzero-dev/vite-plus/vp
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
The confirmation prompt explains that the Homebrew package will remain installed. After cleanup, `vp implode`
|
|
36
|
+
The confirmation prompt explains that the Homebrew package will remain installed. After cleanup, `vp implode` shows the uninstall command for the owning formula.
|
|
37
|
+
|
|
38
|
+
To keep your data when switching installations, follow the [migration steps](/guide/homebrew#switch-an-existing-installation) instead of running `vp implode`.
|
|
37
39
|
|
|
38
40
|
Restart your terminal before you run `vp` again. In Bash, you can run `hash -r` instead to clear cached command paths. If the Homebrew package is still installed, the next `vp` command starts first-run setup again.
|
package/docs/guide/local-cli.md
CHANGED
|
@@ -87,6 +87,27 @@ overrides:
|
|
|
87
87
|
|
|
88
88
|
:::
|
|
89
89
|
|
|
90
|
+
::: warning Existing direct dependencies with npm
|
|
91
|
+
If your npm project already lists `vite` in `dependencies` or `devDependencies`, change that entry to the same alias as `overrides.vite`. npm requires a direct dependency and its override to use the [same dependency specification](https://docs.npmjs.com/cli/v11/configuring-npm/package-json/#overrides). Otherwise, `npm install` fails with `EOVERRIDE`.
|
|
92
|
+
|
|
93
|
+
For example, update an existing `vite` development dependency as follows. Keep the other dependencies in your manifest:
|
|
94
|
+
|
|
95
|
+
```json [package.json]
|
|
96
|
+
{
|
|
97
|
+
"devDependencies": {
|
|
98
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@<vite-plus-version>",
|
|
99
|
+
"vite-plus": "<vite-plus-version>"
|
|
100
|
+
},
|
|
101
|
+
"overrides": {
|
|
102
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@<vite-plus-version>",
|
|
103
|
+
"vitest": "<vitest-version>"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If you also declare `vitest` directly, set its dependency entry to the exact version in `overrides.vitest`. Run `npm install` after these changes to update the lockfile and installed dependencies.
|
|
109
|
+
:::
|
|
110
|
+
|
|
90
111
|
::: details Why are these settings needed?
|
|
91
112
|
|
|
92
113
|
Dependencies and plugins can import `vite` or `vitest` directly, even when your own code imports from `vite-plus`. These overrides align their dependencies with the toolchain Vite+ uses:
|
|
@@ -18,11 +18,31 @@ Migration is idempotent: running it again after a successful migration should no
|
|
|
18
18
|
|
|
19
19
|
On a project that already depends on `vite-plus`, `vp migrate` performs an upgrade only: it updates dependencies and package-manager configuration and finalizes imports. It does not touch project setup.
|
|
20
20
|
|
|
21
|
-
- `--full` also runs the setup actions: git hooks, editor config, agent files, ESLint, Prettier, and
|
|
21
|
+
- `--full` also runs the setup actions: git hooks, editor config, agent files, ESLint, Prettier, tsup, and tsx migration, framework shims, the tsconfig `baseUrl` fix, and the Volta to `.node-version` conversion.
|
|
22
22
|
- `--hooks`, `--agent`, and `--editor` opt into a single setup action without `--full`.
|
|
23
23
|
|
|
24
24
|
When a default upgrade skips setup actions that would apply, it prints a hint to run `vp migrate --full`. Fresh (non Vite+) projects always run the full migration.
|
|
25
25
|
|
|
26
|
+
## Oxlint JSON Inheritance
|
|
27
|
+
|
|
28
|
+
When `.oxlintrc.json` or `.oxlintrc.jsonc` uses `extends`, `vp migrate` resolves each file path relative to the config that declares it. It creates shared TypeScript configs and imports them through `lint.extends`, including nested inheritance. Oxlint applies the existing merge order, rule severities, and overrides. Plain `vp lint` uses the migrated rules without a `-c` flag.
|
|
29
|
+
|
|
30
|
+
Migration assumes ESM projects. Shared configs become sibling `.ts` files. Imports from JavaScript and TypeScript configs use `.js` specifiers, which Vite and TypeScript resolve to the generated source files without changing compiler settings. File-level TypeScript pragmas stay before generated imports. Workspace consumers reuse the same generated modules, including the workspace that owns a shared config. Migration defaults stay in each workspace's local `lint` block. Edit these TypeScript files to update shared settings. Original shared JSON and JSONC files remain available to other consumers; edits to those originals do not update the migrated configs.
|
|
31
|
+
|
|
32
|
+
JS-plugin declarations stay in their original config or override. Relative plugin paths become absolute paths at runtime through `fileURLToPath(new URL(..., import.meta.url))`. Explicit inherited `typeAware` and `typeCheck` settings take precedence over migration defaults.
|
|
33
|
+
|
|
34
|
+
Cleanup removes each completed workspace symlink independently. Shared aliases that remain on disk keep their targets and dependencies available.
|
|
35
|
+
|
|
36
|
+
A shared config's owner keeps `env`, `globals`, `settings`, and `ignorePatterns` at the top level of its `lint` block through references to the shared module. Edits to these fields apply to the owner. Other consumers do not inherit them.
|
|
37
|
+
|
|
38
|
+
Generated modules include a source marker. A later migration attempt reuses these modules without replacing user edits, so a preserved consumer can migrate after its conflict is resolved. Existing modules without a matching marker remain conflicts.
|
|
39
|
+
|
|
40
|
+
Failed merges and existing `lint` blocks record a pending marker in the Vite config, so an isolated failure can be retried after the conflict is resolved. A successful merge removes this marker. Completed workspace merges record a completion marker, including configs merged inline. After fixing an unreadable config, run `vp migrate` again to migrate the remaining consumers and remove JSON files that are no longer needed.
|
|
41
|
+
|
|
42
|
+
Shared config imports use literal paths so Vite and TypeScript can resolve filenames containing `#` or `%`. A relative import path containing `?` or a literal backslash requires a manual migration: Vite treats `?` as a query delimiter, and TypeScript treats backslashes as path separators. Migration preserves the JSON config and reports a warning in these cases.
|
|
43
|
+
|
|
44
|
+
Missing files, invalid JSON, inheritance cycles, conflicting output files, and package-local plugins that resolve differently from the Vite config directory produce a warning and leave the original config in place. Configs outside the project or workspace, configs inside `node_modules`, CommonJS Vite configs, and an existing `lint` block require a manual merge. Workspace JSON removal waits until all migration outcomes are known. Preserved JSON consumers retain their transitive dependencies, including configs whose owners migrated successfully. If an inheritance graph cannot be read, workspace JSON files are kept and their owners use shared modules, because the unreadable consumer can reference them. `vp lint` continues to reject string paths in `lint.extends`; path resolution happens only during migration.
|
|
45
|
+
|
|
26
46
|
## Pack Configuration
|
|
27
47
|
|
|
28
48
|
`vp migrate` updates static `pack` objects in `vite.config.*` and exported objects in `tsdown.config.*` for [tsdown 0.23](https://github.com/rolldown/tsdown/releases/tag/v0.23.0). This also runs on existing Vite+ projects without `--full`, including workspace packages. Arrays and direct objects returned by `defineConfig` callbacks are supported. JSON tsdown configs receive the same updates after they merge into `vite.config.ts`.
|
|
@@ -180,11 +200,13 @@ Object-valued nested npm and Bun overrides are preserved: they are user-defined
|
|
|
180
200
|
|
|
181
201
|
`vite` and `vite/*` imports are rewritten to `vite-plus` **only in config entry files**: `vite.config.*`, `vitest.config.*`, and any config file the migration resolved. Every other file keeps its `vite` imports, for two reasons:
|
|
182
202
|
|
|
183
|
-
- `vite-plus` is not a guaranteed superset of Vite's exposed surface. It owns only `defineConfig`, `defineProject`, and `
|
|
203
|
+
- `vite-plus` is not a guaranteed superset of Vite's exposed surface. It owns only `defineConfig`, `defineProject`, `lazyPlugins`, and `resolveConfigFromFile`, so rewriting a pass-through symbol such as `createBuilder` or `loadConfigFromFile` (including in `typeof import('vite')` type positions) can break.
|
|
184
204
|
- An unrewritten `vite` import still resolves through the `@voidzero-dev/vite-plus-core` alias in a Vite+ project.
|
|
185
205
|
|
|
186
206
|
Plugin packages (an unscoped name starting with `vite-plugin-` or `unplugin-`, or `vite` in `peerDependencies`/`dependencies`) skip the rewrite even in config files. Only the `vite` specifier is in scope for this rule.
|
|
187
207
|
|
|
208
|
+
`vite/rolldown` and `vite/rolldown/*` are never rewritten, because `vite-plus` does not export those subpaths; they keep resolving through the core alias.
|
|
209
|
+
|
|
188
210
|
`declare module 'vite'` augmentations follow the same rule and are preserved outside config files. Through the core alias they reach the same `@voidzero-dev/vite-plus-core` module whose `UserConfig` types `defineConfig` from `vite-plus`, so they keep working after migration; `vite-plus` itself exports no `UserConfig` symbol, so a rewritten `declare module 'vite-plus'` augmentation would merge with nothing. Extensions aimed at `vite-plus`'s own surface are written against `vite-plus` by hand.
|
|
189
211
|
|
|
190
212
|
### `vitest` and Browser Imports
|
|
@@ -228,19 +250,22 @@ The `prefer-vite-plus-imports` lint rule follows the same Nuxt exception, so lin
|
|
|
228
250
|
|
|
229
251
|
Migration rewrites commands provided by the Vite+ toolchain in `package.json` scripts while preserving their arguments:
|
|
230
252
|
|
|
231
|
-
| Before | After
|
|
232
|
-
| ------------- |
|
|
233
|
-
| `vite` | `vp dev`, or the matching `vp` subcommand
|
|
234
|
-
| `vitest` | `vp test`
|
|
235
|
-
| `oxlint` | `vp lint`
|
|
236
|
-
| `oxfmt` | `vp fmt`
|
|
237
|
-
| `tsdown` | `vp pack`
|
|
238
|
-
| `lint-staged` | `vp staged`
|
|
239
|
-
| `eslint` | `vp lint`, when its optional migration runs
|
|
240
|
-
| `prettier` | `vp fmt`, when its optional migration runs
|
|
241
|
-
| `tsup` | `vp pack`, when its optional migration runs
|
|
242
|
-
|
|
243
|
-
|
|
253
|
+
| Before | After |
|
|
254
|
+
| ------------- | -------------------------------------------- |
|
|
255
|
+
| `vite` | `vp dev`, or the matching `vp` subcommand |
|
|
256
|
+
| `vitest` | `vp test` |
|
|
257
|
+
| `oxlint` | `vp lint` |
|
|
258
|
+
| `oxfmt` | `vp fmt` |
|
|
259
|
+
| `tsdown` | `vp pack` |
|
|
260
|
+
| `lint-staged` | `vp staged` |
|
|
261
|
+
| `eslint` | `vp lint`, when its optional migration runs |
|
|
262
|
+
| `prettier` | `vp fmt`, when its optional migration runs |
|
|
263
|
+
| `tsup` | `vp pack`, when its optional migration runs |
|
|
264
|
+
| `tsx` | `vpx`, when its optional migration runs |
|
|
265
|
+
| `oxnode` | `vpx`, when its optional migration runs |
|
|
266
|
+
| `ts-node` | `vpx`, for supported transpile-only commands |
|
|
267
|
+
|
|
268
|
+
For commands launched through `bunx`, migration preserves `bunx` and its `--bun` flag (keeping the user's chosen runtime) and rewrites only the managed command. tsx is the exception: `bunx tsx` becomes `vpx`, and `bunx --bun tsx` keeps tsx (see [tsx to `vpx`](#tsx-to-vpx)). This also works when `bunx` follows a command-launcher delimiter such as `run` or `--`:
|
|
244
269
|
|
|
245
270
|
| Before | After |
|
|
246
271
|
| ------------------------------------------------------- | -------------------------------------------------------- |
|
|
@@ -251,16 +276,93 @@ For commands launched through `bunx`, migration preserves `bunx` and its `--bun`
|
|
|
251
276
|
|
|
252
277
|
Unrelated `bunx` commands and other package-executor forms remain unchanged.
|
|
253
278
|
|
|
279
|
+
### tsx to `vpx`
|
|
280
|
+
|
|
281
|
+
When a `package.json` script, a lint-staged task, or a `#!/usr/bin/env tsx` shebang runs [tsx](https://tsx.is), migration offers to move it to [`vpx`](/guide/vpx), Vite+'s TypeScript script runner. It rewrites scripts and lint-staged tasks in `package.json` and JSON lint-staged files, and `#!/usr/bin/env tsx` shebangs in script files:
|
|
282
|
+
|
|
283
|
+
| Before | After |
|
|
284
|
+
| -------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
285
|
+
| `tsx src/seed.ts --rows 10` | `vpx src/seed.ts --rows 10` |
|
|
286
|
+
| `tsx watch --include "*.json" src/a.ts` | `vpx --watch --include "*.json" src/a.ts` |
|
|
287
|
+
| `npx tsx a.ts`, `pnpm exec tsx a.ts`, `pnpm dlx tsx a.ts`, `bunx tsx a.ts` | `vpx a.ts` |
|
|
288
|
+
| `node --import tsx ./a.ts` | `node --import vite-plus/register ./a.ts` |
|
|
289
|
+
| `node --import=tsx --test` | `node --import=vite-plus/register --test` |
|
|
290
|
+
| `NODE_OPTIONS='--import tsx' mocha` | `NODE_OPTIONS='--import vite-plus/register' mocha` |
|
|
291
|
+
| `cross-env NODE_ENV=dev tsx a.ts` | `cross-env NODE_ENV=dev vpx a.ts` |
|
|
292
|
+
| `concurrently "tsx watch a.ts" "vp dev"` | `concurrently "vpx --watch a.ts" "vp dev"` |
|
|
293
|
+
|
|
294
|
+
`tsx watch` becomes `vpx --watch`, never `vpx watch`, which runs the npm package `watch`. Node.js options and tsx watch options keep their order, and `--no-cache` is dropped. A quoted command is rewritten only for programs that run it, such as `concurrently`, `nodemon --exec`, `sh -c`, and `cross-env-shell`; a quoted argument of other programs, as in `echo "tsx a.ts"`, is data. `vpx` needs the same Node.js versions as Vite+ itself, and migration already upgrades incompatible runtime pins to them (see [Vitest 5](/guide/vitest-v5)).
|
|
295
|
+
|
|
296
|
+
The plain `node --import tsx` and `node --import=tsx` forms keep Node.js, its options, wrappers, and arguments. They use [`vite-plus/register`](/guide/vpx#using-nodejs-directly), so Node.js retains its eval, test discovery, and native watch behavior. Literal `NODE_OPTIONS` assignments also migrate, including assignments through `cross-env` and known command launchers. `vite-plus/register` accepts `TSX_TSCONFIG_PATH` as a fallback. Assignments that also load a legacy tsx hook, or reach a command that still needs tsx, stay unchanged.
|
|
297
|
+
|
|
298
|
+
For the tsx executable and legacy loader forms such as `--loader tsx/esm` and `-r tsx/cjs`, migration keeps the existing `vpx` rules. It keeps tsx, with a warning, for `--eval`, `--print`, or `--check`, the REPL, `--test` without files or in watch mode, an entry without a file extension, or commands that load tsx through `NODE_OPTIONS`. Commands with pipes, variables, or subshells also stay unchanged. `vpx` accepts `TSX_TSCONFIG_PATH` as a fallback too; an explicit `--tsconfig` takes priority.
|
|
299
|
+
|
|
300
|
+
Both migration paths read the scripts a command names, including local `--require` and `--import` modules. They keep tsx when a script does not exist yet, as when an earlier command generates it, or when the Vite+ loader would fail on it: a `require()` of `./a.js` that only tsx resolves to `a.ts`, a `.cts` file with `import` or `export`, or a file that mixes `import` with `__dirname`, `__filename`, `require()`, or `module.exports` in a package without `"type": "module"`. This check skips globs and scripts after a `cd` or another shell state change, and reads only the files a command names, not the modules they import. It does not look for other compiler differences, such as standard decorators, tsconfig `paths` in `require()`, or a tsconfig `module` of `node16` or `nodenext`; the loader reports those when the script runs. A package that lists tsx in `dependencies`, `optionalDependencies`, or `peerDependencies` keeps it too, since the replacement comes from the `vite-plus` devDependency.
|
|
301
|
+
|
|
302
|
+
Migration removes the `tsx` devDependency only when nothing uses tsx anymore: no kept script, no import of `tsx` or its subpaths such as `tsx/esm/api` (in source, build output, or a `package.json` `imports` alias), no shebang, no tool setting such as `--import=tsx` in `package.json` or a JSON or JavaScript config, and no tsx command in CI workflows, git hooks, or shell scripts. The root's dependency stays while any workspace package still uses tsx, and a package's dependency stays while a nested package under it does. When tsx stays, the warning names what still uses it.
|
|
303
|
+
|
|
304
|
+
Tool configurations and source files need manual edits. For example, change `nodeArguments: ['--import=tsx']` to `nodeArguments: ['--import=vite-plus/register']`, or Mocha's `"import": "tsx"` setting to `"import": "vite-plus/register"`. Keep tsx if the project uses its programmatic APIs.
|
|
305
|
+
|
|
306
|
+
See [Coming from tsx](/guide/vpx#coming-from-tsx) for the other differences.
|
|
307
|
+
|
|
308
|
+
### oxnode to `vpx`
|
|
309
|
+
|
|
310
|
+
Migration offers to replace `oxnode`, the command from `@oxc-node/cli`, with `vpx`. It rewrites `package.json` scripts, lint-staged tasks in `package.json` and JSON files, and `#!/usr/bin/env oxnode` shebangs. Node.js preload shebangs such as `#!/usr/bin/env -S node --import @oxc-node/core/register` keep Node.js and use `vite-plus/register`, including in extensionless scripts. The migration preserves the shebang's `env` syntax, flags, and relative paths. On a project that already uses Vite+, run `vp migrate --full` to include this migration.
|
|
311
|
+
|
|
312
|
+
| Before | After |
|
|
313
|
+
| --------------------------------------------------------- | ---------------------------------------------------- |
|
|
314
|
+
| `oxnode ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
315
|
+
| `oxnode -C dev ./build.ts` | `vpx -C dev ./build.ts` |
|
|
316
|
+
| `oxnode watch --include "config/*.json" ./server.ts` | `vpx --watch --include "config/*.json" ./server.ts` |
|
|
317
|
+
| `node --import @oxc-node/core/register ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
318
|
+
| `NODE_OPTIONS='--import @oxc-node/core/register' mocha` | `NODE_OPTIONS='--import vite-plus/register' mocha` |
|
|
319
|
+
|
|
320
|
+
The `node --import @oxc-node/core/register` and `register.mjs` forms keep Node.js, its wrappers, arguments, and native watch, eval, and test modes. Literal `NODE_OPTIONS` assignments also use the public preload. Commands that use the `oxnode` executable follow the `vpx` rules instead: `oxnode --watch` stays unchanged because it starts Node.js's watcher, while `oxnode watch` and `vpx --watch` use oxc-node's watcher.
|
|
321
|
+
|
|
322
|
+
Commands that explicitly set `OXC_TRANSFORM_ALL` to anything other than `typescript` stay unchanged. Nonempty `VP_SCRIPT_TSCONFIG` and `TSX_TSCONFIG_PATH` assignments also stay unchanged because they would change config selection. Commands that read an environment file stay unchanged because it can select a different transform mode. Migration checks the named script and local preloads for standalone oxc-node API usage, which would configure a different loader after migration; it does not follow their imports.
|
|
323
|
+
|
|
324
|
+
Custom asynchronous `--loader` and `--experimental-loader` hooks stay in their original order when the register import changes. This supports project loaders for resolution and assets alongside the Vite+ TypeScript loader. It does not establish compatibility with a second TypeScript transformer or arbitrary synchronous `module.registerHooks()` chains.
|
|
325
|
+
|
|
326
|
+
Direct `oxnode` commands and Node.js preload commands stay unchanged when an additional `--require` or `--import` can change loader settings. Node.js commands also stay unchanged when inline code still calls standalone oxc-node APIs. Migration checks explicit local shebang loaders relative to the owning package for standalone API references, without following their imports. It leaves the paths unchanged: at runtime, relative loader paths use the caller's working directory, not the script's directory.
|
|
327
|
+
|
|
328
|
+
The `@oxc-node/cli` and `@oxc-node/core` development dependencies are removed only when no remaining use needs them. Loader references, API imports, CI commands, hooks, and shell scripts can keep these dependencies installed. Migration also checks files named by `--env-file` and `--env-file-if-exists`, regardless of their filename. If it cannot resolve or read an environment file, it keeps the dependencies for manual review. Runtime and peer dependencies stay in place.
|
|
329
|
+
|
|
330
|
+
### ts-node to `vpx`
|
|
331
|
+
|
|
332
|
+
Migration offers to replace supported ts-node commands with `vpx` only when type-checking is explicitly disabled. Plain `ts-node` type-checks before execution; `vpx` does not. Commands that still type-check stay unchanged with a warning, even when another option enables transpile-only mode.
|
|
333
|
+
|
|
334
|
+
| Before | After |
|
|
335
|
+
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
336
|
+
| `ts-node --transpileOnly ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
337
|
+
| `ts-node -T -P tsconfig.scripts.json ./scripts/seed.ts` | `vpx --tsconfig=tsconfig.scripts.json ./scripts/seed.ts` |
|
|
338
|
+
| `ts-node-transpile-only ./scripts/seed.ts` | `vpx ./scripts/seed.ts` |
|
|
339
|
+
| `node -r ts-node/register/transpile-only ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
340
|
+
| `node --loader ts-node/esm/transpile-only ./scripts/seed.ts` | `node --import vite-plus/register ./scripts/seed.ts` |
|
|
341
|
+
| `NODE_OPTIONS='--require ts-node/register/transpile-only' node ./scripts/seed.ts` | `NODE_OPTIONS='--import vite-plus/register' node ./scripts/seed.ts` |
|
|
342
|
+
|
|
343
|
+
The migration also reads `transpileOnly` and `typeCheck` from local JSONC tsconfig files, local `extends` chains, and literal `TS_NODE_TRANSPILE_ONLY` / `TS_NODE_TYPE_CHECK` assignments. `-P`, `--project`, and `TS_NODE_PROJECT` select the configuration. A directory passed to `-P` or `--project` resolves to its `tsconfig.json`; a directory in `TS_NODE_PROJECT` stays unchanged. When ts-node discovers a config implicitly, migration pins that file with `--tsconfig` so `vpx` uses it for the whole run. `ts-node-esm` and `--esm` are supported when type-checking is disabled.
|
|
344
|
+
|
|
345
|
+
If an existing config and its local `extends` chain omit both `target` and `useDefineForClassFields`, the command stays unchanged with a warning. ts-node defaults to assignment semantics for class fields in this case, while `vpx` defaults to define semantics. Set `compilerOptions.useDefineForClassFields` to `false` to preserve assignment semantics before migrating.
|
|
346
|
+
|
|
347
|
+
Supported Node.js preload commands keep Node.js and replace both the old loader option and module with `--import vite-plus/register`. Literal `NODE_OPTIONS` assignments also migrate when they reach a known `node` command and pass the same checks. An existing `TS_NODE_PROJECT` file selection stays in place. A preload that needs an implicit config pinned stays unchanged: set `TS_NODE_PROJECT` to the config file before migration, because Node.js cannot take `--tsconfig`.
|
|
348
|
+
|
|
349
|
+
Preloads also stay unchanged when the working directory has no config but the entry file would discover a different one. Migration does not scan imported modules for additional config files.
|
|
350
|
+
|
|
351
|
+
Custom compilers, transpilers, SWC, ts-node compiler overrides, unsupported configuration inheritance, eval, and REPL usage stay unchanged. Environment files, Node.js config files, additional preloads, and unsupported `NODE_OPTIONS` assignments also keep the original command because they can change ts-node settings before registration. Nonempty `VP_SCRIPT_TSCONFIG`, `TSX_TSCONFIG_PATH`, or `OXC_TSCONFIG_PATH` assignments stay unchanged because they would select a different config. Migration checks named scripts for known module incompatibilities; it does not follow their imports. Migrated scripts use the [tsconfig and module rules of `vpx`](/guide/vpx#tsconfig).
|
|
352
|
+
|
|
353
|
+
Entries with static imports or re-exports of CommonJS values also stay unchanged. This includes named, namespace, and default bindings, `.js` files in CommonJS packages, and package entry points. Migration checks both import and require resolution without executing dependencies. Unresolved targets and targets that differ between these modes stay unchanged for manual review. Even `esModuleInterop: true` can unwrap a CommonJS `__esModule.default` value differently from Node.js, so that setting alone does not make a default import safe. Type-only imports and exports, imports used only for side effects, checked ES module targets, and named Node.js built-in bindings do not trigger this check.
|
|
354
|
+
|
|
355
|
+
As with oxnode, migration rewrites package scripts, JSON lint-staged tasks, and supported env shebangs. Shebangs that need a pinned config stay unchanged because the config path depends on the caller's working directory. Existing Vite+ projects use `vp migrate --full`. The `ts-node` development dependency is removed only when no remaining command, loader, API import, or config reference needs it. Runtime and peer dependencies remain, and `typescript` is not removed.
|
|
356
|
+
|
|
254
357
|
## Continuous Integration Rules
|
|
255
358
|
|
|
256
359
|
Migration replaces exact `voidzero-dev/setup-vp@v1` references in GitHub Actions workflows and composite actions under `.github` with the latest exact `setup-vp` release known to that Vite+ version. The frozen `v1` tag does not receive new releases. Existing exact versions and commit SHAs are left unchanged.
|
|
257
360
|
|
|
258
361
|
## Node.js Version Rules
|
|
259
362
|
|
|
260
|
-
Migration converts
|
|
363
|
+
Migration converts the Volta `volta.node` pin to `.node-version`, because Vite+ does not read Volta. On an existing Vite+ project this conversion is part of the full setup bucket, so it runs with `vp migrate --full`; fresh migrations run it unconditionally.
|
|
261
364
|
|
|
262
|
-
- `.nvmrc` and Volta
|
|
263
|
-
- When `.nvmrc` is removed, any `actions/setup-node` `node-version-file: .nvmrc` reference in `.github/workflows/*.{yml,yaml}` and composite actions under `.github` (`.github/**/action.{yml,yaml}`) is repointed to `.node-version` so CI does not fail with "node version file ... does not exist".
|
|
365
|
+
- When `.node-version` or `.nvmrc` exists, migration keeps it and skips the Volta conversion. Vite+ reads both files directly (see [Node.js Selection](/guide/env#node-js-selection)).
|
|
264
366
|
|
|
265
367
|
## Package-Manager Rules
|
|
266
368
|
|
package/docs/guide/migrate.md
CHANGED
|
@@ -8,7 +8,7 @@ import { migrationPrompt, upgradePrompt } from '../.vitepress/theme/data/migrati
|
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, and
|
|
11
|
+
This command is the starting point for consolidating separate Vite, Vitest, Oxlint, Oxfmt, ESLint, Prettier, tsdown, tsup, tsx, oxnode, and ts-node setups into Vite+.
|
|
12
12
|
|
|
13
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.
|
|
14
14
|
|
|
@@ -95,21 +95,21 @@ Upgrade the [global CLI](./upgrade.md#global-vp) to your target 1.0 release, the
|
|
|
95
95
|
|
|
96
96
|
### Without the Global CLI
|
|
97
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.
|
|
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.5.0` release:
|
|
99
99
|
|
|
100
100
|
::: code-group
|
|
101
101
|
|
|
102
102
|
```bash [pnpm]
|
|
103
|
-
pnpm dlx --package=vite-plus@1.
|
|
103
|
+
pnpm dlx --package=vite-plus@1.5.0 vp migrate --no-interactive
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
```bash [npm]
|
|
107
|
-
npx --package=vite-plus@1.
|
|
107
|
+
npx --package=vite-plus@1.5.0 vp migrate --no-interactive
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
:::
|
|
111
111
|
|
|
112
|
-
Replace `1.
|
|
112
|
+
Replace `1.5.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
113
|
|
|
114
114
|
After migration, finish dependency installation and validate with the updated local CLI:
|
|
115
115
|
|
|
@@ -151,7 +151,7 @@ View and copy this prompt into your coding agent to upgrade an existing Vite+ 0.
|
|
|
151
151
|
|
|
152
152
|
### Vitest
|
|
153
153
|
|
|
154
|
-
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.0
|
|
154
|
+
Vitest is automatically migrated through `vp migrate`. `vite-plus` re-exports upstream `vitest@5.1.0` 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
155
|
|
|
156
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
157
|
|
|
@@ -234,11 +234,11 @@ export default defineConfig({
|
|
|
234
234
|
});
|
|
235
235
|
```
|
|
236
236
|
|
|
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
|
|
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/commit-hooks) and [Staged Config](/config/staged) for details.
|
|
238
238
|
|
|
239
239
|
### Git hook tools
|
|
240
240
|
|
|
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
|
|
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/commit-hooks).
|
|
242
242
|
|
|
243
243
|
Existing project-owned Vite+ hooks are also preserved. The default staged workflow is introduced only when no existing hook policy is found.
|
|
244
244
|
|
|
@@ -246,7 +246,7 @@ If your project currently uses `lefthook`, `simple-git-hooks`, or `yorkie`, `vp
|
|
|
246
246
|
|
|
247
247
|
If you want to move one of those tools over to Vite+ manually, you can follow these steps. First, move your staged-file commands into the `staged` block within `vite.config.ts`. Then, update your lifecycle script so it runs `vp config`. You will also need to create a Vite+ hook at `.vite-hooks/pre-commit` that runs `vp staged`. Run `vp hooks enable` (or `vp config`) to install the dispatcher and set `core.hooksPath`. Finally, once you have confirmed that the Vite+ hook is working as expected, you can remove the old tool's configuration and dependency.
|
|
248
248
|
|
|
249
|
-
Use `vp hooks status` to verify the dispatcher is active, and `vp hooks disable` if you need to turn it off again in this clone. You can find more details about the full Vite+ hook setup in the [Commit
|
|
249
|
+
Use `vp hooks status` to verify the dispatcher is active, and `vp hooks disable` if you need to turn it off again in this clone. You can find more details about the full Vite+ hook setup in the [Commit Hooks](/guide/commit-hooks).
|
|
250
250
|
|
|
251
251
|
## Examples
|
|
252
252
|
|
|
@@ -212,7 +212,7 @@ Use these when you need lower-level package-manager behavior.
|
|
|
212
212
|
- **Patching**: `patch`, `patch-commit`
|
|
213
213
|
- **Packaging and publishing**: `pack`, `version`, `publish`, `stage`, `dist-tag`, `deprecate`
|
|
214
214
|
- **Inspection**: `view`, `search`, `licenses`, `audit`, `fund`, `ping`
|
|
215
|
-
- **Authentication and access**: `login`, `logout`, `whoami`, `token`, `owner`
|
|
215
|
+
- **Authentication and access**: `login`, `logout`, `whoami`, `token`, `owner`, `team`
|
|
216
216
|
- **Configuration**: `config`, `cache`
|
|
217
217
|
- **Package manifest**: `pkg get`, `pkg set`, `pkg delete`, `pkg fix`
|
|
218
218
|
|
package/docs/guide/run.md
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
`vpr` is available as a standalone shorthand for `vp run`. All examples below work with both `vp run` and `vpr`.
|
|
7
7
|
:::
|
|
8
8
|
|
|
9
|
+
::: info
|
|
10
|
+
Vite Task parses simple commands and `&&` chains itself instead of passing them to a shell, so they behave the same on every platform. Other shell syntax, such as pipes or redirects, may behave differently across platforms.
|
|
11
|
+
:::
|
|
12
|
+
|
|
9
13
|
## Overview
|
|
10
14
|
|
|
11
15
|
Use `vp run` with existing `package.json` scripts:
|
|
@@ -232,7 +236,7 @@ vp run -w build
|
|
|
232
236
|
|
|
233
237
|
## Compound Commands
|
|
234
238
|
|
|
235
|
-
Commands joined with `&&` are split into independent sub-tasks. Each sub-task is cached separately when [caching is enabled](/guide/cache#when-is-caching-enabled). This works for both `vite.config.ts` tasks and `package.json` scripts:
|
|
239
|
+
Commands joined with `&&` are split into independent sub-tasks, unless they also use other shell syntax. Each sub-task is cached separately when [caching is enabled](/guide/cache#when-is-caching-enabled). This works for both `vite.config.ts` tasks and `package.json` scripts:
|
|
236
240
|
|
|
237
241
|
```json [package.json]
|
|
238
242
|
{
|
|
@@ -266,6 +270,24 @@ $ vp build ○ cache miss: 'index.html' modified, executing
|
|
|
266
270
|
vp run: 1/2 cache hit (50%), 2/2 successful, 120ms saved.
|
|
267
271
|
```
|
|
268
272
|
|
|
273
|
+
### Environment Variable Prefixes
|
|
274
|
+
|
|
275
|
+
Environment variable prefixes such as `FOO=bar command` work on every platform, without extra tools like `cross-env`:
|
|
276
|
+
|
|
277
|
+
```json [package.json]
|
|
278
|
+
{
|
|
279
|
+
"scripts": {
|
|
280
|
+
"build": "NODE_ENV=production node build.js"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
A prefix applies only to the command it directly precedes. In `FOO=1 a && b`, `FOO` is set for `a` but not for `b`.
|
|
286
|
+
|
|
287
|
+
::: warning
|
|
288
|
+
Prefixes may not work on every platform when the command also uses other shell syntax.
|
|
289
|
+
:::
|
|
290
|
+
|
|
269
291
|
### Nested `vp run`
|
|
270
292
|
|
|
271
293
|
When a command contains `vp run`, Vite Task inlines it as separate tasks instead of spawning a nested process. Each sub-task is cached independently and output stays flat:
|