Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
842cccf
feat(global-cli): add vite_global_cli crate (Phase 1)
fengmk2 Jan 28, 2026
10de0db
feat(vite_global_cli): implement Phases 2-3 of RFC
fengmk2 Jan 28, 2026
63dc90c
feat(vite_global_cli): implement Phase 4 distribution
fengmk2 Jan 28, 2026
01f48d9
refactor(vite_global_cli): move PM commands from binding to Rust binary
fengmk2 Jan 28, 2026
13a57ec
docs(rfc): update global-cli-rust-binary with implementation status
fengmk2 Jan 28, 2026
6cb3869
refactor(vite_global_cli): simplify delegate_to_local_cli to use JS e…
fengmk2 Jan 28, 2026
779f0c6
docs(rfc): update global-cli-rust-binary for delegate_to_local_cli ch…
fengmk2 Jan 28, 2026
736bb8d
feat(vite_global_cli): add npm_config_registry support to install scr…
fengmk2 Jan 28, 2026
ad7da78
docs(rfc): remove outdated package.json bin entry content
fengmk2 Jan 28, 2026
9afc110
chore: remove unused dependencies
fengmk2 Jan 28, 2026
96370d2
ci: dynamically discover and test all crates
fengmk2 Jan 28, 2026
f11beb9
feat(vite_global_cli): rename global CLI bin from "vite" to "vp"
fengmk2 Jan 28, 2026
0360333
ci: migrate Rust CLI binary build to build-upstream action
fengmk2 Jan 28, 2026
d265518
refactor(vite-plus-cli): simplify platform package name generation
fengmk2 Jan 28, 2026
4160972
fix(ci): remove copy-vp-binary from bootstrap-cli:ci
fengmk2 Jan 28, 2026
1194764
fix(publish): throw error when Rust binary is missing
fengmk2 Jan 28, 2026
58518e1
feat(ci): add npm tag input to release workflow
fengmk2 Jan 28, 2026
d45bfd2
feat(install): add multi-version support with symlinks
fengmk2 Jan 29, 2026
c0ac504
feat(global-cli): pass VITE_PLUS_CLI_BIN env to JS scripts
fengmk2 Jan 29, 2026
c4a423b
feat(global-cli): ensure JS runtime for PM commands
fengmk2 Jan 29, 2026
03b0395
test(snap): add node-version priority over engines.node test
fengmk2 Jan 29, 2026
ab6afe9
fix(global-cli): show install error when binary not found
fengmk2 Jan 29, 2026
dde4430
chore(ci): skip Discord notification for test releases
fengmk2 Jan 29, 2026
d81909d
refactor(shared): add shared init_tracing to vite_shared
fengmk2 Jan 29, 2026
6091b66
fix(global-cli): add vp.cmd wrapper in Windows installer
fengmk2 Jan 29, 2026
5d57c96
fix(js-runtime): use separate join() calls for Windows path compatibi…
fengmk2 Jan 29, 2026
d318ce7
test(global-cli): add unit tests for js_executor
fengmk2 Jan 29, 2026
3883ea1
refactor(global-cli): simplify scripts_dir path resolution
fengmk2 Jan 29, 2026
025e606
FIXUP
fengmk2 Jan 30, 2026
aece282
fix(vite_command): skip which::which_in on Windows
fengmk2 Jan 30, 2026
a0a8cc9
fix(ci): fail release if no vp binaries found
fengmk2 Jan 30, 2026
4fb41dc
feat(install): dynamically detect supported platforms from npm registry
fengmk2 Jan 30, 2026
9893a41
fix(install): include request URL in metadata fetch error message
fengmk2 Jan 30, 2026
44858dd
refactor(ci): cache Rust CLI binary from target directory
fengmk2 Jan 30, 2026
debc834
fix(install): show error message for invalid version instead of silen…
fengmk2 Jan 30, 2026
46f62b1
feat(install): show download progress bar instead of URL
fengmk2 Jan 30, 2026
89f97a0
chore(install): remove "Creating directories" log message
fengmk2 Jan 30, 2026
44cb7d5
chore(install): update installer title to "VITE+(⚡︎) Installer"
fengmk2 Jan 30, 2026
6e483d3
fix(ci): add cross-compilation toolchain for aarch64-linux-gnu
fengmk2 Jan 30, 2026
00da4ad
fix(ci): restore Rust CLI binary directory structure in release workflow
fengmk2 Jan 30, 2026
ef25d97
feat(cli): restore `vp help [command]` and fix `vp new --help` proxying
fengmk2 Jan 31, 2026
36524a0
fix(install): add user-friendly error messages for curl failures
fengmk2 Jan 31, 2026
148c7bb
fix(install): correct PATH config detection to avoid false warning
fengmk2 Jan 31, 2026
3349ad7
feat(install): install production dependencies after copying package.…
fengmk2 Jan 31, 2026
f9831db
feat(install): streamline installation output for cleaner UX
fengmk2 Jan 31, 2026
d7eada1
fix(ci): use napi-cross for glibc 2.17 compatibility in Rust CLI binary
fengmk2 Jan 31, 2026
b65427c
fix(ci): use pnpm exec to run napi CLI from package context
fengmk2 Jan 31, 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
8 changes: 4 additions & 4 deletions .claude/skills/add-ecosystem-ci/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Look for common patterns in workflow files:

- `pnpm run <command>` / `npm run <command>` / `yarn <command>`
- Commands like: `lint`, `build`, `test`, `type-check`, `typecheck`, `format`, `format:check`
- Map detected commands to vite equivalents: `vite run lint`, `vite run build`, etc.
- Map detected commands to `vp` equivalents: `vp run lint`, `vp run build`, etc.

### 2.3 Ask User to Confirm

Expand Down Expand Up @@ -73,8 +73,8 @@ Present the auto-detected configuration and ask user to confirm or modify:
node-version: 24
directory: web # only if subdirectory is needed
command: |
vite run lint
vite run build
vp run lint
vp run build
```

## Step 4: Verify
Expand Down Expand Up @@ -109,5 +109,5 @@ node ecosystem-ci/clone.ts project-name

- The `directory` field is optional - only add it if the package.json is not in the project root
- If `directory` is specified in repo.json, it must also be specified in the workflow matrix
- `patch-project.ts` automatically handles running `vite migrate` in the correct directory
- `patch-project.ts` automatically handles running `vp migrate` in the correct directory
- OS exclusions are added to the existing `exclude` section in the workflow matrix
79 changes: 61 additions & 18 deletions .github/actions/build-upstream/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ inputs:
target:
description: 'The target platform'
required: true
print-after-build:
description: 'Print the output after the build'
required: false

runs:
using: 'composite'
Expand All @@ -24,9 +21,9 @@ runs:
id: cache-key
shell: bash
run: |
echo "key=napi-binding-v1-${{ inputs.target }}-${{ env.RELEASE_BUILD }}-${{ env.DEBUG }}-${{ env.VERSION }}-${{ hashFiles('packages/tools/.upstream-versions.json', 'Cargo.lock', 'crates/**/*.rs', 'crates/*/Cargo.toml', 'packages/*/binding/**/*.rs', 'packages/*/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts', 'packages/global/package.json', 'packages/global/build.ts') }}" >> $GITHUB_OUTPUT
echo "key=napi-binding-v2-${{ inputs.target }}-${{ env.RELEASE_BUILD }}-${{ env.DEBUG }}-${{ env.VERSION }}-${{ env.NPM_TAG }}-${{ hashFiles('packages/tools/.upstream-versions.json', 'Cargo.lock', 'crates/**/*.rs', 'crates/*/Cargo.toml', 'packages/*/binding/**/*.rs', 'packages/*/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts', 'packages/global/package.json', 'packages/global/build.ts') }}" >> $GITHUB_OUTPUT

# Cache only NAPI bindings (the slow part, especially on Windows)
# Cache NAPI bindings and Rust CLI binary (the slow parts, especially on Windows)
- name: Restore NAPI binding cache
id: cache-restore
uses: actions/cache/restore@94b89442628ad1d101e352b7ee38f30e1bef108e # v5
Expand All @@ -40,6 +37,8 @@ runs:
packages/global/binding/*.node
packages/global/binding/index.js
packages/global/binding/index.d.ts
target/${{ inputs.target }}/release/vp
target/${{ inputs.target }}/release/vp.exe
key: ${{ steps.cache-key.outputs.key }}

# Build upstream TypeScript packages first (don't depend on native bindings)
Expand All @@ -56,7 +55,7 @@ runs:

# NAPI builds - only run on cache miss (slow, especially on Windows)
# Must run before vite-plus/vite-plus-cli TypeScript builds which depend on the bindings
- name: Build NAPI bindings
- name: Build NAPI bindings (x86_64-linux)
shell: bash
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown-linux-gnu'
run: |
Expand All @@ -66,17 +65,18 @@ runs:
TARGET_CC: clang
DEBUG: napi:*

- name: Build NAPI bindings
- name: Build NAPI bindings (aarch64-linux)
shell: bash
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
run: |
TARGET_CFLAGS="-D_BSD_SOURCE" pnpm --filter=vite-plus build-native --target ${{ inputs.target }} --use-napi-cross
TARGET_CFLAGS="-D_BSD_SOURCE" pnpm --filter=vite-plus-cli build-native --target ${{ inputs.target }} --use-napi-cross
pnpm --filter=vite-plus build-native --target ${{ inputs.target }} --use-napi-cross
pnpm --filter=vite-plus-cli build-native --target ${{ inputs.target }} --use-napi-cross
env:
TARGET_CC: clang
TARGET_CFLAGS: '-D_BSD_SOURCE'
DEBUG: napi:*

- name: Build NAPI bindings
- name: Build NAPI bindings (non-Linux targets)
shell: bash
if: steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
run: |
Expand All @@ -85,16 +85,29 @@ runs:
env:
DEBUG: napi:*

- name: Print output after build
- name: Build Rust CLI binary (x86_64-linux)
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown-linux-gnu'
shell: bash
if: inputs.print-after-build == 'true'
run: |
pnpm vite -h
pnpm vite run -h
pnpm vite lint -h
pnpm vite test -h
pnpm vite build -h
pnpm vite fmt -h
pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
env:
TARGET_CC: clang
DEBUG: napi:*

- name: Build Rust CLI binary (aarch64-linux)
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
shell: bash
run: |
pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
env:
TARGET_CC: clang
TARGET_CFLAGS: '-D_BSD_SOURCE'
DEBUG: napi:*

- name: Build Rust CLI binary (non-Linux targets)
if: steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
shell: bash
run: cargo build --release --target ${{ inputs.target }} -p vite_global_cli

- name: Save NAPI binding cache
if: steps.cache-restore.outputs.cache-hit != 'true'
Expand All @@ -109,4 +122,34 @@ runs:
packages/global/binding/*.node
packages/global/binding/index.js
packages/global/binding/index.d.ts
target/${{ inputs.target }}/release/vp
target/${{ inputs.target }}/release/vp.exe
key: ${{ steps.cache-key.outputs.key }}

# Copy Rust CLI binary to packages/global/bin/ (runs on both cache hit and miss)
- name: Copy Rust CLI binary
shell: bash
run: |
if [[ "${{ inputs.target }}" == *"windows"* ]]; then
cp target/${{ inputs.target }}/release/vp.exe packages/global/bin/vp.exe
else
cp target/${{ inputs.target }}/release/vp packages/global/bin/vp
fi

# Build vite-plus TypeScript after native bindings are ready
- name: Build vite-plus TypeScript packages
shell: bash
run: |
pnpm --filter=vite-plus build-ts
pnpm --filter=vite-plus-cli build-ts

- name: Print output after build
shell: bash
if: inputs.print-after-build == 'true'
run: |
pnpm vite -h
pnpm vite run -h
pnpm vite lint -h
pnpm vite test -h
pnpm vite build -h
pnpm vite fmt -h
43 changes: 23 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ jobs:
env:
RUSTFLAGS: '-D warnings --cfg tokio_unstable' # also update .cargo/config.toml

- run: cargo test -p vite_command -p vite_install -p vite_migration
# Test all crates/* packages. New crates are automatically included.
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done)

lint:
name: Lint
Expand Down Expand Up @@ -136,13 +137,13 @@ jobs:

- name: Print help for built-in commands
run: |
which vite
vite -h
vite run -h
vite lint -h
vite test -h
vite build -h
vite fmt -h
which vp
vp -h
vp run -h
vp lint -h
vp test -h
vp build -h
vp fmt -h

cli-e2e-test:
name: CLI E2E test
Expand Down Expand Up @@ -194,31 +195,33 @@ jobs:
- name: Build CLI
run: |
pnpm bootstrap-cli:ci
which vite
vite --version
vite -h
which vp
vp --version
vp -h

- name: Check CLI JS execution on Windows rust binary
if: ${{ matrix.os == 'windows-latest' }}
run: |
ls -al packages/global/bin
VITE_LOG=trace ./packages/global/bin/vp.exe -V
VITE_LOG=trace ./packages/global/bin/vp.exe pm cache dir

- name: Run CLI fmt
run: vite fmt --check
run: vp fmt --check

- name: Run CLI lint
run: vite run lint
run: vp run lint

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

- name: Create vite.cmd shim file for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
printf '@echo off\nnode "%%~dp0vite" %%*\n' > packages/global/bin/vite.cmd

- name: Run CLI snapshot tests
run: |
RUST_BACKTRACE=1 pnpm test
git diff --exit-code

install-e2e-test:
name: vite install E2E test
name: Local CLI `vite install` E2E test
needs:
- download-previous-rolldown-binaries
runs-on: ubuntu-latest
Expand Down Expand Up @@ -254,7 +257,7 @@ jobs:
- name: Build CLI
run: pnpm bootstrap-cli:ci

- name: Run local CLI vite install
- name: Run local CLI `vite install`
run: |
export PATH=$PWD/node_modules/.bin:$PATH
vite -h
Expand Down
Loading
Loading