vite-plus 0.2.4 → 0.2.5

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.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/binding/index.cjs +53 -52
  3. package/binding/index.d.cts +17 -26
  4. package/dist/{agent-eMtwgY-u.js → agent-CTwqJqX_.js} +22 -100
  5. package/dist/bin.js +8 -5
  6. package/dist/config/bin.js +2 -2
  7. package/dist/{constants-DdXYYBsz.js → constants-JhDwfMS8.js} +1 -1
  8. package/dist/create/bin.js +73 -22
  9. package/dist/{define-config-Dn5coJS5.js → define-config-BRT5X5UW.js} +2 -2
  10. package/dist/{define-config-DUsBrwKn.cjs → define-config-DD3MUyPC.cjs} +1 -1
  11. package/dist/{define-config-BuMs_LKa.d.ts → define-config-eLQH9us2.d.ts} +2 -3
  12. package/dist/define-config.cjs +1 -1
  13. package/dist/define-config.d.ts +1 -1
  14. package/dist/define-config.js +1 -1
  15. package/dist/{editor-DL4u-ujK.js → editor-H_E_5XOt.js} +95 -4
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/migration/bin.js +5 -5
  20. package/dist/{oxlint-plugin-config-BiYDWQLd.js → oxlint-plugin-config-CnUfwCp9.js} +1 -1
  21. package/dist/oxlint-plugin.js +1 -1
  22. package/dist/{pack-Ciiho0Tq.d.ts → pack-PvUg_xpv.d.ts} +0 -1
  23. package/dist/pack-bin.js +1 -1
  24. package/dist/pack.d.ts +1 -1
  25. package/dist/{package-D2xMMmTQ.js → package-BILvlUYF.js} +1 -1
  26. package/dist/{resolve-vite-config-5SuNAKdv.js → resolve-vite-config-BheiDkKa.js} +1 -1
  27. package/dist/staged/bin.js +47 -17
  28. package/dist/{tsconfig-CtdiYBV_.js → tsconfig-D2NvUjn3.js} +86 -78
  29. package/dist/version.js +2 -2
  30. package/dist/versions.js +5 -5
  31. package/docs/config/run.md +3 -6
  32. package/docs/guide/docker.md +46 -2
  33. package/docs/guide/env.md +12 -0
  34. package/docs/guide/index.md +2 -0
  35. package/docs/guide/installer-env-vars.md +195 -0
  36. package/package.json +17 -20
  37. package/templates/monorepo/_gitignore +5 -0
  38. package/templates/monorepo/_yarnrc.yml +1 -1
  39. package/templates/monorepo/pnpm-workspace.yaml +1 -1
@@ -30,7 +30,9 @@ Tags track the `vp` version:
30
30
 
31
31
  The examples use `:latest` to track the newest release; pin an exact tag or a
32
32
  digest if you need reproducible builds. The image is published for `linux/amd64`
33
- and `linux/arm64` and runs as a non-root user by default.
33
+ and `linux/arm64` and runs as the non-root `vp` user by default. That user has
34
+ passwordless `sudo`, so build/CI steps that need root (extra apt packages,
35
+ `playwright install --with-deps`) work without changing the image user.
34
36
 
35
37
  Browse all published versions and digests on the [GitHub package page](https://github.com/voidzero-dev/vite-plus/pkgs/container/vite-plus).
36
38
 
@@ -136,6 +138,44 @@ build:
136
138
 
137
139
  On GitHub Actions, prefer [`setup-vp`](./ci) instead of the image.
138
140
 
141
+ ## Browser mode tests (Vitest / Playwright)
142
+
143
+ Running as the non-root `vp` user is what you want for browsers: Chromium keeps
144
+ its sandbox (running a browser as root disables it). Install the browser and its
145
+ system libraries in the job. `playwright install --with-deps` needs root to
146
+ `apt-get install` those libraries. The `vp` user has passwordless `sudo`, so
147
+ Playwright uses it to install them without changing the image user:
148
+
149
+ ```yaml [.gitlab-ci.yml]
150
+ test:
151
+ image: ghcr.io/voidzero-dev/vite-plus:latest
152
+ script:
153
+ - vp install --frozen-lockfile
154
+ - vp exec playwright install --with-deps chromium
155
+ - vp test
156
+ ```
157
+
158
+ `vp exec` runs the project's own Playwright (from your lockfile), so it installs
159
+ the browser revision your tests expect. Prefer it over `vpx playwright install`,
160
+ which would download whatever Playwright is latest and can fetch a different
161
+ browser revision.
162
+
163
+ To bake the browser and its libraries into a derived image instead of installing
164
+ them on every run, install the project dependencies first so the baked browser
165
+ matches your lockfile, then install with the project's Playwright (root is
166
+ available through `sudo`):
167
+
168
+ ```dockerfile [Dockerfile]
169
+ FROM ghcr.io/voidzero-dev/vite-plus:latest
170
+ WORKDIR /app
171
+ COPY --chown=vp:vp package.json pnpm-lock.yaml pnpm-workspace.yaml .node-version* ./
172
+ RUN vp install --frozen-lockfile
173
+ RUN vp exec playwright install --with-deps chromium
174
+ ```
175
+
176
+ If Chromium crashes under load in CI, give the container more shared memory with
177
+ `--ipc=host`; see the [Playwright Docker docs](https://playwright.dev/docs/docker).
178
+
139
179
  ## Devcontainers
140
180
 
141
181
  Use the image as a ready-to-go development container with the toolchain
@@ -164,7 +204,11 @@ docker run --rm -it -v "$PWD:/app" -w /app ghcr.io/voidzero-dev/vite-plus vp bui
164
204
  those that use one have it available in every stage.
165
205
  - **Non-root user**: the image runs as the non-root `vp` user, so copy sources
166
206
  with `COPY --chown=vp:vp ...` as shown. Without it, `COPY` writes root-owned
167
- files that `vp install` cannot update (permission denied).
207
+ files that `vp install` cannot update (permission denied). The `vp` user has
208
+ passwordless `sudo` for the occasional root step (installing extra apt packages
209
+ or `playwright install --with-deps`), so you rarely need to switch the image
210
+ user. The production runtime stage is a separate, vp-free base image, so this
211
+ convenience does not reach your deployed image.
168
212
  - **Native addons**: the image includes a C/C++ build toolchain (`build-essential`,
169
213
  `python3`), so native dependencies such as `better-sqlite3` compile during
170
214
  `vp install`.
package/docs/guide/env.md CHANGED
@@ -64,6 +64,16 @@ Open the profile file for editing:
64
64
  Invoke-Item $PROFILE
65
65
  ```
66
66
 
67
+ Windows Command Prompt (`cmd.exe`) cannot define the wrapper function needed for `vp env use` to update the current shell session. Use the generated `vp-use.cmd` command instead:
68
+
69
+ ```batch
70
+ vp-use 20
71
+ node --version
72
+ vp-use --unset
73
+ ```
74
+
75
+ Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` under `VP_HOME/bin` on Windows.
76
+
67
77
  In CI, `vp env use` can still run without shell initialization. It writes a temporary session file under `VP_HOME` so later shim calls in the same job can resolve the selected Node.js version.
68
78
 
69
79
  ### Manage
@@ -74,6 +84,7 @@ In CI, `vp env use` can still run without shell initialization. It writes a temp
74
84
  - `vp env use` sets a Node.js version for the current shell session
75
85
  - `vp env install` installs a Node.js version
76
86
  - `vp env uninstall` removes an installed Node.js version
87
+ - `vp env clean` removes unused managed Node.js runtimes, all downloaded package managers, and the Corepack cache.
77
88
  - `vp env exec` runs a command with a specific Node.js version
78
89
  - `vp node` runs a Node.js script — shorthand for `vp env exec node`
79
90
 
@@ -105,6 +116,7 @@ vp env install # Install the version from .node-version or packag
105
116
  vp env default lts # Set the global default version
106
117
  vp env use 20 # Use Node.js 20 for the current shell session
107
118
  vp env use --unset # Remove the session override
119
+ vp env clean # Remove unused managed caches
108
120
 
109
121
  # Inspect
110
122
  vp env current # Show current resolved environment
@@ -28,6 +28,8 @@ Alternatively, download and run [`vp-setup.exe`](https://setup.viteplus.dev).
28
28
  The `vp-setup.exe` is not yet code-signed. Your browser may show a warning when downloading. Click **"..."** → **"Keep"** → **"Keep anyway"** to proceed. If Windows Defender SmartScreen blocks the file when you run it, click **"More info"** → **"Run anyway"**.
29
29
  :::
30
30
 
31
+ The installer scripts and `vp-setup.exe` read [environment variables](/guide/installer-env-vars) such as `VP_VERSION` and `VP_HOME`.
32
+
31
33
  After installation, open a new shell and run:
32
34
 
33
35
  ```bash
@@ -0,0 +1,195 @@
1
+ # Installer Environment Variables
2
+
3
+ The Vite+ installers (`vp-setup.exe`, `install.ps1`, and `install.sh`) and the installed `vp` CLI read the environment variables on this page.
4
+
5
+ ## Installation Variables
6
+
7
+ These variables control the installer scripts and the standalone Windows installer (`vp-setup.exe`).
8
+
9
+ ### `VP_VERSION`
10
+
11
+ - **Purpose**: Version to install
12
+ - **Default**: `latest`
13
+ - **CLI equivalent**: `--version`
14
+ - **Example**:
15
+
16
+ ```bash
17
+ # Unix
18
+ curl -fsSL https://vite.plus | VP_VERSION=1.2.3 bash
19
+ ```
20
+
21
+ ```powershell
22
+ # PowerShell
23
+ $env:VP_VERSION = "1.2.3"; irm https://vite.plus/ps1 | iex
24
+ ```
25
+
26
+ ### `VP_HOME`
27
+
28
+ - **Purpose**: Installation directory; the installed CLI reads the same variable as the Vite+ home directory (see [Environment](/guide/env))
29
+ - **Default**: `~/.vite-plus` (Unix) or `%USERPROFILE%\.vite-plus` (Windows)
30
+ - **CLI equivalent**: `--install-dir`
31
+ - **Example**:
32
+
33
+ ```bash
34
+ # Unix
35
+ curl -fsSL https://vite.plus | VP_HOME=/opt/vite-plus bash
36
+ ```
37
+
38
+ ```powershell
39
+ # PowerShell
40
+ $env:VP_HOME = "D:\vite-plus"; irm https://vite.plus/ps1 | iex
41
+ ```
42
+
43
+ ### `NPM_CONFIG_REGISTRY`
44
+
45
+ - **Purpose**: Custom npm registry URL
46
+ - **Default**: `https://registry.npmjs.org`
47
+ - **CLI equivalent**: `--registry`
48
+ - **Example**:
49
+ ```bash
50
+ curl -fsSL https://vite.plus | NPM_CONFIG_REGISTRY=https://registry.npmmirror.com bash
51
+ ```
52
+
53
+ ### `VP_NODE_MANAGER`
54
+
55
+ - **Purpose**: Control Node.js version manager setup during installation
56
+ - **Values**: `yes` or `no`
57
+ - **Default**: Auto-detected
58
+ - **CLI equivalent**: `--no-node-manager` (inverted)
59
+ - **Example**:
60
+ ```bash
61
+ # Skip Node.js manager setup in CI
62
+ curl -fsSL https://vite.plus | VP_NODE_MANAGER=no bash
63
+ ```
64
+
65
+ ### `VP_PR_VERSION`
66
+
67
+ - **Purpose**: Install a preview build from a pull request or commit SHA
68
+ - **Values**: PR number or commit SHA
69
+ - **Default**: None
70
+ - **Details**: [Global `vp` Preview](/guide/upgrade#global-vp-preview)
71
+
72
+ ### Development variables
73
+
74
+ When developing Vite+ itself, `VP_LOCAL_TGZ` (path to a local `vite-plus.tgz`) and `VP_LOCAL_BINARY` (path to a local `vp` binary) feed the installer a local build. The installers also set `VP_INSTALL_STOP` themselves; do not set it manually.
75
+
76
+ ## Runtime Variables
77
+
78
+ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applies at runtime.
79
+
80
+ ### `VP_NODE_DIST_MIRROR`
81
+
82
+ - **Purpose**: Node.js distribution mirror URL
83
+ - **Default**: `https://nodejs.org/dist`
84
+ - **Details**: [Custom Node.js Mirror](/guide/env#custom-nodejs-mirror)
85
+
86
+ ### `VP_NODE_VERSION`
87
+
88
+ - **Purpose**: Override Node.js version
89
+ - **Default**: None (auto-detected)
90
+ - **Example**:
91
+ ```bash
92
+ # Run a command with a specific Node.js version
93
+ VP_NODE_VERSION=22 vp env exec node -v
94
+ ```
95
+
96
+ ### `VP_NODE_SKIP_SIGNATURE_VERIFY`
97
+
98
+ - **Purpose**: Skip PGP signature verification of Node.js downloads
99
+ - **Values**: Any non-empty value
100
+ - **Default**: None (verification enabled)
101
+ - **Details**: [Node.js Signature Verification](/guide/env#nodejs-signature-verification)
102
+
103
+ ### `VP_SHELL`
104
+
105
+ - **Purpose**: Specify the current shell
106
+ - **Default**: Auto-detected
107
+ - **Example**:
108
+ ```bash
109
+ VP_SHELL=bash vp env print
110
+ ```
111
+
112
+ ### `VP_BYPASS`
113
+
114
+ - **Purpose**: Bypass the Vite+ shim and use the system tool
115
+ - **Values**: `PATH`-style list of directories to bypass
116
+ - **Default**: None
117
+ - **Example**:
118
+ ```bash
119
+ VP_BYPASS=/usr/local/bin node -v
120
+ ```
121
+
122
+ ### Internal variables
123
+
124
+ Vite+ sets additional `VP_*` variables during shim dispatch and shell integration (recursion guards, active-version records, wrapper flags); do not set them manually.
125
+
126
+ ## TLS/CA Configuration
127
+
128
+ ### `SSL_CERT_FILE` / `NODE_EXTRA_CA_CERTS`
129
+
130
+ - **Purpose**: Path to PEM bundle of extra CA certificates (`NODE_EXTRA_CA_CERTS` is the Node.js convention)
131
+ - **Default**: System trust store
132
+ - **Example**:
133
+ ```bash
134
+ export SSL_CERT_FILE=/path/to/custom-ca.pem
135
+ ```
136
+
137
+ ### `VP_INSECURE_TLS`
138
+
139
+ - **Purpose**: Disable HTTPS certificate verification
140
+ - **Values**: Any non-empty value (`1`, `true`, `yes`)
141
+ - **Default**: None (verification enabled)
142
+ - **Warning**: Diagnostic escape hatch only; do not use in production
143
+ - **Example**:
144
+ ```bash
145
+ VP_INSECURE_TLS=1 vp env install 22
146
+ ```
147
+
148
+ ## Logging and Debugging
149
+
150
+ ### `VITE_LOG`
151
+
152
+ - **Purpose**: Log filter string for `tracing_subscriber`
153
+ - **Default**: None
154
+ - **Example**:
155
+ ```bash
156
+ VITE_LOG=debug vp dev
157
+ VITE_LOG=vite_task=trace vp build
158
+ ```
159
+
160
+ ### `VP_DEBUG_SHIM`
161
+
162
+ - **Purpose**: Enable debug output for shim dispatch
163
+ - **Values**: Any non-empty value
164
+ - **Default**: None
165
+ - **Example**:
166
+ ```bash
167
+ VP_DEBUG_SHIM=1 node -v
168
+ ```
169
+
170
+ ## Standard Environment Variables
171
+
172
+ Vite+ also respects these standard environment variables:
173
+
174
+ ### `CI`
175
+
176
+ - **Purpose**: Indicates running in CI environment
177
+ - **Effect**: Enables silent mode (`--yes`) for installers
178
+
179
+ ### `NO_COLOR`
180
+
181
+ - **Purpose**: Disable colored output
182
+ - **Effect**: Disables ANSI color codes
183
+
184
+ ### `HOME` / `USERPROFILE`
185
+
186
+ - **Purpose**: User home directory
187
+ - **Effect**: Base for the default `~/.vite-plus` path
188
+
189
+ ## Precedence
190
+
191
+ 1. CLI flags (highest priority)
192
+ 2. Environment variables
193
+ 3. Default values (lowest priority)
194
+
195
+ For example, `VP_VERSION=1.0.0 vp-setup.exe --version 2.0.0` installs version 2.0.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plus",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -352,8 +352,8 @@
352
352
  }
353
353
  },
354
354
  "dependencies": {
355
- "@oxc-project/types": "=0.138.0",
356
- "@oxlint/plugins": "=1.68.0",
355
+ "@oxc-project/types": "=0.139.0",
356
+ "@oxlint/plugins": "=1.73.0",
357
357
  "@vitest/browser": "4.1.10",
358
358
  "@vitest/browser-preview": "4.1.10",
359
359
  "@vitest/expect": "4.1.10",
@@ -363,11 +363,11 @@
363
363
  "@vitest/snapshot": "4.1.10",
364
364
  "@vitest/spy": "4.1.10",
365
365
  "@vitest/utils": "4.1.10",
366
- "oxfmt": "=0.57.0",
367
- "oxlint": "=1.72.0",
366
+ "oxfmt": "=0.58.0",
367
+ "oxlint": "=1.73.0",
368
368
  "oxlint-tsgolint": "=0.24.0",
369
369
  "vitest": "4.1.10",
370
- "@voidzero-dev/vite-plus-core": "0.2.4"
370
+ "@voidzero-dev/vite-plus-core": "0.2.5"
371
371
  },
372
372
  "devDependencies": {
373
373
  "@napi-rs/cli": "^3.7.2",
@@ -392,13 +392,13 @@
392
392
  "picocolors": "^1.1.1",
393
393
  "rolldown-plugin-dts": "^0.26.0",
394
394
  "semver": "^7.8.0",
395
- "tsdown": "^0.22.3",
395
+ "tsdown": "^0.22.7",
396
396
  "validate-npm-package-name": "^7.0.2",
397
397
  "yaml": "^2.8.1",
398
398
  "zod": "^3.25.76",
399
- "@voidzero-dev/vite-plus-prompts": "0.0.0",
399
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.2.5",
400
400
  "@voidzero-dev/vite-plus-tools": "0.0.0",
401
- "vite": "npm:@voidzero-dev/vite-plus-core@0.2.4"
401
+ "@voidzero-dev/vite-plus-prompts": "0.0.0"
402
402
  },
403
403
  "peerDependencies": {
404
404
  "@vitest/browser-playwright": "4.1.10",
@@ -430,22 +430,19 @@
430
430
  "node": "^20.19.0 || ^22.18.0 || >=24.11.0"
431
431
  },
432
432
  "optionalDependencies": {
433
- "@voidzero-dev/vite-plus-darwin-arm64": "0.2.4",
434
- "@voidzero-dev/vite-plus-darwin-x64": "0.2.4",
435
- "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.2.4",
436
- "@voidzero-dev/vite-plus-linux-arm64-musl": "0.2.4",
437
- "@voidzero-dev/vite-plus-linux-x64-gnu": "0.2.4",
438
- "@voidzero-dev/vite-plus-linux-x64-musl": "0.2.4",
439
- "@voidzero-dev/vite-plus-win32-x64-msvc": "0.2.4",
440
- "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.2.4"
433
+ "@voidzero-dev/vite-plus-darwin-arm64": "0.2.5",
434
+ "@voidzero-dev/vite-plus-darwin-x64": "0.2.5",
435
+ "@voidzero-dev/vite-plus-linux-arm64-gnu": "0.2.5",
436
+ "@voidzero-dev/vite-plus-linux-arm64-musl": "0.2.5",
437
+ "@voidzero-dev/vite-plus-linux-x64-gnu": "0.2.5",
438
+ "@voidzero-dev/vite-plus-linux-x64-musl": "0.2.5",
439
+ "@voidzero-dev/vite-plus-win32-x64-msvc": "0.2.5",
440
+ "@voidzero-dev/vite-plus-win32-arm64-msvc": "0.2.5"
441
441
  },
442
442
  "scripts": {
443
443
  "build": "oxnode -C dev ./build.ts",
444
444
  "build-ts": "oxnode -C dev ./build.ts --skip-native",
445
445
  "build-native": "oxnode -C dev ./build.ts --skip-ts",
446
- "snap-test": "pnpm snap-test-local && pnpm snap-test-global",
447
- "snap-test-local": "tool snap-test",
448
- "snap-test-global": "tool snap-test --dir snap-tests-global --bin-dir ~/.vite-plus/bin",
449
446
  "publish-native": "node ./publish-native-addons.ts",
450
447
  "test": "vitest run"
451
448
  }
@@ -12,6 +12,11 @@ dist
12
12
  dist-ssr
13
13
  *.local
14
14
 
15
+ # dotenv environment variable files
16
+ .env
17
+ .env.*
18
+ !.env.example
19
+
15
20
  # Editor directories and files
16
21
  .vscode/*
17
22
  !.vscode/settings.json
@@ -1,4 +1,4 @@
1
1
  nodeLinker: node-modules
2
2
  catalog:
3
3
  '@types/node': ^24
4
- typescript: ^5
4
+ typescript: ^7.0.0
@@ -7,4 +7,4 @@ catalogMode: prefer
7
7
 
8
8
  catalog:
9
9
  '@types/node': ^24
10
- typescript: ^5
10
+ typescript: ^7.0.0