Skip to content

Commit e781776

Browse files
committed
Merge remote-tracking branch 'origin/main' into chore(cli)-Upgrade-@oxc-node/core-to-catalog-version
# Conflicts: # pnpm-lock.yaml
2 parents 375c07a + 1ffb0f8 commit e781776

695 files changed

Lines changed: 21588 additions & 7700 deletions

File tree

Some content is hidden

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

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,42 @@ Present the auto-detected configuration and ask user to confirm or modify:
8484
8585
## Step 4: Verify
8686
87-
Test the clone locally:
87+
### 4.1 Build fresh tgz packages
88+
89+
Always rebuild tgz packages from latest source to avoid using stale cached versions:
90+
91+
```bash
92+
# Rebuild the global CLI first (includes Rust binary + NAPI binding)
93+
pnpm bootstrap-cli
94+
95+
# Pack fresh tgz files into tmp/tgz/
96+
rm -rf tmp/tgz && mkdir -p tmp/tgz
97+
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
98+
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
99+
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
100+
ls -la tmp/tgz
101+
```
102+
103+
### 4.2 Clone and test locally
88104

89105
```bash
90106
node ecosystem-ci/clone.ts project-name
91107
```
92108

109+
### 4.3 Patch and run commands
110+
111+
```bash
112+
# Run from the ecosystem-ci temp directory
113+
cd $(node -e "const os=require('os'); console.log(os.tmpdir() + '/vite-plus-ecosystem-ci')")
114+
115+
# Migrate the project (uses tgz files from tmp/tgz/)
116+
node /path/to/vite-plus/ecosystem-ci/patch-project.ts project-name
117+
118+
# Run the configured commands
119+
cd project-name
120+
vp run build
121+
```
122+
93123
3. **Add OS exclusion to `.github/workflows/e2e-test.yml`** (if not running on both):
94124

95125
For ubuntu-only:

.claude/skills/bump-vite-task/SKILL.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,23 @@ To update snap tests:
5959

6060
Snap test files are at `packages/cli/snap-tests/*/snap.txt` and `packages/cli/snap-tests-global/*/snap.txt`.
6161

62-
### 7. Create the PR
62+
### 7. Review changelog and update docs
63+
64+
- Fetch the vite-task `CHANGELOG.md` diff between old and new commits to see what changed:
65+
```
66+
https://raw.githubusercontent.com/voidzero-dev/vite-task/<new-hash>/CHANGELOG.md
67+
```
68+
- Review each changelog entry and determine if it affects user-facing behavior: new CLI options, changed defaults, new config fields, removed features, etc.
69+
- The changelog contains links to the corresponding vite-task PRs. For complex changes, check the PR description and code diff (especially any docs changes in the PR) to understand the full scope of the change.
70+
- If user-facing changes are found, update the relevant docs in `docs/` (e.g., `docs/guide/`, `docs/config/`).
71+
- Common doc updates include:
72+
- **New CLI flags/options**: Update the relevant config doc (e.g., `docs/config/run.md`, `docs/config/build.md`)
73+
- **New features or commands**: Add or update the relevant guide page (e.g., `docs/guide/cache.md`)
74+
- **Changed defaults or behavior**: Update any docs that describe the old behavior
75+
- **Removed/deprecated options**: Remove or mark as deprecated in the relevant docs
76+
- If no user-facing changes are found, skip this step.
77+
78+
### 8. Create the PR
6379

6480
- Commit message: `chore: bump vite-task to <short-hash>`
6581
- PR title: `chore: bump vite-task to <short-hash>`
@@ -68,7 +84,7 @@ Snap test files are at `packages/cli/snap-tests/*/snap.txt` and `packages/cli/sn
6884
https://github.com/voidzero-dev/vite-task/compare/<old-hash>...<new-hash>#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
6985
```
7086

71-
### 8. Verify CI
87+
### 9. Verify CI
7288

7389
Wait for CI and ensure the `done` check passes. Key checks to monitor:
7490

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ runs:
2525
id: cache-key
2626
shell: bash
2727
run: |
28-
echo "key=napi-binding-v3-${{ 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/cli/binding/**/*.rs', 'packages/cli/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts') }}" >> $GITHUB_OUTPUT
28+
echo "key=napi-binding-v3-${{ 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/cli/binding/**/*.rs', 'packages/cli/binding/Cargo.toml', 'Cargo.toml', '.cargo/config.toml', 'packages/cli/package.json', 'packages/cli/build.ts', 'packages/cli/tsdown.config.ts') }}" >> $GITHUB_OUTPUT
29+
30+
# Resolve the Rust target directory (CARGO_TARGET_DIR from setup-rust, or default "target")
31+
- name: Resolve Rust target directory
32+
id: rust-target
33+
shell: bash
34+
run: echo "dir=${CARGO_TARGET_DIR:-target}" >> $GITHUB_OUTPUT
2935

3036
# Cache NAPI bindings and Rust CLI binary (the slow parts, especially on Windows)
3137
- name: Restore NAPI binding cache
@@ -38,9 +44,10 @@ runs:
3844
packages/cli/binding/index.d.ts
3945
packages/cli/binding/index.cjs
4046
packages/cli/binding/index.d.cts
41-
target/${{ inputs.target }}/release/vp
42-
target/${{ inputs.target }}/release/vp.exe
43-
target/${{ inputs.target }}/release/vp-shim.exe
47+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp
48+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp.exe
49+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp-shim.exe
50+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp-setup.exe
4451
key: ${{ steps.cache-key.outputs.key }}
4552

4653
# Apply Vite+ branding patches to vite source (CI checks out
@@ -137,6 +144,11 @@ runs:
137144
shell: bash
138145
run: cargo build --release --target ${{ inputs.target }} -p vite_trampoline
139146

147+
- name: Build installer binary (Windows only)
148+
if: steps.cache-restore.outputs.cache-hit != 'true' && contains(inputs.target, 'windows')
149+
shell: bash
150+
run: cargo build --release --target ${{ inputs.target }} -p vite_installer
151+
140152
- name: Save NAPI binding cache
141153
if: steps.cache-restore.outputs.cache-hit != 'true'
142154
uses: actions/cache/save@94b89442628ad1d101e352b7ee38f30e1bef108e # v5
@@ -147,9 +159,10 @@ runs:
147159
packages/cli/binding/index.d.ts
148160
packages/cli/binding/index.cjs
149161
packages/cli/binding/index.d.cts
150-
target/${{ inputs.target }}/release/vp
151-
target/${{ inputs.target }}/release/vp.exe
152-
target/${{ inputs.target }}/release/vp-shim.exe
162+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp
163+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp.exe
164+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp-shim.exe
165+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp-setup.exe
153166
key: ${{ steps.cache-key.outputs.key }}
154167

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

.github/actions/clone/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ runs:
3131
node -e "console.log('ECOSYSTEM_CI_PROJECT_REPOSITORY=' + require('./ecosystem-ci/repo.json')['${{ inputs.ecosystem-ci-project }}'].repository.replace('https://github.com/', '').replace('.git', ''))" >> $GITHUB_OUTPUT
3232
echo "ECOSYSTEM_CI_PROJECT_PATH=${{ runner.temp }}/vite-plus-ecosystem-ci/${{ inputs.ecosystem-ci-project }}" >> $GITHUB_OUTPUT
3333
34-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3535
with:
3636
repository: rolldown/rolldown
3737
path: rolldown
3838
ref: ${{ steps.upstream-versions.outputs.ROLLDOWN_HASH }}
3939

40-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4141
with:
4242
repository: vitejs/vite
4343
path: vite

.github/renovate.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,38 @@
1111
],
1212
"packageRules": [
1313
{
14-
"matchPackageNames": ["vitest-dev"],
14+
"description": "Ignore selected npm package updates",
15+
"matchManagers": ["npm"],
16+
"matchPackageNames": [
17+
"rolldown",
18+
"/^oxc-.*/",
19+
"@oxc-node/*",
20+
"@oxc-project/*",
21+
"@vitejs/devtools",
22+
"oxfmt",
23+
"oxlint",
24+
"oxlint-tsgolint",
25+
"tsdown",
26+
"vite",
27+
"vitest",
28+
"vitest-dev"
29+
],
1530
"enabled": false
1631
},
1732
{
18-
"matchPackageNames": [
33+
"description": "Ignore oxc crate updates",
34+
"matchManagers": ["cargo"],
35+
"matchPackageNames": ["/^oxc([_-].*)?$/"],
36+
"enabled": false
37+
},
38+
{
39+
"matchDepNames": [
1940
"fspy",
2041
"vite_glob",
2142
"vite_path",
2243
"vite_str",
2344
"vite_task",
24-
"vite_workspace",
25-
"https://github.com/voidzero-dev/vite-task"
45+
"vite_workspace"
2646
],
2747
"enabled": false
2848
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
# Retry only the snap test cases whose snap.txt changed, up to max_retries times.
3+
# Usage: retry-failed-snap-tests.sh [max_retries]
4+
set -euo pipefail
5+
6+
max_retries=${1:-2}
7+
8+
for retry in $(seq 1 "$max_retries"); do
9+
changed=$(git diff --name-only -- 'packages/cli/snap-tests*/*/snap.txt')
10+
if [ -z "$changed" ]; then
11+
exit 0
12+
fi
13+
14+
echo "::warning::Snapshot diff detected, retry $retry/$max_retries for failed cases..."
15+
git diff --stat -- 'packages/cli/snap-tests*/*/snap.txt'
16+
17+
failed_local=$(echo "$changed" | grep -v 'snap-tests-global/' | sed -E 's|packages/cli/snap-tests/([^/]+)/.*|\1|' | sort -u || true)
18+
failed_global=$(echo "$changed" | grep 'snap-tests-global/' | sed -E 's|packages/cli/snap-tests-global/([^/]+)/.*|\1|' | sort -u || true)
19+
20+
echo "$changed" | xargs git checkout --
21+
22+
for name in $failed_local; do
23+
echo "Retrying local snap test: $name"
24+
RUST_BACKTRACE=1 pnpm -F ./packages/cli snap-test-local "$name"
25+
done
26+
for name in $failed_global; do
27+
echo "Retrying global snap test: $name"
28+
RUST_BACKTRACE=1 pnpm -F ./packages/cli snap-test-global "$name"
29+
done
30+
done
31+
32+
# Final check after all retries
33+
if ! git diff --quiet -- 'packages/cli/snap-tests*/*/snap.txt'; then
34+
echo "::error::Snapshot diff detected after $max_retries retries. Run 'pnpm -F vite-plus snap-test' locally and commit the updated snap.txt files."
35+
git diff --stat
36+
git diff
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)