Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .claude/skills/bump-vite-task/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: bump-vite-task
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.
allowed-tools: Read, Grep, Glob, Edit, Bash, Agent, WebFetch
---

# Bump vite-task to Latest Main

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.

## Steps

### 1. Get current and target commits

- 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.
- Get the latest commit hash on vite-task's main branch:
```bash
git ls-remote https://github.com/voidzero-dev/vite-task.git refs/heads/main
```

### 2. Update Cargo.toml

- 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`.

### 3. Ensure upstream dependencies are cloned

- `cargo check` requires the `./rolldown` and `./vite` directories to exist (many workspace path dependencies point to `./rolldown/crates/...`).
- Locally, clone them using the commit hashes from `packages/tools/.upstream-versions.json`.
- CI handles this automatically via the `.github/actions/clone` action.

### 4. Verify compilation

- Run `cargo check` to ensure the new vite-task compiles without errors.
- 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.
- Common breaking changes include: renamed functions/methods, changed function signatures, new required fields in structs, removed public APIs.

### 5. Run tests

- 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.
- 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.
- Note: `cargo test -p vite_task` will NOT work because vite_task is a git dependency, not a workspace member.

### 6. Update snap tests

vite-task changes often affect CLI output, which means snap tests need updating. Common output changes:

- **Status icons**: e.g., cache hit/miss indicators may change
- **New CLI options**: e.g., new flags added to `vp run` that show up in help output
- **Cache behavior messages**: e.g., new summary lines about cache status
- **Task output formatting**: e.g., step numbering, separator lines

To update snap tests:

1. Push your changes and let CI run the snap tests.
2. CI will show the diff in the E2E test logs if snap tests fail.
3. Extract the diff from CI logs and apply it locally.
4. Check all three platforms (Linux, Mac, Windows) since they may have slightly different snap test coverage.
5. Watch for trailing newline issues - ensure snap files end consistently.

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

### 7. Create the PR

- Commit message: `chore: bump vite-task to <short-hash>`
- PR title: `chore: bump vite-task to <short-hash>`
- PR body: Link to vite-task CHANGELOG.md diff between old and new commits:
```
https://github.com/voidzero-dev/vite-task/compare/<old-hash>...<new-hash>#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
```

### 8. Verify CI

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

- **Lint**: Clippy and format checks
- **Test** (Linux, Mac, Windows): Rust unit tests
- **CLI E2E test** (Linux, Mac, Windows): Snap tests - most likely to fail on a vite-task bump
- **Run task**: Task runner integration tests
- **Cargo Deny**: License/advisory checks (may have pre-existing failures unrelated to bump)

The only **required** status check for merging is `done`, which aggregates the other checks (excluding Cargo Deny).

## Notes

- 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.
- `Cargo.lock` is automatically updated by cargo when you change the revision in `Cargo.toml`.
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ dunce = "1.0.5"
fast-glob = "1.0.0"
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
form_urlencoded = "1.2.1"
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
futures = "0.3.31"
futures-util = "0.3.31"
glob = "0.3.2"
Expand Down Expand Up @@ -183,15 +183,15 @@ vfs = "0.12.1"
vite_command = { path = "crates/vite_command" }
vite_error = { path = "crates/vite_error" }
vite_js_runtime = { path = "crates/vite_js_runtime" }
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
vite_install = { path = "crates/vite_install" }
vite_migration = { path = "crates/vite_migration" }
vite_shared = { path = "crates/vite_shared" }
vite_static_config = { path = "crates/vite_static_config" }
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "398a147fd1ed42a88585d3a9481f200c3e56a2f4" }
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "69cc6eba95a3b7f25f7d4d32c3f29b1386995907" }
walkdir = "2.5.0"
wax = "0.6.0"
which = "8.0.0"
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/snap-tests/build-vite-env/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB


> VITE_MY_VAR=1 vp run build # should hit cache
$ vp build cache hit, replaying
$ vp build cache hit, replaying
vite v<semver> building client environment for production...
transforming...✓ <variable> modules transformed.
rendering chunks...
Expand All @@ -25,7 +25,7 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB
vp run: cache hit, <variable>ms saved.

> VITE_MY_VAR=2 vp run build # env changed, should miss cache
$ vp build cache miss: envs changed, executing
$ vp build cache miss: envs changed, executing
vite v<semver> building client environment for production...
transforming...✓ <variable> modules transformed.
rendering chunks...
Expand All @@ -35,3 +35,5 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB

✓ built in <variable>ms

---
vp run: build-vite-env-test#build not cached because it modified its input. (Run `vp run --last-details` for full details)
6 changes: 3 additions & 3 deletions packages/cli/snap-tests/cache-clean/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
$ vp fmt
Finished in <variable>ms on 4 files using <variable> threads.

---
vp run: hello not cached because it modified its input. (Run `vp run --last-details` for full details)

> vp run hello # hit the cache
$ vp fmt ✓ cache hit, replaying
$ vp fmt
Finished in <variable>ms on 4 files using <variable> threads.

---
vp run: cache hit, <variable>ms saved.

> vp cache clean # clean the cache
> vp run hello # cache miss after clean
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/snap-tests/cache-scripts-enabled/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hello from script


> vp run hello # second run should be cache hit
$ node hello.mjs cache hit, replaying
$ node hello.mjs cache hit, replaying
hello from script

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ $ node -p process.env.MY_ENV


> MY_ENV=2 vp run hello # MY_ENV is pass-through. should hit the cache created in step 1
$ node -p process.env.MY_ENV cache hit, replaying
$ node -p process.env.MY_ENV cache hit, replaying
1

---
vp run: cache hit, <variable>ms saved.

> # add a new pass through env via VITE_TASK_PASS_THROUGH_ENVS
> VITE_TASK_PASS_THROUGH_ENVS=MY_ENV,MY_ENV2 MY_ENV=2 vp run hello # cache should be invalidated because untrackedEnv config changed
$ node -p process.env.MY_ENV cache miss: untracked env config changed, executing
$ node -p process.env.MY_ENV cache miss: untracked env config changed, executing
2

14 changes: 6 additions & 8 deletions packages/cli/snap-tests/command-install-shortcut/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ dependencies:

Done in <variable>ms using pnpm v<semver>

---
vp run: command-install-shortcut#install not cached because it modified its input. (Run `vp run --last-details` for full details)

> vp run install # install shortcut hit cache
$ vp install ✓ cache hit, replaying
Packages: +<variable>
+<repeat>
Progress: resolved <variable>, reused <variable>, downloaded <variable>, added <variable>, done

dependencies:
+ tslib <semver>
$ vp install
Lockfile is up to date, resolution step is skipped
Already up to date

Done in <variable>ms using pnpm v<semver>

---
vp run: cache hit, <variable>ms saved.
vp run: command-install-shortcut#install not cached because it modified its input. (Run `vp run --last-details` for full details)
12 changes: 3 additions & 9 deletions packages/cli/snap-tests/command-pack-monorepo/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
> ls packages/hello/dist # should have the library
index.cjs

> vp run hello#build 2>&1 | grep 'cache hit' # should hit cache
~/packages/hello$ vp pack ✓ cache hit, replaying
vp run: cache hit, <variable>ms saved.

[1]> vp run hello#build 2>&1 | grep 'cache hit' # should hit cache
> vp run array-config#build # should build the library supports array config
> ls packages/array-config/dist # should have the library
index.d.mts
index.mjs

> vp run array-config#build 2>&1 | grep 'cache hit' # should hit cache
~/packages/array-config$ vp pack ✓ cache hit, replaying
vp run: cache hit, <variable>ms saved.

[1]> vp run array-config#build 2>&1 | grep 'cache hit' # should hit cache
> vp run default-config#build # should build the library supports default config
> ls packages/default-config/dist # should have the library
index.mjs

> vp run default-config#build 2>&1 | grep 'cache hit' # should hit cache
~/packages/default-config$ vp pack cache hit, replaying
~/packages/default-config$ vp pack cache hit, replaying
vp run: cache hit, <variable>ms saved.
Loading
Loading