Skip to content

Commit 932af60

Browse files
committed
Merge branch 'main' of github.com:Arthie/vite-plus into chore--migrate-from-Husky-to-vp-config-for-git-hooks
1 parent 59cfb3e commit 932af60

File tree

118 files changed

+3332
-2116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3332
-2116
lines changed

.claude/settings.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"mcpServers": {
33
"vite-plus": {
44
"command": "npx",
5-
"args": [
6-
"vp",
7-
"mcp"
8-
]
5+
"args": ["vp", "mcp"]
96
}
107
}
118
}

.claude/skills/add-ecosystem-ci/SKILL.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ gh api repos/OWNER/REPO/commits/BRANCH --jq '.sha'
2525

2626
Fetch the repository's root to check if the main package.json is in a subdirectory (like `web/`, `app/`, `frontend/`).
2727

28-
### 2.2 Auto-detect Commands from GitHub Workflows
28+
### 2.2 Check if Project Already Uses Vite-Plus
29+
30+
Check the project's root `package.json` for `vite-plus` in `dependencies` or `devDependencies`. If the project already uses vite-plus, set `forceFreshMigration: true` in `repo.json`. This tells `patch-project.ts` to set `VITE_PLUS_FORCE_MIGRATE=1` so `vp migrate` forces full dependency rewriting instead of skipping with "already using Vite+".
31+
32+
### 2.3 Auto-detect Commands from GitHub Workflows
2933

3034
Fetch the project's GitHub workflow files to detect available commands:
3135

@@ -43,7 +47,7 @@ Look for common patterns in workflow files:
4347
- Commands like: `lint`, `build`, `test`, `type-check`, `typecheck`, `format`, `format:check`
4448
- Map detected commands to `vp` equivalents: `vp run lint`, `vp run build`, etc.
4549

46-
### 2.3 Ask User to Confirm
50+
### 2.4 Ask User to Confirm
4751

4852
Present the auto-detected configuration and ask user to confirm or modify:
4953

@@ -62,7 +66,8 @@ Present the auto-detected configuration and ask user to confirm or modify:
6266
"repository": "https://github.com/owner/repo.git",
6367
"branch": "main",
6468
"hash": "full-commit-sha",
65-
"directory": "web" // only if subdirectory is needed
69+
"directory": "web", // only if subdirectory is needed
70+
"forceFreshMigration": true // only if project already uses vite-plus
6671
}
6772
}
6873
```
@@ -110,4 +115,5 @@ node ecosystem-ci/clone.ts project-name
110115
- The `directory` field is optional - only add it if the package.json is not in the project root
111116
- If `directory` is specified in repo.json, it must also be specified in the workflow matrix
112117
- `patch-project.ts` automatically handles running `vp migrate` in the correct directory
118+
- `forceFreshMigration` is required for projects that already have `vite-plus` in their package.json — it sets `VITE_PLUS_FORCE_MIGRATE=1` so `vp migrate` forces full dependency rewriting instead of skipping
113119
- OS exclusions are added to the existing `exclude` section in the workflow matrix

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ 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

45-
# Apply Vite+ branding patches to rolldown-vite source (CI checks out
46-
# upstream rolldown-vite which doesn't have branding patches)
47-
- name: Brand rolldown-vite
46+
# Apply Vite+ branding patches to vite source (CI checks out
47+
# upstream vite which doesn't have branding patches)
48+
- name: Brand vite
4849
shell: bash
49-
run: pnpm exec tool brand-rolldown-vite
50+
run: pnpm exec tool brand-vite
5051

5152
# Build upstream TypeScript packages first (don't depend on native bindings)
5253
- name: Build upstream TypeScript packages
@@ -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/actions/clone/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ outputs:
1515
runs:
1616
using: 'composite'
1717
steps:
18-
- name: Output rolldown and rolldown-vite hash
18+
- name: Output rolldown and vite hash
1919
shell: bash
2020
id: upstream-versions
2121
run: |
2222
node -e "console.log('ROLLDOWN_HASH=' + require('./packages/tools/.upstream-versions.json').rolldown.hash)" >> $GITHUB_OUTPUT
23-
node -e "console.log('ROLLDOWN_VITE_HASH=' + require('./packages/tools/.upstream-versions.json')['rolldown-vite'].hash)" >> $GITHUB_OUTPUT
23+
node -e "console.log('ROLLDOWN_VITE_HASH=' + require('./packages/tools/.upstream-versions.json')['vite'].hash)" >> $GITHUB_OUTPUT
2424
2525
- name: Output ecosystem ci project hash
2626
shell: bash
@@ -40,7 +40,7 @@ runs:
4040
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
with:
4242
repository: vitejs/vite
43-
path: rolldown-vite
43+
path: vite
4444
ref: ${{ steps.upstream-versions.outputs.ROLLDOWN_VITE_HASH }}
4545

4646
# Disable autocrlf to preserve LF line endings on Windows

.github/renovate.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"packages/cli/snap-tests-todo/**",
88
"bench/fixtures/**",
99
"rolldown/**",
10-
"rolldown-vite/**"
10+
"vite/**"
1111
],
1212
"packageRules": [
1313
{
@@ -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/scripts/upgrade-deps.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ async function updateUpstreamVersions() {
4848
// rolldown -> rolldown/rolldown
4949
data.rolldown.hash = await getLatestTagCommit('rolldown', 'rolldown');
5050

51-
// rolldown-vite -> vitejs/vite
52-
data['rolldown-vite'].hash = await getLatestTagCommit('vitejs', 'vite');
51+
// vite -> vitejs/vite
52+
data['vite'].hash = await getLatestTagCommit('vitejs', 'vite');
5353

5454
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
5555
console.log('Updated .upstream-versions.json');

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ jobs:
7272
fail-fast: false
7373
matrix:
7474
include:
75-
- os: ubuntu-latest
75+
- os: namespace-profile-linux-x64-default
7676
target: x86_64-unknown-linux-gnu
7777
- os: windows-latest
7878
target: x86_64-pc-windows-msvc
79-
- os: macos-latest
79+
- os: namespace-profile-mac-default
8080
target: aarch64-apple-darwin
8181
runs-on: ${{ matrix.os }}
8282
steps:
@@ -100,7 +100,7 @@ jobs:
100100
target-dir: ${{ runner.os == 'Windows' && format('{0}/target', env.DEV_DRIVE) || '' }}
101101

102102
- run: rustup target add x86_64-unknown-linux-musl
103-
if: ${{ matrix.os == 'ubuntu-latest' }}
103+
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
104104

105105
- run: cargo check --all-targets --all-features
106106
env:
@@ -114,7 +114,7 @@ jobs:
114114
needs: detect-changes
115115
if: needs.detect-changes.outputs.code-changed == 'true'
116116
name: Lint
117-
runs-on: ubuntu-latest
117+
runs-on: namespace-profile-linux-x64-default
118118
steps:
119119
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
120120
- uses: ./.github/actions/clone
@@ -146,7 +146,7 @@ jobs:
146146

147147
run:
148148
name: Run task
149-
runs-on: ubuntu-latest
149+
runs-on: namespace-profile-linux-x64-default
150150
needs:
151151
- download-previous-rolldown-binaries
152152
steps:
@@ -194,8 +194,8 @@ jobs:
194194
fail-fast: false
195195
matrix:
196196
include:
197-
- os: ubuntu-latest
198-
- os: macos-latest
197+
- os: namespace-profile-linux-x64-default
198+
- os: namespace-profile-mac-default
199199
- os: windows-latest
200200
runs-on: ${{ matrix.os }}
201201
steps:
@@ -232,10 +232,10 @@ jobs:
232232
- name: Build with upstream
233233
uses: ./.github/actions/build-upstream
234234
with:
235-
target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'aarch64-apple-darwin' }}
235+
target: ${{ matrix.os == 'namespace-profile-linux-x64-default' && 'x86_64-unknown-linux-gnu' || matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'aarch64-apple-darwin' }}
236236

237237
- name: Check TypeScript types
238-
if: ${{ matrix.os == 'ubuntu-latest' }}
238+
if: ${{ matrix.os == 'namespace-profile-linux-x64-default' }}
239239
run: pnpm tsgo
240240

241241
- name: Install Global CLI vp
@@ -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
@@ -577,7 +577,7 @@ jobs:
577577
name: Local CLI `vp install` E2E test
578578
needs:
579579
- download-previous-rolldown-binaries
580-
runs-on: ubuntu-latest
580+
runs-on: namespace-profile-linux-x64-default
581581
# Run if: not a PR, OR PR has 'test: install-e2e' label
582582
if: >-
583583
github.event_name != 'pull_request' ||

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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'
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+
assignee_trigger: 'boshen'
28+
claude_args: --allowedTools "Edit,Write,Read,Glob,Grep,Bash(gh:*),Bash(cargo:*),Bash(git:*),Bash(just:*),WebFetch,TodoWrite"
29+
prompt: |
30+
Analyze issue #${{ github.event.issue.number }} in ${{ github.repository }} and determine if it can be fixed.
31+
32+
First, use `gh issue view ${{ github.event.issue.number }}` to read the issue details.
33+
34+
Then:
35+
1. Search the codebase to gather relevant context (related files, existing implementations, tests)
36+
2. Determine if the issue is fixable and estimate the complexity
37+
38+
Finally, post a comment on the issue with:
39+
- A brief summary of your understanding of the issue
40+
- Relevant files/code you found
41+
- Whether this issue is fixable (yes/no/needs clarification)
42+
- If the issue is unclear, ask for more context
43+
- If fixable, provide a concrete implementation plan with specific steps
44+
- Any potential concerns or blockers
45+
46+
- name: Unassign boshen
47+
if: always()
48+
env:
49+
GH_TOKEN: ${{ github.token }}
50+
run: gh issue edit ${{ github.event.issue.number }} --remove-assignee Boshen

.github/workflows/e2e-test.yml

Lines changed: 57 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
@@ -250,6 +251,40 @@ jobs:
250251
node-version: 24
251252
command: |
252253
vp test run
254+
- name: vp-config
255+
node-version: 22
256+
command: |
257+
vp check
258+
vp pack
259+
vp test
260+
- name: vinext
261+
node-version: 24
262+
command: |
263+
vp run build
264+
vp check --fix
265+
vp run check
266+
vp run test
267+
- name: reactive-resume
268+
node-version: 24
269+
command: |
270+
vp fmt
271+
vp lint --type-aware
272+
vp build
273+
vp test
274+
- name: yaak
275+
node-version: 24
276+
command: |
277+
vp fmt --ignore-path .oxfmtignore
278+
# FIXME: type-aware lint fails with "Invalid tsconfig" without full Rust/wasm bootstrap
279+
vp lint || true
280+
vp test
281+
- name: npmx.dev
282+
node-version: 24
283+
command: |
284+
vp fmt
285+
vp run lint
286+
vp run test:types
287+
vp test --project unit
253288
exclude:
254289
# frm-stack uses Docker (testcontainers) which doesn't work the same way on Windows
255290
- os: windows-latest
@@ -259,6 +294,18 @@ jobs:
259294
- os: windows-latest
260295
project:
261296
name: dify
297+
# vinext uses workerd native deps that don't build on Windows
298+
- os: windows-latest
299+
project:
300+
name: vinext
301+
# yaak is a Tauri app with Rust/wasm deps
302+
- os: windows-latest
303+
project:
304+
name: yaak
305+
# npmx.dev is a Nuxt app, ubuntu-only for now
306+
- os: windows-latest
307+
project:
308+
name: npmx.dev
262309

263310
steps:
264311
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -289,16 +336,25 @@ jobs:
289336
# Place vp binary where install-global-cli.ts expects it (target/release/)
290337
mkdir -p target/release
291338
cp tmp/tgz/vp target/release/vp 2>/dev/null || cp tmp/tgz/vp.exe target/release/vp.exe 2>/dev/null || true
339+
cp tmp/tgz/vp-shim.exe target/release/vp-shim.exe 2>/dev/null || true
292340
chmod +x target/release/vp 2>/dev/null || true
293341
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
342+
# Use USERPROFILE (native Windows path) instead of HOME (Git Bash path /c/Users/...)
343+
# so cmd.exe and Node.js execSync can resolve binaries in PATH
344+
echo "${USERPROFILE:-$HOME}/.vite-plus/bin" >> $GITHUB_PATH
295345
296346
- name: Migrate in ${{ matrix.project.name }}
297347
working-directory: ${{ runner.temp }}/vite-plus-ecosystem-ci/${{ matrix.project.name }}${{ matrix.project.directory && format('/{0}', matrix.project.directory) || '' }}
348+
shell: bash
298349
run: |
299350
node $GITHUB_WORKSPACE/ecosystem-ci/patch-project.ts ${{ matrix.project.name }}
300351
vp install --no-frozen-lockfile
301352
353+
- name: Verify local tgz packages installed
354+
working-directory: ${{ runner.temp }}/vite-plus-ecosystem-ci/${{ matrix.project.name }}${{ matrix.project.directory && format('/{0}', matrix.project.directory) || '' }}
355+
shell: bash
356+
run: node $GITHUB_WORKSPACE/ecosystem-ci/verify-install.ts
357+
302358
- name: Run vite-plus commands in ${{ matrix.project.name }}
303359
working-directory: ${{ runner.temp }}/vite-plus-ecosystem-ci/${{ matrix.project.name }}${{ matrix.project.directory && format('/{0}', matrix.project.directory) || '' }}
304360
run: ${{ matrix.project.command }}

0 commit comments

Comments
 (0)