Skip to content

Commit a9c7034

Browse files
wan9chifengmk2
andauthored
feat: integrate vite-task runner-aware tools (auto output + tracked envs) (#1774)
Integrates the runner-aware-tools work now available on `vite-task/main`: 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. This enables auto output restoration and auto tracked envs through the runner protocol. ## Changes - **Bump vite-task git deps to `82ec12b2`** (latest `main`): runner-aware IPC server/client + embedded napi addon, tracked env fingerprinting, automatic output tracking/restoration by default, per-schema-version cache directories, and prefix-env executable lookup fixes. Regenerate the napi binding (`RunnerClient`/`load` exports) and `run-config.ts` for the new task-config types (`AutoTracking`). - **Point the vite behind `vp build`/`vp dev` to latest vitejs/vite (`c13a37b53`)**, which carries the vite-task-client integration. vite lists `@voidzero-dev/vite-task-client` in **devDependencies**, so it is bundled into vite's output, and therefore into `@voidzero-dev/vite-plus-core`, the same way as vite's other bundled deps (cac, esbuild, ...). No extra runtime dependency or build wiring is needed. - **Remove `vp build`'s synthetic cache config** (`env: ["VITE_*"]`, manual input excludes). The all-`None` `EnabledCacheConfig` keeps caching enabled with auto input/output inference; vite's `ignoreInput`/`ignoreOutput`/`getEnv`/`getEnvs` refine the fingerprint at runtime. `vp dev` stays `disabled()`. - **Docs**: update cache/run docs for automatic output restoration by default and `output: []` as the opt-out. - **Snap tests**: `vp-build-auto-output-restoration` (dist restored on cache hit without a synthetic `output` config) and `vp-build-auto-tracked-env` (a `VITE_` env change invalidates the cache and names the changed env). Edge cases live in vite-task. ## Notes - The vite-task stack has landed on `main`; this PR now pins latest `main` (`82ec12b2`). Changelog diff for the latest repin: voidzero-dev/vite-task@68fb22e...82ec12b#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed - rolldown stays at main's pin (`c462c7c5`, v1.1.0), which is compatible with vite `c13a37b53`'s rolldown `1.0.3` requirement. --------- Co-authored-by: MK <fengmk2@gmail.com>
1 parent b386620 commit a9c7034

30 files changed

Lines changed: 377 additions & 77 deletions

File tree

.github/workflows/test-vp-create.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ jobs:
195195
# `YN0016 ... are quarantined`. The migrate tool is version-pinned to the
196196
# bundled oxlint, so disable the gate for this test (no-op for npm/pnpm/bun).
197197
YARN_NPM_MINIMAL_AGE_GATE: '0'
198+
# pnpm 11's default `minimumReleaseAge` (~24h) makes the bundled vitest's
199+
# auto-installed `vite` peer resolve to the previous upstream release,
200+
# which can predate vite's `@voidzero-dev/vite-task-client` integration and
201+
# surface a false `vp test` cache miss in "Verify cache". Force 0 so the
202+
# latest vite (with the integration) is used. pnpm-only (no-op elsewhere).
203+
# Temporary band-aid; real fix tracked in voidzero-dev/vite-plus#1932.
204+
PNPM_CONFIG_MINIMUM_RELEASE_AGE: '0'
198205
steps:
199206
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
200207

Cargo.lock

Lines changed: 89 additions & 26 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 = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
196196
futures = "0.3.31"
197197
futures-util = "0.3.31"
198198
glob = "0.3.2"
@@ -304,11 +304,11 @@ vite_pm_cli = { path = "crates/vite_pm_cli" }
304304
vite_setup = { path = "crates/vite_setup" }
305305
vite_shared = { path = "crates/vite_shared" }
306306
vite_static_config = { path = "crates/vite_static_config" }
307-
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
308-
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
309-
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
310-
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
311-
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "5833b374c6edb05c2f2f8e133ff8c796b378472a" }
307+
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
308+
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
309+
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
310+
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
311+
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "8daa9bb72faa89b745cb58c087b416b15d3bddc5" }
312312
walkdir = "2.5.0"
313313
wax = "0.6.0"
314314
which = "8.0.0"

0 commit comments

Comments
 (0)