You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ipc): add fetchEnvs(glob) with match-set fingerprinting
Extends the runner-aware-tools IPC with a glob-pattern env query
alongside the existing single-name `getEnv`. The pattern plus the
match-set observed at execution time enter the post-run fingerprint,
so any add / remove / change to a matching env invalidates the cache,
while non-matching envs are ignored.
- `Request::GetEnvs` + `GetEnvsResponse` carrying a sorted
`BTreeMap<NativeStr, NativeStr>`; `NativeStr` now derives `Ord`.
- `Recorder::get_envs` resolves the glob via `vite_glob`, snapshots
the match-set, and records `{pattern, tracked, matches}`.
- `fetchEnvs(pattern, { tracked })` in the JS wrapper always
round-trips (the client can't know in advance which names match,
so `process.env` short-circuit doesn't apply) and writes the
returned values into `process.env` for names that aren't set.
- `PostRunFingerprint.tracked_env_globs` + `EnvGlobDiff`
(added / removed / changed), validated at lookup by re-enumerating
`vars_os()` against the stored pattern and diffing the match-set;
names already declared under the task's `env` config are dropped
from the stored set to avoid double-counting.
- `patches/vite.patch`: drop `fetchEnv("NODE_ENV")` in `resolveConfig`,
call `fetchEnvs(`${prefix}*`, { tracked: true })` per configured
`envPrefix` inside `loadEnv` — `envPrefix`-matching envs drive
`import.meta.env.*` substitution, so the runner now tracks whatever
vite actually reads from its own config.
- E2E: new `fetch_envs_tracks_glob_match_set` fixture covers the five
diff scenarios (unchanged / changed / added / removed / non-matching
noise); `vite_build_cache`'s NODE_ENV case becomes `VITE_MODE`-driven
to exercise the new glob path through a real `vite build`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments