Skip to content

feat(detector): support the Vite+ (vp) CLI as a version manager - #124

Merged
dipto0321 merged 2 commits into
mainfrom
feat/detector/vite-plus
Nov 1, 2026
Merged

dipto0321 merged 2 commits into
mainfrom
feat/detector/vite-plus

Conversation

@dipto0321

@dipto0321 dipto0321 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #123

Summary

Adds Vite+ (vp, https://viteplus.dev) — VoidZero's unified toolchain — as a
ninth supported Node.js version manager. nodeup upgrade previously reported
"no Node.js version manager detected" for Vite+ users.

vp env exposes exactly the operations nodeup needs from a version manager,
so the new VitePlus manager drives it directly:

Operation Command
Detect vp on PATH, or <data>/bin/vp on disk (no subprocess)
Version vp --version
ListInstalled vp env list node --json
Current vp env current node --json
Install / Uninstall / Use / SetDefault vp env {install,uninstall,use,default} node@<v>
GlobalNpmPrefix <data>/js_runtime/node/<v>/lib/node_modules

Data-directory resolution mirrors upstream's chain
(crates/vp_shared/src/dirs/resolution.rs): VP_HOME → <home>/.vite-plus
(only when it holds a current link) → 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 vp itself would resolve.

One subtlety worth reviewing: 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 Vite+-managed set.

Also registered in the detector registry (unix + windows), taught the
system-node classifier that <data>/js_runtime/node is manager-managed (so a
vp-managed node on PATH no longer trips the "unrecognized layout" warning),
and refreshed the CLI prose and docs.

Verification

  • make ci green (tidy + fmt + vet + lint + race tests)
  • End-to-end against the real vp v1.4.0 on this machine:
    • nodeup list --manager vite-plus → vite-plus: 26.13.0
    • nodeup check → reports the system node as managed by vite-plus
    • nodeup upgrade --dry-run --manager vite-plus → resolves the manager and
      computes the plan
  • Mutations (set default / use / install / uninstall) exercised against
    a throwaway VP_HOME=$(mktemp -d) sandbox, so the real Vite+ install was
    never mutated

Test plan

  • go test ./internal/detector/... — new viteplus_test.go covers the
    three parse helpers, method argv assertions, error propagation
    (errors.Is), Detect() not shelling out, data-dir resolution, and
    GlobalNpmPrefix
  • system_node_test.go — vite-plus cases added to the
    TestManagerManagedRoots table
  • CI green on ubuntu / macos / windows

🤖 Generated with puku-cli

dipto0321 and others added 2 commits November 1, 2026 19:07
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>
@cocogitto-bot

cocogitto-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

✔️ e4455c9...bc93511 - Conventional commits check succeeded.

@dipto0321
dipto0321 merged commit 2732d40 into main Nov 1, 2026
11 checks passed
@dipto0321
dipto0321 deleted the feat/detector/vite-plus branch November 1, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(detector): support the Vite+ (vp) CLI as a Node.js version manager

1 participant