Skip to content

Commit f3c2f78

Browse files
wan9chiclaude
andcommitted
feat: integrate vite-task runner-aware tools (auto output + tracked envs)
Vite reports its inputs/outputs/envs to the `vp` runner via `@voidzero-dev/vite-task-client`, so `vp build` no longer needs a hand-synthesized cache config. - Bump vite-task git deps to c44d7c33 (runner-aware IPC server/client + embedded napi addon); regenerate run-config.ts for the new task-config types. - Point the vite behind vp build/vp dev to latest vitejs/vite (c13a37b53), which carries the vite-task-client integration. vite lists vite-task-client in devDependencies, so it is bundled into vite's output (and thus into core) the same way as vite's other bundled deps (cac, esbuild, ...) — no extra dependency or build wiring needed. - Remove vp build's synthetic cache config (env: [VITE_*], manual input excludes). All-None EnabledCacheConfig keeps caching enabled with auto input/output inference (output restoration); vp dev stays disabled. - Snap tests: vp-build-auto-output-restoration, vp-build-auto-tracked-env. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 52a9999 commit f3c2f78

19 files changed

Lines changed: 235 additions & 44 deletions

File tree

Cargo.lock

Lines changed: 85 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ dunce = "1.0.5"
192192
fast-glob = "1.0.0"
193193
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
194194
form_urlencoded = "1.2.1"
195-
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
195+
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
196196
futures = "0.3.31"
197197
futures-util = "0.3.31"
198198
glob = "0.3.2"
@@ -302,11 +302,11 @@ vite_pm_cli = { path = "crates/vite_pm_cli" }
302302
vite_setup = { path = "crates/vite_setup" }
303303
vite_shared = { path = "crates/vite_shared" }
304304
vite_static_config = { path = "crates/vite_static_config" }
305-
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
306-
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
307-
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
308-
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
309-
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
305+
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
306+
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
307+
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
308+
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
309+
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c44d7c3377c621d384cbb1aa18a6b9160513f99d" }
310310
walkdir = "2.5.0"
311311
wax = "0.6.0"
312312
which = "8.0.0"

packages/cli/binding/src/cli/resolver.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,16 @@ impl SubcommandResolver {
171171
.chain(iter::once(Str::from("build")))
172172
.chain(args.into_iter().map(Str::from))
173173
.collect(),
174+
// No synthetic cache config: vite reports its inputs/outputs/
175+
// envs to the runner via `@voidzero-dev/vite-task-client`.
176+
// All fields `None` keep caching enabled with auto input and
177+
// auto output inference (the latter drives output restoration);
178+
// vite's `ignoreInput`/`ignoreOutput`/`getEnv`/`getEnvs` refine
179+
// the fingerprint at runtime.
174180
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
175-
env: Some(Box::new([Str::from("VITE_*")])),
181+
env: None,
176182
untracked_env: None,
177-
input: Some(build_pack_cache_inputs()),
183+
input: None,
178184
output: None,
179185
}),
180186
envs: merge_resolved_envs_with_version(envs, resolved.envs),

packages/cli/snap-tests/build-vite-env/snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dist/assets/index-Dra_-aT4.js <variable> kB │ gzip: <variable> kB
2525
vp run: cache hit, <variable>ms saved.
2626

2727
> VITE_MY_VAR=2 vp run build # env changed, should miss cache
28-
$ vp build ○ cache miss: envs changed, executing
28+
$ vp build ○ cache miss: tracked env glob 'VITE_*' changed, executing
2929
vite v<semver> building client environment for production...
3030
transforming...✓ <variable> modules transformed.
3131
rendering chunks...

packages/cli/snap-tests/plain-terminal-ui-nested/snap.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ Found 0 warnings and 0 errors.
88
Finished in <variable>ms on 3 files with <variable> rules using <variable> threads.
99

1010
---
11-
vp run: 0/2 cache hit (0%). root-package#hello (and 1 more) not cached because they modified their inputs. (Run `vp run --last-details` for full details)
11+
vp run: 0/2 cache hit (0%). (Run `vp run --last-details` for full details)
1212

1313
> echo 'console.log(123)' > a.ts
1414
> vp run hello # report cache status from the inner runner
15-
$ vp lint ./src
15+
$ vp lint ./src ◉ cache hit, replaying
1616
Found 0 warnings and 0 errors.
1717
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
1818

19-
$ vp lint
19+
$ vp lint ○ cache miss: 'a.ts' modified, executing
2020
Found 0 warnings and 0 errors.
2121
Finished in <variable>ms on 3 files with <variable> rules using <variable> threads.
2222

2323
---
24-
vp run: 0/2 cache hit (0%). root-package#hello (and 1 more) not cached because they modified their inputs. (Run `vp run --last-details` for full details)
24+
vp run: 1/2 cache hit (50%), <variable>ms saved. (Run `vp run --last-details` for full details)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!doctype html>
2+
<html>
3+
<body>
4+
<script type="module">
5+
console.log('hello');
6+
</script>
7+
</body>
8+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "vp-build-auto-output-restoration-test",
3+
"private": true
4+
}

0 commit comments

Comments
 (0)