Skip to content
Draft
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
58 changes: 29 additions & 29 deletions Cargo.lock

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

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,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 = "417b6aae5fca92b128c586c8ff3421e43911b553" }
fspy = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
futures = "0.3.31"
futures-util = "0.3.31"
glob = "0.3.2"
Expand Down Expand Up @@ -250,8 +250,8 @@ pretty_assertions = "1.4.1"
phf = "0.13.0"
prettyplease = "0.2.32"
proc-macro2 = "1"
pty_terminal_test = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
pty_terminal_test_client = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
pty_terminal_test = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
pty_terminal_test_client = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
quote = "1"
rayon = "1.10.0"
regex = "1.11.1"
Expand All @@ -274,7 +274,7 @@ sha2 = "0.10.9"
shell-escape = "0.1.5"
simdutf8 = "0.1.5"
smallvec = { version = "1.15.1", features = ["union"] }
snapshot_test = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
snapshot_test = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
string_cache = "0.9.0"
sugar_path = { version = "2.0.1", features = ["cached_current_dir"] }
supports-color = "3"
Expand Down Expand Up @@ -305,11 +305,11 @@ vite_pm_cli = { path = "crates/vite_pm_cli" }
vite_setup = { path = "crates/vite_setup" }
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 = "417b6aae5fca92b128c586c8ff3421e43911b553" }
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "417b6aae5fca92b128c586c8ff3421e43911b553" }
vite_path = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
vite_powershell = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
vite_str = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
vite_task = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
vite_workspace = { git = "https://github.com/taskylizard/vite-task.git", rev = "e263e2b74c1b926735e2deff9c21768cd8953440" }
walkdir = "2.5.0"
which = "8.0.0"
winreg = "0.56.0"
Expand Down
18 changes: 18 additions & 0 deletions docs/config/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ tasks: {
}
```

### `replayLogs`

- **Type:** `boolean`
- **Default:** `true`

Whether to replay the task's cached stdout/stderr on cache hits. Set this to `false` when you want cache hits to restore output files and report saved time without printing the task's previous logs:

```ts [vite.config.ts]
tasks: {
build: {
command: 'vp build',
replayLogs: false,
},
}
```

This does not disable caching and does not affect [`output`](#output) restoration. On a cache hit, Vite Task still skips the command and restores cached output files.

### `env`

- **Type:** `string[]`
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ When a task runs successfully (exit code 0), its terminal output (stdout/stderr)

When all checks match, Vite Task replays the cached terminal output, restores saved output files, and skips the command.

Set [`replayLogs: false`](/config/run#replaylogs) on a task when cache hits should stay quiet. The task still hits the cache, skips execution, and restores cached output files; only cached stdout/stderr replay is suppressed.

When a cache miss occurs, Vite Task tells you exactly why:

```
Expand Down
1 change: 1 addition & 0 deletions packages/cli/binding/src/cli/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl CommandHandler for VitePlusCommandHandler {
// Check is a composite command (fmt + lint) — run as a subprocess in task scripts
Ok(HandledCommand::Synthesized(command.to_synthetic_plan_request(
UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: Some(Box::new([Str::from("OXLINT_TSGOLINT_PATH")])),
untracked_env: None,
input: Some(check_cache_inputs()),
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/binding/src/cli/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl SubcommandResolver {
.chain(args.into_iter().map(Str::from))
.collect(),
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: Some(Box::new([Str::from("OXLINT_TSGOLINT_PATH")])),
untracked_env: None,
input: None,
Expand Down Expand Up @@ -143,6 +144,7 @@ impl SubcommandResolver {
.chain(args.into_iter().map(Str::from))
.collect(),
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: None,
untracked_env: None,
input: None,
Expand Down Expand Up @@ -172,6 +174,7 @@ impl SubcommandResolver {
// vite's `ignoreInput`/`ignoreOutput`/`getEnv`/`getEnvs` refine
// the fingerprint at runtime.
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: None,
untracked_env: None,
input: None,
Expand All @@ -198,6 +201,7 @@ impl SubcommandResolver {
program: Arc::from(OsStr::new("node")),
args: iter::once(Str::from(js_path_str)).chain(vitest_args).collect(),
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: None,
untracked_env: None,
input: Some(vec![
Expand Down Expand Up @@ -226,6 +230,7 @@ impl SubcommandResolver {
.chain(args.into_iter().map(Str::from))
.collect(),
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: None,
untracked_env: None,
input: Some(build_pack_cache_inputs()),
Expand Down Expand Up @@ -284,6 +289,7 @@ impl SubcommandResolver {
.chain(args.into_iter().map(Str::from))
.collect(),
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
replay_logs: None,
env: None,
untracked_env: None,
input: None,
Expand Down
Loading