Skip to content

Commit 4a66e34

Browse files
authored
Merge branch 'main' into feat/migrate-prompt-explanations
2 parents 3cd4dad + 0c4e54f commit 4a66e34

File tree

534 files changed

+13188
-4429
lines changed

Some content is hidden

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

534 files changed

+13188
-4429
lines changed

.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: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ runs:
2727
run: |
2828
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
2929
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
35+
3036
# Cache NAPI bindings and Rust CLI binary (the slow parts, especially on Windows)
3137
- name: Restore NAPI binding cache
3238
id: cache-restore
@@ -38,9 +44,9 @@ 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
4450
key: ${{ steps.cache-key.outputs.key }}
4551

4652
# Apply Vite+ branding patches to vite source (CI checks out
@@ -147,9 +153,9 @@ runs:
147153
packages/cli/binding/index.d.ts
148154
packages/cli/binding/index.cjs
149155
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
156+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp
157+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp.exe
158+
${{ steps.rust-target.outputs.dir }}/${{ inputs.target }}/release/vp-shim.exe
153159
key: ${{ steps.cache-key.outputs.key }}
154160

155161
# 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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
"enabled": false
1616
},
1717
{
18-
"matchPackageNames": [
18+
"matchDepNames": [
1919
"fspy",
2020
"vite_glob",
2121
"vite_path",
2222
"vite_str",
2323
"vite_task",
24-
"vite_workspace",
25-
"https://github.com/voidzero-dev/vite-task"
24+
"vite_workspace"
2625
],
2726
"enabled": false
2827
}
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)