vite-plus 0.2.8 → 0.3.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 +7 -0
- package/README.md +13 -6
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +100 -3
- package/dist/{agent-CI79DuSy.js → agent-Wqx0MPk0.js} +4 -188
- package/dist/bin.js +298 -278
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +29 -15
- package/dist/{constants-BppDcRc1.js → constants-Bn-U8o4v.js} +13 -3
- package/dist/create/bin.js +197 -247
- package/dist/{define-config-DPnHe1Mx.js → define-config-GXUdVT-0.js} +3 -3
- package/dist/{define-config-CEm_MtvJ.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{editor-CGWdbLgD.js → editor-CC4DqODz.js} +736 -153
- package/dist/{terminal-CrqqK8WT.js → help-BmKpeOP9.js} +27 -34
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +131 -0
- package/dist/hooks-DFqViZqZ.js +573 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-BU88uu6o.js → json-cULBl7Pi.js} +145 -139
- package/dist/migration/bin.js +67 -21
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-DX5ezKbB.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +5 -4
- package/dist/{package-hV-77cBb.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-DYap08te.js → prompts-DF3yU-eU.js} +136 -512
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-ipGb39Jo.js} +2 -9
- package/dist/staged/bin.js +299 -251
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/test/browser/providers/playwright/context.d.ts +1 -1
- package/dist/test/browser/providers/playwright.d.ts +6 -6
- package/dist/test/browser/providers/preview/context.d.ts +1 -1
- package/dist/test/browser/providers/preview.d.ts +4 -4
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
- package/dist/test/browser/providers/webdriverio.d.ts +6 -6
- package/dist/test/browser-playwright/context.d.ts +1 -1
- package/dist/test/browser-playwright.d.ts +6 -6
- package/dist/test/browser-preview/context.d.ts +1 -1
- package/dist/test/browser-preview.d.ts +4 -4
- package/dist/test/browser-webdriverio/context.d.ts +1 -1
- package/dist/test/browser-webdriverio.d.ts +6 -6
- package/dist/test/context.d.ts +3 -3
- package/dist/test/locators.d.ts +1 -1
- package/dist/toolchain.d.ts +25 -0
- package/dist/toolchain.js +194 -0
- package/dist/toolchain.json +193 -0
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-CVUKLfL8.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -4
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +87 -14
- package/docs/guide/create.md +7 -4
- package/docs/guide/env.md +20 -6
- package/docs/guide/fmt.md +2 -2
- package/docs/guide/github-actions-cache.md +5 -1
- package/docs/guide/ide-integration.md +61 -2
- package/docs/guide/index.md +3 -1
- package/docs/guide/install.md +27 -1
- package/docs/guide/installer-env-vars.md +53 -6
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +41 -4
- package/docs/guide/monorepo.md +4 -4
- package/docs/guide/test.md +8 -0
- package/docs/guide/troubleshooting.md +12 -4
- package/docs/guide/upgrade.md +75 -5
- package/package.json +36 -33
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-DT25H9pj.js +0 -3
- package/docs/_data/team.ts +0 -131
- package/docs/package.json +0 -30
- package/docs/pnpm-lock.yaml +0 -4003
- package/docs/pnpm-workspace.yaml +0 -6
- package/docs/public/checkmark.svg +0 -1
- package/docs/public/cta-background.jpg +0 -0
- package/docs/public/favicon.svg +0 -1
- package/docs/public/icon.svg +0 -1
- package/docs/public/logo.svg +0 -1
- package/docs/public/og.jpg +0 -0
- package/docs/vite.config.ts +0 -17
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
- package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
|
@@ -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**:
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -100,6 +134,17 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
|
|
|
100
134
|
- **Default**: None (verification enabled)
|
|
101
135
|
- **Details**: [Node.js Signature Verification](/guide/env#node-js-signature-verification)
|
|
102
136
|
|
|
137
|
+
### `VP_DOWNLOAD_TIMEOUT`
|
|
138
|
+
|
|
139
|
+
- **Purpose**: Per-request timeout, in seconds, for large downloads such as Node.js runtimes and package-manager tarballs
|
|
140
|
+
- **Values**: Positive integer, at most `86400` (24 hours); invalid values are ignored with a warning
|
|
141
|
+
- **Default**: `600` (10 minutes)
|
|
142
|
+
- **Example**:
|
|
143
|
+
```bash
|
|
144
|
+
# Allow up to 30 minutes per download on a slow connection
|
|
145
|
+
VP_DOWNLOAD_TIMEOUT=1800 vp env install 22
|
|
146
|
+
```
|
|
147
|
+
|
|
103
148
|
### `VP_SHELL`
|
|
104
149
|
|
|
105
150
|
- **Purpose**: Specify the current shell
|
|
@@ -150,11 +195,13 @@ Vite+ sets additional `VP_*` variables during shim dispatch and shell integratio
|
|
|
150
195
|
### `VP_LOG`
|
|
151
196
|
|
|
152
197
|
- **Purpose**: Log filter string for `tracing_subscriber`
|
|
198
|
+
- **Installer behavior**: When `CI=true`, `install.sh` hides shell file errors.
|
|
199
|
+
Set `VP_LOG=trace` to show these errors.
|
|
153
200
|
- **Default**: None
|
|
154
201
|
- **Example**:
|
|
155
202
|
```bash
|
|
156
203
|
VP_LOG=debug vp dev
|
|
157
|
-
VP_LOG=
|
|
204
|
+
VP_LOG=vt=trace vp build
|
|
158
205
|
```
|
|
159
206
|
|
|
160
207
|
### `VP_DEBUG_SHIM`
|
|
@@ -184,7 +231,7 @@ Vite+ also respects these standard environment variables:
|
|
|
184
231
|
### `HOME` / `USERPROFILE`
|
|
185
232
|
|
|
186
233
|
- **Purpose**: User home directory
|
|
187
|
-
- **Effect**: Base for the
|
|
234
|
+
- **Effect**: Base for the existing-install probe (`~/.vite-plus`) and for split platform defaults
|
|
188
235
|
|
|
189
236
|
## Precedence
|
|
190
237
|
|
package/docs/guide/lint.md
CHANGED
|
@@ -43,8 +43,10 @@ We recommend enabling both `typeAware` and `typeCheck` in the `lint` block:
|
|
|
43
43
|
- `typeAware: true` enables rules that require TypeScript type information
|
|
44
44
|
- `typeCheck: true` enables full type checking during linting
|
|
45
45
|
|
|
46
|
-
This path is powered by [tsgolint](https://github.com/oxc-project/tsgolint) on top of the TypeScript Go toolchain. It gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.
|
|
46
|
+
This path is powered by [tsgolint](https://github.com/oxc-project/tsgolint) on top of the TypeScript 7 (aka TypeScript Go) toolchain. It gives Oxlint access to type information and allows type checking directly via `vp lint` and `vp check`.
|
|
47
47
|
|
|
48
48
|
## JS Plugins
|
|
49
49
|
|
|
50
50
|
If you are migrating from ESLint and still depend on a few critical JavaScript-based ESLint plugins, Oxlint has [JS plugin support](https://oxc.rs/docs/guide/usage/linter/js-plugins) that can help you keep those plugins running while you complete the migration.
|
|
51
|
+
|
|
52
|
+
JS Plugins also enable [writing your own custom rules](https://oxc.rs/docs/guide/usage/linter/writing-js-plugins.html) for Oxlint.
|
|
@@ -82,6 +82,14 @@ Related rules:
|
|
|
82
82
|
- A direct `vite` declaration is never removed merely because a root override
|
|
83
83
|
exists.
|
|
84
84
|
- Plain or stale aliases are normalized; named catalog references are kept.
|
|
85
|
+
- Under pnpm the managed override keys use an explicit `@*` range (`vite@*`,
|
|
86
|
+
`vitest@*`). pnpm applies an override by replacing the declared spec on every
|
|
87
|
+
manifest, importer manifests included. A bare key matches any spec, including
|
|
88
|
+
`catalog:`, and `vp up` then rewrites that reference to a concrete version.
|
|
89
|
+
The `@*` range keeps the override on the semver ranges that transitive and
|
|
90
|
+
peer declarations use. It leaves `catalog:` references to the catalog, which
|
|
91
|
+
already resolves them to Vite+ core. Migration re-keys a project that still
|
|
92
|
+
holds the bare key, and keeps its named-catalog choice.
|
|
85
93
|
- The direct-entry rule above is pnpm-specific. Bun mirrors its core alias as
|
|
86
94
|
a direct dependency for its peer resolver, and npm browser-provider layouts
|
|
87
95
|
may need a top-level `vite` edge so nested Vitest packages can resolve
|
|
@@ -228,6 +236,7 @@ scripts while preserving their arguments:
|
|
|
228
236
|
| `lint-staged` | `vp staged` |
|
|
229
237
|
| `eslint` | `vp lint`, when its optional migration runs |
|
|
230
238
|
| `prettier` | `vp fmt`, when its optional migration runs |
|
|
239
|
+
| `tsup` | `vp pack`, when its optional migration runs |
|
|
231
240
|
|
|
232
241
|
For commands launched through `bunx`, migration preserves `bunx` and its
|
|
233
242
|
`--bun` flag (keeping the user's chosen runtime) and rewrites only the managed
|
package/docs/guide/migrate.md
CHANGED
|
@@ -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
|
|
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
|
|
|
@@ -22,6 +22,9 @@ The positional `PATH` argument is optional.
|
|
|
22
22
|
|
|
23
23
|
- If omitted, `vp migrate` migrates the current directory
|
|
24
24
|
- If provided, it migrates that target directory instead
|
|
25
|
+
- For a monorepo, the target must be the workspace root. Vite+ cannot
|
|
26
|
+
migrate one workspace member, because migration updates the package-manager
|
|
27
|
+
configuration, the catalogs, and the lockfiles that all members share.
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
30
|
vp migrate
|
|
@@ -67,7 +70,41 @@ After running the migration:
|
|
|
67
70
|
- Run `vp install`
|
|
68
71
|
- Run `vp check`
|
|
69
72
|
- Run `vp test`
|
|
70
|
-
- Run `vp build`
|
|
73
|
+
- Run `vp build` (or `vp pack` if you are building a library)
|
|
74
|
+
|
|
75
|
+
## Manual Installation & Migration
|
|
76
|
+
|
|
77
|
+
If you are manually migrating a project to Vite+, install these dev dependencies first:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
vp install -D vite-plus
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
You need to add overrides to your package manager so that other packages resolve the Vite+ versions: alias `vite` to `@voidzero-dev/vite-plus-core`, and pin `vitest` to the version Vite+ bundles (run `vp --version`) so the whole project shares a single Vitest copy with `vp test`. Without the `vitest` pin, a dependency or workspace package can pull a different Vitest than the bundled runner, splitting Vitest's internals (mocks, `expect`, runner state):
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
"overrides": {
|
|
87
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
88
|
+
"vitest": "4.1.11"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If you are using `pnpm`, add this to your `pnpm-workspace.yaml`:
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
overrides:
|
|
96
|
+
vite: npm:@voidzero-dev/vite-plus-core@latest
|
|
97
|
+
vitest: 4.1.11
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or, if you are using Yarn:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
"resolutions": {
|
|
104
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
|
|
105
|
+
"vitest": "4.1.11"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
71
108
|
|
|
72
109
|
## Migration Prompt
|
|
73
110
|
|
|
@@ -184,9 +221,9 @@ only when no existing hook policy is found.
|
|
|
184
221
|
|
|
185
222
|
If your project currently uses `lefthook`, `simple-git-hooks`, or `yorkie`, `vp migrate` will leave your existing configuration alone and show a warning. This happens even if you choose to set up hooks during the prompt or include the `--hooks` flag.
|
|
186
223
|
|
|
187
|
-
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`. Finally, once you have confirmed that the Vite+ hook is working as expected, you can remove the old tool's configuration and dependency.
|
|
224
|
+
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.
|
|
188
225
|
|
|
189
|
-
You can find more details about the full Vite+ hook setup in the [Commit hooks guide](/guide/commit-hooks).
|
|
226
|
+
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](/guide/commit-hooks).
|
|
190
227
|
|
|
191
228
|
## Examples
|
|
192
229
|
|
package/docs/guide/monorepo.md
CHANGED
|
@@ -24,7 +24,7 @@ export default defineConfig({
|
|
|
24
24
|
overrides: [
|
|
25
25
|
{
|
|
26
26
|
files: ['apps/web/**', 'packages/ui/**'],
|
|
27
|
-
plugins: ['
|
|
27
|
+
plugins: ['react'],
|
|
28
28
|
rules: {
|
|
29
29
|
'react/self-closing-comp': 'error',
|
|
30
30
|
},
|
|
@@ -40,9 +40,9 @@ export default defineConfig({
|
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
files: ['**/*.test.ts', '**/*.spec.ts'],
|
|
43
|
-
plugins: ['
|
|
43
|
+
plugins: ['vitest'],
|
|
44
44
|
rules: {
|
|
45
|
-
'
|
|
45
|
+
'typescript/no-explicit-any': 'off',
|
|
46
46
|
'vitest/no-disabled-tests': 'error',
|
|
47
47
|
},
|
|
48
48
|
},
|
|
@@ -54,7 +54,7 @@ export default defineConfig({
|
|
|
54
54
|
Globs are resolved from the root `vite.config.ts`, so use workspace paths such as `apps/web/**`, `apps/api/**`, and `packages/ui/**`.
|
|
55
55
|
|
|
56
56
|
::: tip
|
|
57
|
-
When a `lint.overrides` entry sets `plugins`, that list
|
|
57
|
+
When a `lint.overrides` entry sets `plugins`, that list will be merged with the base `lint.plugins` list for matched files. Omit `plugins` only when the override should inherit the base list unchanged.
|
|
58
58
|
:::
|
|
59
59
|
|
|
60
60
|
## Format Overrides
|
package/docs/guide/test.md
CHANGED
|
@@ -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
|
:::
|
|
@@ -15,6 +15,9 @@ Vite+ expects modern upstream tool versions.
|
|
|
15
15
|
|
|
16
16
|
If you are migrating an existing project and it still depends on older Vite or Vitest versions, upgrade those first before adopting Vite+.
|
|
17
17
|
|
|
18
|
+
Run `vp toolchain` to show the versions from the local Vite+ package.
|
|
19
|
+
Run `vp toolchain --global` to show the versions from the global Vite+ release.
|
|
20
|
+
|
|
18
21
|
## `vp check` does not run type-aware lint rules or type checks
|
|
19
22
|
|
|
20
23
|
- Confirm that `lint.options.typeAware` and `lint.options.typeCheck` are enabled in `vite.config.ts`
|
|
@@ -53,9 +56,14 @@ You can also run custom tasks defined in `vite.config.ts` and migrate away from
|
|
|
53
56
|
If `vp staged` fails or your pre-commit hook does not run:
|
|
54
57
|
|
|
55
58
|
- make sure `vite.config.ts` contains a `staged` block
|
|
56
|
-
- make sure the project-owned pre-commit hook runs `vp staged`
|
|
57
|
-
- run `vp
|
|
58
|
-
-
|
|
59
|
+
- make sure the project-owned pre-commit hook runs `vp staged` (for example `.vite-hooks/pre-commit`)
|
|
60
|
+
- run `vp hooks status` to see preference, `core.hooksPath`, and whether the dispatcher is installed
|
|
61
|
+
- run `vp hooks enable` (or `vp config`) to install the hook dispatcher
|
|
62
|
+
- if status shows `Preference: disabled (local)`, re-enable with `vp hooks enable`
|
|
63
|
+
- check whether hooks were skipped intentionally through `VP_GIT_HOOKS=0`
|
|
64
|
+
|
|
65
|
+
To stop hooks in this clone without deleting project policy files, run `vp hooks disable`.
|
|
66
|
+
See the [Commit hooks guide](/guide/commit-hooks) for the full workflow.
|
|
59
67
|
|
|
60
68
|
A minimal staged config looks like this:
|
|
61
69
|
|
|
@@ -106,7 +114,7 @@ If you are stuck, please reach out:
|
|
|
106
114
|
|
|
107
115
|
When reporting a problem, please include:
|
|
108
116
|
|
|
109
|
-
- The full output of `vp env current` and `vp
|
|
117
|
+
- The full output of `vp env current`, `vp --version`, and `vp toolchain`
|
|
110
118
|
- The package manager used by the project
|
|
111
119
|
- The exact steps needed to reproduce the problem and your `vite.config.ts`
|
|
112
120
|
- A minimal reproduction repository or runnable sandbox
|
package/docs/guide/upgrade.md
CHANGED
|
@@ -11,6 +11,29 @@ There are two parts to upgrading Vite+:
|
|
|
11
11
|
|
|
12
12
|
You can upgrade both of them independently.
|
|
13
13
|
|
|
14
|
+
## Show the Toolchain
|
|
15
|
+
|
|
16
|
+
Run `vp toolchain` to show the components for the current directory:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
vp toolchain
|
|
20
|
+
vp toolchain vite
|
|
21
|
+
vp toolchain vite rolldown oxc
|
|
22
|
+
vp toolchain --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The command uses the local `vite-plus` package when the project has one. Use
|
|
26
|
+
`--global` to show the release for the global `vp` command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
vp toolchain --global
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`vp why <package>` shows the dependency graph from the package manager. It
|
|
33
|
+
cannot show code bundled into `@voidzero-dev/vite-plus-core`. It also cannot
|
|
34
|
+
show engines compiled into Vite+. Use `vp toolchain` to show those versions and
|
|
35
|
+
relationships.
|
|
36
|
+
|
|
14
37
|
## Global `vp`
|
|
15
38
|
|
|
16
39
|
```bash
|
|
@@ -20,6 +43,51 @@ vp upgrade <version> # install a specific version
|
|
|
20
43
|
vp upgrade --registry <registry> # use a custom npm registry
|
|
21
44
|
```
|
|
22
45
|
|
|
46
|
+
### Move an Existing Install to the Split Directory Layout
|
|
47
|
+
|
|
48
|
+
Vite+ 0.3.0 is the first release that supports the split directory layout.
|
|
49
|
+
Vite+ 0.2.x and earlier use the single-root layout for fresh installs and
|
|
50
|
+
upgrades.
|
|
51
|
+
|
|
52
|
+
`vp upgrade` keeps an existing default install in `~/.vite-plus` on Unix or
|
|
53
|
+
`%USERPROFILE%\.vite-plus` on Windows. The command upgrades the CLI in that
|
|
54
|
+
directory. It does not move the install to the split platform directories. You
|
|
55
|
+
can continue to use the existing layout.
|
|
56
|
+
|
|
57
|
+
To use the split layout now, remove the existing install. Then install Vite+
|
|
58
|
+
again. Run `vp implode` in a shell that uses the current install. The command
|
|
59
|
+
removes the generated environment file and shell profile entries. It does not
|
|
60
|
+
unset directory variables in the current shell. Unset all Vite+ directory
|
|
61
|
+
variables before you run the installer. This can include values from an earlier
|
|
62
|
+
preview environment file. Alternatively, start a new shell after `vp implode`.
|
|
63
|
+
Then run the installer in the new shell.
|
|
64
|
+
|
|
65
|
+
::: warning
|
|
66
|
+
`vp implode` removes all Vite+-managed Node.js runtimes, global packages,
|
|
67
|
+
configuration, and caches. Keep the existing layout if you do not want to
|
|
68
|
+
recreate that data.
|
|
69
|
+
:::
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
vp implode
|
|
73
|
+
unset VP_HOME VP_DATA_DIR VP_BIN_DIR VP_CACHE_DIR
|
|
74
|
+
curl -fsSL https://vite.plus | bash
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
On Windows:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
vp implode
|
|
81
|
+
Remove-Item Env:\VP_HOME, Env:\VP_DATA_DIR, Env:\VP_BIN_DIR, Env:\VP_CACHE_DIR -ErrorAction SilentlyContinue
|
|
82
|
+
irm https://vite.plus/ps1 | iex
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Also remove persistent definitions of `VP_HOME`, `VP_DATA_DIR`, `VP_BIN_DIR`,
|
|
86
|
+
and `VP_CACHE_DIR` from your shell profile or system environment. A fresh
|
|
87
|
+
install uses `VP_HOME` or a complete `VP_*_DIR` group that remains set.
|
|
88
|
+
`VP_HOME` selects the single-root layout. If you install Vite+ 0.2.x or earlier,
|
|
89
|
+
the installer also uses this layout. The installer prints a notice.
|
|
90
|
+
|
|
23
91
|
### Rollback
|
|
24
92
|
|
|
25
93
|
Vite+ keeps the **3 most recent** versions installed so you can revert quickly:
|
|
@@ -46,14 +114,16 @@ If you migrated with `vp migrate`, your project pins `vitest` to an exact versio
|
|
|
46
114
|
|
|
47
115
|
- **npm / Bun:** a `vitest` entry under `overrides` in `package.json`
|
|
48
116
|
- **Yarn:** a `vitest` entry under `resolutions` in `package.json`
|
|
49
|
-
- **pnpm:** a `vitest
|
|
117
|
+
- **pnpm:** a `vitest@*` entry under `overrides` in `pnpm-workspace.yaml`. If your `package.json` already has a `pnpm` field, the entry lives under `pnpm.overrides` in `package.json` instead. pnpm ignores `pnpm-workspace.yaml` overrides when `package.json` defines `pnpm.overrides`.
|
|
118
|
+
|
|
119
|
+
Under pnpm the managed keys use an explicit `@*` range (`vite@*`, `vitest@*`). pnpm applies an override by replacing the declared spec on every manifest, importer manifests included. A bare key matches any spec, including `catalog:`. The `@*` range keeps the override on the semver ranges that transitive and peer declarations use, and leaves `catalog:` references intact. `vp up` therefore no longer rewrites them to a concrete version.
|
|
50
120
|
|
|
51
121
|
A Vite+ release can bump the bundled Vitest. Because that pin also applies to `vite-plus`'s own `vitest` dependency, an out-of-date pin keeps installing the previous runner even after you upgrade `vite-plus` — splitting Vitest's internals (mocks, `expect`, runner state) between the pinned copy and the one `vp test` loads.
|
|
52
122
|
|
|
53
123
|
After upgrading `vite-plus`, re-pin `vitest` to the version Vite+ now bundles. Check that version with:
|
|
54
124
|
|
|
55
125
|
```bash
|
|
56
|
-
vp
|
|
126
|
+
vp toolchain vitest
|
|
57
127
|
```
|
|
58
128
|
|
|
59
129
|
Then set the `vitest` override to that exact version, or rerun `vp migrate` to update the pin for you.
|
|
@@ -86,7 +156,7 @@ irm https://vite.plus/ps1 | iex
|
|
|
86
156
|
Remove-Item Env:\VP_PR_VERSION
|
|
87
157
|
```
|
|
88
158
|
|
|
89
|
-
The installer
|
|
159
|
+
The installer uses the registry bridge to resolve the ref to a `0.0.0-commit.<sha>` build. It installs this build like other versions. Run `vp toolchain --global` to show the active build and tool versions. After testing, run `vp upgrade --force` to restore the published release. You can also run the installer without `VP_PR_VERSION`.
|
|
90
160
|
|
|
91
161
|
### Local `vite-plus` Preview
|
|
92
162
|
|
|
@@ -96,6 +166,6 @@ After installing the preview global CLI above, run migrate in the project to mov
|
|
|
96
166
|
vp migrate
|
|
97
167
|
```
|
|
98
168
|
|
|
99
|
-
Migrate
|
|
169
|
+
Migrate writes the bridge registry to `.npmrc`. For Yarn Berry, it writes the registry to `.yarnrc.yml`. It pins `vite-plus` and the `vite` alias to the matching `0.0.0-commit.<sha>` version. The `vite` alias points to `@voidzero-dev/vite-plus-core`. Commit the registry line if the project CI must test the preview.
|
|
100
170
|
|
|
101
|
-
After
|
|
171
|
+
After the install, run `vp toolchain` to show the selected versions. After testing, set `vite-plus` to `latest`. Remove the bridge `registry` line from `.npmrc` or `.yarnrc.yml`. Then run `vp install`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"binding/index.d.cts",
|
|
29
29
|
"binding/index.d.ts",
|
|
30
30
|
"binding/index.js",
|
|
31
|
-
"dist/test",
|
|
32
31
|
"docs",
|
|
33
32
|
"rules",
|
|
34
33
|
"templates"
|
|
@@ -85,6 +84,10 @@
|
|
|
85
84
|
"./pack/client": {
|
|
86
85
|
"types": "./dist/pack-client.d.ts"
|
|
87
86
|
},
|
|
87
|
+
"./toolchain": {
|
|
88
|
+
"types": "./dist/toolchain.d.ts",
|
|
89
|
+
"default": "./dist/toolchain.js"
|
|
90
|
+
},
|
|
88
91
|
"./versions": {
|
|
89
92
|
"types": "./dist/versions.d.ts",
|
|
90
93
|
"default": "./dist/versions.js"
|
|
@@ -347,33 +350,33 @@
|
|
|
347
350
|
}
|
|
348
351
|
},
|
|
349
352
|
"dependencies": {
|
|
350
|
-
"@oxc-project/types": "=0.
|
|
351
|
-
"@oxlint/plugins": "=1.
|
|
352
|
-
"@vitest/browser": "4.1.
|
|
353
|
-
"@vitest/browser-preview": "4.1.
|
|
354
|
-
"@vitest/expect": "4.1.
|
|
355
|
-
"@vitest/mocker": "4.1.
|
|
356
|
-
"@vitest/pretty-format": "4.1.
|
|
357
|
-
"@vitest/runner": "4.1.
|
|
358
|
-
"@vitest/snapshot": "4.1.
|
|
359
|
-
"@vitest/spy": "4.1.
|
|
360
|
-
"@vitest/utils": "4.1.
|
|
361
|
-
"oxfmt": "=0.
|
|
362
|
-
"oxlint": "=1.
|
|
353
|
+
"@oxc-project/types": "=0.146.0",
|
|
354
|
+
"@oxlint/plugins": "=1.79.0",
|
|
355
|
+
"@vitest/browser": "4.1.11",
|
|
356
|
+
"@vitest/browser-preview": "4.1.11",
|
|
357
|
+
"@vitest/expect": "4.1.11",
|
|
358
|
+
"@vitest/mocker": "4.1.11",
|
|
359
|
+
"@vitest/pretty-format": "4.1.11",
|
|
360
|
+
"@vitest/runner": "4.1.11",
|
|
361
|
+
"@vitest/snapshot": "4.1.11",
|
|
362
|
+
"@vitest/spy": "4.1.11",
|
|
363
|
+
"@vitest/utils": "4.1.11",
|
|
364
|
+
"oxfmt": "=0.64.0",
|
|
365
|
+
"oxlint": "=1.79.0",
|
|
363
366
|
"oxlint-tsgolint": "=7.0.2001",
|
|
364
|
-
"vitest": "4.1.
|
|
365
|
-
"@voidzero-dev/vite-plus-core": "0.
|
|
367
|
+
"vitest": "4.1.11",
|
|
368
|
+
"@voidzero-dev/vite-plus-core": "0.3.0"
|
|
366
369
|
},
|
|
367
370
|
"devDependencies": {
|
|
368
|
-
"@emnapi/core": "2.0.0-alpha.
|
|
369
|
-
"@emnapi/runtime": "2.0.0-alpha.
|
|
371
|
+
"@emnapi/core": "2.0.0-alpha.4",
|
|
372
|
+
"@emnapi/runtime": "2.0.0-alpha.4",
|
|
370
373
|
"@napi-rs/cli": "^3.8.2",
|
|
371
374
|
"@nkzw/safe-word-list": "^3.1.0",
|
|
372
375
|
"@types/cross-spawn": "^6.0.6",
|
|
373
|
-
"@types/semver": "^7.
|
|
376
|
+
"@types/semver": "^7.8.0",
|
|
374
377
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
375
|
-
"@vitest/browser-playwright": "4.1.
|
|
376
|
-
"@vitest/browser-webdriverio": "4.1.
|
|
378
|
+
"@vitest/browser-playwright": "4.1.11",
|
|
379
|
+
"@vitest/browser-webdriverio": "4.1.11",
|
|
377
380
|
"bingo": "^0.9.3",
|
|
378
381
|
"cac": "^7.0.0",
|
|
379
382
|
"cross-spawn": "^7.0.5",
|
|
@@ -392,11 +395,11 @@
|
|
|
392
395
|
"yaml": "^2.8.1",
|
|
393
396
|
"zod": "^3.25.76",
|
|
394
397
|
"@voidzero-dev/vite-plus-prompts": "0.0.0",
|
|
395
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.
|
|
398
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0"
|
|
396
399
|
},
|
|
397
400
|
"peerDependencies": {
|
|
398
|
-
"@vitest/browser-playwright": "4.1.
|
|
399
|
-
"@vitest/browser-webdriverio": "4.1.
|
|
401
|
+
"@vitest/browser-playwright": "4.1.11",
|
|
402
|
+
"@vitest/browser-webdriverio": "4.1.11"
|
|
400
403
|
},
|
|
401
404
|
"peerDependenciesMeta": {
|
|
402
405
|
"@vitest/browser-playwright": {
|
|
@@ -424,14 +427,14 @@
|
|
|
424
427
|
"node": "^20.19.0 || ^22.18.0 || >=24.11.0"
|
|
425
428
|
},
|
|
426
429
|
"optionalDependencies": {
|
|
427
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "0.
|
|
428
|
-
"@voidzero-dev/vite-plus-darwin-x64": "0.
|
|
429
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.
|
|
430
|
-
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.
|
|
431
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.
|
|
432
|
-
"@voidzero-dev/vite-plus-linux-x64-musl": "0.
|
|
433
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.
|
|
434
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.
|
|
430
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "0.3.0",
|
|
431
|
+
"@voidzero-dev/vite-plus-darwin-x64": "0.3.0",
|
|
432
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.3.0",
|
|
433
|
+
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.3.0",
|
|
434
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.3.0",
|
|
435
|
+
"@voidzero-dev/vite-plus-linux-x64-musl": "0.3.0",
|
|
436
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.3.0",
|
|
437
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.3.0"
|
|
435
438
|
},
|
|
436
439
|
"scripts": {
|
|
437
440
|
"build": "oxnode -C dev ./build.ts",
|
package/rules/vite-tools.yml
CHANGED
|
@@ -10,7 +10,6 @@ rule:
|
|
|
10
10
|
regex: 'vite\s+(-v|--version)'
|
|
11
11
|
fix: vp
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
# vite => vp dev (handles all cases: with/without env var prefix and flag args)
|
|
15
14
|
# Match command_name to preserve env var prefix and arguments
|
|
16
15
|
# Excludes subcommands like "vite build", "vite test", etc.
|
|
@@ -27,7 +26,6 @@ rule:
|
|
|
27
26
|
regex: 'vite\s+[^-]'
|
|
28
27
|
fix: vp dev
|
|
29
28
|
|
|
30
|
-
|
|
31
29
|
# vite <subcommand> => vp <subcommand> (handles vite build, vite test, vite dev, etc.)
|
|
32
30
|
# Match command_name when followed by a subcommand, replace only the command name
|
|
33
31
|
---
|
|
@@ -41,7 +39,6 @@ rule:
|
|
|
41
39
|
regex: 'vite\s+[^-]'
|
|
42
40
|
fix: vp
|
|
43
41
|
|
|
44
|
-
|
|
45
42
|
# oxlint => vp lint (handles all cases: with/without env var prefix and args)
|
|
46
43
|
# Match command_name to preserve env var prefix and arguments
|
|
47
44
|
---
|
|
@@ -52,7 +49,6 @@ rule:
|
|
|
52
49
|
regex: '^oxlint$'
|
|
53
50
|
fix: vp lint
|
|
54
51
|
|
|
55
|
-
|
|
56
52
|
# oxfmt => vp fmt
|
|
57
53
|
---
|
|
58
54
|
id: replace-oxfmt
|
|
@@ -62,7 +58,6 @@ rule:
|
|
|
62
58
|
regex: '^oxfmt$'
|
|
63
59
|
fix: vp fmt
|
|
64
60
|
|
|
65
|
-
|
|
66
61
|
# vitest => vp test
|
|
67
62
|
---
|
|
68
63
|
id: replace-vitest
|
|
@@ -72,7 +67,6 @@ rule:
|
|
|
72
67
|
regex: '^vitest$'
|
|
73
68
|
fix: vp test
|
|
74
69
|
|
|
75
|
-
|
|
76
70
|
# lint-staged => vp staged
|
|
77
71
|
---
|
|
78
72
|
id: replace-lint-staged
|
|
@@ -82,7 +76,6 @@ rule:
|
|
|
82
76
|
regex: '^lint-staged$'
|
|
83
77
|
fix: vp staged
|
|
84
78
|
|
|
85
|
-
|
|
86
79
|
# tsdown => vp pack
|
|
87
80
|
---
|
|
88
81
|
id: replace-tsdown
|
package/dist/dist-DT25H9pj.js
DELETED