Skip to content

Commit 26098cc

Browse files
committed
chore: add bump-vite-task skill for Claude Code
Documents the best practices for bumping the vite-task git dependency, including handling breaking changes, updating snap tests, and CI verification.
1 parent a206ba9 commit 26098cc

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
name: bump-vite-task
3+
description: Bump vite-task git dependency to the latest main commit. Use when you need to update the vite-task crates (fspy, vite_glob, vite_path, vite_str, vite_task, vite_workspace) in vite-plus.
4+
allowed-tools: Read, Grep, Glob, Edit, Bash, Agent, WebFetch
5+
---
6+
7+
# Bump vite-task to Latest Main
8+
9+
Update the vite-task git dependency in `Cargo.toml` to the latest commit on the vite-task main branch, fix any breaking changes, and create a PR.
10+
11+
## Steps
12+
13+
### 1. Get current and target commits
14+
15+
- Read `Cargo.toml` and find the current `rev = "..."` for any vite-task git dependency (e.g., `vite_task`, `vite_path`, `fspy`, `vite_glob`, `vite_str`, `vite_workspace`). They all share the same revision.
16+
- Get the latest commit hash on vite-task's main branch:
17+
```bash
18+
git ls-remote https://github.com/voidzero-dev/vite-task.git refs/heads/main
19+
```
20+
21+
### 2. Update Cargo.toml
22+
23+
- Replace **all** occurrences of the old commit hash with the new one in `Cargo.toml`. There are 6 crate entries that reference the same vite-task revision: `fspy`, `vite_glob`, `vite_path`, `vite_str`, `vite_task`, `vite_workspace`.
24+
25+
### 3. Verify compilation
26+
27+
- Run `cargo check` to ensure the new vite-task compiles without errors.
28+
- If there are compilation errors, these are **breaking changes** from vite-task. Fix them in the vite-plus codebase (the consuming side), not in vite-task.
29+
- Common breaking changes include: renamed functions/methods, changed function signatures, new required fields in structs, removed public APIs.
30+
31+
### 4. Run tests
32+
33+
- Run `cargo test -p vite_command -p vite_error -p vite_install -p vite_js_runtime -p vite_migration -p vite_shared -p vite_static_config -p vite-plus-cli -p vite_global_cli` to run the vite-plus crate tests.
34+
- Note: Some tests require network access (e.g., `vite_install::package_manager` tests, `vite_global_cli::commands::env` tests). These may fail in sandboxed environments. Verify they also fail on the main branch before dismissing them.
35+
- Note: `cargo test -p vite_task` will NOT work because vite_task is a git dependency, not a workspace member.
36+
37+
### 5. Update snap tests
38+
39+
vite-task changes often affect CLI output, which means snap tests need updating. Common output changes:
40+
41+
- **Status icons**: e.g., cache hit/miss indicators may change
42+
- **New CLI options**: e.g., new flags added to `vp run` that show up in help output
43+
- **Cache behavior messages**: e.g., new summary lines about cache status
44+
- **Task output formatting**: e.g., step numbering, separator lines
45+
46+
To update snap tests:
47+
1. Push your changes and let CI run the snap tests.
48+
2. CI will show the diff in the E2E test logs if snap tests fail.
49+
3. Extract the diff from CI logs and apply it locally.
50+
4. Check all three platforms (Linux, Mac, Windows) since they may have slightly different snap test coverage.
51+
5. Watch for trailing newline issues - ensure snap files end consistently.
52+
53+
Snap test files are at `packages/cli/snap-tests/*/snap.txt`.
54+
55+
### 6. Create the PR
56+
57+
- Commit message: `chore: bump vite-task to <short-hash>`
58+
- PR title: `chore: bump vite-task to <short-hash>`
59+
- PR body: Link to vite-task CHANGELOG.md diff between old and new commits:
60+
```
61+
https://github.com/voidzero-dev/vite-task/compare/<old-hash>...<new-hash>#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
62+
```
63+
64+
### 7. Verify CI
65+
66+
Wait for CI and ensure the `done` check passes. Key checks to monitor:
67+
68+
- **Lint**: Clippy and format checks
69+
- **Test** (Linux, Mac, Windows): Rust unit tests
70+
- **CLI E2E test** (Linux, Mac, Windows): Snap tests - most likely to fail on a vite-task bump
71+
- **Run task**: Task runner integration tests
72+
- **Cargo Deny**: License/advisory checks (may have pre-existing failures unrelated to bump)
73+
74+
The only **required** status check for merging is `done`, which aggregates the other checks (excluding Cargo Deny).
75+
76+
## Notes
77+
78+
- The rolldown and vite directories must exist for `cargo check` to work locally. CI handles this via the `.github/actions/clone` action. Locally, clone them using hashes from `packages/tools/.upstream-versions.json`.
79+
- Building the full CLI locally (`pnpm bootstrap-cli`) requires the rolldown Node.js package to be built first, which is complex. Prefer relying on CI for snap test generation.
80+
- `Cargo.lock` is automatically updated by cargo when you change the revision in `Cargo.toml`.

0 commit comments

Comments
 (0)