GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(env): implement vp env command for Node.js version management by fengmk2 · Pull Request #524 · voidzero-dev/vite-plus

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jan 31, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Add shim-based Node.js version management with the following features:

  • vp env setup: Create shims (node, npm, npx) in ~/.vite-plus/bin
  • vp env doctor: Diagnostics for environment configuration
  • vp env default [VERSION]: Set/show global default Node.js version
  • vp env which <TOOL>: Show path to tool binary
  • vp env --current [--json]: Show current environment info
  • vp env --print: Print shell snippet for session

The shims intercept node/npm/npx commands and automatically resolve
the correct Node.js version based on:

  1. .node-version file
  2. package.json#engines.node
  3. package.json#devEngines.runtime
  4. User default from config
  5. Latest LTS fallback

Implementation includes:

  • Shim detection via argv[0] or VITE_PLUS_SHIM_TOOL env var
  • Resolution cache with mtime validation for fast repeated invocations
  • Platform-specific execution (execve on Unix, spawn on Windows)
  • Conflict detection for other version managers (nvm, fnm, volta, etc.)
  • Updated install.sh with shim setup and PATH configuration prompt

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fengmk2 fengmk2 self-assigned this Jan 31, 2026
@netlify

netlify Bot commented Jan 31, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ Deploy Preview for viteplus-staging ready!

Name Link
🔨 Latest commit bd0a60d
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-staging/deploys/6981f43d67724600085c1454
😎 Deploy Preview https://deploy-preview-524--viteplus-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 mentioned this pull request Jan 31, 2026
feat(vp): refactor global cli to rust entry point #514
Merged
3 tasks done
@fengmk2 Graphite App

fengmk2 commented Jan 31, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author
  • feat(env): implement vp env command for Node.js version management #524 Graphite: 2 dependent PRs (#532 Graphite, #545 Graphite) 👈 (View in Graphite)
  • feat(vp): refactor global cli to rust entry point #514 Graphite
  • feat(js_runtime): add multi-source Node version reading #522 Graphite
  • fix(build): run vite-plus-cli build after other packages #531 Graphite
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 mentioned this pull request Jan 31, 2026
feat(js_runtime): add multi-source Node version reading #522
Merged
@fengmk2
fengmk2 force-pushed the vp-env-shims branch from e177fa4 to 3ad4bea Compare February 1, 2026 13:45
@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Feb 1, 2026
@fengmk2
fengmk2 force-pushed the vp-env-shims branch 10 times, most recently from 6e04051 to 31b2986 Compare February 2, 2026 15:22
@fengmk2 fengmk2 removed the test: e2e Auto run e2e tests label Feb 2, 2026
@fengmk2
fengmk2 force-pushed the vp-env-shims branch 6 times, most recently from a942407 to 9c1f325 Compare February 3, 2026 05:43
@fengmk2
fengmk2 marked this pull request as ready for review February 3, 2026 05:43
@fengmk2
fengmk2 requested review from Brooooooklyn and cpojer February 3, 2026 05:43
@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Feb 3, 2026
fengmk2
fengmk2 commented Feb 3, 2026
View reviewed changes
Comment thread CONTRIBUTING.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Brooooooklyn

Brooooooklyn commented Feb 3, 2026

Copy link
Copy Markdown
Member

cursor review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fengmk2 added 18 commits February 7, 2026 08:45
@fengmk2
refactor(ci): replace npm install -g with vp install -g in workflows
bb3d565
@fengmk2
feat(env): add vp env use command for per-shell session Node.js ver…
5f45301
…sion override

- Add `vp env use [VERSION]` command that outputs shell-appropriate
  export/unset commands to stdout (eval'd by shell function wrapper)
- Add VITE_PLUS_NODE_VERSION env var as priority 0 in version resolution
- Add fast-path in shim cache to skip disk I/O when env var is set
- Extend env files (POSIX, fish, PowerShell) with shell function wrappers
  that intercept `vp env use` and eval its stdout
- Add -h/--help bypass in shell function wrappers to avoid eval'ing help text
- Patch env files for vp-dev binary name in install-global-cli.ts
- Add friendly error message for invalid version inputs (e.g., `vp env use d`)
- Update doctor diagnostics to report active session override
- Add snap tests for command output and shell wrapper behavior
@fengmk2
feat(env): add vp env list (local) and rename old list to `vp env l…
6758374
…ist-remote`

- `vp env list` (alias `ls`): lists locally installed Node.js versions
  with current/default markers, fnm-style `* v{version}` format
- `vp env list-remote` (alias `ls-remote`): lists remote versions from
  registry with fnm-style output (v{version} per line, LTS in bright blue)
- Add `--sort asc|desc` flag to list-remote (default: asc)
- Add `SortingMethod` enum to CLI args
@fengmk2
feat(env): migrate vp env packages to vp pm list -g + add `vp lis…
e0dad5c
…t`/`vp ls` aliases

Move global package listing from `vp env` to `vp pm list -g` where
package management belongs. Add `vp list` and `vp ls` as top-level
aliases that rewrite to `vp pm list`. When `-g` is passed, the command
intercepts early (before JS runtime init) and delegates to the managed
packages listing with optional pattern filtering.
@fengmk2
fix(env): align vp list -g output format with vp env which
9b36326
Show Package, Binaries, Node.js, and Installed fields in the same
style as the which command output.
@fengmk2
feat(env): add hint to revert session override after vp env install
191fe05
When `vp env install` installs a version from the session override
(VITE_PLUS_NODE_VERSION), print a reminder to run `vp env use --unset`
to revert to project version resolution.
@fengmk2
fix(env): stabilize tests against VITE_PLUS_NODE_VERSION env leak
17dede3
Add `#[serial]` and clear `VERSION_ENV_VAR` in 4 tests that call
`resolve_version()` without guarding against an inherited session
override (e.g. from `vp env use 24`).
@fengmk2
refactor(env): unify vp env and vp env -h into single clap-genera…
fc42ae9
…ted help

Replace custom `print_help()` with clap's `after_help` for Examples and
Global Packages sections. Both `vp env` and `vp env -h` now produce
identical output. Also switch `alias` to `visible_alias` so aliases
show in help text.
@fengmk2
refactor(env): replace vp list -g verbose format with aligned table
4f79a1d
Swap the per-package block output (Package/Binaries/Node.js/Installed)
for a compact three-column table (Package, Node version, Binaries) with
dynamic column widths and bright-blue package names.
@fengmk2
fix(pm): silently succeed for vp ls in directory without package.json
87421fe
When running `vp ls` or `vp pm list` in a directory without a
package.json, catch the PackageJsonNotFound error and return success
with no output, matching `pnpm list` behavior.
@fengmk2
refactor(env): redesign doctor and which command output
c68c39d
doctor:
- Add section headers (Installation, Configuration, PATH, Version Resolution)
- Fixed 18-char aligned key-value columns with ✓/✗/⚠ status indicators
- Abbreviate HOME paths with ~ shorthand
- Make Conflicts and IDE Setup sections conditional (only shown on issues)
- Remove tutorial tips ("Run 'vp env on/off'")
- Dimmed remediation hints below errors/warnings
- Bold summary line (✓ All checks passed / ✗ Some issues found)
- Fix IDE integration check to match both $HOME and absolute path forms

which:
- Core tools now show Version (bright green) and Source below the path
- Global packages: show Node version instead of full path, date-only install
- Aligned 10-char padded labels with consistent indentation
- Error prefix changed from "vp:" to "error:" (red bold)
- Remove unused get_node_path() function
@fengmk2
fix(install): use $HOME-relative paths in shell config sourcing lines
783bbf1
Write `$HOME/.vite-plus/env` instead of absolute paths like
`/Users/foo/.vite-plus/env` to shell config files. This makes the
config portable across sessions where HOME may differ (e.g.,
NFS-mounted homes, renamed user accounts).

Duplicate detection checks for both absolute and `$HOME`-relative
forms for backward compatibility with existing installs.
@fengmk2
fix(env): gate PowerShell/cmd.exe shell detection to Windows only
195cb69
`detect_shell()` checked for `PSModulePath` to detect PowerShell, but
on macOS this variable can be set by Homebrew pwsh even in bash/zsh,
causing `vp env use` to output PowerShell-style commands. Gate both
`PSModulePath` and `COMSPEC` checks behind `cfg!(windows)` so
non-Windows shells default to POSIX after ruling out fish.
@fengmk2
feat(env): write session version file so vp env use works without s…
1aae68d
…hell wrapper

`vp env use` previously only output shell commands to stdout for eval.
In CI (GitHub Actions) where the shell wrapper isn't set up, the env var
was never set and subsequent shim invocations ignored the `use` command.

Now `vp env use` also writes the resolved version to
`~/.vite-plus/.session-node-version`. The shim and version resolution
code check this file after the env var but before `.node-version`, so
`vp env use` works both with and without the eval wrapper.

Resolution priority (updated):
0. VITE_PLUS_NODE_VERSION env var
1. .session-node-version file (NEW)
2. .node-version file
3. package.json#engines.node
4. package.json#devEngines.runtime
5. User default from config.json
6. Latest LTS
@fengmk2
refactor(env): gate session file write behind --write-session flag
0ae1685
The session version file should only be written when the shell eval
wrapper is explicitly unavailable (e.g., CI environments). Without
this flag, `vp env use` behaves as before — outputting shell commands
for the wrapper to eval.

Usage in CI: `vp env use 20 --write-session`
Cleanup:     `vp env use --unset --write-session`
@fengmk2
refactor(env): auto-detect shell eval wrapper instead of --write-sess…
ae768e9
…ion flag

Replace the manual --write-session flag with automatic detection using
VITE_PLUS_ENV_USE_EVAL_ENABLE env var. Shell wrappers (POSIX, Fish,
PowerShell, cmd.exe) now set this var before calling vp, so `vp env use`
can detect whether its stdout will be eval'd. When the wrapper is absent
(CI, direct invocation), a session file is written automatically instead
of printing shell export commands to stdout.
@fengmk2
fix(env): allow recursive package binary shim dispatch
6bd008e
The recursion guard (VITE_PLUS_TOOL_RECURSION) was incorrectly blocking
package binary re-invocations through the shim. Scoped the guard to core
tools only (node/npm/npx) since package binaries resolve via metadata
lookup and can't infinite-loop. Also removed the unnecessary recursion
env var set in dispatch_package_binary().
@fengmk2
fix(snap-test): normalize date-only output to <date> placeholder
9a2077d
Add YYYY-MM-DD pattern to replaceUnstableOutput() so the Installed date
in `vp env which` output doesn't cause snap test diffs across days.
@fengmk2
fengmk2 force-pushed the vp-env-shims branch from 2575ad0 to 9a2077d Compare February 7, 2026 08:45
@fengmk2
fengmk2 merged commit 194c0dc into main Feb 7, 2026
34 of 35 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2
fengmk2 deleted the vp-env-shims branch February 7, 2026 09:05
@fengmk2 fengmk2 mentioned this pull request Feb 7, 2026
refactor(cli): rename vp env run to vp env exec #553
Merged
@liangmiQwQ liangmiQwQ mentioned this pull request Apr 25, 2026
chore: remove dead global logic for update command #1478
Merged
@liangmiQwQ liangmiQwQ mentioned this pull request Jun 4, 2026
fix(cli): remove stale global package shims #1765
Merged
fengmk2 pushed a commit that referenced this pull request Jun 5, 2026
@liangmiQwQ
fix(cli): remove stale global package shims (#1765)
9c06959
The current `vp install -g` flow backs up and replaces the package
installation directory, then writes shims for binaries declared by the
newly installed package. If a package update removes a binary from its
`package.json#bin`, the old shim and per-binary config can remain in
`VP_HOME/bin` and `VP_HOME/bins`. It seems introduced in #524.

This PR removes stale managed binary shims during successful global
package reinstall. It compares the package's previous metadata and bin
configs against the newly installed bin list, then deletes shims/configs
for binaries that the package no longer declares.

This keeps existing behavior where `vp install -g` does not remove shims
before invoking npm; cleanup only happens after the new package has
installed and its current binaries have been finalized.

This PR also adds a global snapshot case with two local package fixtures
that share the same package name: v1 declares two bins, v2 declares one
bin, and the test verifies the removed bin's shim and config are gone
after reinstall.

🤖 Generated with Codex
wan9chi added a commit that referenced this pull request Jul 15, 2026
@wan9chi @claude
chore: bump vite-task to 4003f65 (#2167)
8ea4145
Bumps the `vite-task` git dependency from `cb580c2` to `4003f65`.

## Changes

The delta is entirely internal `fspy` (file-access tracking)
shared-memory work — no user-facing CLI flags, config fields, or
behavior changes, so no docs updates were needed.

- **fix(fspy):** use `memfd` for Linux shared memory — automatic
file-access tracking on Linux now works in containers and Kubernetes
runners with limited `/dev/shm` space
([#523](voidzero-dev/vite-task#523),
[#353](voidzero-dev/vite-task#353))
- **perf(fspy):** use sparse Windows shared memory — Windows file-access
tracking now uses sparse temporary backing files where supported,
avoiding upfront allocation of the full backing file on disk
([#524](voidzero-dev/vite-task#524))
- **refactor(fspy):** own macOS shared-memory mapping
([#526](voidzero-dev/vite-task#526))
- **docs/test(fspy):** document shared-memory facade ownership semantics
([#521](voidzero-dev/vite-task#521)); reproduce
constrained dev shm failure
([#522](voidzero-dev/vite-task#522))

The lockfile change reflects this refactor: `fspy` now pulls in `memfd`
and drops `shared_memory`.

## Validation

- `cargo check --workspace` passes — the new `vite-task` compiles
cleanly, confirming no breaking changes on the consuming side (including
`vite_cli_snapshots`, which compiles against vite-task's PTY/snapshot
test crates).
- vite-plus crate tests pass. (One pre-existing, environment-specific
stack overflow in `vite_global_cli`'s
`unknown_argument_detected_with_pass_as_value_hint` clap-parsing test
reproduces identically on `main` and is unrelated to this bump.)
- PTY snapshot output is unchanged by the bump; the remaining local
snapshot diffs in this sandbox are all environmental (no built
`packages/cli/dist`, plus registry TLS/network restrictions), left to
CI, which builds the JS CLI and has registry access.

## Changelog

Full vite-task CHANGELOG diff:
``https://github.com/voidzero-dev/vite-task/compare/cb580c214bb2314fc1f633a3812782c9b3a1d956...4003f65a3e5e3d957ff81b157e85e6ee41cc59fc#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed``

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
_Generated by [Claude
Code](https://claude.ai/code/session_01YERo1yECf81w37US2Gqnow)_

Co-authored-by: Claude <[email protected]>
@Brooooooklyn Brooooooklyn mentioned this pull request Oct 14, 2026
test: remove tautological and duplicate Rust unit tests #3057
Merged
fengmk2 pushed a commit that referenced this pull request Oct 15, 2026
@Brooooooklyn @claude
test: remove tautological and duplicate Rust unit tests (#3057)
88b34aa
<!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} -->
_Requested by **Brooklyn** · [project
thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_

<!-- routine:prune-tests:duplicate-shell-and-helper-tests -->

Before: `vp_global_cli` and `vp_pm_cli` carried Rust unit tests that
could not fail when the product broke: an `assert!(true)` in
`create.rs`, four `env use` shell-detection tests that repeat
`commands::shell` tests for code `env use` only imports, and three tests
of test-only helpers. `upgrade_check.rs` had 20 hand-unrolled lookup
tests.

After: those 8 tests are gone and the 20 lookup tests are 2 table-driven
tests that keep every row and comment, with the failing row named in the
assertion message. Only test code changes: every hunk is inside a
`#[cfg(test)]` module or the `#[cfg(test)]`-only
`resolution::test_utils` module.

How: each candidate was defended by mutating product code with the most
realistic regression only it would catch, running the crate's tests, and
reverting. No deleted test failed alone on any mutation.

### Totals

| | Before (origin/main c04bcf6) | After |
|---|---|---|
| Files touched | – | 5 |
| `vp_global_cli` cases collected (Linux) | 502 (+2 ignored) | 479 (+2
ignored) |
| `vp_pm_cli` cases collected | 923 (+2 ignored) | 920 (+2 ignored) |

- Cases deleted: **8** of 1,425 collected in the two touched crates.
Repo-wide: about 2,432 `#[test]`/`#[tokio::test]` attributes in tracked
Rust (static count) and 1,492 static `it`/`test` calls in 101 JS spec
files (not collected; Vitest needs a full `packages/core` build).
- Cases folded: **20 into 2**, every row and comment kept.
Runner-collected total: −26.
- Net lines: **−159** (+42 / −201).
- Runtime saved: about 0.03 s (the 8 deleted cases each report 0.000 s;
the 20 folded cases summed 0.028 s against 0.011 s for the 2
replacements).
- Test-binary time on this shared machine: `vp_global_cli` 3.13 s → 3.32
s, `vp_pm_cli` 27.81 s → 29.06 s (noise).

### Per file

1. **`crates/vp_global_cli/src/commands/create.rs` ›
`test_create_command_module_exists`**
   - Class: tautology (`assert!(true)`).
- Best defense: M1 (delegate `"new"` instead of `"create"`) passes all
502 tests, so this test cannot fail. The whole `mod tests` goes.
- Coverage gap (pre-existing, unchanged by this PR): no unit test covers
`vp create` delegation. It may be covered by the PTY snapshot suite,
which was not run.
2. **`crates/vp_global_cli/src/commands/env/use.rs` ›
`test_detect_shell_vp_shell_{powershell,fish,nu}`,
`test_detect_shell_posix_default`**
- Class: duplicates of stronger tests. `detect_shell` /
`Shell::from_str` live in `commands/shell.rs`; `env use` only imports
them.
- Still covered: `fish` is byte-identical to
`commands::shell::tests::test_detect_shell_vp_shell_fish`; `nu` to
`test_detect_shell_vp_shell_explicit`; lowercase `powershell` by
`test_shell_from_str` and `test_detect_shell_vp_shell_case_insensitive`;
`posix_default` by `test_detect_shell_defaults_without_vp_shell`.
- Best defenses M2–M5: each failed the nominee together with at least
one `commands::shell` test.
- The `use vp_shared::env_vars;` import is now `#[cfg(windows)]`, since
only the three Windows-only tests in the module still use it.
3. **`crates/vp_pm_cli/src/resolution/test_utils.rs` ›
`parses_args_without_a_program_name`,
`parses_subcommands_without_a_program_name`**
   - Class: test tooling testing test tooling.
- Best defense: M7 fails 122 tests and M8 fails 17; every resolution
parser test exercises these helpers.
4. **`crates/vp_pm_cli/src/resolution/commands/list.rs` ›
`list_args_helper_keeps_pattern`** (and its test-only `list_args`
helper, which had no other caller)
- Class: test tooling testing test tooling; it only checked struct
construction.
- Best defenses: M9 fails only
`test_list_with_pattern_and_pass_through_args`; M10 fails
`test_parser_accepts_short_dev_and_global_flags` and
`cli::tests::projects_managed_global_commands`. The nominee passes both.

### Folds (`crates/vp_global_cli/src/upgrade_check.rs`)

- The 9 `is_newer_version_*` tests → `is_newer_version_compares_semver`
(12 rows, original comments kept, one comment added for the `0.0.0`
dev-build row).
- The 11 `should_run_for_*` / `should_not_run_for_*` tests →
`should_run_for_command_skips_excluded_and_machine_readable_commands`
(11 rows).
- M11, M12 and M13 still fail the folded tables.

### Kept after defense — do not re-nominate

None: no nominee survived its defense.

### Case counts

| file | before | after | delta | expected delta |
|---|---|---|---|---|
| vp_global_cli `commands/create.rs` | 1 | 0 | −1 | −1 |
| vp_global_cli `commands/env/use.rs` (Linux) | 16 | 12 | −4 | −4 |
| vp_global_cli `upgrade_check.rs` | 36 | 18 | −18 | −18 (20 folded into
2) |
| vp_pm_cli `resolution/commands/list.rs` | 45 | 44 | −1 | −1 |
| vp_pm_cli `resolution/test_utils.rs` | 2 | 0 | −2 | −2 |
| **Crates total** | 1,425 | 1,399 | −26 | −26 |

**0 new failures** (0 failed and 4 ignored, before and after).

### Mutations

Each was temporary and reverted (`git status` clean afterwards).

1. M1 `create.rs:15`: delegate `"new"` instead of `"create"`. Failed:
none.
2. M2 `shell.rs:30`: `"fish"` → `"fishshell"`. Failed: `use::…_fish`,
`shell::test_shell_from_str`, `shell::…_fish`.
3. M3 `shell.rs:31`: `"nu" | "nushell"` → `"nushell"`. Failed:
`use::…_nu`, `shell::…_explicit`, `shell::test_shell_from_str`.
4. M4 `shell.rs:32`: drop `"powershell"`. Failed: `use::…_powershell`,
`shell::…_case_insensitive`, `shell::test_shell_from_str`.
5. M5 `shell.rs:54`: default always `Cmd`. Failed:
`use::…_posix_default`, `shell::…_defaults_without_vp_shell`,
`shell::…_invalid_vp_shell_falls_back_to_default`.
6. M6 `shell.rs:49`: upper-case the value. Failed: none (equivalent
mutation; `from_str` lowercases).
7. M7 `test_utils.rs:70`: `test_argv` no longer prepends a program name.
Failed: 122 tests, including both nominees.
8. M8 `test_utils.rs:57`: `parse_subcommand` gets raw args. Failed: 17
tests (`config`, `dist_tag`, `owner`, `stage`, `token`, plus the
nominee).
9. M9 `list.rs:78-80`: pnpm drops the pattern. Failed:
`test_list_with_pattern_and_pass_through_args` only.
10. M10 `list.rs:11`: `pattern` becomes `#[arg(long)]`. Failed:
`test_parser_accepts_short_dev_and_global_flags`,
`cli::tests::projects_managed_global_commands`.
11. M11 `upgrade_check.rs:170` (after the fold): `>` → `>=`. Failed:
`is_newer_version_compares_semver`.
12. M12 `upgrade_check.rs:338` (after the fold): `Upgrade` removed from
the excluded commands. Failed:
`should_run_for_command_skips_excluded_and_machine_readable_commands`.
13. M13 `upgrade_check.rs:165` (after the fold): the `0.0.0` early
return removed. Failed: `is_newer_version_compares_semver`.

### What ran and what did not

- Ran, at origin/main and on this branch: `cargo test -p vp_global_cli`
and `cargo test -p vp_pm_cli` with `--report-time`; `cargo clippy -p
vp_global_cli -p vp_pm_cli --all-targets --all-features -- --deny
warnings` with the `just lint` allow-list; `cargo fmt --all -- --check`;
`git diff --check`. All pass.
- Not run: the full workspace `just test` / `just lint` / `just check`;
Windows targets (none installed here, so the `#[cfg(windows)]` import
gate was reviewed but not compiled; Windows CI will compile it); the
JS/Vitest suite; the PTY snapshot suite.

### Excluded pull requests

55 open PRs touch 737 files between them; none of the 5 files here is
among them. #3055 #3052 #3051 #3049 #3047 #3046 #3044 #3040 #3038 #3037
#3020 #3018 #3014 #3012 #3009 #3008 #3000 #2986 #2981 #2966 #2936 #2922
#2900 #2863 #2862 #2810 #2792 #2740 #2721 #2699 #2695 #2574 #2557 #2552
#2549 #2543 #2542 #2541 #2483 #2475 #2463 #2462 #2461 #2456 #2428 #2418
#2357 #2267 #2125 #1958 #1783 #1782 #1614 #1517 #1180.

### Age check (cutoff: 30 days, 2026-09-14)

First-added dates from `git log -S`, followed across the `vite_*` →
`vp_*` crate rename.

| Test | First added |
|---|---|
| `test_create_command_module_exists` | 2026-02-10 (a29ac83, #570) |
| `test_detect_shell_posix_default` | 2026-02-07 (194c0dc, #524) |
| `test_detect_shell_vp_shell_{powershell,fish,nu}` | 2026-05-24
(53ae721, #1658) |
| `test_utils` tests and `list_args_helper_keeps_pattern` | 2026-08-03
(c1574dd, #2140) |
| The 20 folded `upgrade_check` tests | 2026-03-30 (db75675) |

None was added for a bug or incident, and none is in a permission,
security or entitlement suite.

### Checks

| Check | Before | After |
|---|---|---|
| Tests `vp_global_cli` | 502 pass | 479 pass |
| Tests `vp_pm_cli` | 923 pass | 920 pass |
| Clippy (deny warnings) | pass | pass |
| rustfmt | – | pass |
| `git diff --check` | – | clean |

To revert: `git revert 687935d`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_

Co-authored-by: Claude <[email protected]>
@Brooooooklyn Brooooooklyn mentioned this pull request Nov 4, 2026
test(js-runtime): fold unrolled .node-version parse tests into one table #3355
Merged
fengmk2 pushed a commit that referenced this pull request Nov 5, 2026
@Brooooooklyn @claude
test(js-runtime): fold unrolled .node-version parse tests into one ta…
b8f1a76
…ble (#3355)

<!-- claude-projects-attribution: {"github_login":"Brooooooklyn"} -->
_Requested by **Brooklyn** · [project
thread](https://claude.ai/code/project/chan_018s9RxRdtH424j2EhXdzV3N?thread=cmsg_018s9RxRdtH424j2EhXdzV3NQxbeR8Pt7qaqSQwoq9rEFo)_

<!-- routine:prune-tests:node-version-table -->

Before: nine `test_parse_node_version_content_*` tests in
`crates/vp_js_runtime/src/dev_engines.rs` each asserted a few input →
output pairs for the pure function `parse_node_version_content`, one
`#[test]` per group.

After: one table-driven `test_parse_node_version_content` holds all 25
rows, its section comments and the "LTS Alias Tests" banner. Each
assertion names the input that failed. Nothing is deleted. Only the test
module changes.

How: each row group was defended by mutating
`parse_node_version_content` and reverting. Two mutations failed only
one of the old tests, so those rows are kept and the new test carries a
comment saying so.

### Totals

- Files touched: 1 (test module only).
- Cases deleted: 0. Cases folded: 9 into 1, so `vp_js_runtime --lib`
goes from 137 to 129.
- Net lines: **−15** (+51 / −66).
- Runtime saved: about 0 (each old case reported `<0.000s`).

### Mutations (each reverted)

| Change | Failed before | Failed after |
|---|---|---|
| drop `strip_prefix('v')` | 3 of the nine, plus 3 `.nvmrc` tests | the
folded test, plus the 3 `.nvmrc` tests |
| drop `.trim()` | 3 of the nine | the folded test |
| drop the empty-content early return | only `_empty` | the folded test
|
| lowercase `lts/<codename>` | only `_lts_codename` | the folded test |
| drop the `lts/` early return | none | none (see below) |

Finding, not changed here: the `lts/` early return has no observable
effect, because the `strip_prefix('v')` after it can never match a
string starting with `lts/`.

### What ran and what did not

- Ran at `a32a8cec` and on this branch: `cargo test -p vp_js_runtime
--lib` with `--report-time` (137/137 before, 129/129 after), `cargo
clippy -p vp_js_runtime --all-targets -- -D warnings`, `rustfmt --check`
and `git diff --check`, all clean. The workspace was loaded without
`packages/cli/binding`, which needs the `rolldown/` clone; `Cargo.toml`
and `Cargo.lock` are unchanged in this PR.
- Not run: the rest of the Rust workspace, JS tests and snapshot tests.

Open pull requests: none of the open PRs touches `dev_engines.rs`.

Ages: the nine tests were added on 2026-02-07 in #522 and #524.

To revert: `git revert 91064a5`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf)_

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@Brooooooklyn Brooooooklyn Brooooooklyn approved these changes
@cpojer cpojer Awaiting requested review from cpojer

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@fengmk2 fengmk2

Labels

test: e2e Auto run e2e tests

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@fengmk2 @Brooooooklyn
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.