You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(rfc): sync RFC with latest implementation changes
- Update interactive menu examples to show "enabled"/"disabled" instead
of "auto-detect" (value is now pre-computed)
- Add Node.js Manager Auto-Detection section with priority table
documenting the full auto-detect logic matching install.ps1/install.sh
- Restructure Installation Flow diagram: local version check before HTTP,
split resolve_version into resolve_version_string + resolve_platform_package,
same-version repair path skips to CONFIGURE, cleanup moved to ACTIVATE
- Update Existing Installation Handling: same version now repairs instead
of exiting early
- Document best-effort post-activation behavior and failure recovery
- Update function mapping table with split registry functions
- Update Test Workflow snippet to match actual single-job structure
- Update Phase 2 description (winreg, pre-computed node manager, repair)
Copy file name to clipboardExpand all lines: rfcs/windows-installer.md
+73-44Lines changed: 73 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,30 +137,32 @@ Welcome to Vite+ Installer!
137
137
138
138
This will install the vp CLI and monorepo task runner.
139
139
140
-
Install directory: C:\Users\alice\.vite-plus
141
-
PATH modification: C:\Users\alice\.vite-plus\bin → User PATH
142
-
Version: latest
143
-
Node.js manager: auto-detect
140
+
Install directory: C:\Users\alice\.vite-plus
141
+
PATH modification: C:\Users\alice\.vite-plus\bin → User PATH
142
+
Version: latest
143
+
Node.js manager: enabled
144
144
145
-
1) Proceed with installation (default)
146
-
2) Customize installation
147
-
3) Cancel
145
+
1) Proceed with installation (default)
146
+
2) Customize installation
147
+
3) Cancel
148
148
149
-
>
149
+
>
150
150
```
151
151
152
+
The Node.js manager value is pre-computed via auto-detection before the menu is shown (see [Node.js Manager Auto-Detection](#nodejs-manager-auto-detection)). The user can override it in the customize submenu before proceeding.
153
+
152
154
Customization submenu:
153
155
154
156
```
155
157
Customize installation:
156
158
157
159
1) Version: [latest]
158
160
2) npm registry: [(default)]
159
-
3) Node.js manager: [auto-detect]
161
+
3) Node.js manager: [enabled]
160
162
4) Modify PATH: [yes]
161
163
162
164
Enter option number to change, or press Enter to go back:
163
-
>
165
+
>
164
166
```
165
167
166
168
### Silent Mode (CI)
@@ -208,18 +210,24 @@ The installer replicates the same result as `install.ps1`, implemented in Rust v
208
210
│ ┌─ detect platform ──────── win32-x64-msvc │
209
211
│ │ win32-arm64-msvc │
210
212
│ │ │
211
-
│ ├─ resolve version ──────── query npm registry │
On failure before the **Activate** phase, the version directory is cleaned up and the existing installation remains untouched. After the **Activate** phase (junction swap), the update has already succeeded — subsequent configure steps are best-effort (non-fatal on error).
310
+
**Same-version repair**: When the resolved version matches the installed version, the DOWNLOAD/INSTALL/ACTIVATE phases are skipped entirely (saving 1 HTTP request + all I/O). The CONFIGURE phase always runs to repair shims, env files, and PATH if needed.
311
+
312
+
**Failure recovery**: Before the **Activate** phase, failures clean up the version directory and leave the existing installation untouched. After **Activate**, all CONFIGURE steps are best-effort — failures log a warning but do not cause exit code 1. Rerunning the installer always retries CONFIGURE.
313
+
314
+
## Node.js Manager Auto-Detection
315
+
316
+
The Node.js manager decision (`enabled`/`disabled`) is pre-computed before the interactive menu is shown, so the user sees the resolved value and can override it via the customize submenu. No prompts occur during the installation phase.
317
+
318
+
The auto-detection logic matches `install.ps1`/`install.sh`:
In interactive mode (rules 7), the default matches `install.ps1`'s Y/n prompt where pressing Enter enables it. The user can disable it in the customize menu before installation begins. In silent mode (rule 8), shims are not created unless explicitly requested, avoiding silently taking over an existing Node toolchain.
301
332
302
333
## Windows-Specific Details
303
334
@@ -342,13 +373,13 @@ The binary uses the console subsystem (default for Rust binaries on Windows). Wh
| Running `vp.exe` in bin/ | Rename to `.old`, copy new (same as trampoline pattern) |
352
383
353
384
## Add/Remove Programs Registration
354
385
@@ -416,28 +447,24 @@ In `release.yml`, installer artifacts are uploaded per-target, renamed with the
416
447
417
448
### Test Workflow
418
449
419
-
`test-standalone-install.yml` includes a `test-vp-setup-exe` job that builds the installer from source and tests silent installation across three shells:
450
+
`test-standalone-install.yml` includes a `test-vp-setup-exe` job that builds the installer from source, installs via pwsh, and verifies from all three shells (pwsh, cmd, bash):
420
451
421
452
```yaml
422
453
test-vp-setup-exe:
423
-
name: Test vp-setup.exe (${{ matrix.shell }})
454
+
name: Test vp-setup.exe (pwsh)
424
455
runs-on: windows-latest
425
-
strategy:
426
-
matrix:
427
-
shell: [cmd, pwsh, bash]
428
456
steps:
429
457
- uses: actions/checkout@v4
430
458
- uses: oxc-project/setup-rust@v1
431
459
- name: Build vp-setup.exe
432
460
run: cargo build --release -p vite_installer
433
461
- name: Install via vp-setup.exe (silent)
462
+
shell: pwsh
434
463
run: ./target/release/vp-setup.exe -y
435
464
env:
436
465
VP_VERSION: alpha
437
-
- name: Verify installation
438
-
run: |
439
-
vp --version
440
-
vp --help
466
+
- name: Verify installation (pwsh/cmd/bash)
467
+
# verifies from all three shells after a single install
441
468
```
442
469
443
470
The workflow triggers on changes to `crates/vite_installer/**` and `crates/vite_setup/**`.
@@ -513,11 +540,13 @@ Embed the PowerShell script in a self-extracting exe. Fragile, still requires Po
513
540
514
541
- Created `crates/vite_installer/` with `[[bin]] name = "vp-setup"`
515
542
- Implemented CLI argument parsing (clap) with env var merging
0 commit comments