Skip to content

Commit 787cb19

Browse files
authored
Merge branch 'main' into feat/embed-release-version
2 parents cc1d9a1 + fb7cc34 commit 787cb19

35 files changed

Lines changed: 1402 additions & 387 deletions

File tree

.github/actions/build-upstream/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ runs:
4040
packages/cli/binding/index.d.cts
4141
target/${{ inputs.target }}/release/vp
4242
target/${{ inputs.target }}/release/vp.exe
43+
target/${{ inputs.target }}/release/vp-shim.exe
4344
key: ${{ steps.cache-key.outputs.key }}
4445

4546
# Apply Vite+ branding patches to rolldown-vite source (CI checks out
@@ -111,6 +112,11 @@ runs:
111112
shell: bash
112113
run: cargo build --release --target ${{ inputs.target }} -p vite_global_cli
113114

115+
- name: Build trampoline shim binary (Windows only)
116+
if: steps.cache-restore.outputs.cache-hit != 'true' && contains(inputs.target, 'windows')
117+
shell: bash
118+
run: cargo build --release --target ${{ inputs.target }} -p vite_trampoline
119+
114120
- name: Save NAPI binding cache
115121
if: steps.cache-restore.outputs.cache-hit != 'true'
116122
uses: actions/cache/save@94b89442628ad1d101e352b7ee38f30e1bef108e # v5
@@ -123,6 +129,7 @@ runs:
123129
packages/cli/binding/index.d.cts
124130
target/${{ inputs.target }}/release/vp
125131
target/${{ inputs.target }}/release/vp.exe
132+
target/${{ inputs.target }}/release/vp-shim.exe
126133
key: ${{ steps.cache-key.outputs.key }}
127134

128135
# Build vite-plus TypeScript after native bindings are ready

.github/renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"vite_path",
2222
"vite_str",
2323
"vite_task",
24-
"vite_workspace"
24+
"vite_workspace",
25+
"https://github.com/voidzero-dev/vite-task"
2526
],
2627
"enabled": false
2728
}

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ jobs:
417417
vp upgrade --check
418418
419419
# full upgrade: download, extract, swap
420-
vp upgrade --tag alpha --force
420+
vp upgrade --force
421421
vp --version
422422
vp env doctor
423423
@@ -463,7 +463,7 @@ jobs:
463463
vp upgrade --check
464464
465465
# full upgrade: download, extract, swap
466-
vp upgrade --tag alpha --force
466+
vp upgrade --force
467467
vp --version
468468
vp env doctor
469469
@@ -502,7 +502,7 @@ jobs:
502502
vp upgrade --check
503503
504504
REM full upgrade: download, extract, swap
505-
vp upgrade --tag alpha --force
505+
vp upgrade --force
506506
vp --version
507507
vp env doctor
508508

.github/workflows/claude.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Claude Code
2+
3+
on:
4+
issues:
5+
types: [assigned]
6+
7+
jobs:
8+
analyze:
9+
if: github.repository == 'voidzero-dev/vite-plus' && github.event.action == 'assigned' && github.event.assignee.login == 'boshen' && github.event.sender.login == 'boshen'
10+
runs-on: ubuntu-slim
11+
permissions:
12+
contents: read
13+
issues: write
14+
id-token: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
fetch-depth: 100
20+
persist-credentials: true
21+
22+
- name: Run Claude Code
23+
id: claude
24+
uses: anthropics/claude-code-action@26ec041249acb0a944c0a47b6c0c13f05dbc5b44 # v1.0.70
25+
with:
26+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
27+
claude_args: --allowedTools "Read,Glob,Grep,Bash(gh:*),Bash(cargo:*),Bash(git:*),WebFetch"
28+
issue_number: ${{ github.event.issue.number }}
29+
prompt: |
30+
Analyze the linked issue and determine if it can be fixed.
31+
32+
1. Search the codebase to gather relevant context (related files, existing implementations, tests)
33+
2. Determine if the issue is fixable and estimate the complexity
34+
35+
Post a comment on the issue with:
36+
- A brief summary of your understanding of the issue
37+
- Relevant files/code you found
38+
- Whether this issue is fixable (yes/no/needs clarification)
39+
- If the issue is unclear, ask for more context
40+
- If fixable, provide a concrete implementation plan with specific steps
41+
- Any potential concerns or blockers

.github/workflows/e2e-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
113113
# Copy vp binary for e2e-test job (findVpBinary expects it in target/)
114114
cp target/${{ matrix.target }}/release/vp tmp/tgz/vp 2>/dev/null || cp target/${{ matrix.target }}/release/vp.exe tmp/tgz/vp.exe 2>/dev/null || true
115+
cp target/${{ matrix.target }}/release/vp-shim.exe tmp/tgz/vp-shim.exe 2>/dev/null || true
115116
ls -la tmp/tgz
116117
117118
- name: Upload tgz artifacts
@@ -289,12 +290,16 @@ jobs:
289290
# Place vp binary where install-global-cli.ts expects it (target/release/)
290291
mkdir -p target/release
291292
cp tmp/tgz/vp target/release/vp 2>/dev/null || cp tmp/tgz/vp.exe target/release/vp.exe 2>/dev/null || true
293+
cp tmp/tgz/vp-shim.exe target/release/vp-shim.exe 2>/dev/null || true
292294
chmod +x target/release/vp 2>/dev/null || true
293295
node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz $GITHUB_WORKSPACE/tmp/tgz/vite-plus-0.0.0.tgz
294-
echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH
296+
# Use USERPROFILE (native Windows path) instead of HOME (Git Bash path /c/Users/...)
297+
# so cmd.exe and Node.js execSync can resolve binaries in PATH
298+
echo "${USERPROFILE:-$HOME}/.vite-plus/bin" >> $GITHUB_PATH
295299
296300
- name: Migrate in ${{ matrix.project.name }}
297301
working-directory: ${{ runner.temp }}/vite-plus-ecosystem-ci/${{ matrix.project.name }}${{ matrix.project.directory && format('/{0}', matrix.project.directory) || '' }}
302+
shell: bash
298303
run: |
299304
node $GITHUB_WORKSPACE/ecosystem-ci/patch-project.ts ${{ matrix.project.name }}
300305
vp install --no-frozen-lockfile

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118
path: |
119119
./target/${{ matrix.settings.target }}/release/vp
120120
./target/${{ matrix.settings.target }}/release/vp.exe
121+
./target/${{ matrix.settings.target }}/release/vp-shim.exe
121122
if-no-files-found: error
122123

123124
- name: Remove .node files before upload dist

.github/workflows/test-standalone-install.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defaults:
1919
shell: bash
2020

2121
env:
22-
VITE_PLUS_VERSION: latest
22+
VITE_PLUS_VERSION: alpha
2323

2424
jobs:
2525
test-install-sh:
@@ -131,7 +131,7 @@ jobs:
131131
run: |
132132
docker run --rm --platform linux/arm64 \
133133
-v "${{ github.workspace }}:/workspace" \
134-
-e VITE_PLUS_VERSION=latest \
134+
-e VITE_PLUS_VERSION=alpha \
135135
ubuntu:20.04 bash -c "
136136
ls -al ~/
137137
apt-get update && apt-get install -y curl ca-certificates
@@ -233,7 +233,7 @@ jobs:
233233
exit 1
234234
}
235235
236-
$expectedShims = @("node.cmd", "npm.cmd", "npx.cmd")
236+
$expectedShims = @("node.exe", "npm.exe", "npx.exe")
237237
foreach ($shim in $expectedShims) {
238238
$shimFile = Join-Path $binPath $shim
239239
if (-not (Test-Path $shimFile)) {
@@ -300,7 +300,7 @@ jobs:
300300
exit 1
301301
}
302302
303-
$expectedShims = @("node.cmd", "npm.cmd", "npx.cmd")
303+
$expectedShims = @("node.exe", "npm.exe", "npx.exe")
304304
foreach ($shim in $expectedShims) {
305305
$shimFile = Join-Path $binPath $shim
306306
if (-not (Test-Path $shimFile)) {
@@ -380,8 +380,8 @@ jobs:
380380
exit 1
381381
}
382382
383-
# Verify shim executables exist (all use .cmd wrappers on Windows)
384-
$expectedShims = @("node.cmd", "npm.cmd", "npx.cmd")
383+
# Verify shim executables exist (trampoline .exe files on Windows)
384+
$expectedShims = @("node.exe", "npm.exe", "npx.exe")
385385
foreach ($shim in $expectedShims) {
386386
$shimFile = Join-Path $binPath $shim
387387
if (-not (Test-Path $shimFile)) {
@@ -419,8 +419,8 @@ jobs:
419419
set "BIN_PATH=%USERPROFILE%\.vite-plus\bin"
420420
dir "%BIN_PATH%"
421421
422-
REM Verify shim executables exist (Windows uses .cmd wrappers)
423-
for %%s in (node.cmd npm.cmd npx.cmd vp.cmd) do (
422+
REM Verify shim executables exist (Windows uses trampoline .exe files)
423+
for %%s in (node.exe npm.exe npx.exe vp.exe) do (
424424
if not exist "%BIN_PATH%\%%s" (
425425
echo Error: Shim not found: %BIN_PATH%\%%s
426426
exit /b 1
@@ -462,22 +462,13 @@ jobs:
462462
exit 1
463463
fi
464464
465-
# Verify .cmd wrappers exist (for cmd.exe/PowerShell)
466-
for shim in node.cmd npm.cmd npx.cmd vp.cmd; do
465+
# Verify trampoline .exe files exist
466+
for shim in node.exe npm.exe npx.exe vp.exe; do
467467
if [ ! -f "$BIN_PATH/$shim" ]; then
468-
echo "Error: .cmd wrapper not found: $BIN_PATH/$shim"
468+
echo "Error: Trampoline shim not found: $BIN_PATH/$shim"
469469
exit 1
470470
fi
471-
echo "Found .cmd wrapper: $BIN_PATH/$shim"
472-
done
473-
474-
# Verify shell scripts exist (for Git Bash)
475-
for shim in node npm npx vp; do
476-
if [ ! -f "$BIN_PATH/$shim" ]; then
477-
echo "Error: Shell script not found: $BIN_PATH/$shim"
478-
exit 1
479-
fi
480-
echo "Found shell script: $BIN_PATH/$shim"
471+
echo "Found trampoline shim: $BIN_PATH/$shim"
481472
done
482473
483474
# Verify vp env doctor works

.husky/pre-commit

100644100755
File mode changed.

Cargo.lock

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,8 @@ codegen-units = 1
318318
strip = "symbols" # set to `false` for debug information
319319
debug = false # set to `true` for debug information
320320
panic = "abort" # Let it crash and force ourselves to write safe Rust.
321+
322+
# The trampoline binary is copied per shim tool (~5-10 copies), so optimize for
323+
# size instead of speed. This reduces it from ~200KB to ~100KB on Windows.
324+
[profile.release.package.vite_trampoline]
325+
opt-level = "z"

0 commit comments

Comments
 (0)