Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
de580ff
feat(env): implement vp env command for Node.js version management
fengmk2 Jan 31, 2026
8fe6dd5
refactor(install): rename VITE_PLUS_INSTALL_DIR to VITE_PLUS_HOME
fengmk2 Jan 31, 2026
4347533
refactor(install): rename VITE_PLUS_INSTALL_DIR to VITE_PLUS_HOME in …
fengmk2 Jan 31, 2026
1fc663f
feat(install): add shim setup to Windows installer
fengmk2 Jan 31, 2026
9ae210b
test(install): add shims verification tests and skip prompt in CI
fengmk2 Jan 31, 2026
a0c98e8
refactor(shared): consolidate PATH env utilities into vite_shared
fengmk2 Feb 1, 2026
88ad00e
feat(env): add `vp env on` and `vp env off` commands for shim mode co…
fengmk2 Feb 1, 2026
9c15585
refactor(global-cli): make main() and shim dispatch async
fengmk2 Feb 1, 2026
9e3c465
refactor(env): convert --setup, --doctor, --which flags to subcommands
fengmk2 Feb 1, 2026
7e3d46c
refactor(js_runtime): extract Node.js version resolution into reusabl…
fengmk2 Feb 1, 2026
5122e63
docs(rfc): add architecture diagram to vp env RFC
fengmk2 Feb 1, 2026
62d41a8
feat(install): add VITE_PLUS_LOCAL_BINARY env var for local testing
fengmk2 Feb 1, 2026
3deddca
fix(install): improve Node.js shims prompt with default yes
fengmk2 Feb 1, 2026
3e66d0f
feat(install): add VITE_PLUS_LOCAL_PACKAGE for offline testing
fengmk2 Feb 1, 2026
52fb3d7
fix(install): handle non-zero returns from path functions safely
fengmk2 Feb 1, 2026
383019c
feat(install): auto-enable Node.js shims when no node detected
fengmk2 Feb 1, 2026
634225a
feat(install): sync install.ps1 with install.sh logic
fengmk2 Feb 1, 2026
f5c3cb1
refactor(shared): migrate get_vite_plus_home to vite_shared and unify…
fengmk2 Feb 1, 2026
587b299
feat(env): add pin, unpin, and list commands for Node.js version mana…
fengmk2 Feb 1, 2026
8aaf690
fix(env): add help subcommand to show usage information
fengmk2 Feb 1, 2026
de2bfae
fix(cli): add env command to main help output
fengmk2 Feb 1, 2026
1f3eb08
fix(env): make list --all show all versions instead of grouped view
fengmk2 Feb 1, 2026
d66fddb
test(env): add unit tests for list --all flag
fengmk2 Feb 1, 2026
c149075
docs(rfc): add global package management, run command, and unified bi…
fengmk2 Feb 2, 2026
6408cd9
feat(env): add run command, recursion prevention, and rename shims/ t…
fengmk2 Feb 2, 2026
95f8d90
feat(env): add IDE-specific setup guidance to doctor command
fengmk2 Feb 2, 2026
c03a365
feat(env): implement global package management
fengmk2 Feb 2, 2026
c237467
feat(env): add packages/uninstall commands and yarn global support
fengmk2 Feb 2, 2026
4a1d851
refactor(env): remove yarn global interception for now
fengmk2 Feb 2, 2026
26c4819
docs(rfc): update implementation plan - move yarn/pnpm to future, add…
fengmk2 Feb 2, 2026
9bce810
test(env): add snap test for vp env run command
fengmk2 Feb 2, 2026
7d24272
docs(rfc): update install prompt to match install.sh
fengmk2 Feb 2, 2026
61c6aee
chore: remove unused get_shared_dir function
fengmk2 Feb 2, 2026
457b7c6
fix: resolve unused variable warnings on Windows
fengmk2 Feb 2, 2026
c112e3b
feat(env): add install command with --node flag and conflict warnings
fengmk2 Feb 2, 2026
24bf1f0
chore: remove unused directories dependency
fengmk2 Feb 2, 2026
533d09d
docs(rfc): add PATH configuration diagram to architecture section
fengmk2 Feb 2, 2026
790f920
docs(rfc): update domain from vite-plus.dev to viteplus.dev
fengmk2 Feb 2, 2026
6eb3cb0
fix(install): fix TTY detection for curl pipe installation
fengmk2 Feb 2, 2026
805139b
refactor(env): consolidate PATH to ~/.vite-plus/bin with wrapper script
fengmk2 Feb 2, 2026
6d812e4
refactor(env): use symlink instead of wrapper script for bin/vp on Unix
fengmk2 Feb 2, 2026
6b9e303
refactor(install): separate PATH config from Node.js manager setup
fengmk2 Feb 2, 2026
18cfc0d
fix(install): add PATH to multiple shell config files
fengmk2 Feb 2, 2026
2981691
docs(install): add .profile support for bash and document shell config
fengmk2 Feb 2, 2026
d835df6
fix(env): ensure bin directory exists before creating package shims
fengmk2 Feb 3, 2026
d905b91
test(env): add unit tests for create_package_shim
fengmk2 Feb 3, 2026
b007c6b
feat(cli): add vp bin alias for vite command
fengmk2 Feb 3, 2026
02d9de4
fix(env): use platform-specific shim paths in tests
fengmk2 Feb 3, 2026
c60ee91
fix(env): use platform-specific PATH separator in env run command
fengmk2 Feb 3, 2026
a1d2386
fix(env): use platform-specific PATH separator and warn on unused --n…
fengmk2 Feb 3, 2026
cfd04f5
fix(env): normalize v-prefix versions, handle scoped packages, and al…
fengmk2 Feb 3, 2026
1639192
fix(env): list scoped packages, don't cache alias defaults, fix docto…
fengmk2 Feb 3, 2026
501095b
refactor(install): use pnpm pack + install.sh for local CLI installation
fengmk2 Feb 3, 2026
e5f1d7f
ci: add ~/.vite-plus-dev/bin to PATH after bootstrap-cli
fengmk2 Feb 3, 2026
91002c1
chore: move unstable new-create-tsdown test to snap-tests-todo
fengmk2 Feb 3, 2026
b41602c
feat(tools): add --tgz parameter to install-global-cli
fengmk2 Feb 3, 2026
b10a868
fix(tools): use absolute paths in install-global-cli
fengmk2 Feb 3, 2026
49d5a5e
feat(env): add LTS alias support and fix cache/shim issues
fengmk2 Feb 3, 2026
c7a82de
fix(env): address code review feedback
fengmk2 Feb 3, 2026
8deb379
fix(env): use runtime probing for npm layouts and detect JS binaries …
fengmk2 Feb 3, 2026
6078ba7
test(ci): add global package install tests to install workflow
fengmk2 Feb 3, 2026
7e9205a
docs(rfc): update shim implementation to use symlinks and vp env run …
fengmk2 Feb 3, 2026
b98d683
feat(env): implement symlinks (Unix) and vp env run wrappers (Windows)
fengmk2 Feb 3, 2026
f83acaa
feat(tools): wrap vp binary to ensure VITE_PLUS_HOME is set
fengmk2 Feb 3, 2026
2c88c28
fix(shim): fix package binary detection for wrapper scripts
fengmk2 Feb 3, 2026
ff23f14
test(ci): migrate global package install test to ci.yml
fengmk2 Feb 3, 2026
26f3318
fix(shim): update bin/vp.cmd to call vp.cmd instead of vp.exe on Windows
fengmk2 Feb 3, 2026
c562757
fix(runtime): accept LTS aliases in version normalization
fengmk2 Feb 3, 2026
b3ef357
fix(shim): set VITE_PLUS_HOME in all Windows .cmd wrappers
fengmk2 Feb 3, 2026
0646525
fix(install): only cleanup semver-format version directories
fengmk2 Feb 3, 2026
32fa9e0
test(ci): add bash verification steps to Windows install test
fengmk2 Feb 4, 2026
5215e33
fix(shim): add shell script wrappers for Git Bash on Windows
fengmk2 Feb 4, 2026
12d3681
test(ci): add cmd shell verification steps to Windows install test
fengmk2 Feb 4, 2026
3e0b22f
test(ci): add cmd shell test for global package install on Windows
fengmk2 Feb 4, 2026
39b9b03
fix(shim): make --node optional in `vp env run` for shim tools
fengmk2 Feb 4, 2026
3a7f452
fix(shim): use VITE_PLUS_SHIM_TOOL env var instead of exec -a
fengmk2 Feb 4, 2026
ce455fd
fix(shim): prevent VITE_PLUS_SHIM_TOOL from leaking to child processes
fengmk2 Feb 4, 2026
f518dd8
fix(install): always replace vp-raw binary on reinstall
fengmk2 Feb 4, 2026
280942d
feat(env): extend `vp env which` to support global packages
fengmk2 Feb 4, 2026
5463724
fix(snap-test): add node installation step for vp env which test
fengmk2 Feb 4, 2026
428f772
feat(env): show all binaries in `vp env which` output for global pack…
fengmk2 Feb 4, 2026
a976be5
fix(env): skip invalid versions and optimize package scan
fengmk2 Feb 4, 2026
29ba6c9
feat(install): redesign success output with Get Started guide
fengmk2 Feb 4, 2026
9a26706
fix(install): remove extra blank line after setup message
fengmk2 Feb 4, 2026
9880d6e
feat(env): add "latest" alias support and fix invalid .node-version f…
fengmk2 Feb 4, 2026
f19950f
fix(env): use .cmd extension for node shim on Windows in doctor
fengmk2 Feb 4, 2026
eeaa01d
docs(guide): update installation and add Node.js version manager section
fengmk2 Feb 4, 2026
231b9ec
docs(cli): rename vite command to vp in CLI documentation
fengmk2 Feb 4, 2026
0de84f5
fix(env): support --node lts/latest in env install
fengmk2 Feb 4, 2026
bd5a030
feat(env): add per-binary config files to fix package binary conflicts
fengmk2 Feb 5, 2026
56e7a55
refactor(snap): use bin config JSON to verify env install node version
fengmk2 Feb 5, 2026
61630e5
refactor(global-cli): replace manual std::env::current_dir with vite_…
fengmk2 Feb 5, 2026
7711c74
docs(guide): rename vite command to vp in getting started guide
fengmk2 Feb 5, 2026
ce97704
feat(env): add env files with PATH guard and --env-only flag
fengmk2 Feb 5, 2026
a5846d0
feat(env): make IDE setup guidance context-aware in vp env doctor
fengmk2 Feb 5, 2026
ec9cce6
fix(env): prevent SystemFirst infinite loop with multiple vite-plus i…
fengmk2 Feb 5, 2026
ecb5743
feat(env): resolve Node.js version from project config when vp env in…
fengmk2 Feb 5, 2026
8a71735
refactor(env): move global package management to vp install/uninstall -g
fengmk2 Feb 5, 2026
54c1022
feat(env): add --dry-run flag to vp remove -g
fengmk2 Feb 5, 2026
0bb931b
fix(snap-test): clean stale files and ensure managed shim mode before…
fengmk2 Feb 5, 2026
1e01218
feat(env): add short aliases for install/uninstall commands
fengmk2 Feb 5, 2026
bb3d565
refactor(ci): replace npm install -g with vp install -g in workflows
fengmk2 Feb 5, 2026
5f45301
feat(env): add `vp env use` command for per-shell session Node.js ver…
fengmk2 Feb 5, 2026
6758374
feat(env): add `vp env list` (local) and rename old list to `vp env l…
fengmk2 Feb 5, 2026
e0dad5c
feat(env): migrate `vp env packages` to `vp pm list -g` + add `vp lis…
fengmk2 Feb 5, 2026
9b36326
fix(env): align `vp list -g` output format with `vp env which`
fengmk2 Feb 5, 2026
191fe05
feat(env): add hint to revert session override after `vp env install`
fengmk2 Feb 5, 2026
17dede3
fix(env): stabilize tests against VITE_PLUS_NODE_VERSION env leak
fengmk2 Feb 5, 2026
fc42ae9
refactor(env): unify `vp env` and `vp env -h` into single clap-genera…
fengmk2 Feb 5, 2026
4f79a1d
refactor(env): replace `vp list -g` verbose format with aligned table
fengmk2 Feb 5, 2026
87421fe
fix(pm): silently succeed for `vp ls` in directory without package.json
fengmk2 Feb 5, 2026
c68c39d
refactor(env): redesign `doctor` and `which` command output
fengmk2 Feb 6, 2026
783bbf1
fix(install): use `$HOME`-relative paths in shell config sourcing lines
fengmk2 Feb 6, 2026
195cb69
fix(env): gate PowerShell/cmd.exe shell detection to Windows only
fengmk2 Feb 6, 2026
1aae68d
feat(env): write session version file so `vp env use` works without s…
fengmk2 Feb 6, 2026
0ae1685
refactor(env): gate session file write behind --write-session flag
fengmk2 Feb 6, 2026
ae768e9
refactor(env): auto-detect shell eval wrapper instead of --write-sess…
fengmk2 Feb 6, 2026
6bd008e
fix(env): allow recursive package binary shim dispatch
fengmk2 Feb 7, 2026
9a2077d
fix(snap-test): normalize date-only output to <date> placeholder
fengmk2 Feb 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 145 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ jobs:
target: x86_64-unknown-linux-gnu

- name: Build CLI
run: pnpm bootstrap-cli:ci
run: |
pnpm bootstrap-cli:ci
echo "$HOME/.vite-plus-dev/bin" >> $GITHUB_PATH

- name: Print help for built-in commands
run: |
Expand Down Expand Up @@ -195,6 +197,14 @@ jobs:
- name: Build CLI
run: |
pnpm bootstrap-cli:ci
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "$USERPROFILE\.vite-plus-dev\bin" >> $GITHUB_PATH
else
echo "$HOME/.vite-plus-dev/bin" >> $GITHUB_PATH
fi

- name: Verify CLI installation
run: |
which vp
vp --version
vp -h
Expand All @@ -212,6 +222,137 @@ jobs:
- name: Run CLI lint
run: vp run lint

- name: Test global package install (powershell)
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
run: |
echo "PATH: $env:Path"
where.exe node
where.exe npm
where.exe npx
where.exe vp
vp env doctor

# Test 1: Install a JS-based CLI (typescript)
vp install -g typescript
tsc --version
where.exe tsc

# Test 2: Verify the package was installed correctly
Get-ChildItem "$env:USERPROFILE\.vite-plus-dev\packages\typescript\"
Get-ChildItem "$env:USERPROFILE\.vite-plus-dev\bin\"

# Test 3: Uninstall
vp uninstall -g typescript

# Test 4: Verify uninstall removed shim
Write-Host "Checking bin dir after uninstall:"
Get-ChildItem "$env:USERPROFILE\.vite-plus-dev\bin\"
$shimPath = "$env:USERPROFILE\.vite-plus-dev\bin\tsc.cmd"
if (Test-Path $shimPath) {
Write-Error "tsc shim file still exists at $shimPath"
exit 1
}
Write-Host "tsc shim removed successfully"

# Test 5: use session
vp env use 18
node --version
vp env doctor
vp env use --unset
node --version

- name: Test global package install (cmd)
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
echo "PATH: %PATH%"
where.exe node
where.exe npm
where.exe npx
where.exe vp

vp env use 18
node --version
vp env use --unset
node --version

vp env doctor

REM Test 1: Install a JS-based CLI (typescript)
vp install -g typescript
tsc --version
where.exe tsc

REM Test 2: Verify the package was installed correctly
dir "%USERPROFILE%\.vite-plus-dev\packages\typescript\"
dir "%USERPROFILE%\.vite-plus-dev\bin\"

REM Test 3: Uninstall
vp uninstall -g typescript

REM Test 4: Verify uninstall removed shim (.cmd wrapper)
echo Checking bin dir after uninstall:
dir "%USERPROFILE%\.vite-plus-dev\bin\"
if exist "%USERPROFILE%\.vite-plus-dev\bin\tsc.cmd" (
echo Error: tsc.cmd shim file still exists
exit /b 1
)
echo tsc.cmd shim removed successfully

REM Test 5: Verify shell script was also removed (for Git Bash)
if exist "%USERPROFILE%\.vite-plus-dev\bin\tsc" (
echo Error: tsc shell script still exists
exit /b 1
)
echo tsc shell script removed successfully

REM Test 6: use session
vp env use 18
node --version
vp env doctor
vp env use --unset
node --version

- name: Test global package install (bash)
run: |
echo "PATH: $PATH"
ls -la ~/.vite-plus-dev/
ls -la ~/.vite-plus-dev/bin/
which node
which npm
which npx
which vp
vp env doctor

# Test 1: Install a JS-based CLI (typescript)
vp install -g typescript
tsc --version
which tsc

# Test 2: Verify the package was installed correctly
ls -la ~/.vite-plus-dev/packages/typescript/
ls -la ~/.vite-plus-dev/bin/

# Test 3: Uninstall
vp uninstall -g typescript

# Test 4: Verify uninstall removed shim
echo "Checking bin dir after uninstall:"
ls -la ~/.vite-plus-dev/bin/
if [ -f ~/.vite-plus-dev/bin/tsc ]; then
echo "Error: tsc shim file still exists at ~/.vite-plus-dev/bin/tsc"
exit 1
fi
echo "tsc shim removed successfully"

# Test 5: use session
vp env use 18
node --version
vp env doctor
vp env use --unset
node --version

- name: Install Playwright browsers
run: pnpx playwright install chromium

Expand Down Expand Up @@ -255,7 +396,9 @@ jobs:
target: x86_64-unknown-linux-gnu

- name: Build CLI
run: pnpm bootstrap-cli:ci
run: |
pnpm bootstrap-cli:ci
echo "$HOME/.vite-plus-dev/bin" >> $GITHUB_PATH

- name: Run local CLI `vite install`
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:

- name: Pack packages into tgz
run: |
pnpm bootstrap-cli:ci
pnpm copy-cli-binding
mkdir -p tmp/tgz
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
Expand Down Expand Up @@ -263,11 +263,15 @@ jobs:
name: vite-plus-packages-${{ matrix.os }}
path: tmp/tgz

- name: Install vite-plus from tgz in ${{ matrix.project.name }}
- name: Install vp CLI
shell: bash
run: |
node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts vp --tgz $GITHUB_WORKSPACE/tmp/tgz/vite-plus-cli-0.0.0.tgz
echo "$HOME/.vite-plus-dev/bin" >> $GITHUB_PATH

- name: Migrate in ${{ matrix.project.name }}
working-directory: ${{ runner.temp }}/vite-plus-ecosystem-ci/${{ matrix.project.name }}${{ matrix.project.directory && format('/{0}', matrix.project.directory) || '' }}
run: |
# install global CLI first
npm install -g $GITHUB_WORKSPACE/tmp/tgz/vite-plus-cli-0.0.0.tgz
node $GITHUB_WORKSPACE/ecosystem-ci/patch-project.ts ${{ matrix.project.name }}
vp install --no-frozen-lockfile

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
run: |
pnpm exec tool replace-file-content packages/cli/binding/Cargo.toml 'version = "0.0.0"' 'version = "${{ env.VERSION }}"'
pnpm exec tool replace-file-content packages/global/binding/Cargo.toml 'version = "0.0.0"' 'version = "${{ env.VERSION }}"'
pnpm exec tool replace-file-content crates/vite_global_cli/Cargo.toml 'version = "0.0.0"' 'version = "${{ env.VERSION }}"'

- name: Configure Git for access to vite-task
run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "ssh://git@github.com/"
Expand Down Expand Up @@ -265,11 +266,11 @@ jobs:
- name: Create release body
run: |
if [[ "${{ inputs.npm_tag }}" == "latest" ]]; then
INSTALL_BASH="curl -fsSL https://viteplus.dev/install.sh | bash"
INSTALL_PS1="irm https://viteplus.dev/install.ps1 | iex"
INSTALL_BASH="curl -fsSL https://staging.viteplus.dev/install.sh | bash"
INSTALL_PS1="irm https://staging.viteplus.dev/install.ps1 | iex"
else
INSTALL_BASH="curl -fsSL https://viteplus.dev/install.sh | VITE_PLUS_VERSION=${{ env.VERSION }} bash"
INSTALL_PS1="\\\$env:VITE_PLUS_VERSION=\\\"${{ env.VERSION }}\\\"; irm https://viteplus.dev/install.ps1 | iex"
INSTALL_BASH="curl -fsSL https://staging.viteplus.dev/install.sh | VITE_PLUS_VERSION=${{ env.VERSION }} bash"
INSTALL_PS1="\\\$env:VITE_PLUS_VERSION=\\\"${{ env.VERSION }}\\\"; irm https://staging.viteplus.dev/install.ps1 | iex"
fi
cat > ./RELEASE_BODY.md <<EOF
## vite-plus v${{ env.VERSION }}
Expand Down Expand Up @@ -326,6 +327,6 @@ jobs:
• vite-plus-cli@${{ env.VERSION }}

**Install:**
• macOS/Linux: `curl -fsSL https://viteplus.dev/install.sh | bash`
• Windows: `irm https://viteplus.dev/install.ps1 | iex`
• macOS/Linux: `curl -fsSL https://staging.viteplus.dev/install.sh | bash`
• Windows: `irm https://staging.viteplus.dev/install.ps1 | iex`
embed-url: https://github.com/${{ github.repository }}/releases/tag/v${{ env.VERSION }}
117 changes: 0 additions & 117 deletions .github/workflows/test-install.yml

This file was deleted.

Loading
Loading