vite-plus 1.5.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/dist/{agent-DkQD3xqe.js → agent-CowvWq3j.js} +2 -2
- package/dist/bin.js +20 -6
- package/dist/config/bin.js +2 -2
- package/dist/{constants-D2P2aVKb.js → constants-D5f7inVN.js} +1 -1
- package/dist/create/bin.js +7 -7
- package/dist/{define-config-CwtQqYC1.cjs → define-config-BGCfAiIo.cjs} +1 -1
- package/dist/{define-config-wR57OZG_.js → define-config-XKYhw0xH.js} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-aOy1T15H.js → editor-BVaNnIey.js} +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +6 -6
- package/dist/{oxlint-plugin-config-CHsI_zKo.js → oxlint-plugin-config-5hVqz4kj.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +1 -1
- package/dist/{package-DfFo6-E-.js → package-DLUCo6L_.js} +1 -1
- package/dist/{prompts-C7DI63WP.js → prompts-DLpJGhfK.js} +1 -1
- package/dist/{resolve-vite-config-Cx3cnVVI.js → resolve-vite-config-D-JtjGRa.js} +2 -2
- package/dist/{resolve-vite-config-33bzSaeT.js → resolve-vite-config-D7IUZYKq.js} +1 -1
- package/dist/staged/bin.js +1 -1
- package/dist/toolchain.js +5 -5
- package/dist/toolchain.json +5 -5
- package/dist/{tsconfig-shNmmCE_.js → tsconfig-D3DiCiW6.js} +2 -2
- package/dist/{tsconfig-BE3Wj9OX.js → tsconfig-DLERIAbF.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +2 -2
- package/docs/guide/global-cli.md +1 -1
- package/docs/guide/index.md +4 -4
- package/docs/guide/local-cli.md +1 -1
- package/docs/guide/migrate.md +4 -4
- 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/vpx.md +1 -1
- package/package.json +12 -12
- 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/vpx.md
CHANGED
|
@@ -253,7 +253,7 @@ vp exec tsc --noEmit
|
|
|
253
253
|
|
|
254
254
|
## `vp dlx`
|
|
255
255
|
|
|
256
|
-
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.
|
|
257
257
|
|
|
258
258
|
```bash
|
|
259
259
|
vp dlx <package> [args...]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -358,19 +358,19 @@
|
|
|
358
358
|
"oxfmt": "=0.76.0",
|
|
359
359
|
"oxlint": "=1.91.0",
|
|
360
360
|
"oxlint-tsgolint": "=7.0.2005",
|
|
361
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.5.
|
|
361
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.5.1",
|
|
362
362
|
"vitest": "5.1.0"
|
|
363
363
|
},
|
|
364
364
|
"devDependencies": {
|
|
365
365
|
"@emnapi/core": "2.0.0-beta.2",
|
|
366
366
|
"@emnapi/runtime": "2.0.0-beta.2",
|
|
367
|
-
"@napi-rs/cli": "^3.10.
|
|
367
|
+
"@napi-rs/cli": "^3.10.12",
|
|
368
368
|
"@nkzw/safe-word-list": "^3.1.0",
|
|
369
369
|
"@types/cross-spawn": "^6.0.6",
|
|
370
370
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
371
371
|
"@vitest/browser-playwright": "5.1.0",
|
|
372
372
|
"@vitest/browser-webdriverio": "5.0.0",
|
|
373
|
-
"@voidzero-dev/vite-plus-prompts": "1.5.
|
|
373
|
+
"@voidzero-dev/vite-plus-prompts": "1.5.1",
|
|
374
374
|
"@voidzero-dev/vite-task-client": "0.2.0",
|
|
375
375
|
"bingo": "^0.13.2",
|
|
376
376
|
"cac": "^7.1.0",
|
|
@@ -424,14 +424,14 @@
|
|
|
424
424
|
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
|
|
425
425
|
},
|
|
426
426
|
"optionalDependencies": {
|
|
427
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "1.5.
|
|
428
|
-
"@voidzero-dev/vite-plus-darwin-x64": "1.5.
|
|
429
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "1.5.
|
|
430
|
-
"@voidzero-dev/vite-plus-linux-arm64-musl": "1.5.
|
|
431
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "1.5.
|
|
432
|
-
"@voidzero-dev/vite-plus-linux-x64-musl": "1.5.
|
|
433
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "1.5.
|
|
434
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "1.5.
|
|
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"
|
|
435
435
|
},
|
|
436
436
|
"scripts": {
|
|
437
437
|
"build": "oxnode -C dev ./build.ts",
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
# Package Management
|
|
2
|
-
|
|
3
|
-
`vp` detects and runs the current workspace's package manager. These commands are available from both the [global CLI](/guide/global-cli) and the [project-local CLI](/guide/local-cli).
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Use Vite+ to manage dependencies across pnpm, npm, Yarn, and Bun. Instead of switching between `pnpm install`, `npm install`, `yarn install`, and `bun install`, you can keep using `vp install`, `vp add`, `vp remove`, and the rest of the Vite+ package-management commands.
|
|
8
|
-
|
|
9
|
-
Vite+ detects the package manager from the workspace root in this order:
|
|
10
|
-
|
|
11
|
-
1. `packageManager` in `package.json`
|
|
12
|
-
2. `devEngines.packageManager` in `package.json`
|
|
13
|
-
3. `pnpm-workspace.yaml`
|
|
14
|
-
4. `pnpm-lock.yaml`
|
|
15
|
-
5. `yarn.lock` or `.yarnrc.yml`
|
|
16
|
-
6. `package-lock.json`
|
|
17
|
-
7. `bun.lock` or `bun.lockb`
|
|
18
|
-
8. `.pnpmfile.cjs` or `pnpmfile.cjs`
|
|
19
|
-
9. `bunfig.toml`
|
|
20
|
-
10. `yarn.config.cjs`
|
|
21
|
-
|
|
22
|
-
If none of those files are present, `vp` falls back to `pnpm` by default. Vite+ automatically downloads the matching package manager and uses it for the command you ran, but package-manager detection never rewrites `package.json`. Use `vp env pin <package-manager>@<version>` when the project should declare an exact version explicitly.
|
|
23
|
-
|
|
24
|
-
The [`devEngines.packageManager`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines) field accepts a single object or an array of objects, and its `version` may be a semver range:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"devEngines": {
|
|
29
|
-
"packageManager": {
|
|
30
|
-
"name": "pnpm",
|
|
31
|
-
"version": "^11.0.0",
|
|
32
|
-
"onFail": "download"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
A range resolves to an already-downloaded satisfying version when possible, otherwise to the latest satisfying version from the npm registry. The range itself stays the source of truth; Vite+ never freezes it into an exact `packageManager` pin. When both `packageManager` and `devEngines.packageManager` are declared, the `packageManager` field drives selection and Vite+ warns when it does not satisfy the devEngines constraint (`vp env doctor` shows details).
|
|
39
|
-
|
|
40
|
-
Vite+ currently downloads the declared package manager (the `onFail: "download"` behavior); the other `onFail` values are accepted but not yet differentiated.
|
|
41
|
-
|
|
42
|
-
The explicit `packageManager` field (or the `devEngines.packageManager` declaration) also affects matching package-manager shims. If a project has `packageManager: "npm@10.9.4"`, `npm` and `npx` use npm 10.9.4. Other generated aliases behave the same way: `pnpm`/`pnpx`/`pn`/`pnx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Mismatched tools are not translated; `npm` in a `pnpm` project still resolves as npm.
|
|
43
|
-
|
|
44
|
-
## Usage
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
vp install
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Common install flows:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
vp install
|
|
54
|
-
vp install --frozen-lockfile
|
|
55
|
-
vp install --lockfile-only
|
|
56
|
-
vp install --filter web
|
|
57
|
-
vp install -w
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
`vp install` maps to the correct underlying install behavior for the detected package manager, including the right lockfile flags for pnpm, npm, Yarn, and Bun.
|
|
61
|
-
|
|
62
|
-
## Global Packages
|
|
63
|
-
|
|
64
|
-
::: info
|
|
65
|
-
Global package operations with `-g` require the [global CLI](/guide/global-cli).
|
|
66
|
-
:::
|
|
67
|
-
|
|
68
|
-
Use the `-g` flag for installing, updating or removing globally installed packages:
|
|
69
|
-
|
|
70
|
-
- `vp install -g <pkg>` installs a package globally
|
|
71
|
-
- `vp install -g --node <version> <pkg>` installs a package globally with a specific Node.js version
|
|
72
|
-
- `vp uninstall -g <pkg>` removes a global package
|
|
73
|
-
- `vp update -g [pkg]` updates one global package or all of them
|
|
74
|
-
- `vp list -g [pkg]` lists global packages
|
|
75
|
-
- `vp outdated -g [pkg]` prints outdated packages
|
|
76
|
-
|
|
77
|
-
Without `--node`, `vp install -g` uses the Node.js version resolved for the current directory, so a project's pin takes precedence over `vp env default`. See [Node.js Selection](/guide/env#node-js-selection).
|
|
78
|
-
|
|
79
|
-
Updates keep the version spec a package was installed with: a package installed from a dist-tag (e.g. `vp install -g some-pkg@nightly`) updates to the newest version of that tag, and a version range stays within the range. Reinstall with a different spec (e.g. `vp update -g some-pkg@latest`) to switch, or pass `--latest` to `vp update -g` to move packages to the `latest` tag and clear their recorded specs. `vp outdated -g` reports both the newest version matching the recorded spec (`Wanted`) and the newest version on the `latest` tag.
|
|
80
|
-
|
|
81
|
-
::: warning
|
|
82
|
-
These commands do **NOT** interact with the underlying package manager's global installation directory.
|
|
83
|
-
|
|
84
|
-
Instead, Vite+ stores its global packages in `packages/` under the resolved data directory. These packages remain available across different Node.js versions.
|
|
85
|
-
|
|
86
|
-
As a result, commands such as `vp link` do not affect Vite+'s global packages and will not appear in `vp list -g`.
|
|
87
|
-
:::
|
|
88
|
-
|
|
89
|
-
## Managing Dependencies
|
|
90
|
-
|
|
91
|
-
Vite+ provides all the familiar package management commands:
|
|
92
|
-
|
|
93
|
-
- `vp install` installs the current dependency graph for the project
|
|
94
|
-
- `vp add <pkg>` adds packages to `dependencies`, use `-D` for `devDependencies`
|
|
95
|
-
- `vp remove <pkg>` removes packages
|
|
96
|
-
- `vp update` updates dependencies
|
|
97
|
-
- `vp dedupe` reduces duplicate dependency entries where the package manager supports it
|
|
98
|
-
- `vp outdated` shows available updates
|
|
99
|
-
- `vp list` shows installed packages
|
|
100
|
-
- `vp why <pkg>` explains why a package is present
|
|
101
|
-
- `vp info <pkg>` shows registry metadata for a package
|
|
102
|
-
- `vp rebuild` rebuilds native modules (e.g. after switching Node.js versions)
|
|
103
|
-
- `vp link` and `vp unlink` manage local package links
|
|
104
|
-
- `vp dlx <pkg>` runs a package binary without adding it to the project
|
|
105
|
-
- `vp pm <command>` provides additional package-management commands adapted to the detected package manager
|
|
106
|
-
|
|
107
|
-
::: info
|
|
108
|
-
The `vp list` and `vp rebuild` shortcuts are available only in the global CLI. With the [project-local CLI](/guide/local-cli), use `vp pm list` and `vp pm rebuild`.
|
|
109
|
-
:::
|
|
110
|
-
|
|
111
|
-
### Command Guide
|
|
112
|
-
|
|
113
|
-
#### Install
|
|
114
|
-
|
|
115
|
-
Use `vp install` when you want to install exactly what the current `package.json` and lockfile describe.
|
|
116
|
-
|
|
117
|
-
- `vp install` is the standard install command
|
|
118
|
-
- `vp install --frozen-lockfile` fails if the lockfile would need changes
|
|
119
|
-
- `vp install --no-frozen-lockfile` allows lockfile updates explicitly
|
|
120
|
-
- `vp install --lockfile-only` updates the lockfile without performing a full install
|
|
121
|
-
- `vp install --prefer-offline` and `vp install --offline` prefer or require cached packages
|
|
122
|
-
- `vp install --ignore-scripts` skips lifecycle scripts
|
|
123
|
-
- `vp install --filter <pattern>` scopes install work in monorepos
|
|
124
|
-
- `vp install -w` installs in the workspace root
|
|
125
|
-
|
|
126
|
-
::: info
|
|
127
|
-
Option support depends on the detected package manager and its version. Unsupported options cause `vp` to exit with an error before running the package-manager command.
|
|
128
|
-
:::
|
|
129
|
-
|
|
130
|
-
##### Git and remote tarball dependencies (npm v12+)
|
|
131
|
-
|
|
132
|
-
npm v12 stops resolving git dependencies (`github:`, `git+https:`) and remote tarball URLs by default; such installs fail with `EALLOWGIT` / `EALLOWREMOTE`. Opt back in per project with npm's `allow-git` / `allow-remote` config.
|
|
133
|
-
|
|
134
|
-
#### Global Install
|
|
135
|
-
|
|
136
|
-
Use these commands when you want package-manager-managed tools available outside a single project.
|
|
137
|
-
|
|
138
|
-
- `vp install -g typescript`
|
|
139
|
-
- `vp uninstall -g typescript`
|
|
140
|
-
- `vp update -g`
|
|
141
|
-
- `vp list -g`
|
|
142
|
-
- `vp outdated -g`
|
|
143
|
-
|
|
144
|
-
#### Add and Remove
|
|
145
|
-
|
|
146
|
-
Use `vp add` and `vp remove` for day-to-day dependency edits instead of editing `package.json` by hand.
|
|
147
|
-
|
|
148
|
-
- `vp add react`
|
|
149
|
-
- `vp add -D typescript vitest`
|
|
150
|
-
- `vp add -O fsevents`
|
|
151
|
-
- `vp add --save-peer react`
|
|
152
|
-
- `vp add react --ignore-scripts`
|
|
153
|
-
- `vp remove react`
|
|
154
|
-
- `vp remove --filter web react`
|
|
155
|
-
|
|
156
|
-
#### Update, Dedupe, and Outdated
|
|
157
|
-
|
|
158
|
-
Use these commands to maintain the dependency graph over time.
|
|
159
|
-
|
|
160
|
-
- `vp update` refreshes packages to newer versions
|
|
161
|
-
- `vp outdated` shows which packages have newer versions available
|
|
162
|
-
- `vp dedupe` asks the package manager to collapse duplicates where possible
|
|
163
|
-
|
|
164
|
-
#### Inspect
|
|
165
|
-
|
|
166
|
-
Use these when you need to understand the current state of dependencies.
|
|
167
|
-
|
|
168
|
-
- `vp list` shows installed packages
|
|
169
|
-
- `vp why react` explains why `react` is installed
|
|
170
|
-
- `vp info react` shows registry metadata such as versions and dist-tags
|
|
171
|
-
|
|
172
|
-
These commands show the packages that the package manager installed. They do not show tools that Vite+ bundles or compiles. Run `vp toolchain [tool]` to show these tools, including Vite, Rolldown, and Oxc. For readable output, `vp why` shows a hint when Vite+ also provides the package.
|
|
173
|
-
|
|
174
|
-
#### Rebuild
|
|
175
|
-
|
|
176
|
-
Use `vp rebuild` when native modules need to be recompiled, for example after switching Node.js versions or when a C/C++ addon fails to load.
|
|
177
|
-
|
|
178
|
-
- `vp rebuild` rebuilds all native modules
|
|
179
|
-
- `vp rebuild <package...>` rebuilds the listed packages only
|
|
180
|
-
- `vp rebuild -- <args>` passes extra arguments to the underlying package manager
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
vp rebuild
|
|
184
|
-
vp rebuild better-sqlite3 sharp
|
|
185
|
-
vp rebuild -- --update-binary
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
`vp rebuild` is a shorthand for `vp pm rebuild`.
|
|
189
|
-
|
|
190
|
-
With pnpm v10+, bare `vp rebuild` only rebuilds packages whose build scripts are listed in `onlyBuiltDependencies` (or approved via `pnpm approve-builds`); name the package explicitly to force a rebuild that bypasses the approval gate.
|
|
191
|
-
|
|
192
|
-
#### Dependency build scripts (npm v12+)
|
|
193
|
-
|
|
194
|
-
npm v12 skips dependency install scripts (`preinstall` / `install` / `postinstall`, including implicit `node-gyp` builds) unless the `allowScripts` field in package.json covers them; the install succeeds and npm warns about what it skipped. `vp pm approve-builds` manages that allowlist:
|
|
195
|
-
|
|
196
|
-
- `vp pm approve-builds <pkg...>` approves the named packages (`npm approve-scripts`)
|
|
197
|
-
- `vp pm approve-builds !<pkg...>` denies them (`npm deny-scripts`)
|
|
198
|
-
- `vp pm approve-builds --all` approves everything currently pending
|
|
199
|
-
- `vp pm approve-builds` lists the packages whose scripts are not yet covered
|
|
200
|
-
|
|
201
|
-
Approval only records the allowlist: scripts an earlier install skipped do not run until you run `vp rebuild <pkg>`. With npm 11.16 - 11.x the same commands work, but npm treats the allowlist as advisory and still runs scripts.
|
|
202
|
-
|
|
203
|
-
#### Advanced
|
|
204
|
-
|
|
205
|
-
Use these when you need lower-level package-manager behavior.
|
|
206
|
-
|
|
207
|
-
- `vp link` and `vp unlink` manage local development links
|
|
208
|
-
- `vp dlx create-vite` runs a package binary without saving it as a dependency
|
|
209
|
-
- `vp pm <command>` provides additional package-management commands adapted to the detected package manager.
|
|
210
|
-
|
|
211
|
-
- **Dependencies**: `ci`, `prune`, `list`, `rebuild`, `approve-builds`
|
|
212
|
-
- **Patching**: `patch`, `patch-commit`
|
|
213
|
-
- **Packaging and publishing**: `pack`, `version`, `publish`, `stage`, `dist-tag`, `deprecate`
|
|
214
|
-
- **Inspection**: `view`, `search`, `licenses`, `audit`, `fund`, `ping`
|
|
215
|
-
- **Authentication and access**: `login`, `logout`, `whoami`, `token`, `owner`, `team`
|
|
216
|
-
- **Configuration**: `config`, `cache`
|
|
217
|
-
- **Package manifest**: `pkg get`, `pkg set`, `pkg delete`, `pkg fix`
|
|
218
|
-
|
|
219
|
-
Command support depends on the package manager and its version. Run `vp pm --help` to list commands or `vp pm <command> --help` for available options.
|
|
220
|
-
|
|
221
|
-
Examples:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
vp pm config get registry
|
|
225
|
-
vp pm cache clean -- --force
|
|
226
|
-
vp pm audit --json
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
#### Package manifest
|
|
230
|
-
|
|
231
|
-
`vp pm pkg` reads and updates fields in `package.json` using the detected package manager.
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
vp pm pkg get name
|
|
235
|
-
vp pm pkg set scripts.build="vite build"
|
|
236
|
-
vp pm pkg set private=true --json
|
|
237
|
-
vp pm pkg delete scripts.build
|
|
238
|
-
vp pm pkg fix
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
npm supports `get`, `set`, and `delete` from 7.20.0 and `fix` from 9.8.0. pnpm supports all four commands from 11.3.0, and Bun supports them through `bun pm pkg` from 1.2.19. Yarn and unsupported versions print a warning and exit successfully without changing the manifest, matching `vp pm patch`.
|
|
242
|
-
|
|
243
|
-
Native behavior is preserved. For example, npm returns JSON from `get`, while pnpm prints a single string value without quotes by default. Use `--json` to request JSON output or to parse values passed to `set` as JSON. Additional native options can be passed after `--`. The corrections made by `fix` depend on the package manager.
|
|
244
|
-
|
|
245
|
-
#### Staged publishing
|
|
246
|
-
|
|
247
|
-
`vp pm stage` exposes [npm's staged publishing](https://docs.npmjs.com/staged-publishing) workflow: a build is uploaded to a staging area (no 2FA, CI-friendly), then a maintainer approves or rejects it from a trusted device (2FA). It adapts to the detected package manager.
|
|
248
|
-
|
|
249
|
-
```bash
|
|
250
|
-
vp pm stage publish # upload the package to staging (no 2FA)
|
|
251
|
-
vp pm stage list # list staged versions
|
|
252
|
-
vp pm stage view <stage-id> # inspect a staged version
|
|
253
|
-
vp pm stage download <stage-id> # download the staged tarball
|
|
254
|
-
vp pm stage approve <stage-id> # promote to the live registry (2FA)
|
|
255
|
-
vp pm stage reject <stage-id> # discard a staged version (2FA)
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
- pnpm (`pnpm stage`, requires pnpm ≥ 11.3) and npm (`npm stage`, requires npm ≥ 11.15 and Node ≥ 22.14) pass through directly.
|
|
259
|
-
- Yarn 4.16.0 and later uses its npm plugin (`yarn npm publish --staged`, `yarn npm stage …`). The `view` and `download` subcommands, and `publish` with an explicit tarball or folder target, fall back to `npm stage`.
|
|
260
|
-
- Yarn versions earlier than 4.16.0 and Bun fall back to `npm stage`.
|
|
261
|
-
|
|
262
|
-
## Package-Manager Integrity Verification
|
|
263
|
-
|
|
264
|
-
A `packageManager` pin can carry an integrity hash (`yarn@4.17.1+sha512.…`). `corepack use` writes that hash. Vite+ hashes the same artifact as Corepack:
|
|
265
|
-
|
|
266
|
-
- the extracted CLI binary (`bin/yarn.js`) for Yarn 2 and later
|
|
267
|
-
- the npm package tarball for npm, pnpm, and Yarn Classic
|
|
268
|
-
|
|
269
|
-
Vite+ hashes the CLI once, when it installs Yarn, and records the pin it verified. A later command compares its own pin against that record. A pin that does not match the record fails the check, and the command stops. Corepack keeps the same kind of record for its own cache.
|