vite-plus 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding/index.cjs +116 -55
- package/binding/index.d.cts +31 -0
- package/dist/{agent-D8oxxhVR.js → agent-CowvWq3j.js} +2 -2
- package/dist/bin.js +30 -8
- package/dist/config/bin.js +5 -5
- package/dist/{constants-DRUnJ_Dz.js → constants-D5f7inVN.js} +6 -2
- package/dist/create/bin.js +115 -65
- package/dist/{define-config-Cv2P6NT2.cjs → define-config-BGCfAiIo.cjs} +35 -3
- package/dist/{define-config-rPhYIFSn.d.ts → define-config-BrvHRi-G.d.ts} +30 -2
- package/dist/{define-config-ChwJcu5e.js → define-config-XKYhw0xH.js} +30 -5
- package/dist/define-config.cjs +2 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +1 -1
- package/dist/{editor-ClL78D8u.js → editor-BVaNnIey.js} +1266 -884
- package/dist/hooks/bin.js +2 -2
- package/dist/{hooks-xRcJPc-O.js → hooks-w_e2whkQ.js} +40 -21
- package/dist/index.cjs +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +1302 -311
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BVpqYdcC.js → oxlint-plugin-config-5hVqz4kj.js} +1 -1
- package/dist/oxlint-plugin.js +29 -4
- package/dist/pack-bin.js +2 -2
- package/dist/{package-DzsomcUD.js → package-DLUCo6L_.js} +1 -1
- package/dist/{prompts-GL1vj0wk.js → prompts-DLpJGhfK.js} +3 -3
- package/dist/register.d.ts +1 -0
- package/dist/register.js +12 -0
- package/dist/{report-DLHO30yZ.js → report-BEdpIQvC.js} +2 -0
- package/dist/{resolve-vite-config-Dn5896A4.js → resolve-vite-config-D-JtjGRa.js} +2 -2
- package/dist/{resolve-vite-config-QO6cC0SP.js → resolve-vite-config-D7IUZYKq.js} +1 -1
- package/dist/script-esm-hooks.d.ts +5 -2
- package/dist/script-esm-hooks.js +5 -2
- package/dist/script-preload.cjs +24 -1
- package/dist/script-register.js +7 -2
- package/dist/script-watch.js +135 -41
- package/dist/staged/bin.js +2 -2
- package/dist/sync-versions/bin.js +1 -1
- package/dist/toolchain.js +14 -14
- package/dist/toolchain.json +14 -14
- package/dist/{tsconfig-LE_mAwe_.js → tsconfig-D3DiCiW6.js} +2 -2
- package/dist/{tsconfig-Do6MAG_f.js → tsconfig-DLERIAbF.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +7 -7
- 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 +6 -2
- package/docs/config/staged.md +1 -1
- package/docs/guide/check.md +5 -1
- package/docs/guide/ci.md +2 -2
- package/docs/guide/create.md +1 -1
- package/docs/guide/env.md +1 -1
- package/docs/guide/global-cli.md +13 -9
- 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/index.md +4 -4
- package/docs/guide/local-cli.md +22 -1
- package/docs/guide/migrate-rules.md +81 -22
- package/docs/guide/migrate.md +9 -9
- package/docs/guide/package-management/add.md +84 -0
- package/docs/guide/package-management/approve-builds.md +48 -0
- package/docs/guide/package-management/audit.md +39 -0
- package/docs/guide/package-management/cache.md +53 -0
- package/docs/guide/package-management/ci.md +28 -0
- package/docs/guide/package-management/config.md +119 -0
- package/docs/guide/package-management/dedupe.md +32 -0
- package/docs/guide/package-management/deprecate.md +39 -0
- package/docs/guide/package-management/dist-tag.md +61 -0
- package/docs/guide/package-management/dlx.md +40 -0
- package/docs/guide/package-management/fund.md +32 -0
- package/docs/guide/package-management/global-packages.md +32 -0
- package/docs/guide/package-management/index.md +78 -0
- package/docs/guide/package-management/info.md +35 -0
- package/docs/guide/package-management/install.md +89 -0
- package/docs/guide/package-management/licenses.md +42 -0
- package/docs/guide/package-management/link.md +29 -0
- package/docs/guide/package-management/list.md +60 -0
- package/docs/guide/package-management/login.md +34 -0
- package/docs/guide/package-management/logout.md +34 -0
- package/docs/guide/package-management/outdated.md +60 -0
- package/docs/guide/package-management/owner.md +79 -0
- package/docs/guide/package-management/pack.md +40 -0
- package/docs/guide/package-management/package-manager-selection.md +60 -0
- package/docs/guide/package-management/patch-commit.md +27 -0
- package/docs/guide/package-management/patch.md +29 -0
- package/docs/guide/package-management/ping.md +32 -0
- package/docs/guide/package-management/pkg.md +88 -0
- package/docs/guide/package-management/prune.md +34 -0
- package/docs/guide/package-management/publish.md +61 -0
- package/docs/guide/package-management/rebuild.md +31 -0
- package/docs/guide/package-management/remove.md +47 -0
- package/docs/guide/package-management/search.md +38 -0
- package/docs/guide/package-management/stage.md +175 -0
- package/docs/guide/package-management/team.md +140 -0
- package/docs/guide/package-management/token.md +87 -0
- package/docs/guide/package-management/unlink.md +33 -0
- package/docs/guide/package-management/update.md +62 -0
- package/docs/guide/package-management/version.md +36 -0
- package/docs/guide/package-management/whoami.md +30 -0
- package/docs/guide/package-management/why.md +55 -0
- 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 +45 -5
- package/package.json +40 -34
- package/docs/guide/package-management.md +0 -269
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# vp update
|
|
2
|
+
|
|
3
|
+
Update project dependencies using the selected manager's update rules. Alias: `vp up`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp update
|
|
7
|
+
vp update react
|
|
8
|
+
vp update --latest
|
|
9
|
+
vp update -g
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
| Option | Description | Notes |
|
|
15
|
+
| --------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
16
|
+
| `-L, --latest` | Update to latest version (ignore semver range). | Global mode clears recorded version ranges. |
|
|
17
|
+
| `-g, --global` | Update global packages. | Requires the global CLI. Uses the [global package store](./global-packages). |
|
|
18
|
+
| `--concurrency <number>` | Number of global package updates to run in parallel. | Requires --global. Must be a positive integer. |
|
|
19
|
+
| `--reinstall-node-mismatch` | Reinstall up-to-date global packages installed with a different Node.js version. | Requires --global. |
|
|
20
|
+
| `--ignore-node-mismatch` | Skip up-to-date global packages installed with a different Node.js version. | Requires --global. |
|
|
21
|
+
| `-r, --recursive` | Update recursively in all workspace packages. | |
|
|
22
|
+
| `--filter <pattern>` | Select workspaces by pattern. | Can be repeated. |
|
|
23
|
+
| `-w, --workspace-root` | Include workspace root. | |
|
|
24
|
+
| `-D, --dev` | Select development dependencies. | |
|
|
25
|
+
| `-P, --prod` | Select production dependencies. | |
|
|
26
|
+
| `-i, --interactive` | Interactive mode. | |
|
|
27
|
+
| `--no-optional` | Exclude optionalDependencies. | |
|
|
28
|
+
| `--no-save` | Request native no-save behavior. | |
|
|
29
|
+
| `--workspace` | Update only dependencies available in the workspace. | |
|
|
30
|
+
|
|
31
|
+
## Compatibility
|
|
32
|
+
|
|
33
|
+
The commands below describe project operations. Global mode is described under [Options](#options).
|
|
34
|
+
|
|
35
|
+
- **npm:** `npm update`.
|
|
36
|
+
- **pnpm:** `pnpm update`.
|
|
37
|
+
- **Yarn Classic:** `yarn upgrade` or `yarn upgrade-interactive`.
|
|
38
|
+
- **Yarn Modern:** `yarn up`.
|
|
39
|
+
- **Bun:** `bun update`.
|
|
40
|
+
|
|
41
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
42
|
+
| --------------------------- | ---------------- | ---- | ------------ | ---------------------------- | ------------ | ----- |
|
|
43
|
+
| `-L, --latest` | Global mode only | Yes | Yes | Yes | Yes | |
|
|
44
|
+
| `-g, --global` | Yes | Yes | Yes | Yes | Yes | |
|
|
45
|
+
| `--concurrency <number>` | Yes | Yes | Yes | Yes | Yes | |
|
|
46
|
+
| `--reinstall-node-mismatch` | Yes | Yes | Yes | Yes | Yes | |
|
|
47
|
+
| `--ignore-node-mismatch` | Yes | Yes | Yes | Yes | Yes | |
|
|
48
|
+
| `-r, --recursive` | 8.1.0 or later | Yes | No | Yes | 1.4 or later | |
|
|
49
|
+
| `--filter <pattern>` | 7.14.0 or later | Yes | One filter | No | 1.4 or later | |
|
|
50
|
+
| `-w, --workspace-root` | 8.1.0 or later | Yes | No | No | No | |
|
|
51
|
+
| `-D, --dev` | Yes | Yes | No | No | 1.4 or later | |
|
|
52
|
+
| `-P, --prod` | 7 or later | Yes | Yes | No | 1.4 or later | |
|
|
53
|
+
| `-i, --interactive` | No | Yes | Yes | Yes | Yes | |
|
|
54
|
+
| `--no-optional` | Yes | Yes | Yes | No | 1.4 or later | |
|
|
55
|
+
| `--no-save` | Yes | Yes | No | --recursive without --latest | Yes | |
|
|
56
|
+
| `--workspace` | No | Yes | No | No | No | |
|
|
57
|
+
|
|
58
|
+
To change a dependency's declared range on npm, use [add](./add) with a new version specification. Yarn Modern follows project-wide update semantics. Recursive mode without `--latest` re-resolves existing ranges without rewriting manifests; combining it with `--latest` uses ordinary `yarn up`.
|
|
59
|
+
|
|
60
|
+
## Native Options
|
|
61
|
+
|
|
62
|
+
For native options, see [npm update](https://docs.npmjs.com/cli/v11/commands/npm-update), [pnpm update](https://pnpm.io/cli/update), [Yarn up](https://yarnpkg.com/cli/up), [Yarn Classic upgrade](https://classic.yarnpkg.com/en/docs/cli/upgrade), [Yarn Classic upgrade-interactive](https://classic.yarnpkg.com/en/docs/cli/upgrade-interactive), and [Bun update](https://bun.com/docs/pm/cli/update). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# vp pm version
|
|
2
|
+
|
|
3
|
+
Run the package manager's version command. This manages package versions, not the Vite+ version displayed by `vp --version`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm version patch
|
|
7
|
+
vp pm version 2.0.0
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
|
|
12
|
+
Supply a version or increment strategy such as `major`, `minor`, or `patch`. Omitting it retains the manager's native behavior, which may display information, prompt, or require a strategy.
|
|
13
|
+
|
|
14
|
+
| Option | Description | Notes |
|
|
15
|
+
| -------- | --------------------------- | --------------------------------- |
|
|
16
|
+
| `--json` | Request native JSON output. | Output retains the native schema. |
|
|
17
|
+
|
|
18
|
+
## Compatibility
|
|
19
|
+
|
|
20
|
+
- **npm:** `npm version`.
|
|
21
|
+
- **pnpm:** `pnpm version`.
|
|
22
|
+
- **Yarn Classic:** `yarn version`.
|
|
23
|
+
- **Yarn Modern:** `yarn version`.
|
|
24
|
+
- **Bun:** 1.2.18 or later: `bun pm version`. Earlier versions warn before the command is invoked.
|
|
25
|
+
|
|
26
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
27
|
+
| -------- | --- | ---- | ------------ | ----------- | --- | ----- |
|
|
28
|
+
| `--json` | Yes | Yes | Yes | No | No | |
|
|
29
|
+
|
|
30
|
+
Yarn Classic converts increment strategies to flags such as `--patch`. An explicit version becomes `--new-version <version>`. Other managers retain their native operand syntax.
|
|
31
|
+
|
|
32
|
+
Version commands can modify manifests and lockfiles and may create Git commits or tags. Vite+ preserves the selected manager's behavior.
|
|
33
|
+
|
|
34
|
+
## Native Options
|
|
35
|
+
|
|
36
|
+
For native options, see [npm version](https://docs.npmjs.com/cli/v11/commands/npm-version), [pnpm version](https://pnpm.io/cli/version), [Yarn version](https://yarnpkg.com/cli/version), [Yarn Classic version](https://classic.yarnpkg.com/en/docs/cli/version), and [Bun pm version](https://bun.com/docs/pm/cli/pm). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# vp pm whoami
|
|
2
|
+
|
|
3
|
+
Show the account authenticated with the registry.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp pm whoami
|
|
7
|
+
vp pm whoami --registry https://registry.npmjs.org
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
|
|
12
|
+
| Option | Description | Notes |
|
|
13
|
+
| ------------------ | -------------------- | ----- |
|
|
14
|
+
| `--registry <url>` | Select the registry. | |
|
|
15
|
+
|
|
16
|
+
## Compatibility
|
|
17
|
+
|
|
18
|
+
- **npm:** `npm whoami`.
|
|
19
|
+
- **pnpm:** 11 or later: `pnpm whoami`. Earlier versions use `npm whoami` as a fallback.
|
|
20
|
+
- **Yarn Classic:** No command. Warns and exits successfully without performing the operation.
|
|
21
|
+
- **Yarn Modern:** `yarn npm whoami`.
|
|
22
|
+
- **Bun:** `bun pm whoami`.
|
|
23
|
+
|
|
24
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
25
|
+
| ------------------ | --- | ---- | ------------ | ----------- | --- | ----------------------------------------------- |
|
|
26
|
+
| `--registry <url>` | Yes | Yes | No | No | Yes | Configure the registry in Yarn Modern settings. |
|
|
27
|
+
|
|
28
|
+
## Native Options
|
|
29
|
+
|
|
30
|
+
For native options, see [npm whoami](https://docs.npmjs.com/cli/v11/commands/npm-whoami), [pnpm whoami](https://pnpm.io/cli/whoami), [Yarn npm whoami](https://yarnpkg.com/cli/npm/whoami), and [Bun pm whoami](https://bun.com/docs/pm/cli/pm). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# vp why
|
|
2
|
+
|
|
3
|
+
Explain why a dependency is installed. Alias: `vp explain`.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
vp why react
|
|
7
|
+
vp why react --json
|
|
8
|
+
vp why react --filter web
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
| Option | Description | Notes |
|
|
14
|
+
| ------------------------- | ----------------------------------------------- | --------------------------------- |
|
|
15
|
+
| `--json` | Request native JSON output. | Output retains the native schema. |
|
|
16
|
+
| `--long` | Show extended information. | |
|
|
17
|
+
| `--parseable` | Show parseable output. | |
|
|
18
|
+
| `-r, --recursive` | Check recursively across all workspaces. | |
|
|
19
|
+
| `--filter <pattern>` | Select workspaces by pattern. | Can be repeated. |
|
|
20
|
+
| `-w, --workspace-root` | Check in workspace root. | |
|
|
21
|
+
| `-P, --prod` | Only production dependencies. | |
|
|
22
|
+
| `-D, --dev` | Only dev dependencies. | |
|
|
23
|
+
| `--depth <depth>` | Limit tree depth. | |
|
|
24
|
+
| `--no-optional` | Exclude optional dependencies. | |
|
|
25
|
+
| `--exclude-peers` | Exclude peer dependencies. | |
|
|
26
|
+
| `--find-by <finder_name>` | Use a finder function defined in .pnpmfile.cjs. | |
|
|
27
|
+
|
|
28
|
+
## Compatibility
|
|
29
|
+
|
|
30
|
+
- **npm:** `npm explain`.
|
|
31
|
+
- **pnpm:** `pnpm why`.
|
|
32
|
+
- **Yarn Classic:** `yarn why`. With multiple package names, warns and checks only the first.
|
|
33
|
+
- **Yarn Modern:** `yarn why`. With multiple package names, warns and checks only the first.
|
|
34
|
+
- **Bun:** `bun why`.
|
|
35
|
+
|
|
36
|
+
| Option | npm | pnpm | Yarn Classic | Yarn Modern | Bun | Notes |
|
|
37
|
+
| ------------------------- | --------------- | ---------------- | ------------ | ----------- | --- | -------------------------------------- |
|
|
38
|
+
| `--json` | Yes | Yes | Yes | Yes | No | |
|
|
39
|
+
| `--long` | No | Yes | No | No | No | |
|
|
40
|
+
| `--parseable` | No | Yes | No | No | No | |
|
|
41
|
+
| `-r, --recursive` | 7.14.0 or later | Yes | No | Yes | No | |
|
|
42
|
+
| `--filter <pattern>` | 7.14.0 or later | Yes | No | No | No | |
|
|
43
|
+
| `-w, --workspace-root` | No | Yes | No | No | No | |
|
|
44
|
+
| `-P, --prod` | No | Yes | No | No | No | |
|
|
45
|
+
| `-D, --dev` | No | Yes | No | No | No | |
|
|
46
|
+
| `--depth <depth>` | No | Yes | No | No | Yes | |
|
|
47
|
+
| `--no-optional` | No | Yes | No | No | No | |
|
|
48
|
+
| `--exclude-peers` | No | Yes | No | Yes | No | Yarn Modern includes peers by default. |
|
|
49
|
+
| `--find-by <finder_name>` | No | 10.16.0 or later | No | No | No | |
|
|
50
|
+
|
|
51
|
+
The dependency graph does not include tools Vite+ bundles or compiles. For readable output, Vite+ shows a hint when it also provides the requested package. Use `vp toolchain [tool]` to inspect bundled tools.
|
|
52
|
+
|
|
53
|
+
## Native Options
|
|
54
|
+
|
|
55
|
+
For native options, see [npm explain](https://docs.npmjs.com/cli/v11/commands/npm-explain), [pnpm why](https://pnpm.io/cli/why), [Yarn why](https://yarnpkg.com/cli/why), [Yarn Classic why](https://classic.yarnpkg.com/en/docs/cli/why), and [Bun why](https://bun.com/docs/pm/cli/why). To pass these options through Vite+, see [Native Arguments](./#native-arguments).
|
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:
|
package/docs/guide/test.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`vp test` runs tests with [Vitest](https://vitest.dev).
|
|
4
4
|
|
|
5
|
-
Vite+ depends on Vitest `5.0
|
|
5
|
+
Vite+ depends on Vitest `5.1.0`, which requires Node `^22.18.0 || ^24.11.0 || >=26.0.0`. For existing projects, follow [Upgrade to Vitest 5](./vitest-v5.md) before updating dependencies.
|
|
6
6
|
|
|
7
7
|
`vp test` resolves Vitest from `vite-plus`'s dependencies first, then from your project.
|
|
8
8
|
|
|
@@ -72,7 +72,7 @@ If `vp staged` fails or your pre-commit hook does not run:
|
|
|
72
72
|
- if status shows `Preference: disabled (local)`, re-enable with `vp hooks enable`
|
|
73
73
|
- check whether hooks were skipped intentionally through `VP_GIT_HOOKS=0`
|
|
74
74
|
|
|
75
|
-
To stop hooks in this clone without deleting project policy files, run `vp hooks disable`. See the [Commit
|
|
75
|
+
To stop hooks in this clone without deleting project policy files, run `vp hooks disable`. See the [Commit Hooks](/guide/commit-hooks) for the full workflow.
|
|
76
76
|
|
|
77
77
|
A minimal staged config looks like this:
|
|
78
78
|
|
package/docs/guide/upgrade.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Upgrading Vite+
|
|
2
2
|
|
|
3
|
-
Use `vp upgrade` to update the global `vp` binary. To update the local `vite-plus` package in a project, see [Update Vite+](/guide/upgrade-project).
|
|
3
|
+
Use `vp upgrade` to update the global `vp` binary, or [Homebrew](#homebrew) if it owns your installation. To update the local `vite-plus` package in a project, see [Update Vite+](/guide/upgrade-project).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ vp toolchain vite rolldown oxc
|
|
|
22
22
|
vp toolchain --json
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The command uses the local `vite-plus` package when the project has one. Use `--global` to show the release for the global `vp` command:
|
|
25
|
+
The command uses the local `vite-plus` package when the project has one. Use `--global` or `-g` to show the release for the global `vp` command:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
vp toolchain --global
|
|
@@ -87,15 +87,19 @@ Older versions are pruned automatically after each upgrade. The active version a
|
|
|
87
87
|
|
|
88
88
|
### Homebrew
|
|
89
89
|
|
|
90
|
-
Homebrew owns its installed binary
|
|
90
|
+
The [official Homebrew tap](/guide/homebrew) owns its installed binary. Update it with:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
brew upgrade vite-plus
|
|
93
|
+
brew upgrade voidzero-dev/vite-plus/vp
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
`vp upgrade` detects
|
|
96
|
+
`vp upgrade` detects the installed formula and shows its Homebrew upgrade command without downloading or installing another version. This also applies to `--force`, a specific version, and `--rollback`. The script installer's rollback and automatic pruning do not apply to Homebrew installations.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
For the tap, run `vp` after upgrading to install the new version's dependencies in your user data directory. Setup preserves your management preferences.
|
|
99
|
+
|
|
100
|
+
For the tap, `vp upgrade --check` directs you to `brew outdated voidzero-dev/vite-plus/vp`. Automatic npm update checks and notices are disabled for Homebrew installations.
|
|
101
|
+
|
|
102
|
+
To switch to the tap, follow the [migration steps](/guide/homebrew#switch-an-existing-installation).
|
|
99
103
|
|
|
100
104
|
## Preview Builds
|
|
101
105
|
|
|
@@ -111,6 +115,8 @@ Preview builds are addressed by pull request number or commit SHA. They are not
|
|
|
111
115
|
|
|
112
116
|
### Global `vp` Preview
|
|
113
117
|
|
|
118
|
+
For a Homebrew installation, follow the [tap preview instructions](/guide/homebrew#test-a-preview-build).
|
|
119
|
+
|
|
114
120
|
Install a preview build of the global CLI by passing `VP_PR_VERSION` to the installer. Pass a pull request number or a commit SHA:
|
|
115
121
|
|
|
116
122
|
```bash
|
package/docs/guide/vitest-v5.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Upgrade to Vitest 5
|
|
2
2
|
|
|
3
|
-
Vite+ bundles Vitest `5.0
|
|
3
|
+
Vite+ bundles Vitest `5.1.0`. Use Node `^22.18.0 || ^24.11.0 || >=26.0.0` for the CLI and tests.
|
|
4
4
|
|
|
5
5
|
## Before you migrate
|
|
6
6
|
|
|
@@ -126,7 +126,7 @@ Review calls with benchmark options, imported or reassigned callbacks, callback
|
|
|
126
126
|
|
|
127
127
|
## Entry points and packages
|
|
128
128
|
|
|
129
|
-
Use `vite-plus/test` for assertions and supported runner APIs. Keep coverage providers and `@vitest/ui` at the bundled runner's exact version, `5.0
|
|
129
|
+
Use `vite-plus/test` for assertions and supported runner APIs. Keep coverage providers and `@vitest/ui` at the bundled runner's exact version, `5.1.0`. Keep `@vitest/web-worker` aligned when your project uses it.
|
|
130
130
|
|
|
131
131
|
| v4 import | v5 import or action |
|
|
132
132
|
| ---------------------------------------- | --------------------------------------------------------------------------- |
|
package/docs/guide/vpx.md
CHANGED
|
@@ -87,7 +87,7 @@ A missing path, or a missing name with a TypeScript extension, is an error: `vpx
|
|
|
87
87
|
|
|
88
88
|
- `--tsconfig <path>` applies one tsconfig to every file (see [tsconfig](#tsconfig))
|
|
89
89
|
- `--watch` runs the file again when a file it uses changes (see [Watch Mode](#watch-mode))
|
|
90
|
-
- Node.js options before the file, such as `--inspect`, `--test`, `--env-file`, `--require`, and `--import`, are passed to Node.js; `--require` and `--import`
|
|
90
|
+
- Node.js options before the file, such as `--inspect`, `--test`, `--env-file`, `--require`, and `--import`, are passed to Node.js; modules loaded with `--require` and `--import` can be TypeScript too
|
|
91
91
|
- Everything after the file, including `--`, is passed to the script
|
|
92
92
|
|
|
93
93
|
### Shebang Scripts
|
|
@@ -103,6 +103,38 @@ Scripts can use `vpx` as their interpreter. Make the file executable and keep it
|
|
|
103
103
|
|
|
104
104
|
The `vpx` bin of the `vite-plus` package runs scripts on its own, so `"seed": "vpx ./scripts/seed.ts"` works in `package.json` scripts without the global CLI. It runs them on the Node.js that started it, which inside `vp run` and package manager scripts is the project's version.
|
|
105
105
|
|
|
106
|
+
### Using Node.js Directly
|
|
107
|
+
|
|
108
|
+
To run TypeScript with `node`, use `--import vite-plus/register`. This registers the Vite+ TypeScript loader before your script runs:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
node --import=vite-plus/register ./scripts/seed.ts
|
|
112
|
+
node --import vite-plus/register --test ./test/example.test.ts
|
|
113
|
+
NODE_OPTIONS='--import=vite-plus/register' node ./scripts/seed.ts
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Install `vite-plus` in the project first. Node.js resolves `vite-plus/register` from the project. The loader provides the same TypeScript transforms, tsconfig resolution, and source maps as `vpx`, and requires the same Node.js versions as Vite+.
|
|
117
|
+
|
|
118
|
+
If a tool starts Node.js itself, add `--import vite-plus/register` to its Node.js arguments or `NODE_OPTIONS`. Replace an existing `--import tsx` argument with `--import vite-plus/register`. For example, an AVA configuration can use:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"ava": {
|
|
123
|
+
"nodeArguments": ["--import=vite-plus/register"]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Keep the tool's existing TypeScript file patterns and other settings. A JavaScript launcher can also run `await import('vite-plus/register')` before dynamically importing a TypeScript file. A static TypeScript import in that launcher is resolved before registration, so use `--import` for static imports.
|
|
129
|
+
|
|
130
|
+
`fork()` and workers inherit the `--import` option through Node.js arguments. `NODE_OPTIONS` also passes the option to spawned Node.js processes. Replacing a child's arguments or environment follows Node.js's normal inheritance rules.
|
|
131
|
+
|
|
132
|
+
To select a tsconfig, set `VP_SCRIPT_TSCONFIG=tsconfig.scripts.json`. The existing `TSX_TSCONFIG_PATH` variable also works, with `VP_SCRIPT_TSCONFIG` taking precedence. Otherwise the [usual tsconfig discovery](#tsconfig) applies. Each worker selects its config from its own environment, so workers can use different configs without changing their parent.
|
|
133
|
+
|
|
134
|
+
Node.js owns its flags, test discovery, and native watch mode. Eval and stdin can import TypeScript files, but their input text is not transformed. Modules loaded with `--require` run before modules loaded with `--import`. To load a TypeScript setup file, put `--import ./setup.ts` after `--import vite-plus/register`. Repeated imports of `vite-plus/register` are harmless, including when a tool already runs under `vpx`.
|
|
135
|
+
|
|
136
|
+
The [compiler differences from tsx](#coming-from-tsx) also apply when you use `vite-plus/register`.
|
|
137
|
+
|
|
106
138
|
### Watch Mode
|
|
107
139
|
|
|
108
140
|
```bash
|
|
@@ -132,7 +164,7 @@ It watches every file the script imports or requires (in worker threads too, on
|
|
|
132
164
|
|
|
133
165
|
`vpx` reads compiler options from a tsconfig but does not type-check with it. Each file uses the nearest `tsconfig.json` above it that includes it through `files`, `include`, `exclude`, or project `references`, as `tsc` does, and `extends` is followed. Files in `node_modules` use no tsconfig, and neither does a file that no tsconfig includes, so it gets the defaults below. Such a file still resolves `paths` aliases through the nearest `tsconfig.json` above it, as tsx does: with a root tsconfig whose `include` is `["src"]`, a script in `scripts/` can import the same aliases as `src/`. Because the config depends on the file's location, not on the working directory, `vpx` compiles a file the same way wherever it runs from.
|
|
134
166
|
|
|
135
|
-
`--tsconfig <path>` applies one config to every file instead, including files that config does not include. Without `--tsconfig`,
|
|
167
|
+
`--tsconfig <path>` applies one config to every file instead, including files that config does not include. Without `--tsconfig`, `TSX_TSCONFIG_PATH`, `TS_NODE_PROJECT`, or `OXC_TSCONFIG_PATH` can select a config, in that order. If it names a file that does not exist, or a tsconfig fails to parse, `vpx` prints a warning and runs without that config.
|
|
136
168
|
|
|
137
169
|
A file that no tsconfig applies to runs as if its `compilerOptions` were empty:
|
|
138
170
|
|
|
@@ -193,8 +225,16 @@ JSX that depends on a compiler plugin is not supported. `vpx` compiles JSX only
|
|
|
193
225
|
- **Node.js version**: `vpx` needs Node.js `^22.18.0 || ^24.11.0 || >=26.0.0`, while tsx also runs on older releases.
|
|
194
226
|
- **Watch mode**: `tsx watch` becomes `vpx --watch`, which takes tsx watch's options (see [Watch Mode](#watch-mode)). It also reruns the script on tsconfig edits and when a file a failed import looked for is created, which tsx watch misses.
|
|
195
227
|
- **Eval, REPL, and `--check`**: `vpx --eval`, the REPL, and `vpx --check` do not transform TypeScript.
|
|
196
|
-
- **`node --import tsx`**: `
|
|
197
|
-
- **Other loaders**:
|
|
228
|
+
- **`node --import tsx`**: replace it with [`node --import vite-plus/register`](#using-nodejs-directly), including in tool settings and `NODE_OPTIONS`.
|
|
229
|
+
- **Other loaders**: replace `--import tsx` with `--import vite-plus/register`. Registering both TypeScript loaders makes them compete for the same files.
|
|
230
|
+
|
|
231
|
+
### Coming from oxnode
|
|
232
|
+
|
|
233
|
+
`vp migrate` can replace `oxnode <file>` with `vpx <file>` and `oxnode watch <file>` with `vpx --watch <file>`. Both use oxc-node's transformer and watcher. Node.js commands and literal `NODE_OPTIONS` assignments that load `@oxc-node/core/register` use `vite-plus/register` instead. Migration removes the standalone development dependencies only when no remaining commands or imports need them. See [oxnode to `vpx`](/guide/migrate-rules#oxnode-to-vpx).
|
|
234
|
+
|
|
235
|
+
### Coming from ts-node
|
|
236
|
+
|
|
237
|
+
`vp migrate` can replace supported transpile-only ts-node commands with `vpx`. Supported Node.js preloads and literal `NODE_OPTIONS` assignments use `vite-plus/register`. Migration keeps commands that type-check because neither replacement performs that check. Custom compiler settings and remaining loader or API usage can also keep `ts-node` installed. See [ts-node to `vpx`](/guide/migrate-rules#ts-node-to-vpx).
|
|
198
238
|
|
|
199
239
|
## `vp exec`
|
|
200
240
|
|
|
@@ -213,7 +253,7 @@ vp exec tsc --noEmit
|
|
|
213
253
|
|
|
214
254
|
## `vp dlx`
|
|
215
255
|
|
|
216
|
-
Use `vp dlx` for one-off package execution without adding the package to your project dependencies.
|
|
256
|
+
Use `vp dlx` for one-off package execution without adding the package to your project dependencies. See the [dlx command reference](/guide/package-management/dlx) for options and package-manager compatibility.
|
|
217
257
|
|
|
218
258
|
```bash
|
|
219
259
|
vp dlx <package> [args...]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"templates"
|
|
33
33
|
],
|
|
34
34
|
"type": "module",
|
|
35
|
-
"sideEffects":
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"./dist/register.js"
|
|
37
|
+
],
|
|
36
38
|
"main": "./dist/index.js",
|
|
37
39
|
"types": "./dist/index.d.ts",
|
|
38
40
|
"exports": {
|
|
@@ -85,6 +87,10 @@
|
|
|
85
87
|
"types": "./dist/oxlint-plugin.d.ts"
|
|
86
88
|
},
|
|
87
89
|
"./package.json": "./package.json",
|
|
90
|
+
"./register": {
|
|
91
|
+
"types": "./dist/register.d.ts",
|
|
92
|
+
"default": "./dist/register.js"
|
|
93
|
+
},
|
|
88
94
|
"./pack": {
|
|
89
95
|
"types": "./dist/pack.d.ts",
|
|
90
96
|
"import": "./dist/pack.js"
|
|
@@ -339,53 +345,53 @@
|
|
|
339
345
|
}
|
|
340
346
|
},
|
|
341
347
|
"dependencies": {
|
|
342
|
-
"@oxc-project/runtime": "=0.
|
|
343
|
-
"@oxc-project/types": "=0.
|
|
344
|
-
"@oxlint/plugins": "=1.
|
|
345
|
-
"@vitest/browser": "5.0
|
|
346
|
-
"@vitest/browser-preview": "5.0
|
|
347
|
-
"@vitest/mocker": "5.0
|
|
348
|
-
"@vitest/pretty-format": "5.0
|
|
349
|
-
"@vitest/snapshot": "5.0
|
|
350
|
-
"@vitest/spy": "5.0
|
|
351
|
-
"@vitest/utils": "5.0
|
|
352
|
-
"oxfmt": "=0.
|
|
353
|
-
"oxlint": "=1.
|
|
354
|
-
"oxlint-tsgolint": "=7.0.
|
|
355
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.
|
|
356
|
-
"vitest": "5.0
|
|
348
|
+
"@oxc-project/runtime": "=0.157.0",
|
|
349
|
+
"@oxc-project/types": "=0.157.0",
|
|
350
|
+
"@oxlint/plugins": "=1.91.0",
|
|
351
|
+
"@vitest/browser": "5.1.0",
|
|
352
|
+
"@vitest/browser-preview": "5.1.0",
|
|
353
|
+
"@vitest/mocker": "5.1.0",
|
|
354
|
+
"@vitest/pretty-format": "5.1.0",
|
|
355
|
+
"@vitest/snapshot": "5.1.0",
|
|
356
|
+
"@vitest/spy": "5.1.0",
|
|
357
|
+
"@vitest/utils": "5.1.0",
|
|
358
|
+
"oxfmt": "=0.76.0",
|
|
359
|
+
"oxlint": "=1.91.0",
|
|
360
|
+
"oxlint-tsgolint": "=7.0.2005",
|
|
361
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.5.1",
|
|
362
|
+
"vitest": "5.1.0"
|
|
357
363
|
},
|
|
358
364
|
"devDependencies": {
|
|
359
|
-
"@emnapi/core": "2.0.0-
|
|
360
|
-
"@emnapi/runtime": "2.0.0-
|
|
361
|
-
"@napi-rs/cli": "^3.10.
|
|
365
|
+
"@emnapi/core": "2.0.0-beta.2",
|
|
366
|
+
"@emnapi/runtime": "2.0.0-beta.2",
|
|
367
|
+
"@napi-rs/cli": "^3.10.12",
|
|
362
368
|
"@nkzw/safe-word-list": "^3.1.0",
|
|
363
369
|
"@types/cross-spawn": "^6.0.6",
|
|
364
370
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
365
|
-
"@vitest/browser-playwright": "5.0
|
|
371
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
366
372
|
"@vitest/browser-webdriverio": "5.0.0",
|
|
367
|
-
"@voidzero-dev/vite-plus-prompts": "1.
|
|
373
|
+
"@voidzero-dev/vite-plus-prompts": "1.5.1",
|
|
368
374
|
"@voidzero-dev/vite-task-client": "0.2.0",
|
|
369
375
|
"bingo": "^0.13.2",
|
|
370
|
-
"cac": "^7.
|
|
376
|
+
"cac": "^7.1.0",
|
|
371
377
|
"cross-spawn": "^7.0.5",
|
|
372
378
|
"detect-indent": "^7.0.2",
|
|
373
379
|
"detect-newline": "^4.0.1",
|
|
374
380
|
"jsonc-parser": "^3.3.1",
|
|
375
381
|
"lint-staged": "^17.6.0",
|
|
376
|
-
"minimatch": "^
|
|
382
|
+
"minimatch": "^11.0.0",
|
|
377
383
|
"nanotar": "^0.3.0",
|
|
378
384
|
"picocolors": "^1.1.1",
|
|
379
385
|
"pirates": "^4.0.7",
|
|
380
386
|
"tinyglobby": "^0.2.15",
|
|
381
|
-
"tsdown": "^0.23.
|
|
387
|
+
"tsdown": "^0.23.4",
|
|
382
388
|
"validate-npm-package-name": "^8.0.0",
|
|
383
389
|
"verkit": "^0.5.0",
|
|
384
390
|
"yaml": "^2.9.1",
|
|
385
391
|
"zod": "^4.4.3"
|
|
386
392
|
},
|
|
387
393
|
"peerDependencies": {
|
|
388
|
-
"@vitest/browser-playwright": "5.0
|
|
394
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
389
395
|
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
|
390
396
|
"playwright": "*"
|
|
391
397
|
},
|
|
@@ -418,14 +424,14 @@
|
|
|
418
424
|
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
|
|
419
425
|
},
|
|
420
426
|
"optionalDependencies": {
|
|
421
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "1.
|
|
422
|
-
"@voidzero-dev/vite-plus-darwin-x64": "1.
|
|
423
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "1.
|
|
424
|
-
"@voidzero-dev/vite-plus-linux-arm64-musl": "1.
|
|
425
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "1.
|
|
426
|
-
"@voidzero-dev/vite-plus-linux-x64-musl": "1.
|
|
427
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "1.
|
|
428
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "1.
|
|
427
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "1.5.1",
|
|
428
|
+
"@voidzero-dev/vite-plus-darwin-x64": "1.5.1",
|
|
429
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "1.5.1",
|
|
430
|
+
"@voidzero-dev/vite-plus-linux-arm64-musl": "1.5.1",
|
|
431
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "1.5.1",
|
|
432
|
+
"@voidzero-dev/vite-plus-linux-x64-musl": "1.5.1",
|
|
433
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "1.5.1",
|
|
434
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "1.5.1"
|
|
429
435
|
},
|
|
430
436
|
"scripts": {
|
|
431
437
|
"build": "oxnode -C dev ./build.ts",
|