Skip to content

Commit 3673f94

Browse files
committed
docs(env): update RFC to reflect system-first mode covers all vp commands
- Rename "Shim Mode" to "Node.js Mode" throughout - Update config.json comments to describe broader scope - Update all doctor output examples (managed/system-first/unhealthy) - Update vp env on/off command output examples - Add NixOS, air-gapped, container, and multi-tool use cases - Show Version Resolution section for system-first mode in doctor
1 parent 4d7ed09 commit 3673f94

2 files changed

Lines changed: 38 additions & 28 deletions

File tree

packages/cli/snap-tests-global/command-env-off-on/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "command-env-off-on",
33
"version": "1.0.0",
44
"private": true,
5-
"engines": {
6-
"node": "20.18.0"
7-
},
85
"scripts": {
96
"assert-managed": "node src/assert-managed.mjs",
107
"assert-not-managed": "node src/assert-not-managed.mjs"
8+
},
9+
"engines": {
10+
"node": "20.18.0"
1111
}
1212
}

rfcs/env-command.md

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,10 @@ VITE_PLUS_HOME/ # Default: ~/.vite-plus
412412
// "defaultNodeVersion": "lts" // Always use latest LTS
413413
// "defaultNodeVersion": "latest" // Always use latest (not recommended)
414414

415-
// Shim mode: controls how shims resolve tools
415+
// Node.js mode: controls how all vp commands and shims resolve Node.js
416416
// Set via: vp env on (managed) or vp env off (system_first)
417-
// - "managed" (default): Shims always use vite-plus managed Node.js
418-
// - "system_first": Shims prefer system Node.js, fallback to managed if not found
417+
// - "managed" (default): All vp commands and shims use vite-plus managed Node.js
418+
// - "system_first": All vp commands and shims prefer system Node.js, fallback to managed if not found
419419
"shimMode": "managed"
420420
}
421421
```
@@ -824,7 +824,7 @@ Installation
824824
✓ Shims node, npm, npx
825825

826826
Configuration
827-
Shim mode managed
827+
Node.js mode managed
828828

829829
PATH
830830
✗ vp not in PATH
@@ -922,7 +922,7 @@ Installation
922922
✓ Shims node, npm, npx
923923

924924
Configuration
925-
Shim mode managed
925+
Node.js mode managed
926926
✓ IDE integration env sourced in ~/.zshenv
927927

928928
PATH
@@ -947,7 +947,7 @@ $ vp env doctor
947947
...
948948

949949
Configuration
950-
Shim mode managed
950+
Node.js mode managed
951951
✓ IDE integration env sourced in ~/.zshenv
952952
⚠ Session override VITE_PLUS_NODE_VERSION=20.18.0
953953
Overrides all file-based resolution.
@@ -965,10 +965,18 @@ $ vp env doctor
965965
...
966966

967967
Configuration
968-
Shim mode system-first
968+
Node.js mode system-first
969969
System Node.js /usr/local/bin/node
970970
✓ IDE integration env sourced in ~/.zshenv
971971

972+
...
973+
974+
Version Resolution
975+
Directory /Users/user/projects/my-app
976+
Source system PATH
977+
Version v22.22.0
978+
✓ Node binary /usr/local/bin/node
979+
972980
...
973981
```
974982

@@ -979,8 +987,8 @@ $ vp env doctor
979987
...
980988

981989
Configuration
982-
Shim mode system-first
983-
⚠ System Node.js not found (will use managed)
990+
Node.js mode system-first
991+
⚠ System Node.js not found (will fall back to managed)
984992

985993
...
986994
```
@@ -996,7 +1004,7 @@ Installation
9961004
Run 'vp env setup' to create bin directory and shims.
9971005

9981006
Configuration
999-
Shim mode managed
1007+
Node.js mode managed
10001008

10011009
PATH
10021010
✗ vp not in PATH
@@ -1256,40 +1264,42 @@ No default version configured. Using latest LTS (22.13.0).
12561264
Run 'vp env default <version>' to set a default.
12571265
```
12581266

1259-
### Shim Mode Commands
1267+
### Node.js Mode Commands
12601268

1261-
The shim mode controls how shims resolve tools:
1269+
The Node.js mode controls how all vp commands and shims resolve Node.js:
12621270

1263-
| Mode | Description |
1264-
| ------------------- | ------------------------------------------------------------- |
1265-
| `managed` (default) | Shims always use vite-plus managed Node.js |
1266-
| `system_first` | Shims prefer system Node.js, fallback to managed if not found |
1271+
| Mode | Description |
1272+
| ------------------- | --------------------------------------------------------------------------------- |
1273+
| `managed` (default) | All vp commands and shims use vite-plus managed Node.js |
1274+
| `system_first` | All vp commands and shims prefer system Node.js, fallback to managed if not found |
12671275

12681276
```bash
12691277
# Enable managed mode (always use vite-plus Node.js)
12701278
$ vp env on
1271-
Shim mode set to managed.
1279+
Node.js management set to managed.
12721280

1273-
Shims will now always use the Vite+ managed Node.js.
1281+
All vp commands and shims will now always use Vite+ managed Node.js.
12741282
Run 'vp env off' to prefer system Node.js instead.
12751283

12761284
# Enable system-first mode (prefer system Node.js)
12771285
$ vp env off
1278-
Shim mode set to system-first.
1286+
Node.js management set to system-first.
12791287

1280-
Shims will now prefer system Node.js, falling back to managed if not found.
1281-
Run 'vp env on' to always use vite-plus managed Node.js.
1288+
All vp commands and shims will now prefer system Node.js, falling back to managed if not found.
1289+
Run 'vp env on' to always use Vite+ managed Node.js.
12821290

12831291
# If already in the requested mode
12841292
$ vp env on
1285-
Shim mode is already set to managed.
1286-
Shims will always use vite-plus managed Node.js.
1293+
Node.js management is already set to managed.
1294+
All vp commands and shims will always use Vite+ managed Node.js.
12871295
```
12881296
12891297
**Use cases for system-first mode (`vp env off`)**:
12901298
1291-
- When you have a system Node.js that you want to use by default
1292-
- When working on projects that don't need vite-plus version management
1299+
- NixOS / GNU Guix where downloaded binaries are dynamically linked and fail to run
1300+
- Air-gapped environments with no network access to download Node.js
1301+
- Container images where Node.js is already installed
1302+
- Users managing Node.js via other tools (mise, nvm, fnm, etc.)
12931303
- When debugging version-related issues by comparing system vs managed Node.js
12941304
12951305
### Which Command

0 commit comments

Comments
 (0)