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(cache): store colored task logs, strip at display when needed (#378)
Fixes#358.
## Summary
- Cached tasks are spawned with `FORCE_COLOR=1`, so the cache always
stores task logs with ANSI colors intact. On a cache hit the original
bytes are replayed verbatim — cached logs keep their colors regardless
of the parent's `FORCE_COLOR` value.
- Colors are stripped at display time when the user's terminal does not
support them, decided per stdout/stderr via the `supports-color` crate.
- `NO_COLOR`, `COLORTERM`, `TERM`, and `TERM_PROGRAM` are no longer in
`DEFAULT_UNTRACKED_ENV`. Tasks that need them can opt in via `env` /
`untrackedEnv`.
## Implementation notes
- `EnvFingerprints::resolve` pre-inserts `FORCE_COLOR=1` before pattern
filtering. `FORCE_COLOR` stays in `DEFAULT_UNTRACKED_ENV`, so the value
is passed through but not part of the cache key.
- A new `ColorSupport { stdout, stderr }` struct threads per-stream
support through the reporter builders. `maybe_strip_writer` is applied
only to the `StdioConfig.writers` returned from
`LeafExecutionReporter::start` (child stdout/stderr and the grouped
buffer); banners and summaries use a thin `ColorizeExt::style` extension
that delegates to `OwoColorize::if_supports_color`.
- e2e harness gained `formatted-snapshot = true` (per-step) and switched
`screen_contents_formatted` to `vt100::Screen::rows_formatted`. Raw
`\x1b[m` resets are stripped from the rendered rows so snapshots match
across Linux/macOS/Windows ConPTY.
## Test plan
- [x] `cargo test -p vite_task -p vite_task_plan -p vite_task_graph`
- [x] `cargo test -p vite_task_bin --test e2e_snapshots`
- [x] `cargo clippy --tests` on Linux
- [x] `cargo doc --workspace -D warnings`
- [ ] CI passes on all platforms (Linux gnu, musl, macOS x86_64/arm64,
Windows)
https://claude.ai/code/session_01EAhpw6TzUWExMeF7hdwuF3
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Changelog
2
2
3
+
-**Changed** Cached logs are stored with colors intact (`FORCE_COLOR=1` is auto-injected into spawned tasks). Colors are then stripped at display time when the terminal does not support them. Other color-related env vars (`NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) are no longer passed through by default. Opt in via a task's `env`/`untrackedEnv` ([#378](https://github.com/voidzero-dev/vite-task/pull/378))
3
4
-**Added**`output` field for cached tasks: archives matching files after a successful run and restores them on cache hit ([#375](https://github.com/voidzero-dev/vite-task/pull/375))
4
5
-**Fixed** Windows cached tasks can now run package shims rewritten through PowerShell; default env passthrough now preserves `PATHEXT` ([#366](https://github.com/voidzero-dev/vite-task/pull/366))
5
6
-**Added** Platform support for targets without `input` auto-inference (e.g. Android). Tasks still run; those relying on auto-inference run uncached, with the summary noting that `input` must be configured manually to enable caching ([#352](https://github.com/voidzero-dev/vite-task/pull/352))
0 commit comments