Repository navigation
feat(detector): support the Vite+ (vp) CLI as a version manager - #124
Merged
Merged
Conversation
nodeup could not upgrade Node for users of Vite+ (https://viteplus.dev), the unified toolchain from VoidZero: `nodeup upgrade` reported "no Node.js version manager detected". Vite+'s `vp env` subcommand exposes the same operations nodeup needs from a version manager, so add a VitePlus manager alongside the existing eight. The implementation follows upstream's data-directory resolution chain (VP_HOME → <home>/.vite-plus → VP_DATA_DIR → XDG/platform default) and drives `vp env {list,current,install,uninstall,use,default} node@<v>`. One subtlety worth calling out: Vite+ can run in "system_first" mode, where the shims prefer the system Node over a managed runtime. In that mode `vp env current` reports the *system* version, so Current() returns an error instead of that version. nodeup treats a failed Current() as "active version unknown" and fails closed on cleanup (issue #58) rather than attributing a system install to the managed set. Also registers the manager in the detector registry (both unix and windows), teaches the system-node classifier that <data>/js_runtime/node is manager-managed, and refreshes the CLI prose and docs. Co-Authored-By: puku-ai-2.8 <noreply@puku.sh>
The data-dir branch of VitePlus.Det() stat'd <data>/bin/vp directly, but on Windows the executable is vp.exe — so a Vite+ install whose binary is not on PATH went undetected. LookPath applies PATHEXT for PATH lookups, but a direct filesystem stat has to apply the suffix itself. Co-Authored-By: puku-ai-2.8 <noreply@puku.sh>
|
✔️ e4455c9...bc93511 - Conventional commits check succeeded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123
Summary
Adds Vite+ (
vp, https://viteplus.dev) — VoidZero's unified toolchain — as aninth supported Node.js version manager.
nodeup upgradepreviously reported"no Node.js version manager detected" for Vite+ users.
vp envexposes exactly the operations nodeup needs from a version manager,so the new
VitePlusmanager drives it directly:vpon PATH, or<data>/bin/vpon disk (no subprocess)vp --versionvp env list node --jsonvp env current node --jsonvp env {install,uninstall,use,default} node@<v><data>/js_runtime/node/<v>/lib/node_modulesData-directory resolution mirrors upstream's chain
(
crates/vp_shared/src/dirs/resolution.rs):VP_HOME→<home>/.vite-plus(only when it holds a
currentlink) →VP_DATA_DIR→ XDG / platform default.All candidates are returned, not just the first hit, so nodeup can still find
Node installs when the shell it runs in doesn't carry the same Vite+ env vars
that
vpitself would resolve.One subtlety worth reviewing: Vite+ can run in
system_firstmode, wherethe shims prefer the system Node over a managed runtime. In that mode
vp env currentreports the system version — soCurrent()returns an errorinstead of that version. nodeup treats a failed
Current()as "active versionunknown" and fails closed on cleanup (issue #58) rather than attributing a
system install to the Vite+-managed set.
Also registered in the detector registry (unix + windows), taught the
system-node classifier that
<data>/js_runtime/nodeis manager-managed (so avp-managednodeon PATH no longer trips the "unrecognized layout" warning),and refreshed the CLI prose and docs.
Verification
make cigreen (tidy + fmt + vet + lint + race tests)vpv1.4.0 on this machine:nodeup list --manager vite-plus→vite-plus: 26.13.0nodeup check→ reports the system node asmanaged by vite-plusnodeup upgrade --dry-run --manager vite-plus→ resolves the manager andcomputes the plan
set default/use/install/uninstall) exercised againsta throwaway
VP_HOME=$(mktemp -d)sandbox, so the real Vite+ install wasnever mutated
Test plan
go test ./internal/detector/...— newviteplus_test.gocovers thethree parse helpers, method argv assertions, error propagation
(
errors.Is),Detect()not shelling out, data-dir resolution, andGlobalNpmPrefixsystem_node_test.go—vite-pluscases added to theTestManagerManagedRootstable🤖 Generated with puku-cli