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(vp): refactor global cli to rust entry point by fengmk2 · Pull Request #514 · voidzero-dev/vite-plus

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jan 28, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The binary can now be used as a drop-in replacement for the Node.js
global CLI for package manager operations.

Verification Tests

  • install.sh
  • install.ps1
  • e2e

Sorry, something went wrong.

Uh oh!

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

All reactions
@fengmk2 fengmk2 changed the title feat(global-cli): add vite_global_cli crate (Phase 1) feat(global-cli): add vite_global_cli crate Jan 28, 2026
@fengmk2 fengmk2 mentioned this pull request Jan 28, 2026
feat(js_runtime): add vite_js_runtime crate for JavaScript runtime management #508
Merged
@fengmk2 Graphite App

fengmk2 commented Jan 28, 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)
  • feat(vp): refactor global cli to rust entry point #514 Graphite 👈 (View in 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 28, 2026
refactor: consolidate get_cache_dir logic via vite_shared crate #509
Merged
@fengmk2 fengmk2 self-assigned this Jan 28, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 28, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Deploying vite-plus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7b866d4
Status: ✅  Deploy successful!
Preview URL: https://74789c44.vite-plus.pages.dev
Branch Preview URL: https://vite-global-cli-crate.vite-plus.pages.dev

View logs

All reactions

Sorry, something went wrong.

Uh oh!

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

@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from 8824030 to a9acd67 Compare January 28, 2026 08:56
@fengmk2 fengmk2 changed the title feat(global-cli): add vite_global_cli crate feat(vp): refactor global cli to rust entry point Jan 28, 2026
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from 499ea84 to c96424e Compare January 28, 2026 14:40
@fengmk2 fengmk2 added the test: install-e2e run vite install e2e test label Jan 28, 2026
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch 2 times, most recently from b5aa8af to 22ea026 Compare January 29, 2026 04:06
@fengmk2
fengmk2 force-pushed the vite_shared branch 2 times, most recently from 59ab7cd to c6a1f1e Compare January 29, 2026 08:25
@fengmk2
fengmk2 changed the base branch from vite_shared to graphite-base/514 January 29, 2026 08:32
@fengmk2
fengmk2 force-pushed the graphite-base/514 branch from c6a1f1e to e0da176 Compare January 29, 2026 08:33
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from 4955d30 to 5f6b2ea Compare January 29, 2026 08:33
@graphite-app
graphite-app Bot changed the base branch from graphite-base/514 to main January 29, 2026 08:34
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from 5f6b2ea to 23318e2 Compare January 29, 2026 08:34
@fengmk2
fengmk2 changed the base branch from main to graphite-base/514 January 29, 2026 09:51
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from 23318e2 to a213f27 Compare January 29, 2026 09:51
@fengmk2
fengmk2 changed the base branch from graphite-base/514 to improve-js-runtime January 29, 2026 09:51
@fengmk2 fengmk2 mentioned this pull request Jan 29, 2026
feat(js_runtime): add multi-source Node version reading #522
Merged
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch from a213f27 to 1750eb2 Compare January 29, 2026 10:15
@fengmk2
fengmk2 force-pushed the improve-js-runtime branch from 901823c to 256cd9b Compare January 29, 2026 10:15
@fengmk2
fengmk2 force-pushed the vite_global_cli_crate branch 5 times, most recently from 0afd672 to 485b520 Compare January 29, 2026 13:37
fengmk2 added 29 commits February 7, 2026 08:26
@fengmk2
feat(global-cli): pass VITE_PLUS_CLI_BIN env to JS scripts
c0ac504
- Add VITE_PLUS_CLI_BIN environment variable containing the vp binary path
- JS scripts can use this to invoke vp commands when needed
- Add CliBinaryNotFound error variant for proper error semantics
- Extract create_node_command helper to reduce code duplication
@fengmk2
feat(global-cli): ensure JS runtime for PM commands
c4a423b
Add prepend_js_runtime_to_path_env() helper that downloads managed
Node.js via vite_js_runtime and prepends it to PATH before executing
package manager commands. Uses project's devEngines.runtime if
package.json exists, otherwise falls back to CLI's runtime.

- Update all 12 PM command files to call the helper
- Rename create_node_command to create_js_command
- Add PATH prepending to create_js_command for child processes
- Remove unused execute_pm_command method
- Add snap test for devEngines.runtime verification
@fengmk2
test(snap): add node-version priority over engines.node test
03b0395
@fengmk2
fix(global-cli): show install error when binary not found
ab6afe9
- Replace JS-only fallback with helpful error message directing users
  to install from https://viteplus.dev
- Show OS-specific installation commands (bash for Unix, PowerShell for Windows)
- Add ensureExecutable() to auto-fix binary permissions on non-Windows systems
@fengmk2
chore(ci): skip Discord notification for test releases
dde4430
- Only send Discord notification when npm_tag is 'latest'
- Update install instructions to use install.sh/install.ps1 scripts
@fengmk2
refactor(shared): add shared init_tracing to vite_shared
d81909d
Move tracing initialization to vite_shared crate and reuse it in both
vite_global_cli and vite-plus-cli bindings. Uses VITE_LOG environment
variable for log filtering with OnceLock to ensure single initialization.
@fengmk2
fix(global-cli): add vp.cmd wrapper in Windows installer
6091b66
Create vp.cmd alongside vp.exe so Windows users can run 'vp' directly
without needing to specify the .exe extension.
@fengmk2
fix(js-runtime): use separate join() calls for Windows path compatibi…
5d57c96
…lity

Replace embedded forward slashes in format strings with separate join()
calls to ensure proper path separators on Windows. This fixes paths like
`C:\...\js_runtime\node/25.5.0` becoming `C:\...\js_runtime\node\25.5.0`.
@fengmk2
test(global-cli): add unit tests for js_executor
d318ce7
Add tests for create_js_command and execute_cli_script to verify
Node.js execution works correctly on both Windows and Unix platforms.
@fengmk2
refactor(global-cli): simplify scripts_dir path resolution
3883ea1
Use parent() to navigate up the directory tree instead of join("..")
with canonicalize(). This avoids the \\?\ prefix that Windows adds
during canonicalization.
@fengmk2
FIXUP
025e606
@fengmk2
fix(vite_command): skip which::which_in on Windows
aece282
Windows handles PATH resolution and executable extensions (.exe, .cmd,
etc.) automatically, so we can let the OS resolve the binary path
directly instead of using which::which_in.
@fengmk2
fix(ci): fail release if no vp binaries found
a0a8cc9
The find command exits normally even when no files match. Add explicit
check to fail the workflow if no vp binaries are found in target.
@fengmk2
feat(install): dynamically detect supported platforms from npm registry
4fb41dc
- Replace hard-coded platform mappings with dynamic lookup from optionalDependencies
- Add libc detection (gnu vs musl) for Linux to support Alpine/musl environments
- Fetch version-specific metadata to ensure correct platform packages
- Provide helpful error messages listing available platforms when unsupported
- Cache npm metadata to avoid duplicate API calls

This makes the install scripts automatically support new platforms when they
are added to the package.json optionalDependencies.
@fengmk2
fix(install): include request URL in metadata fetch error message
9893a41
Helps users troubleshoot network issues or incorrect registry URLs.
@fengmk2
refactor(ci): cache Rust CLI binary from target directory
44858dd
- Cache vp binary directly from target/${target}/release/ instead of
  packages/global/bin/
- Use merge-multiple: true when downloading artifacts to preserve
  directory structure, eliminating the reorganization step
- Add separate "Copy Rust CLI binary" step that runs on both cache
  hit and miss
- Update release body with shell-based install instructions for both
  macOS/Linux and Windows, with version env var for non-latest tags
@fengmk2
fix(install): show error message for invalid version instead of silen…
debc834
…t exit

When specifying a non-existent version, the installers previously failed
silently due to:
- Bash: `set -e` causing script exit when grep failed in subshell
- PowerShell: generic HTTP error instead of npm's specific message

Changes:
- Add npm registry error response detection in fetch_package_metadata()
- Handle both {"error":"..."} and plain string error responses
- Fix subshell exit issue by using global variables instead of command
  substitution (exit in subshell only exits subshell, not main script)
- Extract and display npm error messages in PowerShell catch block
@fengmk2
feat(install): show download progress bar instead of URL
46f62b1
Replace text-based download messages with visual progress bars:
- Bash: use curl --progress-bar instead of silent mode
- PowerShell: remove -UseBasicParsing to enable native progress bar
@fengmk2
chore(install): remove "Creating directories" log message
89f97a0
@fengmk2
chore(install): update installer title to "VITE+(⚡︎) Installer"
44cb7d5
@fengmk2
fix(ci): add cross-compilation toolchain for aarch64-linux-gnu
6e483d3
Install gcc-aarch64-linux-gnu and set CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER
to fix the release workflow failing with "failed to find tool aarch64-linux-gnu-gcc"
when cross-compiling vite_global_cli from x86_64 to aarch64.
@fengmk2
fix(ci): restore Rust CLI binary directory structure in release workflow
00da4ad
Download artifacts without merge-multiple and move files from artifact
subdirectories to the expected target/{target}/release/ locations.
@fengmk2
feat(cli): restore vp help [command] and fix vp new --help proxying
ef25d97
Transform `vp help [command]` into `vp [command] --help` at the entry
point before clap parsing. This restores the help subcommand that was
lost during the Rust refactoring.

Also disable clap's help flag for `new` and `migrate` commands so that
`--help` and `-h` are passed through to the JavaScript handlers which
have styled, comprehensive help output.
@fengmk2
fix(install): add user-friendly error messages for curl failures
36524a0
Wrap curl calls to capture exit codes and provide helpful error messages
with troubleshooting suggestions when network errors occur.

Maps common curl exit codes to descriptive messages:
- Exit 6: DNS resolution failed
- Exit 7: Connection refused
- Exit 28: Connection timed out
- Exit 35: SSL/TLS connection error
- Exit 60: SSL certificate verification failed

Each error includes the failed URL and a debug command users can run.
@fengmk2
fix(install): correct PATH config detection to avoid false warning
148c7bb
When PATH was already configured in shell profile, add_to_path returned
1 (failure), causing the script to show "Could not automatically update
PATH" warning incorrectly.

Now add_to_path uses return codes to indicate the result:
- 0: path was newly added
- 1: file not found (failure)
- 2: path already exists

This ensures the correct message is shown: "PATH already configured"
when the path already exists in the profile.
@fengmk2
feat(install): install production dependencies after copying package.…
3349ad7
…json

- Copy templates, rules directories and AGENTS.md file to VERSION_DIR
- Remove devDependencies and optionalDependencies from package.json
- Run `CI=true vp install` to install production dependencies
- Refactor copy logic into a loop to reduce duplication
@fengmk2
feat(install): streamline installation output for cleaner UX
f9831db
- Replace verbose info messages with clean, minimal output
- Use silent curl downloads (no progress bars)
- Add smart PATH handling: prefer ~/.local/bin symlink when available
- Show version, location, and next steps in success message
- Display actual install path from VITE_PLUS_INSTALL_DIR
- Add test-install.yml workflow to test installers on all platforms
@fengmk2
fix(ci): use napi-cross for glibc 2.17 compatibility in Rust CLI binary
d7eada1
Use `napi build --use-napi-cross` instead of `cargo build` for Linux gnu
targets to link against glibc 2.17, ensuring compatibility with older
Linux distributions (Ubuntu 20.04+, Debian 10+, RHEL 8+).

- Build Linux gnu targets with napi-cross toolchain
- Add glibc version verification step for x86_64-linux
- Test install script on Ubuntu 20.04 (oldest supported LTS)
@fengmk2
fix(ci): use pnpm exec to run napi CLI from package context
b65427c
The napi CLI is a devDependency, not globally available. Use
`pnpm --filter=vite-plus exec napi` to run it from the package context.
@fengmk2 fengmk2 mentioned this pull request Feb 7, 2026
refactor(cli): rename vp env run to vp env exec #553
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@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: install-e2e run vite install e2e test

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.