vite-plus 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -29
- package/README.md +2 -2
- package/binding/index.cjs +60 -55
- package/binding/index.d.cts +125 -14
- package/dist/{agent-Wqx0MPk0.js → agent-C5jMYVfB.js} +3 -2
- package/dist/bin.js +89 -58
- package/dist/cli-parse-DHE8NrBU.js +13 -0
- package/dist/client/bundledDevClient.mjs +1 -1
- package/dist/client/client.mjs +1 -1
- package/dist/client/env.mjs +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/config/bin.js +83 -55
- package/dist/{constants-Bn-U8o4v.js → constants-0IAVgpox.js} +3 -3
- package/dist/create/bin.d.ts +13 -5
- package/dist/create/bin.js +37 -190
- package/dist/{define-config-WiVlryJ2.cjs → define-config-DIE9de46.cjs} +1 -1
- package/dist/{define-config-DWoAkNdp.d.ts → define-config-DPNEJxPz.d.ts} +5 -9
- package/dist/{define-config-GXUdVT-0.js → define-config-U3_xg7i-.js} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/dist-DfmT__Aw.js +619 -0
- package/dist/{editor-CC4DqODz.js → editor-B5-lvRaU.js} +68 -40
- package/dist/hooks/bin.js +9 -114
- package/dist/{hooks-DFqViZqZ.js → hooks-C-4gykWR.js} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/migration/bin.js +24 -143
- package/dist/migration/compat/worker.js +1 -1
- package/dist/module-runner.d.ts +1 -1
- package/dist/module-runner.js +1 -1
- package/dist/{oxlint-plugin-config-DX5ezKbB.js → oxlint-plugin-config-Drdl67Xp.js} +1 -1
- package/dist/oxlint-plugin.d.ts +2 -2
- package/dist/oxlint-plugin.js +1 -1
- package/dist/{pack-PvUg_xpv.d.ts → pack-BK38MLVZ.d.ts} +1 -1
- package/dist/pack-bin.d.ts +2 -3
- package/dist/pack-bin.js +5 -622
- package/dist/pack-client.d.ts +1 -1
- package/dist/pack.d.ts +2 -2
- package/dist/pack.js +1 -1
- package/dist/{package-CBe9EWPY.js → package-BZz2Ij68.js} +1 -1
- package/dist/{prompts-DF3yU-eU.js → prompts-CtzEgFY-.js} +3 -1400
- package/dist/{report-ZNR1Mk6h.js → report-CK5TnTsr.js} +1 -0
- package/dist/{resolve-vite-config-ipGb39Jo.js → resolve-vite-config-CGks1xR7.js} +3 -3
- package/dist/resolve-vite-config-Dnmc-lBc.js +2 -0
- package/dist/semver-CaDAb8vV.js +1400 -0
- package/dist/staged/bin.js +83 -218
- package/dist/sync-versions/bin.d.ts +1 -0
- package/dist/sync-versions/bin.js +3884 -0
- package/dist/sync-versions/bin.mjs +13323 -0
- package/dist/toolchain.js +9 -9
- package/dist/toolchain.json +9 -9
- package/dist/{tsconfig-LD2QhQ0O.js → tsconfig-CUggNuJR.js} +2 -2
- package/dist/{tsconfig-BVHG3DpR.js → tsconfig-VAbm4ZzJ.js} +1 -1
- package/dist/tsgolint-path.d.ts +3 -4
- package/dist/types/customEvent.d.ts +1 -1
- package/dist/types/hmrPayload.d.ts +1 -1
- package/dist/types/hot.d.ts +1 -1
- package/dist/types/import-meta.d.ts +1 -1
- package/dist/types/importGlob.d.ts +1 -1
- package/dist/types/importMeta.d.ts +1 -1
- package/dist/types/metadata.d.ts +1 -1
- package/dist/version.d.ts +2 -3
- package/dist/version.js +2 -2
- package/dist/versions.js +4 -4
- package/dist/vitest-ecosystem-BiRqcaRI.js +23 -0
- package/docs/guide/check.md +1 -0
- package/docs/guide/ci.md +42 -2
- package/docs/guide/env.md +124 -52
- package/docs/guide/ide-integration.md +14 -2
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +3 -1
- package/docs/guide/installer-env-vars.md +10 -0
- package/docs/guide/migrate-rules.md +57 -2
- package/package.json +17 -19
- package/dist/lib-L3DWSRQp.js +0 -75
- package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
package/dist/toolchain.js
CHANGED
|
@@ -4,7 +4,7 @@ export const toolchain = {
|
|
|
4
4
|
{
|
|
5
5
|
"id": "vite-plus",
|
|
6
6
|
"name": "vite-plus",
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.1",
|
|
8
8
|
"kind": "package",
|
|
9
9
|
"delivery": [
|
|
10
10
|
"dependency"
|
|
@@ -14,7 +14,7 @@ export const toolchain = {
|
|
|
14
14
|
{
|
|
15
15
|
"id": "vite-plus-core",
|
|
16
16
|
"name": "@voidzero-dev/vite-plus-core",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.1",
|
|
18
18
|
"kind": "package",
|
|
19
19
|
"delivery": [
|
|
20
20
|
"dependency"
|
|
@@ -36,7 +36,7 @@ export const toolchain = {
|
|
|
36
36
|
{
|
|
37
37
|
"id": "rolldown",
|
|
38
38
|
"name": "rolldown",
|
|
39
|
-
"version": "1.2.
|
|
39
|
+
"version": "1.2.7",
|
|
40
40
|
"kind": "tool",
|
|
41
41
|
"delivery": [
|
|
42
42
|
"bundled",
|
|
@@ -57,7 +57,7 @@ export const toolchain = {
|
|
|
57
57
|
{
|
|
58
58
|
"id": "oxlint",
|
|
59
59
|
"name": "oxlint",
|
|
60
|
-
"version": "1.
|
|
60
|
+
"version": "1.81.0",
|
|
61
61
|
"kind": "tool",
|
|
62
62
|
"delivery": [
|
|
63
63
|
"dependency"
|
|
@@ -67,7 +67,7 @@ export const toolchain = {
|
|
|
67
67
|
{
|
|
68
68
|
"id": "oxfmt",
|
|
69
69
|
"name": "oxfmt",
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.66.0",
|
|
71
71
|
"kind": "tool",
|
|
72
72
|
"delivery": [
|
|
73
73
|
"dependency"
|
|
@@ -89,7 +89,7 @@ export const toolchain = {
|
|
|
89
89
|
{
|
|
90
90
|
"id": "tsdown",
|
|
91
91
|
"name": "tsdown",
|
|
92
|
-
"version": "0.
|
|
92
|
+
"version": "0.23.0",
|
|
93
93
|
"kind": "tool",
|
|
94
94
|
"delivery": [
|
|
95
95
|
"bundled"
|
|
@@ -100,7 +100,7 @@ export const toolchain = {
|
|
|
100
100
|
"id": "vite-task",
|
|
101
101
|
"name": "vite-task",
|
|
102
102
|
"revision": "d05b1dcdbaabaa69643ee0b89cebe3cd390957e9",
|
|
103
|
-
"builtAt": "2026-
|
|
103
|
+
"builtAt": "2026-09-08T13:14:20Z",
|
|
104
104
|
"kind": "tool",
|
|
105
105
|
"delivery": [
|
|
106
106
|
"compiled"
|
|
@@ -110,7 +110,7 @@ export const toolchain = {
|
|
|
110
110
|
{
|
|
111
111
|
"id": "oxc",
|
|
112
112
|
"name": "oxc",
|
|
113
|
-
"version": "0.
|
|
113
|
+
"version": "0.148.0",
|
|
114
114
|
"kind": "engine",
|
|
115
115
|
"delivery": [
|
|
116
116
|
"compiled"
|
|
@@ -120,7 +120,7 @@ export const toolchain = {
|
|
|
120
120
|
{
|
|
121
121
|
"id": "oxc-resolver",
|
|
122
122
|
"name": "oxc-resolver",
|
|
123
|
-
"version": "11.24.
|
|
123
|
+
"version": "11.24.3",
|
|
124
124
|
"kind": "engine",
|
|
125
125
|
"delivery": [
|
|
126
126
|
"compiled"
|
package/dist/toolchain.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"id": "vite-plus",
|
|
6
6
|
"name": "vite-plus",
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.1",
|
|
8
8
|
"kind": "package",
|
|
9
9
|
"delivery": [
|
|
10
10
|
"dependency"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"id": "vite-plus-core",
|
|
16
16
|
"name": "@voidzero-dev/vite-plus-core",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.1",
|
|
18
18
|
"kind": "package",
|
|
19
19
|
"delivery": [
|
|
20
20
|
"dependency"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"id": "rolldown",
|
|
38
38
|
"name": "rolldown",
|
|
39
|
-
"version": "1.2.
|
|
39
|
+
"version": "1.2.7",
|
|
40
40
|
"kind": "tool",
|
|
41
41
|
"delivery": [
|
|
42
42
|
"bundled",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
{
|
|
58
58
|
"id": "oxlint",
|
|
59
59
|
"name": "oxlint",
|
|
60
|
-
"version": "1.
|
|
60
|
+
"version": "1.81.0",
|
|
61
61
|
"kind": "tool",
|
|
62
62
|
"delivery": [
|
|
63
63
|
"dependency"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
{
|
|
68
68
|
"id": "oxfmt",
|
|
69
69
|
"name": "oxfmt",
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.66.0",
|
|
71
71
|
"kind": "tool",
|
|
72
72
|
"delivery": [
|
|
73
73
|
"dependency"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{
|
|
90
90
|
"id": "tsdown",
|
|
91
91
|
"name": "tsdown",
|
|
92
|
-
"version": "0.
|
|
92
|
+
"version": "0.23.0",
|
|
93
93
|
"kind": "tool",
|
|
94
94
|
"delivery": [
|
|
95
95
|
"bundled"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"id": "vite-task",
|
|
101
101
|
"name": "vite-task",
|
|
102
102
|
"revision": "d05b1dcdbaabaa69643ee0b89cebe3cd390957e9",
|
|
103
|
-
"builtAt": "2026-
|
|
103
|
+
"builtAt": "2026-09-08T13:14:20Z",
|
|
104
104
|
"kind": "tool",
|
|
105
105
|
"delivery": [
|
|
106
106
|
"compiled"
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
{
|
|
111
111
|
"id": "oxc",
|
|
112
112
|
"name": "oxc",
|
|
113
|
-
"version": "0.
|
|
113
|
+
"version": "0.148.0",
|
|
114
114
|
"kind": "engine",
|
|
115
115
|
"delivery": [
|
|
116
116
|
"compiled"
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
{
|
|
121
121
|
"id": "oxc-resolver",
|
|
122
122
|
"name": "oxc-resolver",
|
|
123
|
-
"version": "11.24.
|
|
123
|
+
"version": "11.24.3",
|
|
124
124
|
"kind": "engine",
|
|
125
125
|
"delivery": [
|
|
126
126
|
"compiled"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-
|
|
2
|
-
import { A as isCancel, C as log, t as cancelAndExit, x as confirm } from "./prompts-DF3yU-eU.js";
|
|
1
|
+
import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-0IAVgpox.js";
|
|
3
2
|
import { c as parse, o as applyEdits, s as modify } from "./json-cULBl7Pi.js";
|
|
3
|
+
import { S as log, b as confirm, k as isCancel, t as cancelAndExit } from "./prompts-CtzEgFY-.js";
|
|
4
4
|
import { n as runCommandSilently } from "./command-CguLh2KL.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { styleText } from "node:util";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig } from "./tsconfig-
|
|
1
|
+
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig } from "./tsconfig-CUggNuJR.js";
|
|
2
2
|
export { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig };
|
package/dist/tsgolint-path.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
//#region src/utils/tsgolint-path.d.ts
|
|
2
|
-
declare function resolveWindowsTsgolintExecutable(pathCandidates: string[], options: {
|
|
2
|
+
export declare function resolveWindowsTsgolintExecutable(pathCandidates: string[], options: {
|
|
3
3
|
exists: (path: string) => boolean;
|
|
4
4
|
getRealpathCandidates?: () => string[];
|
|
5
5
|
}): string;
|
|
6
|
-
declare function resolveTsgolintExecutable(tsgolintBinPath: string, scriptUrl: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { resolveTsgolintExecutable, resolveWindowsTsgolintExecutable };
|
|
6
|
+
export declare function resolveTsgolintExecutable(tsgolintBinPath: string, scriptUrl: string): string;
|
|
7
|
+
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/customEvent.d.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/hmrPayload.d.ts';
|
package/dist/types/hot.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/hot.d.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/import-meta.d.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/importGlob.d.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/importMeta.d.ts';
|
package/dist/types/metadata.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from '
|
|
1
|
+
export type * from 'vite/types/metadata.d.ts';
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as renderCliDoc } from "./help-BmKpeOP9.js";
|
|
2
2
|
import { i as log, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { _ as version } from "./constants-
|
|
4
|
-
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-
|
|
3
|
+
import { _ as version } from "./constants-0IAVgpox.js";
|
|
4
|
+
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-BZz2Ij68.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
//#region src/version.ts
|
package/dist/versions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const versions = {
|
|
2
2
|
"vite": "8.2.2",
|
|
3
|
-
"rolldown": "1.2.
|
|
3
|
+
"rolldown": "1.2.7",
|
|
4
4
|
"vitest": "4.1.11",
|
|
5
|
-
"oxfmt": "0.
|
|
6
|
-
"oxlint": "1.
|
|
5
|
+
"oxfmt": "0.66.0",
|
|
6
|
+
"oxlint": "1.81.0",
|
|
7
7
|
"oxlint-tsgolint": "7.0.2001",
|
|
8
|
-
"tsdown": "0.
|
|
8
|
+
"tsdown": "0.23.0"
|
|
9
9
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/utils/package-overrides.ts
|
|
2
|
+
function extractOverrideTargetName(key) {
|
|
3
|
+
let target = key.trim();
|
|
4
|
+
for (let delimiter = target.search(/[^ |@]>/); delimiter !== -1; delimiter = target.search(/[^ |@]>/)) target = target.slice(delimiter + 2).trim();
|
|
5
|
+
if (!target) return target;
|
|
6
|
+
if (target.includes("/")) {
|
|
7
|
+
const segments = target.split("/");
|
|
8
|
+
const last = segments[segments.length - 1];
|
|
9
|
+
const scope = segments[segments.length - 2];
|
|
10
|
+
target = scope?.startsWith("@") ? `${scope}/${last}` : last;
|
|
11
|
+
}
|
|
12
|
+
const nameStart = target.startsWith("@") ? target.indexOf("/") + 1 : 0;
|
|
13
|
+
const versionAt = target.indexOf("@", nameStart);
|
|
14
|
+
return versionAt > 0 ? target.slice(0, versionAt) : target;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/utils/vitest-ecosystem.ts
|
|
18
|
+
const VITEST_ALIGN_EXCLUDED = /* @__PURE__ */ new Set(["@vitest/eslint-plugin", "@vitest/coverage-c8"]);
|
|
19
|
+
function isAlignableVitestEcosystemPackage(name) {
|
|
20
|
+
return name.startsWith("@vitest/") && !VITEST_ALIGN_EXCLUDED.has(name);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { extractOverrideTargetName as n, isAlignableVitestEcosystemPackage as t };
|
package/docs/guide/check.md
CHANGED
|
@@ -15,6 +15,7 @@ We recommend turning `typeCheck` on so `vp check` becomes the single command for
|
|
|
15
15
|
```bash
|
|
16
16
|
vp check
|
|
17
17
|
vp check --fix # Format and run autofixers.
|
|
18
|
+
vp check --quiet # Hide lint warnings; still report and fail on errors.
|
|
18
19
|
vp check --no-fmt # Skip format; run lint (and type-check if enabled).
|
|
19
20
|
vp check --no-lint # Skip lint rules; keep type-check when enabled.
|
|
20
21
|
vp check --no-fmt --no-lint # Type-check only (requires `typeCheck` enabled).
|
package/docs/guide/ci.md
CHANGED
|
@@ -4,12 +4,17 @@ You can use `voidzero-dev/setup-vp` to use Vite+ in CI environments.
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
[`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) provides integrations for GitHub Actions
|
|
7
|
+
[`voidzero-dev/setup-vp`](https://github.com/voidzero-dev/setup-vp) provides integrations for GitHub Actions, GitLab CI/CD, and Azure Pipelines. All three install Vite+ and can install project dependencies. The GitHub Action and Azure Pipelines template can also set up Node.js and cache package manager data automatically, while the GitLab CI/CD template uses the Node.js runtime and cache configuration provided by the job.
|
|
8
8
|
|
|
9
9
|
## setup-vp Versioning
|
|
10
10
|
|
|
11
11
|
Set `<setup-vp-version>` in each example to an exact version from the [`setup-vp` releases page](https://github.com/voidzero-dev/setup-vp/releases). You can use a commit SHA instead. Do not use the `v1` tag. The `v1` tag no longer receives updates.
|
|
12
12
|
|
|
13
|
+
Run `vp migrate` to replace exact `voidzero-dev/setup-vp@v1` references in
|
|
14
|
+
GitHub Actions workflows and composite actions under `.github` with the latest
|
|
15
|
+
exact release known to your Vite+ version. Existing exact versions and commit
|
|
16
|
+
SHAs remain unchanged.
|
|
17
|
+
|
|
13
18
|
### Automatic Version Updates
|
|
14
19
|
|
|
15
20
|
Dependabot and Renovate can update exact versions in GitHub Actions workflows.
|
|
@@ -35,7 +40,7 @@ When you use a commit SHA, add the exact release tag in a comment. Renovate uses
|
|
|
35
40
|
- uses: voidzero-dev/setup-vp@<commit-sha> # <setup-vp-version>
|
|
36
41
|
```
|
|
37
42
|
|
|
38
|
-
These settings apply only to GitHub Actions workflows. For GitLab CI/CD, update both version values together.
|
|
43
|
+
These settings apply only to GitHub Actions workflows. For GitLab CI/CD and Azure Pipelines, update both version values together.
|
|
39
44
|
|
|
40
45
|
## GitHub Actions
|
|
41
46
|
|
|
@@ -85,6 +90,41 @@ The GitLab CI/CD integration differs from the GitHub Action in a few ways:
|
|
|
85
90
|
|
|
86
91
|
For advanced configuration and the complete input reference, see the [`setup-vp` GitLab CI/CD documentation](https://github.com/voidzero-dev/setup-vp#gitlab-cicd).
|
|
87
92
|
|
|
93
|
+
## Azure Pipelines
|
|
94
|
+
|
|
95
|
+
Use the reusable `setup-vp` step template in your Azure Pipelines configuration. Create a GitHub service connection named `github`, then reference the template from the `setup-vp` repository:
|
|
96
|
+
|
|
97
|
+
```yaml [azure-pipelines.yml]
|
|
98
|
+
resources:
|
|
99
|
+
repositories:
|
|
100
|
+
- repository: setupVp
|
|
101
|
+
type: github
|
|
102
|
+
endpoint: github
|
|
103
|
+
name: voidzero-dev/setup-vp
|
|
104
|
+
ref: refs/tags/<setup-vp-version>
|
|
105
|
+
|
|
106
|
+
pool:
|
|
107
|
+
vmImage: ubuntu-latest
|
|
108
|
+
|
|
109
|
+
steps:
|
|
110
|
+
- checkout: self
|
|
111
|
+
- template: azure/setup-vp.yml@setupVp
|
|
112
|
+
parameters:
|
|
113
|
+
setupRef: '<setup-vp-version>'
|
|
114
|
+
nodeVersion: 24.x
|
|
115
|
+
cache: true
|
|
116
|
+
runInstall: true
|
|
117
|
+
- script: vp check
|
|
118
|
+
- script: vp test
|
|
119
|
+
- script: vp build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Pin `ref` and `setupRef` to the same tag or commit SHA for strict reproducibility.
|
|
123
|
+
|
|
124
|
+
The Azure Pipelines template supports Microsoft-hosted Linux, macOS, and Windows agents. It uses Azure's native `UseNode@1` and `Cache@2` tasks to set up Node.js and cache package-manager data.
|
|
125
|
+
|
|
126
|
+
For advanced configuration and the complete parameter reference, see the [`setup-vp` Azure Pipelines documentation](https://github.com/voidzero-dev/setup-vp#azure-pipelines).
|
|
127
|
+
|
|
88
128
|
## Simplifying Existing Workflows
|
|
89
129
|
|
|
90
130
|
If you are migrating an existing GitHub Actions workflow, you can often replace large blocks of Node, package-manager, and cache setup with a single `setup-vp` step.
|
package/docs/guide/env.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
# Environment
|
|
2
2
|
|
|
3
|
-
`vp env` manages Node.js
|
|
3
|
+
`vp env` manages the complete JavaScript environment: one Node.js runtime and one selected package manager. npm, pnpm, Yarn, and Bun are peer package-manager families.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
Managed mode is on by default, so
|
|
7
|
+
Managed mode is on by default, so Node.js and configured package-manager shims resolve through Vite+ and pick the right versions for the current project. Fresh installers record managed mode for npm, pnpm, Yarn, and Bun after the user enables environment management.
|
|
8
|
+
|
|
9
|
+
When an upgrade adds a package-manager shim that has no recorded mode, its first interactive invocation asks what to do only when the corresponding system binary is already on PATH. The current family defaults to managed mode; choosing a system tool or applying a choice to every family remains explicit. Non-interactive invocations use managed mode without recording a choice.
|
|
10
|
+
|
|
11
|
+
Most commands operate on both components when no selector is given. Add `node`, `pm`, `npm`, `pnpm`, `yarn`, or `bun` to narrow the command. `pm` means all four families for listing and cleanup, but the single selected package manager for project operations.
|
|
12
|
+
|
|
13
|
+
Unqualified versions remain Node.js versions for compatibility:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
vp env pin 22.0.0 # Node.js only
|
|
17
|
+
vp env pin pnpm@10.18.0 # pnpm only
|
|
18
|
+
vp env pin node@24 pnpm@12 # Both components
|
|
19
|
+
vp env pin 22.0.0 pnpm@10.18.0 # Also both components
|
|
20
|
+
```
|
|
8
21
|
|
|
9
22
|
Vite+ checks the current directory first, then walks up through its parents. The nearest directory
|
|
10
23
|
with a supported declaration wins. Within each directory, sources are checked in this order:
|
|
@@ -19,7 +32,29 @@ latest LTS.
|
|
|
19
32
|
|
|
20
33
|
`devEngines.runtime` ranks above `engines.node` because it declares the development-environment requirement, while `engines.node` is a consumer-facing support range. `vp env doctor` warns when declared sources conflict.
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
::: tip Using pnpm with Vite+ runtime management
|
|
36
|
+
pnpm can also manage the runtime declared in `devEngines.runtime`. When both pnpm and Vite+ manage Node.js, they can download the same version separately or select different versions, causing inconsistent behavior between commands.
|
|
37
|
+
|
|
38
|
+
If you want Vite+ to manage Node.js, pnpm 11+ supports disabling pnpm's automatic runtime management globally with [`runtimeOnFail`](https://pnpm.io/settings/cli#runtimeonfail):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm config set --global runtimeOnFail ignore
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This setting also disables pnpm's automatic management of other declared runtimes, including Bun and Deno. Consider whether any of your projects rely on that behavior before setting it globally.
|
|
45
|
+
:::
|
|
46
|
+
|
|
47
|
+
Package-manager selection uses this priority:
|
|
48
|
+
|
|
49
|
+
1. Explicit command override
|
|
50
|
+
2. `VP_PACKAGE_MANAGER` or the shell-session override
|
|
51
|
+
3. Top-level `packageManager`
|
|
52
|
+
4. `devEngines.packageManager`
|
|
53
|
+
5. Lockfile or manager-specific configuration
|
|
54
|
+
6. The named package manager's global default version
|
|
55
|
+
7. The named shim's latest release
|
|
56
|
+
|
|
57
|
+
A selected manager controls only its named shims. For example, pnpm controls `pnpm` and `pnpx`; invoking `npm` still resolves npm independently. Alias pairs are `npm`/`npx`, `pnpm`/`pnpx`, `yarn`/`yarnpkg`, and `bun`/`bunx`. Without a matching project selection, a named shim uses its configured default version and otherwise uses the latest release without prompting. The resolved version is cached for one hour and an expired cache remains available when the registry cannot be reached. The directly invoked npm shim keeps its Node-bundled fallback, while an explicit `vp env ... npm` family scope uses standalone npm's latest release.
|
|
23
58
|
|
|
24
59
|
A fresh install uses the split platform layout by default. On Unix, Vite+
|
|
25
60
|
stores managed runtimes and related files in `~/.local/share/vite-plus`. It
|
|
@@ -34,7 +69,14 @@ If you want to keep that behavior, run:
|
|
|
34
69
|
vp env on
|
|
35
70
|
```
|
|
36
71
|
|
|
37
|
-
This enables managed mode
|
|
72
|
+
This enables managed mode for both components. Their modes can also be changed independently, including one package-manager family:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
vp env on node
|
|
76
|
+
vp env off pm
|
|
77
|
+
vp env off pnpm
|
|
78
|
+
vp env on bun
|
|
79
|
+
```
|
|
38
80
|
|
|
39
81
|
If you do not want Vite+ to manage Node.js first, run:
|
|
40
82
|
|
|
@@ -42,16 +84,17 @@ If you do not want Vite+ to manage Node.js first, run:
|
|
|
42
84
|
vp env off
|
|
43
85
|
```
|
|
44
86
|
|
|
45
|
-
This switches to system-first mode
|
|
87
|
+
This switches both components to system-first mode. Vite+ prefers system tools and falls back to managed installations. Mixed configurations compose: a system package-manager launcher receives the Node.js selected by the Node mode.
|
|
88
|
+
|
|
89
|
+
Using `pm` records the selected mode for all currently supported package managers and replaces their individual choices. An unscoped `on` or `off` does the same while also changing Node.js. A family without a recorded mode remains undecided until its shim is first used or an `on` / `off` command configures it.
|
|
46
90
|
|
|
47
91
|
## Commands
|
|
48
92
|
|
|
49
93
|
### Setup
|
|
50
94
|
|
|
51
|
-
- `vp env setup` creates or updates shims in the resolved bin directory. It writes shell setup scripts in the config directory.
|
|
52
|
-
- `vp env on`
|
|
53
|
-
- `vp env
|
|
54
|
-
- `vp env print` prints the shell snippet for the current session
|
|
95
|
+
- `vp env setup` creates or updates the `node`, `npm`, `npx`, `pnpm`, `pnpx`, `yarn`, `yarnpkg`, `bun`, `bunx`, `vpx`, and `vpr` shims in the resolved bin directory. It writes shell setup scripts in the config directory.
|
|
96
|
+
- `vp env on` / `vp env off` changes both modes; append `node`, `pm`, `npm`, `pnpm`, `yarn`, or `bun` to narrow the change
|
|
97
|
+
- `vp env print` prints PATH setup for both components; append a selector to print one
|
|
55
98
|
|
|
56
99
|
PowerShell needs to dot-source the generated setup script in the current shell before `vp env use` can affect only that shell session:
|
|
57
100
|
|
|
@@ -87,28 +130,28 @@ vp-use --unset
|
|
|
87
130
|
Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` in the bin directory on Windows.
|
|
88
131
|
|
|
89
132
|
In CI, `vp env use` can run without shell initialization. It writes a temporary
|
|
90
|
-
session file in the resolved state directory. Later
|
|
91
|
-
use
|
|
133
|
+
Node.js or package-manager session file in the resolved state directory. Later
|
|
134
|
+
shim calls in the same job use these files to resolve the same environment.
|
|
92
135
|
|
|
93
136
|
### Manage
|
|
94
137
|
|
|
95
|
-
- `vp env default`
|
|
96
|
-
- `vp env pin`
|
|
97
|
-
- `vp env unpin` removes
|
|
98
|
-
- `vp env use`
|
|
99
|
-
- `vp env install` installs a
|
|
100
|
-
- `vp env uninstall` removes
|
|
101
|
-
- `vp env clean` removes unused
|
|
102
|
-
- `vp env exec` runs a command
|
|
103
|
-
- `vp node`
|
|
138
|
+
- `vp env default` shows the global Node.js default and each configured package-manager version. Bare versions set Node.js; qualified specs such as `pnpm@10.18.0` set that package manager's shim default without replacing the defaults for Bun, Yarn, or npm. `--unset` clears all defaults unless scoped.
|
|
139
|
+
- `vp env pin` shows or writes project pins. Existing `.node-version` and top-level `packageManager` fields keep being updated for compatibility; otherwise Vite+ writes the matching `devEngines` entry. Use `--target node-version`, `--target dev-engines`, or `--target package-manager` to choose explicitly.
|
|
140
|
+
- `vp env unpin` removes both effective pins by default; append a selector to remove one. Lower-priority declarations are not deleted.
|
|
141
|
+
- `vp env use` activates the complete project environment. Explicit specs override selected components; `--unset` clears both unless scoped.
|
|
142
|
+
- `vp env install` installs the complete resolved environment, a selected component, or explicit specs.
|
|
143
|
+
- `vp env uninstall` removes explicit exact Node.js or qualified package-manager versions.
|
|
144
|
+
- `vp env clean` removes unused installs. Use `clean node`, `clean pm`, or a concrete manager. Current and configured-default versions are preserved.
|
|
145
|
+
- `vp env exec` runs a command in the resolved environment. Use `--node` and `--package-manager`; `--npm` is an alias for `--package-manager npm@…`.
|
|
146
|
+
- `vp node` uses the resolved Node.js runtime and exposes the selected package-manager path to child processes.
|
|
104
147
|
|
|
105
148
|
### Inspect
|
|
106
149
|
|
|
107
150
|
- `vp env current` shows the current resolved environment
|
|
108
151
|
- `vp env doctor` runs environment diagnostics
|
|
109
152
|
- `vp env which` shows which tool path will be used
|
|
110
|
-
- `vp env list` shows
|
|
111
|
-
- `vp env list-remote`
|
|
153
|
+
- `vp env list` shows separate Node.js, npm, pnpm, Yarn, and Bun sections; selectors narrow output
|
|
154
|
+
- `vp env list-remote` fetches Node.js and all four PM registries concurrently; selectors narrow network work. `--lts` implicitly selects Node.js.
|
|
112
155
|
|
|
113
156
|
## Project Setup
|
|
114
157
|
|
|
@@ -120,54 +163,83 @@ use this file to select the Node.js version.
|
|
|
120
163
|
|
|
121
164
|
```bash
|
|
122
165
|
# Setup
|
|
123
|
-
vp env setup # Create
|
|
124
|
-
vp env on #
|
|
125
|
-
vp env
|
|
166
|
+
vp env setup # Create Node.js and package-manager shims
|
|
167
|
+
vp env on # Manage Node.js and package managers
|
|
168
|
+
vp env off pm # Prefer system package managers only
|
|
169
|
+
vp env off pnpm # Prefer system pnpm only
|
|
170
|
+
vp env print # Print PATH setup for both components
|
|
126
171
|
|
|
127
172
|
# Manage
|
|
128
|
-
vp env pin lts
|
|
129
|
-
vp env install # Install the
|
|
130
|
-
vp env default
|
|
131
|
-
vp env
|
|
132
|
-
vp env use
|
|
133
|
-
vp env
|
|
173
|
+
vp env pin lts pnpm@10 # Pin both project components to exact versions
|
|
174
|
+
vp env install # Install the complete resolved environment
|
|
175
|
+
vp env default node@24 # Set the global Node.js default
|
|
176
|
+
vp env default pnpm@10 # Set pnpm's global default version
|
|
177
|
+
vp env use 20 pnpm@10 # Override both components for this shell
|
|
178
|
+
vp env use --unset pm # Remove only the PM session override
|
|
179
|
+
vp env clean # Remove unused managed Node.js and package manager versions
|
|
134
180
|
|
|
135
181
|
# Inspect
|
|
136
182
|
vp env current # Show current resolved environment
|
|
137
183
|
vp env current --json # JSON output for automation
|
|
138
184
|
vp env which node # Show which node binary will be used
|
|
139
185
|
vp env which npx # Show pinned package-manager alias when packageManager matches
|
|
140
|
-
vp env list
|
|
186
|
+
vp env list # Show every locally installed component
|
|
187
|
+
vp env list node # Show only Node.js installations
|
|
188
|
+
vp env list-remote --lts # List only Node.js LTS versions
|
|
141
189
|
|
|
142
190
|
# Execute
|
|
143
|
-
vp env exec --node lts
|
|
191
|
+
vp env exec --node lts --package-manager pnpm@10 pnpm install
|
|
144
192
|
vp env exec node -v # Use shim mode with automatic version resolution
|
|
145
193
|
vp node script.js # Shorthand: run a Node.js script with the resolved version
|
|
146
194
|
vp node -e "console.log(1+1)" # Shorthand: forward any node flag or argument
|
|
147
195
|
```
|
|
148
196
|
|
|
149
|
-
##
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
197
|
+
## JSON output
|
|
198
|
+
|
|
199
|
+
The JSON output for `current`, `list`, and `list-remote` is organized by component. `current --json` returns sibling `node` and `package_manager` objects:
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"node": {
|
|
204
|
+
"version": "22.0.0",
|
|
205
|
+
"source": "devEngines.runtime",
|
|
206
|
+
"source_path": "/project/package.json",
|
|
207
|
+
"project_root": "/project",
|
|
208
|
+
"bin_path": "/home/.vite-plus/js_runtime/node/22.0.0/bin/node",
|
|
209
|
+
"installed": true,
|
|
210
|
+
"mode": "managed"
|
|
211
|
+
},
|
|
212
|
+
"package_manager": {
|
|
213
|
+
"name": "pnpm",
|
|
214
|
+
"version": "10.18.0",
|
|
215
|
+
"source": "packageManager",
|
|
216
|
+
"source_path": "/project/package.json",
|
|
217
|
+
"project_root": "/project",
|
|
218
|
+
"bin_paths": {
|
|
219
|
+
"pnpm": "/home/.vite-plus/package_manager/pnpm/10.18.0/pnpm/bin/pnpm",
|
|
220
|
+
"pnpx": "/home/.vite-plus/package_manager/pnpm/10.18.0/pnpm/bin/pnpx"
|
|
221
|
+
},
|
|
222
|
+
"installed": true,
|
|
223
|
+
"mode": "managed"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
166
226
|
```
|
|
167
227
|
|
|
168
|
-
|
|
228
|
+
`list --json` and `list-remote --json` group the component arrays:
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"node": [],
|
|
233
|
+
"package_managers": {
|
|
234
|
+
"npm": [],
|
|
235
|
+
"pnpm": [],
|
|
236
|
+
"yarn": [],
|
|
237
|
+
"bun": []
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
169
241
|
|
|
170
|
-
|
|
242
|
+
Selectors omit unselected top-level fields or PM families. Registry listing is all-or-error: Vite+ prints no partial human or JSON result when any selected registry request fails.
|
|
171
243
|
|
|
172
244
|
## Custom Node.js Mirror
|
|
173
245
|
|