From ddbbb943e73a2e0e8fe8a294b8e28755b1fd85ed Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 17:05:03 +0800 Subject: [PATCH 01/12] feat: replace verbose execution summary with compact one-liners Add --details flag for full summary and --last-details to view saved summary from last run. Normal runs now show a compact one-liner instead of the full summary table: - Single task + no cache hit: no summary - Single task + cache hit: '[vp run] cache hit, {duration} saved.' - Multi-task: '[vp run] {hits}/{total} cache hit ({rate}%)' Summary data is persisted as structured JSON (last-summary.json) in the cache directory using atomic writes. Both live and --last-details rendering share the same code path through LastRunSummary. The TaskResult enum encodes cache status and execution outcome together, making invalid states unrepresentable (e.g. CacheHit+exit_code, InProcess+error). Also fixes a pre-existing flaky test in e2e-lint-cache where oxlint scanned node_modules, causing fspy to fingerprint the cache directory. --- crates/vite_task/src/cli/mod.rs | 12 +- crates/vite_task/src/session/cache/display.rs | 136 +--- crates/vite_task/src/session/cache/mod.rs | 3 +- crates/vite_task/src/session/mod.rs | 68 +- .../vite_task/src/session/reporter/labeled.rs | 373 +++------ crates/vite_task/src/session/reporter/mod.rs | 1 + .../vite_task/src/session/reporter/summary.rs | 761 ++++++++++++++++++ .../associate-existing-cache/snapshots.toml | 6 +- .../snapshots/associate existing cache.snap | 6 +- .../builtin-different-cwd/snapshots.toml | 8 +- .../snapshots/builtin different cwd.snap | 16 +- .../builtin-non-zero-exit/snapshots.toml | 4 +- ... exit does not show cache not updated.snap | 4 +- .../fixtures/cache-disabled/snapshots.toml | 8 +- .../snapshots/task with cache disabled.snap | 4 +- .../snapshots/task with cache enabled.snap | 4 +- .../cache-miss-command-change/snapshots.toml | 6 +- .../snapshots/cache miss command change.snap | 6 +- .../cache-miss-reasons/snapshots.toml | 28 +- .../snapshots/cwd changed.snap | 4 +- .../snapshots/env added.snap | 4 +- .../snapshots/env removed.snap | 4 +- .../snapshots/env value changed.snap | 4 +- .../snapshots/input content changed.snap | 4 +- .../snapshots/pass-through env added.snap | 4 +- .../snapshots/pass-through env removed.snap | 4 +- .../fixtures/cache-subcommand/snapshots.toml | 6 +- .../snapshots/cache clean.snap | 6 +- .../read file with colon in name.snap | 27 +- ...est prints value from additional_envs.snap | 14 - .../env-test with different values.snap | 28 - .../fixtures/e2e-lint-cache/.gitignore | 7 + .../fixtures/e2e-lint-cache/snapshots.toml | 4 +- .../e2e-lint-cache/snapshots/direct lint.snap | 4 +- .../exec not triggered from script.snap | 14 - .../fixtures/exit-codes/snapshots.toml | 4 +- ...ple task failures returns exit code 1.snap | 2 +- ...e task failure returns task exit code.snap | 2 +- .../snapshots.toml | 8 +- .../individual cache for extra args.snap | 8 +- .../individual-cache-for-envs/snapshots.toml | 8 +- .../snapshots/individual cache for envs.snap | 8 +- .../fixtures/lint-dot-git/snapshots.toml | 4 +- .../lint-dot-git/snapshots/lint dot git.snap | 12 +- .../replay logs chronological order.snap | 40 +- .../shared-caching-inputs/snapshots.toml | 8 +- .../snapshots/shared caching inputs.snap | 8 +- .../fixtures/signal-exit/snapshots.toml | 2 +- ...nated task returns non-zero exit code.snap | 2 +- .../multiple tasks get null stdin.snap | 16 +- .../single task no cache inherits stdin.snap | 14 - ...ingle task with cache gets null stdin.snap | 14 - .../multiple tasks, cache disabled.snap | 16 +- .../snapshots/multiple tasks, cache hit.snap | 32 +- .../snapshots/multiple tasks, cache miss.snap | 16 +- .../single task, cache disabled.snap | 14 - .../snapshots/single task, cache hit.snap | 27 +- .../snapshots/single task, cache miss.snap | 14 - ...es piped for nested single-node graph.snap | 16 +- ...it even with multi-node sibling graph.snap | 22 +- .../task-list/snapshots/vp run in script.snap | 28 - .../snapshots/no trailing newline.snap | 16 +- .../interactive long command truncated.snap | 14 - ...ve enter with no results does nothing.snap | 14 - .../interactive escape clears query.snap | 14 - .../interactive scroll long list.snap | 14 - ...interactive search other package task.snap | 14 - ...earch preserves rating within package.snap | 14 - .../interactive search then select.snap | 14 - ...active search with hash skips reorder.snap | 14 - .../interactive select task from lib.snap | 14 - .../snapshots/interactive select task.snap | 14 - .../interactive select with recursive.snap | 16 +- ...ctive select with typo and transitive.snap | 16 +- .../interactive select with typo.snap | 14 - .../snapshots.toml | 6 +- ...d runs dependencies before dependents.snap | 2 +- ... build from app runs all dependencies.snap | 2 +- ...d from lib runs only its dependencies.snap | 2 +- .../fixtures/vite-task-smoke/snapshots.toml | 4 +- .../cache hit after file modification.snap | 4 +- 81 files changed, 1113 insertions(+), 1046 deletions(-) create mode 100644 crates/vite_task/src/session/reporter/summary.rs create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.gitignore diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 7e6a76d4..3cb414b2 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -17,6 +17,7 @@ pub enum CacheSubcommand { /// Extracted as a separate struct so they can be cheaply `Copy`-ed /// before `RunCommand` is consumed. #[derive(Debug, Clone, Copy, clap::Args)] +#[expect(clippy::struct_excessive_bools, reason = "CLI flags are naturally boolean")] pub struct RunFlags { /// Run tasks found in all packages in the workspace, in topological order based on package dependencies. #[clap(default_value = "false", short, long)] @@ -29,6 +30,10 @@ pub struct RunFlags { /// Do not run dependencies specified in `dependsOn` fields. #[clap(default_value = "false", long)] pub ignore_depends_on: bool, + + /// Show full detailed summary after execution. + #[clap(default_value = "false", long)] + pub details: bool, } /// Arguments for the `run` subcommand. @@ -43,6 +48,10 @@ pub struct RunCommand { /// Additional arguments to pass to the tasks #[clap(trailing_var_arg = true, allow_hyphen_values = true)] pub additional_args: Vec, + + /// Display the detailed summary of the last run. + #[clap(long, exclusive = true)] + pub last_details: bool, } /// vite task CLI subcommands @@ -82,8 +91,9 @@ impl RunCommand { ) -> Result { let Self { task_specifier, - flags: RunFlags { recursive, transitive, ignore_depends_on }, + flags: RunFlags { recursive, transitive, ignore_depends_on, .. }, additional_args, + .. } = self; let task_specifier = task_specifier.ok_or(CLITaskQueryError::MissingTaskSpecifier)?; diff --git a/crates/vite_task/src/session/cache/display.rs b/crates/vite_task/src/session/cache/display.rs index 0db234db..a527f0bc 100644 --- a/crates/vite_task/src/session/cache/display.rs +++ b/crates/vite_task/src/session/cache/display.rs @@ -4,14 +4,18 @@ //! Coloring is handled by the reporter to respect `NO_COLOR` environment variable. use rustc_hash::FxHashSet; +use serde::{Deserialize, Serialize}; use vite_str::Str; use vite_task_plan::cache_metadata::SpawnFingerprint; use super::{CacheMiss, FingerprintMismatch}; use crate::session::event::{CacheDisabledReason, CacheStatus}; -/// Describes a single atomic change between two spawn fingerprints -enum SpawnFingerprintChange { +/// Describes a single atomic change between two spawn fingerprints. +/// +/// Used both for live cache status display and for persisted summary data. +#[derive(Serialize, Deserialize)] +pub enum SpawnFingerprintChange { // Environment variable changes /// Environment variable added EnvAdded { key: Str, value: Str }, @@ -43,8 +47,40 @@ enum SpawnFingerprintChange { FingerprintIgnoreRemoved { pattern: Str }, } -/// Compare two spawn fingerprints and return all changes -fn detect_spawn_fingerprint_changes( +/// Format a single spawn fingerprint change as human-readable text. +/// +/// Used by both the live cache status display and the persisted summary rendering. +pub fn format_spawn_change(change: &SpawnFingerprintChange) -> Str { + match change { + SpawnFingerprintChange::EnvAdded { key, value } => { + vite_str::format!("env {key}={value} added") + } + SpawnFingerprintChange::EnvRemoved { key, value } => { + vite_str::format!("env {key}={value} removed") + } + SpawnFingerprintChange::EnvValueChanged { key, old_value, new_value } => { + vite_str::format!("env {key} value changed from '{old_value}' to '{new_value}'") + } + SpawnFingerprintChange::PassThroughEnvAdded { name } => { + vite_str::format!("pass-through env '{name}' added") + } + SpawnFingerprintChange::PassThroughEnvRemoved { name } => { + vite_str::format!("pass-through env '{name}' removed") + } + SpawnFingerprintChange::ProgramChanged => Str::from("program changed"), + SpawnFingerprintChange::ArgsChanged => Str::from("args changed"), + SpawnFingerprintChange::CwdChanged => Str::from("working directory changed"), + SpawnFingerprintChange::FingerprintIgnoreAdded { pattern } => { + vite_str::format!("fingerprint ignore '{pattern}' added") + } + SpawnFingerprintChange::FingerprintIgnoreRemoved { pattern } => { + vite_str::format!("fingerprint ignore '{pattern}' removed") + } + } +} + +/// Compare two spawn fingerprints and return all changes. +pub fn detect_spawn_fingerprint_changes( old: &SpawnFingerprint, new: &SpawnFingerprint, ) -> Vec { @@ -190,95 +226,3 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option { } } } - -/// Format cache status for summary display (post-execution). -/// -/// Returns a formatted string showing detailed cache information. -/// - Cache Hit: Shows saved time -/// - Cache Miss (NotFound): Indicates first-time execution -/// - Cache Miss (with mismatch): Shows specific reason with details -/// - Cache Disabled: Shows user-friendly reason message -/// -/// Note: Returns plain text without styling. The reporter applies colors. -pub fn format_cache_status_summary(cache_status: &CacheStatus) -> Str { - match cache_status { - CacheStatus::Hit { replayed_duration } => { - // Show saved time for cache hits - vite_str::format!("→ Cache hit - output replayed - {replayed_duration:.2?} saved") - } - CacheStatus::Miss(CacheMiss::NotFound) => { - // First time running this task - no previous cache entry - Str::from("→ Cache miss: no previous cache entry found") - } - CacheStatus::Miss(CacheMiss::FingerprintMismatch(mismatch)) => { - // Show specific reason why cache was invalidated - match mismatch { - FingerprintMismatch::SpawnFingerprintMismatch { old, new } => { - let changes = detect_spawn_fingerprint_changes(old, new); - let formatted: Vec = changes - .iter() - .map(|c| match c { - SpawnFingerprintChange::EnvAdded { key, value } => { - vite_str::format!("env {key}={value} added") - } - SpawnFingerprintChange::EnvRemoved { key, value } => { - vite_str::format!("env {key}={value} removed") - } - SpawnFingerprintChange::EnvValueChanged { - key, - old_value, - new_value, - } => { - vite_str::format!( - "env {key} value changed from '{old_value}' to '{new_value}'" - ) - } - SpawnFingerprintChange::PassThroughEnvAdded { name } => { - vite_str::format!("pass-through env '{name}' added") - } - SpawnFingerprintChange::PassThroughEnvRemoved { name } => { - vite_str::format!("pass-through env '{name}' removed") - } - SpawnFingerprintChange::ProgramChanged => Str::from("program changed"), - SpawnFingerprintChange::ArgsChanged => Str::from("args changed"), - SpawnFingerprintChange::CwdChanged => { - Str::from("working directory changed") - } - SpawnFingerprintChange::FingerprintIgnoreAdded { pattern } => { - vite_str::format!("fingerprint ignore '{pattern}' added") - } - SpawnFingerprintChange::FingerprintIgnoreRemoved { pattern } => { - vite_str::format!("fingerprint ignore '{pattern}' removed") - } - }) - .collect(); - - if formatted.is_empty() { - Str::from("→ Cache miss: configuration changed") - } else { - let joined = - formatted.iter().map(Str::as_str).collect::>().join("; "); - vite_str::format!("→ Cache miss: {joined}") - } - } - FingerprintMismatch::PostRunFingerprintMismatch(diff) => { - // Post-run mismatch has specific path information - use crate::session::execute::fingerprint::PostRunFingerprintMismatch; - match diff { - PostRunFingerprintMismatch::InputContentChanged { path } => { - vite_str::format!("→ Cache miss: content of input '{path}' changed") - } - } - } - } - } - CacheStatus::Disabled(reason) => { - // Display user-friendly message for each disabled reason - let message = match reason { - CacheDisabledReason::InProcessExecution => "Cache disabled for built-in command", - CacheDisabledReason::NoCacheMetadata => "Cache disabled in task configuration", - }; - vite_str::format!("→ {message}") - } - } -} diff --git a/crates/vite_task/src/session/cache/mod.rs b/crates/vite_task/src/session/cache/mod.rs index c9bf5381..e9ff6093 100644 --- a/crates/vite_task/src/session/cache/mod.rs +++ b/crates/vite_task/src/session/cache/mod.rs @@ -6,7 +6,8 @@ use std::{fmt::Display, fs::File, io::Write, sync::Arc, time::Duration}; use bincode::{Decode, Encode, decode_from_slice, encode_to_vec}; // Re-export display functions for convenience -pub use display::{format_cache_status_inline, format_cache_status_summary}; +pub use display::format_cache_status_inline; +pub use display::{SpawnFingerprintChange, detect_spawn_fingerprint_changes, format_spawn_change}; use rusqlite::{Connection, OptionalExtension as _, config::DbConfig}; use serde::{Deserialize, Serialize}; use tokio::sync::Mutex; diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 17c5d7e3..bea07c9b 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -10,7 +10,10 @@ use cache::ExecutionCache; pub use cache::{CacheMiss, FingerprintMismatch}; use once_cell::sync::OnceCell; pub use reporter::ExitStatus; -use reporter::LabeledReporterBuilder; +use reporter::{ + LabeledReporterBuilder, + summary::{LastRunSummary, ReadSummaryError, format_full_summary}, +}; use rustc_hash::FxHashMap; use vite_path::{AbsolutePath, AbsolutePathBuf}; use vite_select::SelectItem; @@ -225,12 +228,18 @@ impl<'a> Session<'a> { match command { Command::Cache { ref subcmd } => self.handle_cache_command(subcmd), Command::Run(run_command) => { + // --last-details: display saved summary and exit (exclusive flag) + if run_command.last_details { + return self.show_last_run_details(); + } + let cwd = Arc::clone(&self.cwd); let is_interactive = std::io::stdin().is_terminal() && std::io::stdout().is_terminal(); // Save task name and flags before consuming run_command let task_name = run_command.task_specifier.as_ref().map(|s| s.task_name.clone()); + let show_details = run_command.flags.details; let flags = run_command.flags; let additional_args = run_command.additional_args.clone(); @@ -249,6 +258,8 @@ impl<'a> Session<'a> { let builder = LabeledReporterBuilder::new( self.workspace_path(), Box::new(tokio::io::stdout()), + show_details, + Some(self.summary_file_path()), ); Ok(self .execute_graph(graph, Box::new(builder)) @@ -389,13 +400,22 @@ impl<'a> Session<'a> { // Interactive: run the selected task let selected_label = &select_items[selected_index].label; let task_specifier = TaskSpecifier::parse_raw(selected_label); - let run_command = - RunCommand { task_specifier: Some(task_specifier), flags, additional_args }; + let show_details = flags.details; + let run_command = RunCommand { + task_specifier: Some(task_specifier), + flags, + additional_args, + last_details: false, + }; let cwd = Arc::clone(&self.cwd); let graph = self.plan_from_cli_run(cwd, run_command).await?; - let builder = - LabeledReporterBuilder::new(self.workspace_path(), Box::new(tokio::io::stdout())); + let builder = LabeledReporterBuilder::new( + self.workspace_path(), + Box::new(tokio::io::stdout()), + show_details, + Some(self.summary_file_path()), + ); Ok(self.execute_graph(graph, Box::new(builder)).await.err().unwrap_or(ExitStatus::SUCCESS)) } @@ -414,6 +434,44 @@ impl<'a> Session<'a> { Arc::clone(&self.workspace_path) } + /// Path to the `last-summary.json` file inside the cache directory. + fn summary_file_path(&self) -> AbsolutePathBuf { + self.cache_path.join("last-summary.json") + } + + /// Display the saved summary from the last run (`--last-details`). + #[expect( + clippy::print_stderr, + reason = "--last-details error messages are user-facing diagnostics, not debug output" + )] + fn show_last_run_details(&self) -> anyhow::Result { + let path = self.summary_file_path(); + match LastRunSummary::read_from_path(&path) { + Ok(Some(summary)) => { + let buf = format_full_summary(&summary); + { + use std::io::Write; + let mut stdout = std::io::stdout().lock(); + let _ = stdout.write_all(&buf); + let _ = stdout.flush(); + } + Ok(ExitStatus(summary.exit_code)) + } + Ok(None) => { + eprintln!("No previous run summary found. Run a task first to generate a summary."); + Ok(ExitStatus::FAILURE) + } + Err(ReadSummaryError::IncompatibleVersion) => { + eprintln!( + "Summary data was saved by a different version of vite-task and cannot be read. \ + Run a task to generate a new summary." + ); + Ok(ExitStatus::FAILURE) + } + Err(ReadSummaryError::Io(err)) => Err(err.into()), + } + } + pub const fn task_graph(&self) -> Option<&TaskGraph> { match &self.lazy_task_graph { LazyTaskGraph::Initialized(graph) => Some(graph.task_graph()), diff --git a/crates/vite_task/src/session/reporter/labeled.rs b/crates/vite_task/src/session/reporter/labeled.rs index 9101a40d..3a14f479 100644 --- a/crates/vite_task/src/session/reporter/labeled.rs +++ b/crates/vite_task/src/session/reporter/labeled.rs @@ -6,25 +6,25 @@ //! Tracks statistics across multiple leaf executions, prints command lines with cache //! status indicators, and renders a summary with per-task details at the end. -use std::{cell::RefCell, process::ExitStatus as StdExitStatus, rc::Rc, sync::Arc, time::Duration}; +use std::{cell::RefCell, process::ExitStatus as StdExitStatus, rc::Rc, sync::Arc}; -use owo_colors::Style; use tokio::io::{AsyncWrite, AsyncWriteExt as _}; -use vite_path::AbsolutePath; +use vite_path::{AbsolutePath, AbsolutePathBuf}; use vite_str::Str; use vite_task_plan::{ExecutionItemDisplay, LeafExecutionKind}; use super::{ - CACHE_MISS_STYLE, COMMAND_STYLE, ColorizeExt, ExitStatus, GraphExecutionReporter, - GraphExecutionReporterBuilder, LeafExecutionReporter, StdioConfig, StdioSuggestion, - format_command_display, format_command_with_cache_status, format_error_message, + ExitStatus, GraphExecutionReporter, GraphExecutionReporterBuilder, LeafExecutionReporter, + StdioConfig, StdioSuggestion, format_command_with_cache_status, format_error_message, }; use crate::session::{ - cache::format_cache_status_summary, event::{CacheStatus, CacheUpdateStatus, ExecutionError, exit_status_to_code}, + reporter::summary::{ + LastRunSummary, SavedExecutionError, format_compact_summary, format_full_summary, + }, }; -/// Information tracked for each leaf execution, used in the final summary. +/// Information tracked for each leaf execution, used to build the summary. #[derive(Debug)] struct ExecutionInfo { display: ExecutionItemDisplay, @@ -32,16 +32,13 @@ struct ExecutionInfo { cache_status: CacheStatus, /// Exit status from the process. `None` means no process was spawned (cache hit or in-process). exit_status: Option, - /// Error message, set on error. - error_message: Option, + /// Execution error, converted to the serializable form for the summary. + saved_error: Option, } /// Running statistics updated as leaf executions complete. #[derive(Default)] struct ExecutionStats { - cache_hits: usize, - cache_misses: usize, - cache_disabled: usize, failed: usize, } @@ -62,18 +59,21 @@ struct SharedReporterState { /// /// # Output Modes /// -/// ## Normal Mode (default) -/// - Prints command lines with cache status indicators during execution -/// - Shows full summary with Statistics and Task Details at the end +/// ## Compact Summary (default) +/// - Single task + not cache hit → no summary at all +/// - Single task + cache hit → thin line + "[vp run] cache hit, {duration} saved." +/// - Multi-task → thin line + one-liner with stats /// -/// ## Simplified Summary for Single Tasks -/// - When a single task with display info is executed: -/// - Skips full summary (no Statistics/Task Details sections) -/// - Shows only cache status inline -/// - Results in clean output showing just the command's stdout/stderr +/// ## Full Summary (`--details`) +/// - Shows full Statistics, Performance, and Task Details sections pub struct LabeledReporterBuilder { workspace_path: Arc, writer: Box, + /// Whether to render the full detailed summary (`--details` flag). + show_details: bool, + /// Path to write `last-summary.json`. `None` when persistence is not needed + /// (e.g., nested script execution). + summary_file_path: Option, } impl LabeledReporterBuilder { @@ -81,8 +81,15 @@ impl LabeledReporterBuilder { /// /// - `workspace_path`: The workspace root, used to compute relative cwds in display. /// - `writer`: Async writer for reporter display output. - pub fn new(workspace_path: Arc, writer: Box) -> Self { - Self { workspace_path, writer } + /// - `show_details`: Whether to render the full detailed summary. + /// - `summary_file_path`: Where to persist `last-summary.json`, or `None` to skip. + pub fn new( + workspace_path: Arc, + writer: Box, + show_details: bool, + summary_file_path: Option, + ) -> Self { + Self { workspace_path, writer, show_details, summary_file_path } } } @@ -96,6 +103,8 @@ impl GraphExecutionReporterBuilder for LabeledReporterBuilder { })), writer, workspace_path: self.workspace_path, + show_details: self.show_details, + summary_file_path: self.summary_file_path, }) } } @@ -108,6 +117,8 @@ pub struct LabeledGraphReporter { shared: Rc>, writer: Rc>>, workspace_path: Arc, + show_details: bool, + summary_file_path: Option, } #[async_trait::async_trait(?Send)] @@ -140,25 +151,22 @@ impl GraphExecutionReporter for LabeledGraphReporter { } async fn finish(self: Box) -> Result<(), ExitStatus> { - // Borrow shared state synchronously to build the summary buffer and compute + // Borrow shared state synchronously to build the summary and compute // the exit result. The borrow is dropped before any async writes. - let (summary_buf, result) = { + let (summary_buf, result, exit_code) = { let shared = self.shared.borrow(); - let summary_buf = - format_summary(&shared.executions, &shared.stats, &self.workspace_path); - - // Determine exit code based on failed tasks and infrastructure errors: - // - Infrastructure errors (cache lookup, spawn failure) have error_message set - // but no meaningful exit_status. - // - Process failures have a non-zero exit_status. - // - // Rules: - // 1. No failures at all → Ok(()) - // 2. Exactly one process failure, no infra errors → use that task's exit code - // 3. Any infra errors, or multiple failures → Err(1) - let has_infra_errors = - shared.executions.iter().any(|exec| exec.error_message.is_some()); + // Build LastRunSummary from execution data + let executions: Vec<_> = shared + .executions + .iter() + .map(|exec| { + (&exec.display, &exec.cache_status, exec.exit_status, exec.saved_error.as_ref()) + }) + .collect(); + + // Determine exit code (same logic as before) + let has_infra_errors = shared.executions.iter().any(|exec| exec.saved_error.is_some()); let failed_exit_codes: Vec = shared .executions @@ -170,8 +178,8 @@ impl GraphExecutionReporter for LabeledGraphReporter { let result = match (has_infra_errors, failed_exit_codes.as_slice()) { (false, []) => Ok(()), - (false, [code]) => { - // Return the single failed task's exit code (clamped to u8 range) + (false, [code]) => + { #[expect( clippy::cast_sign_loss, reason = "value is clamped to 1..=255, always positive" @@ -181,12 +189,36 @@ impl GraphExecutionReporter for LabeledGraphReporter { _ => Err(ExitStatus::FAILURE), }; - (summary_buf, result) + let exit_code = match &result { + Ok(()) => 0u8, + Err(status) => status.0, + }; + + // Build LastRunSummary from the execution data + let summary = + LastRunSummary::from_executions(&executions, &self.workspace_path, exit_code); + + // Render summary based on mode + let summary_buf = if self.show_details { + format_full_summary(&summary) + } else { + format_compact_summary(&summary) + }; + + // Save summary to file (best-effort, log failures) + if let Some(ref path) = self.summary_file_path + && let Err(err) = summary.write_atomic(path) + { + tracing::warn!("Failed to write summary to {:?}: {err}", path); + } + + (summary_buf, result, exit_code) }; // shared borrow dropped here + let _ = exit_code; // used only in the block above // Write the summary buffer asynchronously - { + if !summary_buf.is_empty() { let mut writer = self.writer.borrow_mut(); let _ = writer.write_all(&summary_buf).await; let _ = writer.flush().await; @@ -227,19 +259,12 @@ impl LeafExecutionReporter for LabeledLeafReporter { { let mut shared = self.shared.borrow_mut(); - // Update statistics based on cache status - match &cache_status { - CacheStatus::Hit { .. } => shared.stats.cache_hits += 1, - CacheStatus::Miss(_) => shared.stats.cache_misses += 1, - CacheStatus::Disabled(_) => shared.stats.cache_disabled += 1, - } - // Store execution info for the summary shared.executions.push(ExecutionInfo { display: self.display.clone(), cache_status, exit_status: None, - error_message: None, + saved_error: None, }); } // shared borrow dropped here @@ -268,26 +293,27 @@ impl LeafExecutionReporter for LabeledLeafReporter { _cache_update_status: CacheUpdateStatus, error: Option, ) { - // Format error message up front (before borrowing shared state) - let error_message: Option = + // Convert the execution error to its serializable form before borrowing shared state + let saved_error = error.as_ref().map(SavedExecutionError::from_execution_error); + let has_error = saved_error.is_some(); + + // Format the error message for display (using the original error with full anyhow chain) + let error_display: Option = error.map(|e| vite_str::format!("{:#}", anyhow::Error::from(e))); - let has_error = error_message.is_some(); // Update shared state synchronously, then drop the borrow before any async writes. { let mut shared = self.shared.borrow_mut(); // Handle errors — update execution info and stats. - // Error message is formatted using anyhow's `{:#}` formatter - // (joins cause chain with `: ` separators). - if let Some(ref message) = error_message { + if saved_error.is_some() { // Update the execution info if start() was called (an entry was pushed). // Without the `self.started` guard, `last_mut()` would return a - // *different* execution's entry, corrupting its error_message. + // *different* execution's entry, corrupting its error. if self.started && let Some(exec) = shared.executions.last_mut() { - exec.error_message = Some(message.clone()); + exec.saved_error = saved_error; } shared.stats.failed += 1; @@ -311,7 +337,7 @@ impl LeafExecutionReporter for LabeledLeafReporter { // Build all display output into a buffer (sync), then write once asynchronously. let mut buf = Vec::new(); - if let Some(ref message) = error_message { + if let Some(ref message) = error_display { buf.extend_from_slice(format_error_message(message).as_bytes()); } @@ -330,225 +356,6 @@ impl LeafExecutionReporter for LabeledLeafReporter { } } -// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -// Summary printing -// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -/// Format the full execution summary into a byte buffer. -/// -/// Called by [`LabeledGraphReporter::finish`] after all tasks have executed. -/// The caller writes the returned buffer to the async writer. -/// -/// Building the summary synchronously into a `Vec` buffer avoids holding -/// `RefCell` borrows across async write points, and ensures atomic output. -#[expect( - clippy::too_many_lines, - reason = "summary formatting is inherently verbose with many write calls" -)] -fn format_summary( - executions: &[ExecutionInfo], - stats: &ExecutionStats, - workspace_path: &AbsolutePath, -) -> Vec { - use std::io::Write; - let mut buf = Vec::new(); - - let total = executions.len(); - let cache_hits = stats.cache_hits; - let cache_misses = stats.cache_misses; - let cache_disabled = stats.cache_disabled; - let failed = stats.failed; - - // Print summary header with decorative line - // Note: leaf finish already adds a trailing newline after each task's output - // Add an extra blank line before the summary for visual separation - let _ = writeln!(buf); - let _ = writeln!( - buf, - "{}", - "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) - ); - let _ = writeln!( - buf, - "{}", - " Vite+ Task Runner • Execution Summary".style(Style::new().bold().bright_white()) - ); - let _ = writeln!( - buf, - "{}", - "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) - ); - let _ = writeln!(buf); - - // Print statistics - let cache_disabled_str = if cache_disabled > 0 { - Str::from( - vite_str::format!("• {cache_disabled} cache disabled") - .style(Style::new().bright_black()) - .to_string(), - ) - } else { - Str::default() - }; - - let failed_str = if failed > 0 { - Str::from(vite_str::format!("• {failed} failed").style(Style::new().red()).to_string()) - } else { - Str::default() - }; - - // Build statistics line, only including non-empty parts - let _ = write!( - buf, - "{} {} {} {}", - "Statistics:".style(Style::new().bold()), - vite_str::format!(" {total} tasks").style(Style::new().bright_white()), - vite_str::format!("• {cache_hits} cache hits").style(Style::new().green()), - vite_str::format!("• {cache_misses} cache misses").style(CACHE_MISS_STYLE), - ); - if !cache_disabled_str.is_empty() { - let _ = write!(buf, " {cache_disabled_str}"); - } - if !failed_str.is_empty() { - let _ = write!(buf, " {failed_str}"); - } - let _ = writeln!(buf); - - // Calculate cache hit rate - let cache_rate = if total > 0 { - #[expect( - clippy::cast_possible_truncation, - reason = "percentage is always 0..=100, fits in u32" - )] - #[expect(clippy::cast_sign_loss, reason = "percentage is always non-negative")] - #[expect( - clippy::cast_precision_loss, - reason = "acceptable precision loss for display percentage" - )] - { - (f64::from(cache_hits as u32) / total as f64 * 100.0) as u32 - } - } else { - 0 - }; - - // Calculate total time saved from cache hits - let total_saved: Duration = executions - .iter() - .filter_map(|exec| { - if let CacheStatus::Hit { replayed_duration } = &exec.cache_status { - Some(*replayed_duration) - } else { - None - } - }) - .sum(); - - let _ = write!( - buf, - "{} {} cache hit rate", - "Performance:".style(Style::new().bold()), - format_args!("{cache_rate}%").style(if cache_rate >= 75 { - Style::new().green().bold() - } else if cache_rate >= 50 { - CACHE_MISS_STYLE - } else { - Style::new().red() - }) - ); - - if total_saved > Duration::ZERO { - let _ = - write!(buf, ", {:.2?} saved in total", total_saved.style(Style::new().green().bold())); - } - let _ = writeln!(buf); - let _ = writeln!(buf); - - // Detailed task results - let _ = writeln!(buf, "{}", "Task Details:".style(Style::new().bold())); - let _ = writeln!( - buf, - "{}", - "────────────────────────────────────────────────".style(Style::new().bright_black()) - ); - - for (idx, exec) in executions.iter().enumerate() { - let display = &exec.display; - - let task_display = &display.task_display; - - // Task name and index - let _ = write!( - buf, - " {} {}", - vite_str::format!("[{}]", idx + 1).style(Style::new().bright_black()), - task_display.to_string().style(Style::new().bright_white().bold()) - ); - - // Command with cwd prefix - let command_display = format_command_display(display, workspace_path); - let _ = write!(buf, ": {}", command_display.style(COMMAND_STYLE)); - - // Execution result icon - // None means success (cache hit or in-process), Some checks actual status - match &exec.exit_status { - None => { - let _ = write!(buf, " {}", "✓".style(Style::new().green().bold())); - } - Some(exit_status) if exit_status.success() => { - let _ = write!(buf, " {}", "✓".style(Style::new().green().bold())); - } - Some(exit_status) => { - let code = exit_status_to_code(*exit_status); - let _ = write!( - buf, - " {} {}", - "✗".style(Style::new().red().bold()), - vite_str::format!("(exit code: {code})").style(Style::new().red()) - ); - } - } - let _ = writeln!(buf); - - // Cache status details — use display module for plain text, apply styling here - let cache_summary = format_cache_status_summary(&exec.cache_status); - let styled_summary = match &exec.cache_status { - CacheStatus::Hit { .. } => cache_summary.style(Style::new().green()), - CacheStatus::Miss(_) => cache_summary.style(CACHE_MISS_STYLE), - CacheStatus::Disabled(_) => cache_summary.style(Style::new().bright_black()), - }; - let _ = writeln!(buf, " {styled_summary}"); - - // Error message if present - if let Some(ref error_msg) = exec.error_message { - let _ = writeln!( - buf, - " {} {}", - "✗ Error:".style(Style::new().red().bold()), - error_msg.style(Style::new().red()) - ); - } - - // Add spacing between tasks except for the last one - if idx < executions.len() - 1 { - let _ = writeln!( - buf, - " {}", - "·······················································" - .style(Style::new().bright_black()) - ); - } - } - - let _ = writeln!( - buf, - "{}", - "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) - ); - - buf -} - #[cfg(test)] mod tests { use vite_task_plan::ExecutionItemKind; @@ -576,8 +383,12 @@ mod tests { leaf_kind: &LeafExecutionKind, all_ancestors_single_node: bool, ) -> Box { - let builder = - Box::new(LabeledReporterBuilder::new(test_path(), Box::new(tokio::io::sink()))); + let builder = Box::new(LabeledReporterBuilder::new( + test_path(), + Box::new(tokio::io::sink()), + false, + None, + )); let mut reporter = builder.build(); reporter.new_leaf_execution(display, leaf_kind, all_ancestors_single_node) } diff --git a/crates/vite_task/src/session/reporter/mod.rs b/crates/vite_task/src/session/reporter/mod.rs index 7c8d2974..58c4ed63 100644 --- a/crates/vite_task/src/session/reporter/mod.rs +++ b/crates/vite_task/src/session/reporter/mod.rs @@ -22,6 +22,7 @@ mod labeled; mod plain; +pub mod summary; // Re-export the concrete implementations so callers can use `reporter::PlainReporter` // and `reporter::LabeledReporterBuilder` without navigating into child modules. diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs new file mode 100644 index 00000000..122c5cc3 --- /dev/null +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -0,0 +1,761 @@ +//! Structured summary types for persisting and rendering execution results. +//! +//! The [`LastRunSummary`] is built after every graph execution and: +//! 1. Saved atomically to `cache_path/last-summary.json` for `vp run --last-details`. +//! 2. Rendered immediately — either as a compact one-liner or a full detailed summary. +//! +//! Both the live reporter and the `--last-details` display use the same rendering +//! functions, ensuring consistent output. + +use std::{io::Write, num::NonZeroI32, time::Duration}; + +use owo_colors::Style; +use serde::{Deserialize, Serialize}; +use vite_path::AbsolutePath; +use vite_str::Str; +use vite_task_plan::ExecutionItemDisplay; + +use super::{CACHE_MISS_STYLE, COMMAND_STYLE, ColorizeExt}; +use crate::session::{ + cache::{ + CacheMiss, FingerprintMismatch, SpawnFingerprintChange, detect_spawn_fingerprint_changes, + format_spawn_change, + }, + event::{CacheDisabledReason, CacheErrorKind, CacheStatus, ExecutionError}, +}; + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Structured types (Serialize + Deserialize for JSON persistence) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +/// Saved summary of a task runner execution. +/// +/// Persisted as `last-summary.json` in the cache directory. +#[derive(Serialize, Deserialize)] +pub struct LastRunSummary { + pub tasks: Vec, + pub exit_code: u8, +} + +/// Summary for a single task execution. +/// +/// All fields are structured data — no pre-formatted display strings. +/// Formatting (including color decisions) happens at render time. +#[derive(Serialize, Deserialize)] +pub struct TaskSummary { + pub package_name: Str, + pub task_name: Str, + /// Raw command text (e.g., "vitest run"). + pub command: Str, + /// Working directory relative to workspace root (e.g., "packages/lib"). + /// Empty string when the cwd is the workspace root. + pub cwd: Str, + /// Combined cache status and execution outcome. + pub result: TaskResult, +} + +/// The complete result of a task execution. +/// +/// Encodes both the cache status and execution outcome in a single enum, +/// making invalid combinations unrepresentable. +#[derive(Serialize, Deserialize)] +pub enum TaskResult { + /// Cache hit — output was replayed from cache. Always successful. + CacheHit { saved_duration_ms: u64 }, + + /// In-process execution (built-in command like echo). Always successful. + InProcess, + + /// A process was spawned. + Spawned { + /// Why the process was spawned (cache miss or cache disabled). + cache_status: SpawnedCacheStatus, + outcome: SpawnOutcome, + }, +} + +/// Cache status for tasks that required spawning a process. +/// +/// Only two cache statuses lead to spawning: +/// - `Miss`: cache lookup found no match or a mismatch. +/// - `Disabled`: no cache configuration for this task. +/// +/// `Hit` and `InProcessExecution` are handled by [`TaskResult::CacheHit`] +/// and [`TaskResult::InProcess`] respectively. +#[derive(Serialize, Deserialize)] +pub enum SpawnedCacheStatus { + Miss(SavedCacheMissReason), + /// No cache configuration for this task. + Disabled, +} + +/// Outcome of a spawned process. +#[derive(Serialize, Deserialize)] +pub enum SpawnOutcome { + /// Process exited successfully (exit code 0). + /// May have a post-execution infrastructure error (cache update or fingerprint failed). + /// These only run after exit 0, so this field only exists on the success path. + Success { infra_error: Option }, + + /// Process exited with non-zero status. + /// [`NonZeroI32`] enforces that exit code 0 is unrepresentable here. + /// No `infra_error` field: cache operations are skipped on non-zero exit. + Failed { exit_code: NonZeroI32 }, + + /// Could not start the process (e.g., command not found). + SpawnError(SavedExecutionError), +} + +/// Why a cache miss occurred. +#[derive(Serialize, Deserialize)] +pub enum SavedCacheMissReason { + /// No previous cache entry for this task. + NotFound, + /// Spawn fingerprint changed (command, envs, cwd, etc.). + SpawnFingerprintChanged(Vec), + /// Content of an input file changed. + InputContentChanged { path: Str }, +} + +/// An execution error, serializable for persistence. +/// +/// The `message` field contains the raw inner error text (from `anyhow::Error`). +/// The error prefix (e.g., "Cache update failed") is derived from the variant +/// at render time. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum SavedExecutionError { + Cache { kind: SavedCacheErrorKind, message: Str }, + Spawn { message: Str }, + PostRunFingerprint { message: Str }, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum SavedCacheErrorKind { + Lookup, + Update, +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Computed stats (derived from tasks, not persisted) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +struct SummaryStats { + total: usize, + cache_hits: usize, + cache_misses: usize, + cache_disabled: usize, + failed: usize, + total_saved: Duration, +} + +impl SummaryStats { + fn compute(tasks: &[TaskSummary]) -> Self { + let mut stats = Self { + total: tasks.len(), + cache_hits: 0, + cache_misses: 0, + cache_disabled: 0, + failed: 0, + total_saved: Duration::ZERO, + }; + + for task in tasks { + match &task.result { + TaskResult::CacheHit { saved_duration_ms } => { + stats.cache_hits += 1; + stats.total_saved += Duration::from_millis(*saved_duration_ms); + } + TaskResult::InProcess => { + stats.cache_disabled += 1; + } + TaskResult::Spawned { cache_status, outcome } => { + match cache_status { + SpawnedCacheStatus::Miss(_) => stats.cache_misses += 1, + SpawnedCacheStatus::Disabled => stats.cache_disabled += 1, + } + match outcome { + SpawnOutcome::Success { infra_error: Some(_) } + | SpawnOutcome::Failed { .. } + | SpawnOutcome::SpawnError(_) => stats.failed += 1, + SpawnOutcome::Success { infra_error: None } => {} + } + } + } + } + + stats + } +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Conversion from live execution data +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +impl SavedExecutionError { + /// Convert a live [`ExecutionError`] into a serializable error. + pub fn from_execution_error(error: &ExecutionError) -> Self { + match error { + ExecutionError::Cache { kind, source } => Self::Cache { + kind: match kind { + CacheErrorKind::Lookup => SavedCacheErrorKind::Lookup, + CacheErrorKind::Update => SavedCacheErrorKind::Update, + }, + message: vite_str::format!("{source:#}"), + }, + ExecutionError::Spawn(source) => { + Self::Spawn { message: vite_str::format!("{source:#}") } + } + ExecutionError::PostRunFingerprint(source) => { + Self::PostRunFingerprint { message: vite_str::format!("{source:#}") } + } + } + } + + /// Format the full error message for display. + fn display_message(&self) -> Str { + match self { + Self::Cache { kind, message } => { + let kind_str = match kind { + SavedCacheErrorKind::Lookup => "lookup", + SavedCacheErrorKind::Update => "update", + }; + vite_str::format!("Cache {kind_str} failed: {message}") + } + Self::Spawn { message } => { + vite_str::format!("Failed to spawn process: {message}") + } + Self::PostRunFingerprint { message } => { + vite_str::format!("Failed to create post-run fingerprint: {message}") + } + } + } +} + +impl SavedCacheMissReason { + fn from_cache_miss(cache_miss: &CacheMiss) -> Self { + match cache_miss { + CacheMiss::NotFound => Self::NotFound, + CacheMiss::FingerprintMismatch(mismatch) => match mismatch { + FingerprintMismatch::SpawnFingerprintMismatch { old, new } => { + Self::SpawnFingerprintChanged(detect_spawn_fingerprint_changes(old, new)) + } + FingerprintMismatch::PostRunFingerprintMismatch(diff) => { + use crate::session::execute::fingerprint::PostRunFingerprintMismatch; + match diff { + PostRunFingerprintMismatch::InputContentChanged { path } => { + Self::InputContentChanged { path: Str::from(path.as_str()) } + } + } + } + }, + } + } +} + +impl TaskResult { + /// Build a [`TaskResult`] from live execution data. + /// + /// `cache_status`: the cache status determined at `start()` time. + /// `exit_status`: the process exit status, or `None` for cache hit / in-process. + /// `saved_error`: an optional pre-converted execution error. + pub fn from_execution( + cache_status: &CacheStatus, + exit_status: Option, + saved_error: Option<&SavedExecutionError>, + ) -> Self { + match cache_status { + CacheStatus::Hit { replayed_duration } => { + Self::CacheHit { saved_duration_ms: duration_to_ms(*replayed_duration) } + } + CacheStatus::Disabled(CacheDisabledReason::InProcessExecution) => Self::InProcess, + CacheStatus::Disabled(CacheDisabledReason::NoCacheMetadata) => Self::Spawned { + cache_status: SpawnedCacheStatus::Disabled, + outcome: spawn_outcome_from_execution(exit_status, saved_error), + }, + CacheStatus::Miss(cache_miss) => Self::Spawned { + cache_status: SpawnedCacheStatus::Miss(SavedCacheMissReason::from_cache_miss( + cache_miss, + )), + outcome: spawn_outcome_from_execution(exit_status, saved_error), + }, + } + } +} + +/// Build a [`SpawnOutcome`] from process exit status and optional pre-converted error. +fn spawn_outcome_from_execution( + exit_status: Option, + saved_error: Option<&SavedExecutionError>, +) -> SpawnOutcome { + match (exit_status, saved_error) { + // Spawn error — process never ran + (None, Some(err)) => SpawnOutcome::SpawnError(err.clone()), + // Process exited successfully, possible infra error + (Some(status), _) if status.success() => { + SpawnOutcome::Success { infra_error: saved_error.cloned() } + } + // Process exited with non-zero code + (Some(status), _) => { + let code = crate::session::event::exit_status_to_code(status); + SpawnOutcome::Failed { + // exit_status_to_code returns 1..=255 for failed processes (see its + // implementation: always positive, non-zero for non-success status). + // NonZeroI32::new returns None only for 0, which cannot happen here. + exit_code: NonZeroI32::new(code).unwrap_or(NonZeroI32::MIN), + } + } + // No exit status, no error — this is the cache hit / in-process path, + // handled by TaskResult::CacheHit / InProcess before reaching here. + // If we somehow get here, treat as success. + (None, None) => SpawnOutcome::Success { infra_error: None }, + } +} + +#[expect( + clippy::cast_possible_truncation, + reason = "value is clamped to u64::MAX before casting, so no data loss" +)] +fn duration_to_ms(d: Duration) -> u64 { + d.as_millis().min(u128::from(u64::MAX)) as u64 +} + +impl LastRunSummary { + /// Build a summary from the reporter's collected execution data. + /// + /// Each element contains references to the display info, cache status, exit status, + /// and an optional pre-converted execution error. + /// `workspace_path` is used to compute relative cwds. + /// `exit_code` is the overall exit code for the run. + pub fn from_executions( + executions: &[( + &ExecutionItemDisplay, + &CacheStatus, + Option, + Option<&SavedExecutionError>, + )], + workspace_path: &AbsolutePath, + exit_code: u8, + ) -> Self { + let tasks = executions + .iter() + .map(|(display, cache_status, exit_status, saved_error)| { + let cwd_relative = if let Ok(Some(rel)) = display.cwd.strip_prefix(workspace_path) { + Str::from(rel.as_str()) + } else { + Str::default() + }; + + TaskSummary { + package_name: display.task_display.package_name.clone(), + task_name: display.task_display.task_name.clone(), + command: display.command.clone(), + cwd: cwd_relative, + result: TaskResult::from_execution(cache_status, *exit_status, *saved_error), + } + }) + .collect(); + + Self { tasks, exit_code } + } + + // ── Persistence ────────────────────────────────────────────────────── + + /// Write the summary as JSON atomically (write to `.tmp`, then rename). + /// + /// Errors are returned to the caller (the reporter logs them without propagating). + #[expect( + clippy::disallowed_types, + reason = "PathBuf is needed to construct a temporary path by appending .tmp suffix; \ + AbsolutePathBuf cannot be constructed without validation" + )] + pub fn write_atomic(&self, path: &AbsolutePath) -> std::io::Result<()> { + let json = serde_json::to_vec(self).map_err(std::io::Error::other)?; + + let mut tmp_os = path.as_path().as_os_str().to_owned(); + tmp_os.push(".tmp"); + let tmp_path = std::path::PathBuf::from(tmp_os); + std::fs::write(&tmp_path, &json)?; + std::fs::rename(&tmp_path, path)?; + Ok(()) + } + + /// Read a summary from a JSON file. + /// + /// Returns `Ok(None)` if the file does not exist. + /// Returns `Err` on parse or IO errors (caller provides version mismatch message). + pub fn read_from_path(path: &AbsolutePath) -> Result, ReadSummaryError> { + let bytes = match std::fs::read(path) { + Ok(bytes) => bytes, + Err(err) if err.kind() == std::io::ErrorKind::NotFound => return Ok(None), + Err(err) => return Err(ReadSummaryError::Io(err)), + }; + let summary = + serde_json::from_slice(&bytes).map_err(|_| ReadSummaryError::IncompatibleVersion)?; + Ok(Some(summary)) + } +} + +/// Error type for [`LastRunSummary::read_from_path`]. +pub enum ReadSummaryError { + Io(std::io::Error), + /// The JSON could not be parsed — likely saved by a different version. + IncompatibleVersion, +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Display helpers for TaskResult +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +impl TaskSummary { + /// Format the task display name (e.g., "package#task" or "task"). + fn format_task_display(&self) -> Str { + if self.package_name.is_empty() { + self.task_name.clone() + } else { + vite_str::format!("{}#{}", self.package_name, self.task_name) + } + } + + /// Format the command with cwd prefix (e.g., "~/packages/lib$ vitest run"). + fn format_command_display(&self) -> Str { + if self.cwd.is_empty() { + vite_str::format!("$ {}", self.command) + } else { + vite_str::format!("~/{cwd}$ {cmd}", cwd = self.cwd, cmd = self.command) + } + } +} + +impl TaskResult { + /// Whether this task succeeded (used for exit icon rendering). + const fn is_success(&self) -> bool { + match self { + Self::CacheHit { .. } | Self::InProcess => true, + Self::Spawned { outcome, .. } => matches!(outcome, SpawnOutcome::Success { .. }), + } + } + + /// Format the cache status detail line for the full summary. + /// + /// Examples: + /// - "→ Cache hit - output replayed - 102.96ms saved" + /// - "→ Cache miss: no previous cache entry found" + /// - "→ Cache disabled in task configuration" + fn format_cache_detail(&self) -> Str { + match self { + Self::CacheHit { saved_duration_ms } => { + let d = Duration::from_millis(*saved_duration_ms); + vite_str::format!("→ Cache hit - output replayed - {d:.2?} saved") + } + Self::InProcess => Str::from("→ Cache disabled for built-in command"), + Self::Spawned { cache_status, .. } => match cache_status { + SpawnedCacheStatus::Disabled => Str::from("→ Cache disabled in task configuration"), + SpawnedCacheStatus::Miss(reason) => match reason { + SavedCacheMissReason::NotFound => { + Str::from("→ Cache miss: no previous cache entry found") + } + SavedCacheMissReason::SpawnFingerprintChanged(changes) => { + let formatted: Vec = changes.iter().map(format_spawn_change).collect(); + if formatted.is_empty() { + Str::from("→ Cache miss: configuration changed") + } else { + let joined = + formatted.iter().map(Str::as_str).collect::>().join("; "); + vite_str::format!("→ Cache miss: {joined}") + } + } + SavedCacheMissReason::InputContentChanged { path } => { + vite_str::format!("→ Cache miss: content of input '{path}' changed") + } + }, + }, + } + } + + /// The [`Style`] for the cache detail line. + const fn cache_detail_style(&self) -> Style { + match self { + Self::CacheHit { .. } => Style::new().green(), + Self::InProcess => Style::new().bright_black(), + Self::Spawned { cache_status: SpawnedCacheStatus::Disabled, .. } => { + Style::new().bright_black() + } + Self::Spawned { cache_status: SpawnedCacheStatus::Miss(_), .. } => CACHE_MISS_STYLE, + } + } + + /// Optional error associated with this result. + const fn error(&self) -> Option<&SavedExecutionError> { + match self { + Self::CacheHit { .. } | Self::InProcess => None, + Self::Spawned { outcome, .. } => match outcome { + SpawnOutcome::Success { infra_error } => infra_error.as_ref(), + SpawnOutcome::Failed { .. } => None, + SpawnOutcome::SpawnError(err) => Some(err), + }, + } + } +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Full summary rendering (--details and --last-details) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +/// Render the full detailed execution summary. +/// +/// Used by both `--details` (live) and `--last-details` (from file). +#[expect( + clippy::too_many_lines, + reason = "summary formatting is inherently verbose with many write calls" +)] +pub fn format_full_summary(summary: &LastRunSummary) -> Vec { + let mut buf = Vec::new(); + + let stats = SummaryStats::compute(&summary.tasks); + + // Header + let _ = writeln!(buf); + let _ = writeln!( + buf, + "{}", + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) + ); + let _ = writeln!( + buf, + "{}", + " Vite+ Task Runner • Execution Summary".style(Style::new().bold().bright_white()) + ); + let _ = writeln!( + buf, + "{}", + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) + ); + let _ = writeln!(buf); + + // Statistics line + let cache_disabled_str = if stats.cache_disabled > 0 { + let n = stats.cache_disabled; + Str::from( + vite_str::format!("• {n} cache disabled") + .style(Style::new().bright_black()) + .to_string(), + ) + } else { + Str::default() + }; + + let failed_str = if stats.failed > 0 { + let n = stats.failed; + Str::from(vite_str::format!("• {n} failed").style(Style::new().red()).to_string()) + } else { + Str::default() + }; + + let total = stats.total; + let cache_hits = stats.cache_hits; + let cache_misses = stats.cache_misses; + let _ = write!( + buf, + "{} {} {} {}", + "Statistics:".style(Style::new().bold()), + vite_str::format!(" {total} tasks").style(Style::new().bright_white()), + vite_str::format!("• {cache_hits} cache hits").style(Style::new().green()), + vite_str::format!("• {cache_misses} cache misses").style(CACHE_MISS_STYLE), + ); + if !cache_disabled_str.is_empty() { + let _ = write!(buf, " {cache_disabled_str}"); + } + if !failed_str.is_empty() { + let _ = write!(buf, " {failed_str}"); + } + let _ = writeln!(buf); + + // Performance line + #[expect( + clippy::cast_possible_truncation, + reason = "percentage is always 0..=100, fits in u32" + )] + #[expect(clippy::cast_sign_loss, reason = "percentage is always non-negative")] + #[expect( + clippy::cast_precision_loss, + reason = "acceptable precision loss for display percentage" + )] + let cache_rate = if total > 0 { (cache_hits as f64 / total as f64 * 100.0) as u32 } else { 0 }; + + let _ = write!( + buf, + "{} {} cache hit rate", + "Performance:".style(Style::new().bold()), + format_args!("{cache_rate}%").style(if cache_rate >= 75 { + Style::new().green().bold() + } else if cache_rate >= 50 { + CACHE_MISS_STYLE + } else { + Style::new().red() + }) + ); + + if stats.total_saved > Duration::ZERO { + let _ = write!( + buf, + ", {:.2?} saved in total", + stats.total_saved.style(Style::new().green().bold()) + ); + } + let _ = writeln!(buf); + let _ = writeln!(buf); + + // Task Details + let _ = writeln!(buf, "{}", "Task Details:".style(Style::new().bold())); + let _ = writeln!( + buf, + "{}", + "────────────────────────────────────────────────".style(Style::new().bright_black()) + ); + + for (idx, task) in summary.tasks.iter().enumerate() { + // Task index and name + let _ = write!( + buf, + " {} {}", + vite_str::format!("[{}]", idx + 1).style(Style::new().bright_black()), + task.format_task_display().to_string().style(Style::new().bright_white().bold()) + ); + + // Command with cwd prefix + let _ = write!(buf, ": {}", task.format_command_display().style(COMMAND_STYLE)); + + // Exit icon + if task.result.is_success() { + let _ = write!(buf, " {}", "✓".style(Style::new().green().bold())); + } else if let TaskResult::Spawned { outcome: SpawnOutcome::Failed { exit_code }, .. } = + &task.result + { + let code = exit_code.get(); + let _ = write!( + buf, + " {} {}", + "✗".style(Style::new().red().bold()), + vite_str::format!("(exit code: {code})").style(Style::new().red()) + ); + } + let _ = writeln!(buf); + + // Cache status detail + let cache_detail = task.result.format_cache_detail(); + let _ = writeln!(buf, " {}", cache_detail.style(task.result.cache_detail_style())); + + // Error message if present + if let Some(err) = task.result.error() { + let msg = err.display_message(); + let _ = writeln!( + buf, + " {} {}", + "✗ Error:".style(Style::new().red().bold()), + msg.style(Style::new().red()) + ); + } + + // Separator between tasks (except last) + if idx < summary.tasks.len() - 1 { + let _ = writeln!( + buf, + " {}", + "·······················································" + .style(Style::new().bright_black()) + ); + } + } + + let _ = writeln!( + buf, + "{}", + "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━".style(Style::new().bright_black()) + ); + + buf +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Compact summary rendering (default mode) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +/// Render a compact summary (one-liner or empty). +/// +/// Rules: +/// - Single task + not cache hit → empty (no summary at all) +/// - Single task + cache hit → thin line + "[vp run] cache hit, {duration} saved." +/// - Multi-task → thin line + "[vp run] {hits}/{total} cache hit ({rate}%), {duration} saved." +/// with optional failure count and `--details` hint. +pub fn format_compact_summary(summary: &LastRunSummary) -> Vec { + let stats = SummaryStats::compute(&summary.tasks); + + let is_single_task = summary.tasks.len() == 1; + + // Single task + not cache hit → no summary + if is_single_task && stats.cache_hits == 0 { + return Vec::new(); + } + + let mut buf = Vec::new(); + + // Thin line separator + let _ = writeln!( + buf, + "{}", + "────────────────────────────────────────────────".style(Style::new().bright_black()) + ); + + if is_single_task { + // Single task cache hit + let _ = writeln!( + buf, + "{} cache hit, {:.2?} saved.", + "[vp run]".style(Style::new().bright_black()), + stats.total_saved.style(Style::new().green().bold()), + ); + } else { + // Multi-task + let total = stats.total; + let hits = stats.cache_hits; + + #[expect( + clippy::cast_possible_truncation, + reason = "percentage is always 0..=100, fits in u32" + )] + #[expect(clippy::cast_sign_loss, reason = "percentage is always non-negative")] + #[expect( + clippy::cast_precision_loss, + reason = "acceptable precision loss for display percentage" + )] + let rate = if total > 0 { (hits as f64 / total as f64 * 100.0) as u32 } else { 0 }; + + let _ = write!( + buf, + "{} {hits}/{total} cache hit ({rate}%)", + "[vp run]".style(Style::new().bright_black()), + ); + + if stats.total_saved > Duration::ZERO { + let _ = write!( + buf, + ", {:.2?} saved", + stats.total_saved.style(Style::new().green().bold()), + ); + } + + if stats.failed > 0 { + let n = stats.failed; + let _ = write!(buf, ", {} failed", n.style(Style::new().red())); + } + + let _ = write!( + buf, + ". {}", + "(Run `vp run --details` for full details)".style(Style::new().bright_black()), + ); + let _ = writeln!(buf); + } + + buf +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index a7e54885..9336147e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "associate existing cache" steps = [ - "vp run script1 # cache miss", - "vp run script2 # cache hit, same command as script1", + "vp run --details script1 # cache miss", + "vp run --details script2 # cache hit, same command as script1", "json-edit package.json '_.scripts.script2 = \"print world\"' # change script2", - "vp run script2 # cache miss", + "vp run --details script2 # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index 5e27e637..53744713 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run script1 # cache miss +> vp run --details script1 # cache miss $ print hello hello @@ -19,7 +19,7 @@ Task Details: [1] script1: $ print hello ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run script2 # cache hit, same command as script1 +> vp run --details script2 # cache hit, same command as script1 $ print hello ✓ cache hit, replaying hello @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.script2 = "print world"' # change script2 -> vp run script2 # cache miss +> vp run --details script2 # cache miss $ print world ✗ cache miss: args changed, executing world diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index 44289fd4..fd4941f7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "builtin different cwd" steps = [ - "cd folder1 && vp run lint # cache miss in folder1", - "cd folder2 && vp run lint # cache miss in folder2", + "cd folder1 && vp run --details lint # cache miss in folder1", + "cd folder2 && vp run --details lint # cache miss in folder2", "echo 'console.log(1);' > folder2/a.js # modify folder2", - "cd folder1 && vp run lint # cache hit", - "cd folder2 && vp run lint # cache miss", + "cd folder1 && vp run --details lint # cache hit", + "cd folder2 && vp run --details lint # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index a07da593..c2f69a7f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cd folder1 && vp run lint # cache miss in folder1 +> cd folder1 && vp run --details lint # cache miss in folder1 $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -35,8 +35,8 @@ Task Details: [1] lint: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run lint # cache miss in folder2 -$ vp lint ✓ cache hit, replaying +> cd folder2 && vp run --details lint # cache miss in folder2 +$ vp lint ✗ cache miss: content of input 'node_modules/.vite/task-cache' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -60,17 +60,17 @@ Finished in on 2 files with 90 rules using threads. Vite+ Task Runner • Execution Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total +Statistics: 1 tasks • 0 cache hits • 1 cache misses +Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── [1] lint: $ vp lint ✓ - → Cache hit - output replayed - saved + → Cache miss: content of input 'node_modules/.vite/task-cache' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo 'console.log(1);' > folder2/a.js # modify folder2 -> cd folder1 && vp run lint # cache hit +> cd folder1 && vp run --details lint # cache hit $ vp lint ✗ cache miss: content of input 'folder2/a.js' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -96,7 +96,7 @@ Task Details: [1] lint: $ vp lint ✓ → Cache miss: content of input 'folder2/a.js' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run lint # cache miss +> cd folder2 && vp run --details lint # cache miss $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml index 821b270b..168e0460 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml @@ -1,6 +1,6 @@ [[e2e]] name = "builtin command with non-zero exit does not show cache not updated" steps = [ - "vp run lint -- -D no-debugger", - "vp run lint -- -D no-debugger", + "vp run --details lint -- -D no-debugger", + "vp run --details lint -- -D no-debugger", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap index 90d7981c..b1b511f3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run lint -- -D no-debugger +[1]> vp run --details lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed @@ -28,7 +28,7 @@ Task Details: [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -[1]> vp run lint -- -D no-debugger +[1]> vp run --details lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml index b79bd5cb..ea8c8f83 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml @@ -3,13 +3,13 @@ [[e2e]] name = "task with cache disabled" steps = [ - "vp run no-cache-task # cache miss", - "vp run no-cache-task # cache disabled, runs again", + "vp run --details no-cache-task # cache miss", + "vp run --details no-cache-task # cache disabled, runs again", ] [[e2e]] name = "task with cache enabled" steps = [ - "vp run cached-task # cache miss", - "vp run cached-task # cache hit", + "vp run --details cached-task # cache miss", + "vp run --details cached-task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index b3062dc5..3963803e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run no-cache-task # cache miss +> vp run --details no-cache-task # cache miss $ print-file test.txt ⊘ cache disabled: no cache config test content @@ -19,7 +19,7 @@ Task Details: [1] cache-disabled-test#no-cache-task: $ print-file test.txt ✓ → Cache disabled in task configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run no-cache-task # cache disabled, runs again +> vp run --details no-cache-task # cache disabled, runs again $ print-file test.txt ⊘ cache disabled: no cache config test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index 4bc07bee..0669e34f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run cached-task # cache miss +> vp run --details cached-task # cache miss $ print-file test.txt test content @@ -19,7 +19,7 @@ Task Details: [1] cache-disabled-test#cached-task: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run cached-task # cache hit +> vp run --details cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index a70a462b..918cc4ac 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "cache miss command change" steps = [ - "vp run task # cache miss", + "vp run --details task # cache miss", "json-edit package.json '_.scripts.task = \"print baz && print bar\"' # change first subtask", - "vp run task # first: cache miss, second: cache hit", + "vp run --details task # first: cache miss, second: cache hit", "json-edit package.json '_.scripts.task = \"print bar\"' # remove first subtask", - "vp run task # cache hit", + "vp run --details task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index 2459b8c0..c102fb55 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run task # cache miss +> vp run --details task # cache miss $ print foo foo @@ -27,7 +27,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask -> vp run task # first: cache miss, second: cache hit +> vp run --details task # first: cache miss, second: cache hit $ print baz ✗ cache miss: args changed, executing baz @@ -52,7 +52,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask -> vp run task # cache hit +> vp run --details task # cache hit $ print bar ✓ cache hit, replaying bar diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 150a6812..27446519 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,55 +3,55 @@ [[e2e]] name = "env value changed" steps = [ - "cross-env MY_ENV=1 vp run test # cache miss", - "cross-env MY_ENV=2 vp run test # cache miss: env value changed", + "cross-env MY_ENV=1 vp run --details test # cache miss", + "cross-env MY_ENV=2 vp run --details test # cache miss: env value changed", ] [[e2e]] name = "env added" steps = [ - "vp run test # cache miss", - "cross-env MY_ENV=1 vp run test # cache miss: env added", + "vp run --details test # cache miss", + "cross-env MY_ENV=1 vp run --details test # cache miss: env added", ] [[e2e]] name = "env removed" steps = [ - "cross-env MY_ENV=1 vp run test # cache miss", - "vp run test # cache miss: env removed", + "cross-env MY_ENV=1 vp run --details test # cache miss", + "vp run --details test # cache miss: env removed", ] [[e2e]] name = "pass-through env added" steps = [ - "vp run test # cache miss", + "vp run --details test # cache miss", "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # add pass-through env", - "vp run test # cache miss: pass-through env added", + "vp run --details test # cache miss: pass-through env added", ] [[e2e]] name = "pass-through env removed" steps = [ "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # setup", - "vp run test # cache miss", + "vp run --details test # cache miss", "json-edit vite-task.json \"delete _.tasks.test.passThroughEnvs\" # remove pass-through env", - "vp run test # cache miss: pass-through env removed", + "vp run --details test # cache miss: pass-through env removed", ] [[e2e]] name = "cwd changed" steps = [ - "vp run test # cache miss", + "vp run --details test # cache miss", "mkdir -p subfolder", "cp test.txt subfolder/test.txt", "json-edit vite-task.json \"_.tasks.test.cwd = 'subfolder'\" # change cwd", - "vp run test # cache miss: cwd changed", + "vp run --details test # cache miss: cwd changed", ] [[e2e]] name = "input content changed" steps = [ - "vp run test # cache miss", + "vp run --details test # cache miss", "replace-file-content test.txt initial modified # modify input", - "vp run test # cache miss: input changed", + "vp run --details test # cache miss: input changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 448a0b3b..5b87a38c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run test # cache miss +> vp run --details test # cache miss $ print-file test.txt initial content @@ -25,7 +25,7 @@ Task Details: > json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd -> vp run test # cache miss: cwd changed +> vp run --details test # cache miss: cwd changed ~/subfolder$ print-file test.txt ✗ cache miss: working directory changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap index 4414d10e..50b92902 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run test # cache miss +> vp run --details test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=1 vp run test # cache miss: env added +> cross-env MY_ENV=1 vp run --details test # cache miss: env added $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap index 50992adf..51e7c782 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run test # cache miss +> cross-env MY_ENV=1 vp run --details test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run test # cache miss: env removed +> vp run --details test # cache miss: env removed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap index 3197f138..0b06af0c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run test # cache miss +> cross-env MY_ENV=1 vp run --details test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=2 vp run test # cache miss: env value changed +> cross-env MY_ENV=2 vp run --details test # cache miss: env value changed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap index b7b5b628..4468f8a8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run test # cache miss +> vp run --details test # cache miss $ print-file test.txt initial content @@ -21,7 +21,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content test.txt initial modified # modify input -> vp run test # cache miss: input changed +> vp run --details test # cache miss: input changed $ print-file test.txt ✗ cache miss: content of input 'test.txt' changed, executing modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap index baeb9a19..e4f80a25 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run test # cache miss +> vp run --details test # cache miss $ print-file test.txt initial content @@ -21,7 +21,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # add pass-through env -> vp run test # cache miss: pass-through env added +> vp run --details test # cache miss: pass-through env added $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap index 5e112f0e..b91774a1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # setup -> vp run test # cache miss +> vp run --details test # cache miss $ print-file test.txt initial content @@ -23,7 +23,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "delete _.tasks.test.passThroughEnvs" # remove pass-through env -> vp run test # cache miss: pass-through env removed +> vp run --details test # cache miss: pass-through env removed $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml index 348802e4..dfc6c9ec 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml @@ -1,8 +1,8 @@ [[e2e]] name = "cache clean" steps = [ - "vp run cached-task # cache miss", - "vp run cached-task # cache hit", + "vp run --details cached-task # cache miss", + "vp run --details cached-task # cache hit", "vp cache clean", - "vp run cached-task # cache miss after clean", + "vp run --details cached-task # cache miss after clean", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index f6f36f8c..c0e67ea2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run cached-task # cache miss +> vp run --details cached-task # cache miss $ print-file test.txt test content @@ -19,7 +19,7 @@ Task Details: [1] @test/cache-subcommand#cached-task: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run cached-task # cache hit +> vp run --details cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp cache clean -> vp run cached-task # cache miss after clean +> vp run --details cached-task # cache miss after clean $ print-file test.txt test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap index e400fcc0..0049c549 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap @@ -4,33 +4,8 @@ expression: e2e_outputs --- > vp run read_colon_in_name # cache miss $ node read_node_fs.js - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] read_colon_in_name: $ node read_node_fs.js ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp run read_colon_in_name # cache hit $ node read_node_fs.js ✓ cache hit, replaying - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] read_colon_in_name: $ node read_node_fs.js ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap index 5b6128bb..7c284657 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap @@ -5,17 +5,3 @@ expression: e2e_outputs > vp run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value $ vp env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer test_value_from_synthesizer - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vp env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap index 5203f28f..75140305 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap @@ -5,34 +5,6 @@ expression: e2e_outputs > vp run env-test -- FOO bar # sets FOO=bar $ vp env-test FOO bar bar - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vp env-test FOO bar ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp run env-test -- BAZ qux # sets BAZ=qux $ vp env-test BAZ qux qux - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vp env-test BAZ qux ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.gitignore new file mode 100644 index 00000000..231280da --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.gitignore @@ -0,0 +1,7 @@ +# Prevent oxlint from scanning node_modules. +# Without this, oxlint reads files in node_modules/.vite/task-cache, causing +# fspy to fingerprint the cache directory as an input. The cache directory +# changes between runs (DB writes, last-summary.json), producing flaky +# cache-miss reasons that alternate between '' and +# 'node_modules/.vite/task-cache'. +node_modules diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml index 1117a3f1..a65372e5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "direct lint" steps = [ - "vp run lint # cache miss", + "vp run --details lint # cache miss", "echo debugger > main.js # add lint error", - "vp run lint # cache miss, lint fails", + "vp run --details lint # cache miss, lint fails", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index 8078ba98..191f60b8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run lint # cache miss +> vp run --details lint # cache miss $ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. @@ -22,7 +22,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo debugger > main.js # add lint error -> vp run lint # cache miss, lint fails +> vp run --details lint # cache miss, lint fails $ vp lint ✗ cache miss: content of input '' changed, executing ! eslint(no-debugger): `debugger` statement is not allowed diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap index eb4fade4..e72e9ea7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap @@ -6,17 +6,3 @@ expression: e2e_outputs $ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] @test/exec-api#lint-task: $ vp lint ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml index 5e7b5ccc..af28db2e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml @@ -3,11 +3,11 @@ [[e2e]] name = "single task failure returns task exit code" steps = [ - "vp run pkg-a#fail # exits with code 42", + "vp run --details pkg-a#fail # exits with code 42", ] [[e2e]] name = "multiple task failures returns exit code 1" steps = [ - "vp run -r fail # multiple failures -> exit code 1", + "vp run --details -r fail # multiple failures -> exit code 1", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index acff1d72..9a904ebf 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run -r fail # multiple failures -> exit code 1 +[1]> vp run --details -r fail # multiple failures -> exit code 1 ~/packages/pkg-a$ node -e "process.exit(42)" ~/packages/pkg-b$ node -e "process.exit(7)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap index 310238da..ee6373aa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[42]> vp run pkg-a#fail # exits with code 42 +[42]> vp run --details pkg-a#fail # exits with code 42 ~/packages/pkg-a$ node -e "process.exit(42)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml index d1b8f1d2..358ff156 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for extra args" steps = [ - "vp run say a # cache miss", - "vp run say b # cache miss, different args", - "vp run say a # cache hit", - "vp run say b # cache hit", + "vp run --details say a # cache miss", + "vp run --details say b # cache miss, different args", + "vp run --details say a # cache hit", + "vp run --details say b # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index de8f439e..6e79d166 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run say a # cache miss +> vp run --details say a # cache miss $ print a a @@ -19,7 +19,7 @@ Task Details: [1] say: $ print a ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run say b # cache miss, different args +> vp run --details say b # cache miss, different args $ print b b @@ -36,7 +36,7 @@ Task Details: [1] say: $ print b ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run say a # cache hit +> vp run --details say a # cache hit $ print a ✓ cache hit, replaying a @@ -53,7 +53,7 @@ Task Details: [1] say: $ print a ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run say b # cache hit +> vp run --details say b # cache hit $ print b ✓ cache hit, replaying b diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml index 77193ea2..c3dec658 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for envs" steps = [ - "FOO=1 vp run hello # cache miss", - "FOO=2 vp run hello # cache miss, different env", - "FOO=1 vp run hello # cache hit", - "FOO=2 vp run hello # cache hit", + "FOO=1 vp run --details hello # cache miss", + "FOO=2 vp run --details hello # cache miss, different env", + "FOO=1 vp run --details hello # cache hit", + "FOO=2 vp run --details hello # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap index 1d0620a0..7ca4a904 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> FOO=1 vp run hello # cache miss +> FOO=1 vp run --details hello # cache miss $ print-env FOO 1 @@ -19,7 +19,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run hello # cache miss, different env +> FOO=2 vp run --details hello # cache miss, different env $ print-env FOO ✗ cache miss: envs changed, executing 2 @@ -36,7 +36,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache miss: env FOO value changed from '1' to '2' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=1 vp run hello # cache hit +> FOO=1 vp run --details hello # cache hit $ print-env FOO ✓ cache hit, replaying 1 @@ -53,7 +53,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run hello # cache hit +> FOO=2 vp run --details hello # cache hit $ print-env FOO ✓ cache hit, replaying 2 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml index 6849eb0b..634aaaa1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml @@ -4,7 +4,7 @@ name = "lint dot git" steps = [ "mkdir .git", - "vp run lint # cache miss", + "vp run --details lint # cache miss", "echo hello > .git/foo.txt # add file inside .git", - "vp run lint # cache hit, .git is ignored", + "vp run --details lint # cache hit, .git is ignored", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 38ea12c2..5950012e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > mkdir .git -> vp run lint # cache miss +> vp run --details lint # cache miss $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -32,8 +32,8 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo hello > .git/foo.txt # add file inside .git -> vp run lint # cache hit, .git is ignored -$ vp lint ✓ cache hit, replaying +> vp run --details lint # cache hit, .git is ignored +$ vp lint ✗ cache miss: content of input 'node_modules/.vite/task-cache' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[a.js:1:1] @@ -50,11 +50,11 @@ Finished in on 1 file with 90 rules using threads. Vite+ Task Runner • Execution Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total +Statistics: 1 tasks • 0 cache hits • 1 cache misses +Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── [1] lint: $ vp lint ✓ - → Cache hit - output replayed - saved + → Cache miss: content of input 'node_modules/.vite/task-cache' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap index 7b0be9e8..f31d3581 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap @@ -97,20 +97,6 @@ $ node build.js [echo.js] 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 [echo.js] -------------------------------- [build.js] main process end - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] build: $ node build.js ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp run build # cache hit $ node build.js ✓ cache hit, replaying [build.js] -------------------------------- @@ -207,19 +193,8 @@ $ node build.js ✓ cache hit, replaying [echo.js] -------------------------------- [build.js] main process end - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] build: $ node build.js ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. > vp run build # cache hit $ node build.js ✓ cache hit, replaying [build.js] -------------------------------- @@ -316,16 +291,5 @@ $ node build.js ✓ cache hit, replaying [echo.js] -------------------------------- [build.js] main process end - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] build: $ node build.js ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml index 73abab94..0d8aca38 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "shared caching inputs" steps = [ - "vp run script1 # cache miss", - "vp run script2 # cache hit, same command as script1", + "vp run --details script1 # cache miss", + "vp run --details script2 # cache hit, same command as script1", "replace-file-content foo.txt initial modified # modify shared input", - "vp run script2 # cache miss, input changed", - "vp run script1 # cache hit, script2 already warmed cache", + "vp run --details script2 # cache miss, input changed", + "vp run --details script1 # cache hit, script2 already warmed cache", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap index f42197bc..1aaf4dcd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run script1 # cache miss +> vp run --details script1 # cache miss $ print-file foo.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] script1: $ print-file foo.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run script2 # cache hit, same command as script1 +> vp run --details script2 # cache hit, same command as script1 $ print-file foo.txt ✓ cache hit, replaying initial content @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content foo.txt initial modified # modify shared input -> vp run script2 # cache miss, input changed +> vp run --details script2 # cache miss, input changed $ print-file foo.txt ✗ cache miss: content of input 'foo.txt' changed, executing modified content @@ -55,7 +55,7 @@ Task Details: [1] script2: $ print-file foo.txt ✓ → Cache miss: content of input 'foo.txt' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run script1 # cache hit, script2 already warmed cache +> vp run --details script1 # cache hit, script2 already warmed cache $ print-file foo.txt ✓ cache hit, replaying modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml index 0548189b..5d4e0e1b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml @@ -5,5 +5,5 @@ name = "signal terminated task returns non-zero exit code" platform = "unix" steps = [ - "vp run abort # SIGABRT -> exit code 134", + "vp run --details abort # SIGABRT -> exit code 134", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap index c47cb863..f8093c42 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[134]> vp run abort # SIGABRT -> exit code 134 +[134]> vp run --details abort # SIGABRT -> exit code 134 $ node -e "process.kill(process.pid, 6)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap index 5d6f5884..6c030045 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap @@ -7,19 +7,5 @@ expression: e2e_outputs $ read-stdin ⊘ cache disabled: no cache config - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 1 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] other#read-stdin: ~/packages/other$ read-stdin ✓ - → Cache miss: no previous cache entry found - ······················································· - [2] stdin-inheritance-test#read-stdin: $ read-stdin ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap index 3ed85c44..f4dcaa58 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap @@ -5,17 +5,3 @@ expression: e2e_outputs > echo from-stdin | vp run read-stdin $ read-stdin ⊘ cache disabled: no cache config from-stdin - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] stdin-inheritance-test#read-stdin: $ read-stdin ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task with cache gets null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task with cache gets null stdin.snap index c6a38299..56301c7d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task with cache gets null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task with cache gets null stdin.snap @@ -4,17 +4,3 @@ expression: e2e_outputs --- > echo from-stdin | vp run read-stdin-cached $ read-stdin - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] stdin-inheritance-test#read-stdin-cached: $ read-stdin ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap index 56088f27..c2361573 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap @@ -13,19 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 1 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] other#check-tty: ~/packages/other$ check-tty ✓ - → Cache miss: no previous cache entry found - ······················································· - [2] stdio-detection-test#check-tty: $ check-tty ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap index 707718c8..9a7344c3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap @@ -13,22 +13,8 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 2 cache misses -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] other#check-tty-cached: ~/packages/other$ check-tty ✓ - → Cache miss: no previous cache entry found - ······················································· - [2] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) > vp run -r check-tty-cached ~/packages/other$ check-tty ✓ cache hit, replaying stdin:not-tty @@ -40,19 +26,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 2 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] other#check-tty-cached: ~/packages/other$ check-tty ✓ - → Cache hit - output replayed - saved - ······················································· - [2] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 2/2 cache hit (100%), saved. (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap index 2a2d6eeb..e3319747 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap @@ -13,19 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 2 cache misses -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] other#check-tty-cached: ~/packages/other$ check-tty ✓ - → Cache miss: no previous cache entry found - ······················································· - [2] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap index afea75d1..e910f7a7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap @@ -7,17 +7,3 @@ $ check-tty ⊘ cache disabled: no cache config stdin:tty stdout:tty stderr:tty - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] stdio-detection-test#check-tty: $ check-tty ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap index 5381bb2f..71932f9f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap @@ -7,36 +7,11 @@ $ check-tty stdin:not-tty stdout:not-tty stderr:not-tty - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp run check-tty-cached $ check-tty ✓ cache hit, replaying stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache miss.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache miss.snap index 2d0a4310..0763cd35 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache miss.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache miss.snap @@ -7,17 +7,3 @@ $ check-tty stdin:not-tty stdout:not-tty stderr:not-tty - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] stdio-detection-test#check-tty-cached: $ check-tty ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap index 15f23f7d..201fdaf6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap @@ -13,19 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] other#bar: ~/packages/other$ check-tty ✓ - → Cache disabled in task configuration - ······················································· - [2] stdio-graph-criteria-test#bar: $ check-tty ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap index 3a9c8bda..2428e3c7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap @@ -23,25 +23,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 4 tasks • 0 cache hits • 0 cache misses • 4 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] stdio-graph-criteria-test#foo: $ check-tty ✓ - → Cache disabled in task configuration - ······················································· - [2] stdio-graph-criteria-test#bar: $ check-tty ✓ - → Cache disabled in task configuration - ······················································· - [3] other#check-tty: ~/packages/other$ check-tty ✓ - → Cache disabled in task configuration - ······················································· - [4] stdio-graph-criteria-test#check-tty: $ check-tty ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/4 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap index b0e427ef..3db8e285 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap @@ -16,31 +16,3 @@ Search task (↑/↓ to move, enter to select): $ vp run ⊘ cache disabled: no cache config $ echo hello from root ⊘ cache disabled: built-in command hello from root - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] task-list-test#hello: $ echo hello from root ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] task-list-test#list-tasks: $ vp run ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index 8e80c017..9024ed12 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -8,19 +8,5 @@ foo $ echo bar ⊘ cache disabled: built-in command bar - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] hello: $ echo -n foo ✓ - → Cache disabled for built-in command - ······················································· - [2] hello: $ echo bar ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap index 0ff4c0d7..8ae89966 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap @@ -40,17 +40,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/app$ echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ⊘ cache disabled: built-in command aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#long-cmd: ~/packages/app$ echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap index 653c1409..2fed61dc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap @@ -42,17 +42,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap index 116c06ad..f48b4f5e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap @@ -42,17 +42,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap index b032faf8..2e284abf 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap @@ -67,17 +67,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap index ccc81642..f2df5d9e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap @@ -25,17 +25,3 @@ Search task (↑/↓ to move, enter to select): typec @ write-key: enter ~/packages/lib$ echo typecheck lib ⊘ cache disabled: built-in command typecheck lib - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lib#typecheck: ~/packages/lib$ echo typecheck lib ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap index dfcbf9e9..a984bcfa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap @@ -37,17 +37,3 @@ Search task (↑/↓ to move, enter to select): t @ write-key: enter ~/packages/lib$ echo test lib ⊘ cache disabled: built-in command test lib - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lib#test: ~/packages/lib$ echo test lib ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap index 138d4395..55ca0beb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap @@ -26,17 +26,3 @@ Search task (↑/↓ to move, enter to select): lin @ write-key: enter ~/packages/app$ echo lint app ⊘ cache disabled: built-in command lint app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#lint: ~/packages/app$ echo lint app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap index 9db7109e..bc16084b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap @@ -28,17 +28,3 @@ Search task (↑/↓ to move, enter to select): lib# @ write-key: enter ~/packages/lib$ echo build lib ⊘ cache disabled: built-in command build lib - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lib#build: ~/packages/lib$ echo build lib ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap index 4aaa2919..47959505 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap @@ -21,17 +21,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/lib$ echo build lib ⊘ cache disabled: built-in command build lib - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lib#build: ~/packages/lib$ echo build lib ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap index ac252807..e2cd9031 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap @@ -37,17 +37,3 @@ Search task (↑/↓ to move, enter to select): @ write-key: enter ~/packages/app$ echo lint app ⊘ cache disabled: built-in command lint app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#lint: ~/packages/app$ echo lint app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap index acd834b1..fdc67e71 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap @@ -25,19 +25,5 @@ build lib ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] lib#build: ~/packages/lib$ echo build lib ✓ - → Cache disabled for built-in command - ······················································· - [2] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap index f5bee2b6..34c2dd44 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap @@ -15,19 +15,5 @@ build lib ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] lib#build: ~/packages/lib$ echo build lib ✓ - → Cache disabled for built-in command - ······················································· - [2] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap index d710f842..4c434ce9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap @@ -11,17 +11,3 @@ Search task (↑/↓ to move, enter to select): buid @ write-key: enter ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] app#build: ~/packages/app$ echo build app ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml index fab682d8..e787ca72 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml @@ -4,19 +4,19 @@ [[e2e]] name = "recursive build runs dependencies before dependents" steps = [ - "vp run -r build # core -> lib -> app", + "vp run --details -r build # core -> lib -> app", ] [[e2e]] name = "transitive build from app runs all dependencies" cwd = "packages/app" steps = [ - "vp run -t build # core -> lib -> app", + "vp run --details -t build # core -> lib -> app", ] [[e2e]] name = "transitive build from lib runs only its dependencies" cwd = "packages/lib" steps = [ - "vp run -t build # core -> lib", + "vp run --details -t build # core -> lib", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index 7027a21b..4916e824 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run -r build # core -> lib -> app +> vp run --details -r build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index 905651f8..3c5401b5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run -t build # core -> lib -> app +> vp run --details -t build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index aa074606..44523270 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run -t build # core -> lib +> vp run --details -t build # core -> lib ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index c8530001..99f7f3f6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "cache hit after file modification" steps = [ - "vp run test-task # cache miss", + "vp run --details test-task # cache miss", "replace-file-content main.js foo bar # modify input file", - "vp run test-task # cache miss, main.js changed", + "vp run --details test-task # cache miss, main.js changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 4ac8bb58..fbc3443d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run test-task # cache miss +> vp run --details test-task # cache miss $ echo hello ⊘ cache disabled: built-in command hello @@ -27,7 +27,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content main.js foo bar # modify input file -> vp run test-task # cache miss, main.js changed +> vp run --details test-task # cache miss, main.js changed $ echo hello ⊘ cache disabled: built-in command hello From 9e67fc97e0afbac58b034ee40124a38c41e5ad00 Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 17:58:21 +0800 Subject: [PATCH 02/12] refactor: address review comments on task runner summary - Make --last-details exclusive at type level by splitting Command into ParsedCommand (clap) and Command (resolved with RunLastDetails variant) - Use ? to propagate IO errors in show_last_run_details - Replace summary_file_path with write_summary callback to decouple reporter from file paths - Remove ExecutionInfo/ExecutionStats, build TaskSummary directly in leaf reporter's finish() instead of collecting intermediate state - Add .gitignore to oxlint fixtures to prevent fspy from fingerprinting the cache directory, fixing flaky cache-miss snapshots --- crates/vite_task/src/cli/mod.rs | 83 +++++- crates/vite_task/src/lib.rs | 2 +- crates/vite_task/src/session/mod.rs | 43 +-- .../vite_task/src/session/reporter/labeled.rs | 248 +++++++----------- .../vite_task/src/session/reporter/summary.rs | 41 +-- crates/vite_task_bin/src/lib.rs | 8 +- crates/vite_task_bin/src/main.rs | 2 +- .../fixtures/builtin-different-cwd/.gitignore | 7 + .../snapshots/builtin different cwd.snap | 8 +- .../fixtures/builtin-non-zero-exit/.gitignore | 7 + .../fixtures/lint-dot-git/.gitignore | 7 + .../lint-dot-git/snapshots/lint dot git.snap | 8 +- .../tests/plan_snapshots/main.rs | 8 +- 13 files changed, 231 insertions(+), 241 deletions(-) create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.gitignore create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.gitignore diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 3cb414b2..85d4a602 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -36,29 +36,39 @@ pub struct RunFlags { pub details: bool, } -/// Arguments for the `run` subcommand. +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Clap-parsed types (used only at the parsing boundary) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +/// Arguments for the `run` subcommand as parsed by clap. +/// +/// Contains the `--last-details` flag which is resolved into a separate +/// [`Command::RunLastDetails`] variant via [`ParsedCommand::into_command`]. #[derive(Debug, clap::Args)] -pub struct RunCommand { +pub struct ParsedRunCommand { /// `packageName#taskName` or `taskName`. If omitted, lists all available tasks. - pub task_specifier: Option, + task_specifier: Option, #[clap(flatten)] - pub flags: RunFlags, + flags: RunFlags, /// Additional arguments to pass to the tasks #[clap(trailing_var_arg = true, allow_hyphen_values = true)] - pub additional_args: Vec, + additional_args: Vec, /// Display the detailed summary of the last run. #[clap(long, exclusive = true)] - pub last_details: bool, + last_details: bool, } -/// vite task CLI subcommands +/// vite task CLI subcommands as parsed by clap. +/// +/// Use [`ParsedCommand::into_command`] to resolve into the dispatched [`Command`] +/// enum, which makes `--last-details` exclusive at the type level. #[derive(Debug, Parser)] -pub enum Command { +pub enum ParsedCommand { /// Run tasks - Run(RunCommand), + Run(ParsedRunCommand), /// Manage the task cache Cache { #[clap(subcommand)] @@ -66,6 +76,60 @@ pub enum Command { }, } +impl ParsedCommand { + /// Resolve the clap-parsed command into the dispatched [`Command`] enum. + /// + /// When `--last-details` is set on the `run` subcommand, this produces + /// [`Command::RunLastDetails`] instead of [`Command::Run`], making the + /// exclusivity enforced at the type level. + #[must_use] + pub fn into_command(self) -> Command { + match self { + Self::Run(run) if run.last_details => Command::RunLastDetails, + Self::Run(run) => Command::Run(RunCommand { + task_specifier: run.task_specifier, + flags: run.flags, + additional_args: run.additional_args, + }), + Self::Cache { subcmd } => Command::Cache { subcmd }, + } + } +} + +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +// Resolved types (used for dispatch — `--last-details` is a separate variant) +// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +/// Resolved CLI command for dispatch. +/// +/// Unlike [`ParsedCommand`], this enum makes `--last-details` a separate variant +/// ([`Command::RunLastDetails`]) so that it is exclusive at the type level — +/// there is no way to combine it with task execution fields. +#[derive(Debug)] +pub enum Command { + /// Run tasks with the given parameters. + Run(RunCommand), + /// Display the saved detailed summary of the last run (`--last-details`). + RunLastDetails, + /// Manage the task cache. + Cache { subcmd: CacheSubcommand }, +} + +/// Resolved arguments for executing tasks. +/// +/// Does not contain `last_details` — that case is represented by +/// [`Command::RunLastDetails`] instead. +#[derive(Debug)] +pub struct RunCommand { + /// `packageName#taskName` or `taskName`. If omitted, lists all available tasks. + pub task_specifier: Option, + + pub flags: RunFlags, + + /// Additional arguments to pass to the tasks. + pub additional_args: Vec, +} + #[derive(thiserror::Error, Debug)] pub enum CLITaskQueryError { #[error("no task specifier provided")] @@ -93,7 +157,6 @@ impl RunCommand { task_specifier, flags: RunFlags { recursive, transitive, ignore_depends_on, .. }, additional_args, - .. } = self; let task_specifier = task_specifier.ok_or(CLITaskQueryError::MissingTaskSpecifier)?; diff --git a/crates/vite_task/src/lib.rs b/crates/vite_task/src/lib.rs index 41e7c04b..35c172ac 100644 --- a/crates/vite_task/src/lib.rs +++ b/crates/vite_task/src/lib.rs @@ -4,7 +4,7 @@ mod maybe_str; pub mod session; // Public exports for vite_task_bin -pub use cli::{CacheSubcommand, Command, RunCommand, RunFlags}; +pub use cli::{CacheSubcommand, Command, ParsedCommand, RunCommand, RunFlags}; pub use session::{CommandHandler, ExitStatus, HandledCommand, Session, SessionCallbacks}; pub use vite_task_graph::{ config::{ diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index bea07c9b..21083aff 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -101,9 +101,11 @@ impl vite_task_plan::PlanRequestParser for PlanRequestParser<'_> { match self.command_handler.handle_command(command).await? { HandledCommand::Synthesized(synthetic) => Ok(Some(PlanRequest::Synthetic(synthetic))), HandledCommand::ViteTaskCommand(cli_command) => match cli_command { - Command::Cache { .. } => Ok(Some(PlanRequest::Synthetic( - command.to_synthetic_plan_request(UserCacheConfig::disabled()), - ))), + Command::Cache { .. } | Command::RunLastDetails => { + Ok(Some(PlanRequest::Synthetic( + command.to_synthetic_plan_request(UserCacheConfig::disabled()), + ))) + } Command::Run(run_command) => { match run_command.into_query_plan_request(&command.cwd) { Ok(query_plan_request) => Ok(Some(PlanRequest::Query(query_plan_request))), @@ -227,12 +229,8 @@ impl<'a> Session<'a> { pub async fn main(mut self, command: Command) -> anyhow::Result { match command { Command::Cache { ref subcmd } => self.handle_cache_command(subcmd), + Command::RunLastDetails => self.show_last_run_details(), Command::Run(run_command) => { - // --last-details: display saved summary and exit (exclusive flag) - if run_command.last_details { - return self.show_last_run_details(); - } - let cwd = Arc::clone(&self.cwd); let is_interactive = std::io::stdin().is_terminal() && std::io::stdout().is_terminal(); @@ -259,7 +257,7 @@ impl<'a> Session<'a> { self.workspace_path(), Box::new(tokio::io::stdout()), show_details, - Some(self.summary_file_path()), + Some(self.make_summary_writer()), ); Ok(self .execute_graph(graph, Box::new(builder)) @@ -401,12 +399,8 @@ impl<'a> Session<'a> { let selected_label = &select_items[selected_index].label; let task_specifier = TaskSpecifier::parse_raw(selected_label); let show_details = flags.details; - let run_command = RunCommand { - task_specifier: Some(task_specifier), - flags, - additional_args, - last_details: false, - }; + let run_command = + RunCommand { task_specifier: Some(task_specifier), flags, additional_args }; let cwd = Arc::clone(&self.cwd); let graph = self.plan_from_cli_run(cwd, run_command).await?; @@ -414,7 +408,7 @@ impl<'a> Session<'a> { self.workspace_path(), Box::new(tokio::io::stdout()), show_details, - Some(self.summary_file_path()), + Some(self.make_summary_writer()), ); Ok(self.execute_graph(graph, Box::new(builder)).await.err().unwrap_or(ExitStatus::SUCCESS)) } @@ -439,6 +433,19 @@ impl<'a> Session<'a> { self.cache_path.join("last-summary.json") } + /// Create a callback that persists the summary to `last-summary.json`. + /// + /// The returned closure captures the file path and handles errors internally + /// (logging failures without propagating). + fn make_summary_writer(&self) -> Box { + let path = self.summary_file_path(); + Box::new(move |summary: &LastRunSummary| { + if let Err(err) = summary.write_atomic(&path) { + tracing::warn!("Failed to write summary to {path:?}: {err}"); + } + }) + } + /// Display the saved summary from the last run (`--last-details`). #[expect( clippy::print_stderr, @@ -452,8 +459,8 @@ impl<'a> Session<'a> { { use std::io::Write; let mut stdout = std::io::stdout().lock(); - let _ = stdout.write_all(&buf); - let _ = stdout.flush(); + stdout.write_all(&buf)?; + stdout.flush()?; } Ok(ExitStatus(summary.exit_code)) } diff --git a/crates/vite_task/src/session/reporter/labeled.rs b/crates/vite_task/src/session/reporter/labeled.rs index 3a14f479..8a2392ed 100644 --- a/crates/vite_task/src/session/reporter/labeled.rs +++ b/crates/vite_task/src/session/reporter/labeled.rs @@ -9,7 +9,7 @@ use std::{cell::RefCell, process::ExitStatus as StdExitStatus, rc::Rc, sync::Arc}; use tokio::io::{AsyncWrite, AsyncWriteExt as _}; -use vite_path::{AbsolutePath, AbsolutePathBuf}; +use vite_path::AbsolutePath; use vite_str::Str; use vite_task_plan::{ExecutionItemDisplay, LeafExecutionKind}; @@ -18,29 +18,15 @@ use super::{ StdioConfig, StdioSuggestion, format_command_with_cache_status, format_error_message, }; use crate::session::{ - event::{CacheStatus, CacheUpdateStatus, ExecutionError, exit_status_to_code}, + event::{CacheStatus, CacheUpdateStatus, ExecutionError}, reporter::summary::{ - LastRunSummary, SavedExecutionError, format_compact_summary, format_full_summary, + LastRunSummary, SavedExecutionError, SpawnOutcome, TaskResult, TaskSummary, + format_compact_summary, format_full_summary, }, }; -/// Information tracked for each leaf execution, used to build the summary. -#[derive(Debug)] -struct ExecutionInfo { - display: ExecutionItemDisplay, - /// Cache status, determined at `start()`. - cache_status: CacheStatus, - /// Exit status from the process. `None` means no process was spawned (cache hit or in-process). - exit_status: Option, - /// Execution error, converted to the serializable form for the summary. - saved_error: Option, -} - -/// Running statistics updated as leaf executions complete. -#[derive(Default)] -struct ExecutionStats { - failed: usize, -} +/// Callback type for persisting the summary (e.g., writing `last-summary.json`). +type WriteSummaryFn = Box; /// Mutable state shared between [`LabeledGraphReporter`] and its [`LabeledLeafReporter`] instances /// via `Rc>`. @@ -48,8 +34,7 @@ struct ExecutionStats { /// This is safe because execution is single-threaded and sequential — only one leaf /// reporter is active at a time. struct SharedReporterState { - executions: Vec, - stats: ExecutionStats, + tasks: Vec, } /// Builder for the labeled graph reporter. @@ -71,9 +56,9 @@ pub struct LabeledReporterBuilder { writer: Box, /// Whether to render the full detailed summary (`--details` flag). show_details: bool, - /// Path to write `last-summary.json`. `None` when persistence is not needed - /// (e.g., nested script execution). - summary_file_path: Option, + /// Callback to persist the summary (e.g., write `last-summary.json`). + /// `None` when persistence is not needed (e.g., nested script execution, tests). + write_summary: Option, } impl LabeledReporterBuilder { @@ -82,14 +67,14 @@ impl LabeledReporterBuilder { /// - `workspace_path`: The workspace root, used to compute relative cwds in display. /// - `writer`: Async writer for reporter display output. /// - `show_details`: Whether to render the full detailed summary. - /// - `summary_file_path`: Where to persist `last-summary.json`, or `None` to skip. + /// - `write_summary`: Callback to persist the summary, or `None` to skip. pub fn new( workspace_path: Arc, writer: Box, show_details: bool, - summary_file_path: Option, + write_summary: Option, ) -> Self { - Self { workspace_path, writer, show_details, summary_file_path } + Self { workspace_path, writer, show_details, write_summary } } } @@ -97,14 +82,11 @@ impl GraphExecutionReporterBuilder for LabeledReporterBuilder { fn build(self: Box) -> Box { let writer = Rc::new(RefCell::new(self.writer)); Box::new(LabeledGraphReporter { - shared: Rc::new(RefCell::new(SharedReporterState { - executions: Vec::new(), - stats: ExecutionStats::default(), - })), + shared: Rc::new(RefCell::new(SharedReporterState { tasks: Vec::new() })), writer, workspace_path: self.workspace_path, show_details: self.show_details, - summary_file_path: self.summary_file_path, + write_summary: self.write_summary, }) } } @@ -118,7 +100,7 @@ pub struct LabeledGraphReporter { writer: Rc>>, workspace_path: Arc, show_details: bool, - summary_file_path: Option, + write_summary: Option, } #[async_trait::async_trait(?Send)] @@ -146,78 +128,64 @@ impl GraphExecutionReporter for LabeledGraphReporter { display, workspace_path: Arc::clone(&self.workspace_path), stdio_suggestion, - started: false, + cache_status: None, }) } async fn finish(self: Box) -> Result<(), ExitStatus> { - // Borrow shared state synchronously to build the summary and compute - // the exit result. The borrow is dropped before any async writes. - let (summary_buf, result, exit_code) = { - let shared = self.shared.borrow(); - - // Build LastRunSummary from execution data - let executions: Vec<_> = shared - .executions - .iter() - .map(|exec| { - (&exec.display, &exec.cache_status, exec.exit_status, exec.saved_error.as_ref()) - }) - .collect(); - - // Determine exit code (same logic as before) - let has_infra_errors = shared.executions.iter().any(|exec| exec.saved_error.is_some()); - - let failed_exit_codes: Vec = shared - .executions - .iter() - .filter_map(|exec| exec.exit_status.as_ref()) - .filter(|status| !status.success()) - .map(|status| exit_status_to_code(*status)) - .collect(); - - let result = match (has_infra_errors, failed_exit_codes.as_slice()) { - (false, []) => Ok(()), - (false, [code]) => - { - #[expect( - clippy::cast_sign_loss, - reason = "value is clamped to 1..=255, always positive" - )] - Err(ExitStatus((*code).clamp(1, 255) as u8)) - } - _ => Err(ExitStatus::FAILURE), - }; - - let exit_code = match &result { - Ok(()) => 0u8, - Err(status) => status.0, - }; + // Take tasks from shared state — all leaf reporters have been dropped by now. + let tasks = { + let mut shared = self.shared.borrow_mut(); + std::mem::take(&mut shared.tasks) + }; - // Build LastRunSummary from the execution data - let summary = - LastRunSummary::from_executions(&executions, &self.workspace_path, exit_code); + // Compute exit status from the collected task results. + let has_infra_errors = tasks.iter().any(|t| t.result.error().is_some()); - // Render summary based on mode - let summary_buf = if self.show_details { - format_full_summary(&summary) - } else { - format_compact_summary(&summary) - }; + let failed_exit_codes: Vec = tasks + .iter() + .filter_map(|t| match &t.result { + TaskResult::Spawned { outcome: SpawnOutcome::Failed { exit_code }, .. } => { + Some(exit_code.get()) + } + _ => None, + }) + .collect(); - // Save summary to file (best-effort, log failures) - if let Some(ref path) = self.summary_file_path - && let Err(err) = summary.write_atomic(path) + let result = match (has_infra_errors, failed_exit_codes.as_slice()) { + (false, []) => Ok(()), + (false, [code]) => { - tracing::warn!("Failed to write summary to {:?}: {err}", path); + #[expect( + clippy::cast_sign_loss, + reason = "value is clamped to 1..=255, always positive" + )] + Err(ExitStatus((*code).clamp(1, 255) as u8)) } + _ => Err(ExitStatus::FAILURE), + }; + + let exit_code = match &result { + Ok(()) => 0u8, + Err(status) => status.0, + }; + + // Build summary from collected tasks. + let summary = LastRunSummary { tasks, exit_code }; - (summary_buf, result, exit_code) + // Render summary based on mode. + let summary_buf = if self.show_details { + format_full_summary(&summary) + } else { + format_compact_summary(&summary) }; - // shared borrow dropped here - let _ = exit_code; // used only in the block above - // Write the summary buffer asynchronously + // Persist summary via callback (best-effort, callback handles errors). + if let Some(write_summary) = self.write_summary { + write_summary(&summary); + } + + // Write the summary buffer asynchronously. if !summary_buf.is_empty() { let mut writer = self.writer.borrow_mut(); let _ = writer.write_all(&summary_buf).await; @@ -230,8 +198,8 @@ impl GraphExecutionReporter for LabeledGraphReporter { /// Leaf-level reporter created by [`LabeledGraphReporter::new_leaf_execution`]. /// -/// Writes display output in real-time to the shared async writer and updates shared -/// stats/errors via `Rc>`. +/// Writes display output in real-time to the shared async writer and builds +/// [`TaskSummary`] entries that are pushed to [`SharedReporterState`] on completion. struct LabeledLeafReporter { shared: Rc>, writer: Rc>>, @@ -240,9 +208,9 @@ struct LabeledLeafReporter { workspace_path: Arc, /// Stdio suggestion precomputed from this leaf's graph path. stdio_suggestion: StdioSuggestion, - /// Whether `start()` has been called. Used to determine if stats should be updated - /// in `finish()` and whether to push an `ExecutionInfo` entry. - started: bool, + /// Cache status, set at `start()` time. `None` means `start()` was never called + /// (e.g., cache lookup failure). Consumed in `finish()` to build [`TaskSummary`]. + cache_status: Option, } #[async_trait::async_trait(?Send)] @@ -253,29 +221,12 @@ struct LabeledLeafReporter { )] impl LeafExecutionReporter for LabeledLeafReporter { async fn start(&mut self, cache_status: CacheStatus) -> StdioConfig { - self.started = true; + // Format command line with cache status before storing it. + let line = + format_command_with_cache_status(&self.display, &self.workspace_path, &cache_status); - // Update shared state synchronously, then drop the borrow before any async writes. - { - let mut shared = self.shared.borrow_mut(); + self.cache_status = Some(cache_status); - // Store execution info for the summary - shared.executions.push(ExecutionInfo { - display: self.display.clone(), - cache_status, - exit_status: None, - saved_error: None, - }); - } - // shared borrow dropped here - - // Format command line with cache status (sync), then write asynchronously. - // The shared borrow to read cache_status is brief and dropped before the await. - let line = { - let shared = self.shared.borrow(); - let cache_status = &shared.executions.last().unwrap().cache_status; - format_command_with_cache_status(&self.display, &self.workspace_path, cache_status) - }; let mut writer = self.writer.borrow_mut(); let _ = writer.write_all(line.as_bytes()).await; let _ = writer.flush().await; @@ -293,48 +244,35 @@ impl LeafExecutionReporter for LabeledLeafReporter { _cache_update_status: CacheUpdateStatus, error: Option, ) { - // Convert the execution error to its serializable form before borrowing shared state + // Convert error before consuming it (need the original for display formatting). let saved_error = error.as_ref().map(SavedExecutionError::from_execution_error); - let has_error = saved_error.is_some(); - - // Format the error message for display (using the original error with full anyhow chain) let error_display: Option = error.map(|e| vite_str::format!("{:#}", anyhow::Error::from(e))); - // Update shared state synchronously, then drop the borrow before any async writes. - { - let mut shared = self.shared.borrow_mut(); - - // Handle errors — update execution info and stats. - if saved_error.is_some() { - // Update the execution info if start() was called (an entry was pushed). - // Without the `self.started` guard, `last_mut()` would return a - // *different* execution's entry, corrupting its error. - if self.started - && let Some(exec) = shared.executions.last_mut() - { - exec.saved_error = saved_error; - } + // Destructure self to avoid partial-move issues with Box. + let Self { shared, writer, display, workspace_path, cache_status, .. } = *self; + let started = cache_status.is_some(); - shared.stats.failed += 1; - } + // Build TaskSummary and push to shared state if start() was called. + if let Some(cache_status) = cache_status { + let cwd_relative = if let Ok(Some(rel)) = display.cwd.strip_prefix(&workspace_path) { + Str::from(rel.as_str()) + } else { + Str::default() + }; - // Update failure statistics for non-zero exit status (not an error, just a failed task) - // None means success (cache hit or in-process), Some checks the actual exit status - if !has_error && status.is_some_and(|s| !s.success()) { - shared.stats.failed += 1; - } + let task_summary = TaskSummary { + package_name: display.task_display.package_name.clone(), + task_name: display.task_display.task_name.clone(), + command: display.command.clone(), + cwd: cwd_relative, + result: TaskResult::from_execution(&cache_status, status, saved_error.as_ref()), + }; - // Update execution info with exit status (if start() was called and an entry exists) - if self.started - && let Some(exec) = shared.executions.last_mut() - { - exec.exit_status = status; - } + shared.borrow_mut().tasks.push(task_summary); } - // shared borrow dropped here - // Build all display output into a buffer (sync), then write once asynchronously. + // Build all display output into a buffer, then write once asynchronously. let mut buf = Vec::new(); if let Some(ref message) = error_display { @@ -344,12 +282,12 @@ impl LeafExecutionReporter for LabeledLeafReporter { // Add a trailing newline after each task's output for readability. // Skip if start() was never called (e.g. cache lookup failure) — there's // no task output to separate. - if self.started { + if started { buf.push(b'\n'); } if !buf.is_empty() { - let mut writer = self.writer.borrow_mut(); + let mut writer = writer.borrow_mut(); let _ = writer.write_all(&buf).await; let _ = writer.flush().await; } diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs index 122c5cc3..7c3483a8 100644 --- a/crates/vite_task/src/session/reporter/summary.rs +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -13,7 +13,6 @@ use owo_colors::Style; use serde::{Deserialize, Serialize}; use vite_path::AbsolutePath; use vite_str::Str; -use vite_task_plan::ExecutionItemDisplay; use super::{CACHE_MISS_STYLE, COMMAND_STYLE, ColorizeExt}; use crate::session::{ @@ -320,44 +319,6 @@ fn duration_to_ms(d: Duration) -> u64 { } impl LastRunSummary { - /// Build a summary from the reporter's collected execution data. - /// - /// Each element contains references to the display info, cache status, exit status, - /// and an optional pre-converted execution error. - /// `workspace_path` is used to compute relative cwds. - /// `exit_code` is the overall exit code for the run. - pub fn from_executions( - executions: &[( - &ExecutionItemDisplay, - &CacheStatus, - Option, - Option<&SavedExecutionError>, - )], - workspace_path: &AbsolutePath, - exit_code: u8, - ) -> Self { - let tasks = executions - .iter() - .map(|(display, cache_status, exit_status, saved_error)| { - let cwd_relative = if let Ok(Some(rel)) = display.cwd.strip_prefix(workspace_path) { - Str::from(rel.as_str()) - } else { - Str::default() - }; - - TaskSummary { - package_name: display.task_display.package_name.clone(), - task_name: display.task_display.task_name.clone(), - command: display.command.clone(), - cwd: cwd_relative, - result: TaskResult::from_execution(cache_status, *exit_status, *saved_error), - } - }) - .collect(); - - Self { tasks, exit_code } - } - // ── Persistence ────────────────────────────────────────────────────── /// Write the summary as JSON atomically (write to `.tmp`, then rename). @@ -485,7 +446,7 @@ impl TaskResult { } /// Optional error associated with this result. - const fn error(&self) -> Option<&SavedExecutionError> { + pub const fn error(&self) -> Option<&SavedExecutionError> { match self { Self::CacheHit { .. } | Self::InProcess => None, Self::Spawned { outcome, .. } => match outcome { diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index 392a6df4..4d4032a7 100644 --- a/crates/vite_task_bin/src/lib.rs +++ b/crates/vite_task_bin/src/lib.rs @@ -10,8 +10,8 @@ use rustc_hash::FxHashMap; use vite_path::AbsolutePath; use vite_str::Str; use vite_task::{ - Command, EnabledCacheConfig, HandledCommand, ScriptCommand, SessionCallbacks, UserCacheConfig, - get_path_env, plan_request::SyntheticPlanRequest, + EnabledCacheConfig, HandledCommand, ParsedCommand, ScriptCommand, SessionCallbacks, + UserCacheConfig, get_path_env, plan_request::SyntheticPlanRequest, }; #[derive(Debug, Default)] @@ -85,7 +85,7 @@ pub enum Args { value: Str, }, #[command(flatten)] - Task(Command), + Task(ParsedCommand), } #[async_trait::async_trait(?Send)] @@ -130,7 +130,7 @@ impl vite_task::CommandHandler for CommandHandler { envs: Arc::new(envs), })) } - Args::Task(cli_command) => Ok(HandledCommand::ViteTaskCommand(cli_command)), + Args::Task(parsed) => Ok(HandledCommand::ViteTaskCommand(parsed.into_command())), } } } diff --git a/crates/vite_task_bin/src/main.rs b/crates/vite_task_bin/src/main.rs index 6c9d41e0..79b4acb0 100644 --- a/crates/vite_task_bin/src/main.rs +++ b/crates/vite_task_bin/src/main.rs @@ -21,7 +21,7 @@ async fn run() -> anyhow::Result { let mut owned_callbacks = OwnedSessionCallbacks::default(); let session = Session::init(owned_callbacks.as_callbacks())?; match args { - Args::Task(command) => session.main(command).await, + Args::Task(parsed) => session.main(parsed.into_command()).await, args => { // If env FOO is set, run `print-env FOO` via Session::exec before proceeding. // In vite-plus, Session::exec is used for auto-install. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore new file mode 100644 index 00000000..231280da --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore @@ -0,0 +1,7 @@ +# Prevent oxlint from scanning node_modules. +# Without this, oxlint reads files in node_modules/.vite/task-cache, causing +# fspy to fingerprint the cache directory as an input. The cache directory +# changes between runs (DB writes, last-summary.json), producing flaky +# cache-miss reasons that alternate between '' and +# 'node_modules/.vite/task-cache'. +node_modules diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index c2f69a7f..21e1f158 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -36,7 +36,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > cd folder2 && vp run --details lint # cache miss in folder2 -$ vp lint ✗ cache miss: content of input 'node_modules/.vite/task-cache' changed, executing +$ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -60,13 +60,13 @@ Finished in on 2 files with 90 rules using threads. Vite+ Task Runner • Execution Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate +Statistics: 1 tasks • 1 cache hits • 0 cache misses +Performance: 100% cache hit rate, saved in total Task Details: ──────────────────────────────────────────────── [1] lint: $ vp lint ✓ - → Cache miss: content of input 'node_modules/.vite/task-cache' changed + → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo 'console.log(1);' > folder2/a.js # modify folder2 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.gitignore new file mode 100644 index 00000000..231280da --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.gitignore @@ -0,0 +1,7 @@ +# Prevent oxlint from scanning node_modules. +# Without this, oxlint reads files in node_modules/.vite/task-cache, causing +# fspy to fingerprint the cache directory as an input. The cache directory +# changes between runs (DB writes, last-summary.json), producing flaky +# cache-miss reasons that alternate between '' and +# 'node_modules/.vite/task-cache'. +node_modules diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.gitignore new file mode 100644 index 00000000..231280da --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.gitignore @@ -0,0 +1,7 @@ +# Prevent oxlint from scanning node_modules. +# Without this, oxlint reads files in node_modules/.vite/task-cache, causing +# fspy to fingerprint the cache directory as an input. The cache directory +# changes between runs (DB writes, last-summary.json), producing flaky +# cache-miss reasons that alternate between '' and +# 'node_modules/.vite/task-cache'. +node_modules diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 5950012e..9e88c112 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -33,7 +33,7 @@ Task Details: > echo hello > .git/foo.txt # add file inside .git > vp run --details lint # cache hit, .git is ignored -$ vp lint ✗ cache miss: content of input 'node_modules/.vite/task-cache' changed, executing +$ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[a.js:1:1] @@ -50,11 +50,11 @@ Finished in on 1 file with 90 rules using threads. Vite+ Task Runner • Execution Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate +Statistics: 1 tasks • 1 cache hits • 0 cache misses +Performance: 100% cache hit rate, saved in total Task Details: ──────────────────────────────────────────────── [1] lint: $ vp lint ✓ - → Cache miss: content of input 'node_modules/.vite/task-cache' changed + → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 294a74ad..6bad3f85 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -10,7 +10,7 @@ use rustc_hash::FxHashMap; use tokio::runtime::Runtime; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_str::Str; -use vite_task::{Command, Session}; +use vite_task::{Command, ParsedCommand, Session}; use vite_workspace::find_workspace_root; /// Local parser wrapper for `BuiltInCommand` @@ -18,7 +18,7 @@ use vite_workspace::find_workspace_root; #[command(name = "vp")] enum Cli { #[clap(flatten)] - Command(Command), + Command(ParsedCommand), } #[derive(serde::Deserialize, Debug)] @@ -174,8 +174,8 @@ fn run_case_inner( continue; } }; - let Cli::Command(command) = cli; - let Command::Run(run_command) = command else { + let Cli::Command(parsed) = cli; + let Command::Run(run_command) = parsed.into_command() else { panic!("only `run` commands supported in plan tests") }; From 86019bc35d99fbbf141ba0a9ee63111089a7be65 Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 18:06:29 +0800 Subject: [PATCH 03/12] test: add --verbose to all e2e test runs to prove full summary output is unchanged MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename --details flag to -v/--verbose and add it to all vp run steps in e2e snapshot tests. The .snap file diffs confirm that only the flag name in command echo lines and the compact summary hint text changed — the actual summary output is identical, proving the full summary rendering path is correct. This commit will be reverted so that e2e tests exercise the compact summary path (the default without --verbose). --- crates/vite_task/src/cli/mod.rs | 4 +-- crates/vite_task/src/session/mod.rs | 4 +-- .../vite_task/src/session/reporter/labeled.rs | 4 +-- .../vite_task/src/session/reporter/summary.rs | 8 +++--- .../associate-existing-cache/snapshots.toml | 6 ++-- .../snapshots/associate existing cache.snap | 6 ++-- .../builtin-different-cwd/snapshots.toml | 8 +++--- .../snapshots/builtin different cwd.snap | 8 +++--- .../builtin-non-zero-exit/snapshots.toml | 4 +-- ... exit does not show cache not updated.snap | 4 +-- .../fixtures/cache-disabled/snapshots.toml | 8 +++--- .../snapshots/task with cache disabled.snap | 4 +-- .../snapshots/task with cache enabled.snap | 4 +-- .../cache-miss-command-change/snapshots.toml | 6 ++-- .../snapshots/cache miss command change.snap | 6 ++-- .../cache-miss-reasons/snapshots.toml | 28 +++++++++---------- .../snapshots/cwd changed.snap | 4 +-- .../snapshots/env added.snap | 4 +-- .../snapshots/env removed.snap | 4 +-- .../snapshots/env value changed.snap | 4 +-- .../snapshots/input content changed.snap | 4 +-- .../snapshots/pass-through env added.snap | 4 +-- .../snapshots/pass-through env removed.snap | 4 +-- .../fixtures/cache-subcommand/snapshots.toml | 6 ++-- .../snapshots/cache clean.snap | 6 ++-- .../fixtures/e2e-lint-cache/snapshots.toml | 4 +-- .../e2e-lint-cache/snapshots/direct lint.snap | 4 +-- .../fixtures/exit-codes/snapshots.toml | 4 +-- ...ple task failures returns exit code 1.snap | 2 +- ...e task failure returns task exit code.snap | 2 +- .../snapshots.toml | 8 +++--- .../individual cache for extra args.snap | 8 +++--- .../individual-cache-for-envs/snapshots.toml | 8 +++--- .../snapshots/individual cache for envs.snap | 8 +++--- .../fixtures/lint-dot-git/snapshots.toml | 4 +-- .../lint-dot-git/snapshots/lint dot git.snap | 4 +-- .../shared-caching-inputs/snapshots.toml | 8 +++--- .../snapshots/shared caching inputs.snap | 8 +++--- .../fixtures/signal-exit/snapshots.toml | 2 +- ...nated task returns non-zero exit code.snap | 2 +- .../multiple tasks get null stdin.snap | 2 +- .../multiple tasks, cache disabled.snap | 2 +- .../snapshots/multiple tasks, cache hit.snap | 4 +-- .../snapshots/multiple tasks, cache miss.snap | 2 +- ...es piped for nested single-node graph.snap | 2 +- ...it even with multi-node sibling graph.snap | 2 +- .../snapshots/no trailing newline.snap | 2 +- .../interactive select with recursive.snap | 2 +- ...ctive select with typo and transitive.snap | 2 +- .../snapshots.toml | 6 ++-- ...d runs dependencies before dependents.snap | 2 +- ... build from app runs all dependencies.snap | 2 +- ...d from lib runs only its dependencies.snap | 2 +- .../fixtures/vite-task-smoke/snapshots.toml | 4 +-- .../cache hit after file modification.snap | 4 +-- 55 files changed, 134 insertions(+), 134 deletions(-) diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 85d4a602..38d75101 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -32,8 +32,8 @@ pub struct RunFlags { pub ignore_depends_on: bool, /// Show full detailed summary after execution. - #[clap(default_value = "false", long)] - pub details: bool, + #[clap(default_value = "false", short = 'v', long)] + pub verbose: bool, } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 21083aff..190d72d9 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -237,7 +237,7 @@ impl<'a> Session<'a> { // Save task name and flags before consuming run_command let task_name = run_command.task_specifier.as_ref().map(|s| s.task_name.clone()); - let show_details = run_command.flags.details; + let show_details = run_command.flags.verbose; let flags = run_command.flags; let additional_args = run_command.additional_args.clone(); @@ -398,7 +398,7 @@ impl<'a> Session<'a> { // Interactive: run the selected task let selected_label = &select_items[selected_index].label; let task_specifier = TaskSpecifier::parse_raw(selected_label); - let show_details = flags.details; + let show_details = flags.verbose; let run_command = RunCommand { task_specifier: Some(task_specifier), flags, additional_args }; diff --git a/crates/vite_task/src/session/reporter/labeled.rs b/crates/vite_task/src/session/reporter/labeled.rs index 8a2392ed..d36bee7c 100644 --- a/crates/vite_task/src/session/reporter/labeled.rs +++ b/crates/vite_task/src/session/reporter/labeled.rs @@ -49,12 +49,12 @@ struct SharedReporterState { /// - Single task + cache hit → thin line + "[vp run] cache hit, {duration} saved." /// - Multi-task → thin line + one-liner with stats /// -/// ## Full Summary (`--details`) +/// ## Full Summary (`--verbose`) /// - Shows full Statistics, Performance, and Task Details sections pub struct LabeledReporterBuilder { workspace_path: Arc, writer: Box, - /// Whether to render the full detailed summary (`--details` flag). + /// Whether to render the full detailed summary (`--verbose` flag). show_details: bool, /// Callback to persist the summary (e.g., write `last-summary.json`). /// `None` when persistence is not needed (e.g., nested script execution, tests). diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs index 7c3483a8..bd40cce4 100644 --- a/crates/vite_task/src/session/reporter/summary.rs +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -459,12 +459,12 @@ impl TaskResult { } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -// Full summary rendering (--details and --last-details) +// Full summary rendering (--verbose and --last-details) // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ /// Render the full detailed execution summary. /// -/// Used by both `--details` (live) and `--last-details` (from file). +/// Used by both `--verbose` (live) and `--last-details` (from file). #[expect( clippy::too_many_lines, reason = "summary formatting is inherently verbose with many write calls" @@ -647,7 +647,7 @@ pub fn format_full_summary(summary: &LastRunSummary) -> Vec { /// - Single task + not cache hit → empty (no summary at all) /// - Single task + cache hit → thin line + "[vp run] cache hit, {duration} saved." /// - Multi-task → thin line + "[vp run] {hits}/{total} cache hit ({rate}%), {duration} saved." -/// with optional failure count and `--details` hint. +/// with optional failure count and `--verbose` hint. pub fn format_compact_summary(summary: &LastRunSummary) -> Vec { let stats = SummaryStats::compute(&summary.tasks); @@ -713,7 +713,7 @@ pub fn format_compact_summary(summary: &LastRunSummary) -> Vec { let _ = write!( buf, ". {}", - "(Run `vp run --details` for full details)".style(Style::new().bright_black()), + "(Run `vp run --verbose` for full details)".style(Style::new().bright_black()), ); let _ = writeln!(buf); } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index 9336147e..9889699d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "associate existing cache" steps = [ - "vp run --details script1 # cache miss", - "vp run --details script2 # cache hit, same command as script1", + "vp run --verbose script1 # cache miss", + "vp run --verbose script2 # cache hit, same command as script1", "json-edit package.json '_.scripts.script2 = \"print world\"' # change script2", - "vp run --details script2 # cache miss", + "vp run --verbose script2 # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index 53744713..3f0eaf33 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details script1 # cache miss +> vp run --verbose script1 # cache miss $ print hello hello @@ -19,7 +19,7 @@ Task Details: [1] script1: $ print hello ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details script2 # cache hit, same command as script1 +> vp run --verbose script2 # cache hit, same command as script1 $ print hello ✓ cache hit, replaying hello @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.script2 = "print world"' # change script2 -> vp run --details script2 # cache miss +> vp run --verbose script2 # cache miss $ print world ✗ cache miss: args changed, executing world diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index fd4941f7..946ebbd1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "builtin different cwd" steps = [ - "cd folder1 && vp run --details lint # cache miss in folder1", - "cd folder2 && vp run --details lint # cache miss in folder2", + "cd folder1 && vp run --verbose lint # cache miss in folder1", + "cd folder2 && vp run --verbose lint # cache miss in folder2", "echo 'console.log(1);' > folder2/a.js # modify folder2", - "cd folder1 && vp run --details lint # cache hit", - "cd folder2 && vp run --details lint # cache miss", + "cd folder1 && vp run --verbose lint # cache hit", + "cd folder2 && vp run --verbose lint # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index 21e1f158..bd3a80cc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cd folder1 && vp run --details lint # cache miss in folder1 +> cd folder1 && vp run --verbose lint # cache miss in folder1 $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -35,7 +35,7 @@ Task Details: [1] lint: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run --details lint # cache miss in folder2 +> cd folder2 && vp run --verbose lint # cache miss in folder2 $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -70,7 +70,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo 'console.log(1);' > folder2/a.js # modify folder2 -> cd folder1 && vp run --details lint # cache hit +> cd folder1 && vp run --verbose lint # cache hit $ vp lint ✗ cache miss: content of input 'folder2/a.js' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -96,7 +96,7 @@ Task Details: [1] lint: $ vp lint ✓ → Cache miss: content of input 'folder2/a.js' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run --details lint # cache miss +> cd folder2 && vp run --verbose lint # cache miss $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml index 168e0460..86b501b1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml @@ -1,6 +1,6 @@ [[e2e]] name = "builtin command with non-zero exit does not show cache not updated" steps = [ - "vp run --details lint -- -D no-debugger", - "vp run --details lint -- -D no-debugger", + "vp run --verbose lint -- -D no-debugger", + "vp run --verbose lint -- -D no-debugger", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap index b1b511f3..fad4828c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run --details lint -- -D no-debugger +[1]> vp run --verbose lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed @@ -28,7 +28,7 @@ Task Details: [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -[1]> vp run --details lint -- -D no-debugger +[1]> vp run --verbose lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml index ea8c8f83..afe73ab4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml @@ -3,13 +3,13 @@ [[e2e]] name = "task with cache disabled" steps = [ - "vp run --details no-cache-task # cache miss", - "vp run --details no-cache-task # cache disabled, runs again", + "vp run --verbose no-cache-task # cache miss", + "vp run --verbose no-cache-task # cache disabled, runs again", ] [[e2e]] name = "task with cache enabled" steps = [ - "vp run --details cached-task # cache miss", - "vp run --details cached-task # cache hit", + "vp run --verbose cached-task # cache miss", + "vp run --verbose cached-task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index 3963803e..856b368d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details no-cache-task # cache miss +> vp run --verbose no-cache-task # cache miss $ print-file test.txt ⊘ cache disabled: no cache config test content @@ -19,7 +19,7 @@ Task Details: [1] cache-disabled-test#no-cache-task: $ print-file test.txt ✓ → Cache disabled in task configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details no-cache-task # cache disabled, runs again +> vp run --verbose no-cache-task # cache disabled, runs again $ print-file test.txt ⊘ cache disabled: no cache config test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index 0669e34f..6a12575e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details cached-task # cache miss +> vp run --verbose cached-task # cache miss $ print-file test.txt test content @@ -19,7 +19,7 @@ Task Details: [1] cache-disabled-test#cached-task: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details cached-task # cache hit +> vp run --verbose cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index 918cc4ac..9eeabbee 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "cache miss command change" steps = [ - "vp run --details task # cache miss", + "vp run --verbose task # cache miss", "json-edit package.json '_.scripts.task = \"print baz && print bar\"' # change first subtask", - "vp run --details task # first: cache miss, second: cache hit", + "vp run --verbose task # first: cache miss, second: cache hit", "json-edit package.json '_.scripts.task = \"print bar\"' # remove first subtask", - "vp run --details task # cache hit", + "vp run --verbose task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index c102fb55..0cfd1288 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details task # cache miss +> vp run --verbose task # cache miss $ print foo foo @@ -27,7 +27,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask -> vp run --details task # first: cache miss, second: cache hit +> vp run --verbose task # first: cache miss, second: cache hit $ print baz ✗ cache miss: args changed, executing baz @@ -52,7 +52,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask -> vp run --details task # cache hit +> vp run --verbose task # cache hit $ print bar ✓ cache hit, replaying bar diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 27446519..0090d86a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,55 +3,55 @@ [[e2e]] name = "env value changed" steps = [ - "cross-env MY_ENV=1 vp run --details test # cache miss", - "cross-env MY_ENV=2 vp run --details test # cache miss: env value changed", + "cross-env MY_ENV=1 vp run --verbose test # cache miss", + "cross-env MY_ENV=2 vp run --verbose test # cache miss: env value changed", ] [[e2e]] name = "env added" steps = [ - "vp run --details test # cache miss", - "cross-env MY_ENV=1 vp run --details test # cache miss: env added", + "vp run --verbose test # cache miss", + "cross-env MY_ENV=1 vp run --verbose test # cache miss: env added", ] [[e2e]] name = "env removed" steps = [ - "cross-env MY_ENV=1 vp run --details test # cache miss", - "vp run --details test # cache miss: env removed", + "cross-env MY_ENV=1 vp run --verbose test # cache miss", + "vp run --verbose test # cache miss: env removed", ] [[e2e]] name = "pass-through env added" steps = [ - "vp run --details test # cache miss", + "vp run --verbose test # cache miss", "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # add pass-through env", - "vp run --details test # cache miss: pass-through env added", + "vp run --verbose test # cache miss: pass-through env added", ] [[e2e]] name = "pass-through env removed" steps = [ "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # setup", - "vp run --details test # cache miss", + "vp run --verbose test # cache miss", "json-edit vite-task.json \"delete _.tasks.test.passThroughEnvs\" # remove pass-through env", - "vp run --details test # cache miss: pass-through env removed", + "vp run --verbose test # cache miss: pass-through env removed", ] [[e2e]] name = "cwd changed" steps = [ - "vp run --details test # cache miss", + "vp run --verbose test # cache miss", "mkdir -p subfolder", "cp test.txt subfolder/test.txt", "json-edit vite-task.json \"_.tasks.test.cwd = 'subfolder'\" # change cwd", - "vp run --details test # cache miss: cwd changed", + "vp run --verbose test # cache miss: cwd changed", ] [[e2e]] name = "input content changed" steps = [ - "vp run --details test # cache miss", + "vp run --verbose test # cache miss", "replace-file-content test.txt initial modified # modify input", - "vp run --details test # cache miss: input changed", + "vp run --verbose test # cache miss: input changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 5b87a38c..6d36b6c9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details test # cache miss +> vp run --verbose test # cache miss $ print-file test.txt initial content @@ -25,7 +25,7 @@ Task Details: > json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd -> vp run --details test # cache miss: cwd changed +> vp run --verbose test # cache miss: cwd changed ~/subfolder$ print-file test.txt ✗ cache miss: working directory changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap index 50b92902..51cf2135 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details test # cache miss +> vp run --verbose test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=1 vp run --details test # cache miss: env added +> cross-env MY_ENV=1 vp run --verbose test # cache miss: env added $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap index 51e7c782..37324912 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run --details test # cache miss +> cross-env MY_ENV=1 vp run --verbose test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details test # cache miss: env removed +> vp run --verbose test # cache miss: env removed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap index 0b06af0c..e0c2411c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run --details test # cache miss +> cross-env MY_ENV=1 vp run --verbose test # cache miss $ print-file test.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] cache-miss-reasons#test: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=2 vp run --details test # cache miss: env value changed +> cross-env MY_ENV=2 vp run --verbose test # cache miss: env value changed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap index 4468f8a8..788d39d0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details test # cache miss +> vp run --verbose test # cache miss $ print-file test.txt initial content @@ -21,7 +21,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content test.txt initial modified # modify input -> vp run --details test # cache miss: input changed +> vp run --verbose test # cache miss: input changed $ print-file test.txt ✗ cache miss: content of input 'test.txt' changed, executing modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap index e4f80a25..fa0470b9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details test # cache miss +> vp run --verbose test # cache miss $ print-file test.txt initial content @@ -21,7 +21,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # add pass-through env -> vp run --details test # cache miss: pass-through env added +> vp run --verbose test # cache miss: pass-through env added $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap index b91774a1..3fb6f5f8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # setup -> vp run --details test # cache miss +> vp run --verbose test # cache miss $ print-file test.txt initial content @@ -23,7 +23,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "delete _.tasks.test.passThroughEnvs" # remove pass-through env -> vp run --details test # cache miss: pass-through env removed +> vp run --verbose test # cache miss: pass-through env removed $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml index dfc6c9ec..ddfdbc27 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml @@ -1,8 +1,8 @@ [[e2e]] name = "cache clean" steps = [ - "vp run --details cached-task # cache miss", - "vp run --details cached-task # cache hit", + "vp run --verbose cached-task # cache miss", + "vp run --verbose cached-task # cache hit", "vp cache clean", - "vp run --details cached-task # cache miss after clean", + "vp run --verbose cached-task # cache miss after clean", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index c0e67ea2..309d0dbd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details cached-task # cache miss +> vp run --verbose cached-task # cache miss $ print-file test.txt test content @@ -19,7 +19,7 @@ Task Details: [1] @test/cache-subcommand#cached-task: $ print-file test.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details cached-task # cache hit +> vp run --verbose cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > vp cache clean -> vp run --details cached-task # cache miss after clean +> vp run --verbose cached-task # cache miss after clean $ print-file test.txt test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml index a65372e5..6d04d9d6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "direct lint" steps = [ - "vp run --details lint # cache miss", + "vp run --verbose lint # cache miss", "echo debugger > main.js # add lint error", - "vp run --details lint # cache miss, lint fails", + "vp run --verbose lint # cache miss, lint fails", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index 191f60b8..c167c298 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details lint # cache miss +> vp run --verbose lint # cache miss $ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. @@ -22,7 +22,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo debugger > main.js # add lint error -> vp run --details lint # cache miss, lint fails +> vp run --verbose lint # cache miss, lint fails $ vp lint ✗ cache miss: content of input '' changed, executing ! eslint(no-debugger): `debugger` statement is not allowed diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml index af28db2e..72dd3031 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml @@ -3,11 +3,11 @@ [[e2e]] name = "single task failure returns task exit code" steps = [ - "vp run --details pkg-a#fail # exits with code 42", + "vp run --verbose pkg-a#fail # exits with code 42", ] [[e2e]] name = "multiple task failures returns exit code 1" steps = [ - "vp run --details -r fail # multiple failures -> exit code 1", + "vp run --verbose -r fail # multiple failures -> exit code 1", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index 9a904ebf..414e4897 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run --details -r fail # multiple failures -> exit code 1 +[1]> vp run --verbose -r fail # multiple failures -> exit code 1 ~/packages/pkg-a$ node -e "process.exit(42)" ~/packages/pkg-b$ node -e "process.exit(7)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap index ee6373aa..cf1368fc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[42]> vp run --details pkg-a#fail # exits with code 42 +[42]> vp run --verbose pkg-a#fail # exits with code 42 ~/packages/pkg-a$ node -e "process.exit(42)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml index 358ff156..41ed4fe9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for extra args" steps = [ - "vp run --details say a # cache miss", - "vp run --details say b # cache miss, different args", - "vp run --details say a # cache hit", - "vp run --details say b # cache hit", + "vp run --verbose say a # cache miss", + "vp run --verbose say b # cache miss, different args", + "vp run --verbose say a # cache hit", + "vp run --verbose say b # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index 6e79d166..aa49203b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details say a # cache miss +> vp run --verbose say a # cache miss $ print a a @@ -19,7 +19,7 @@ Task Details: [1] say: $ print a ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details say b # cache miss, different args +> vp run --verbose say b # cache miss, different args $ print b b @@ -36,7 +36,7 @@ Task Details: [1] say: $ print b ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details say a # cache hit +> vp run --verbose say a # cache hit $ print a ✓ cache hit, replaying a @@ -53,7 +53,7 @@ Task Details: [1] say: $ print a ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details say b # cache hit +> vp run --verbose say b # cache hit $ print b ✓ cache hit, replaying b diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml index c3dec658..e1a8782c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for envs" steps = [ - "FOO=1 vp run --details hello # cache miss", - "FOO=2 vp run --details hello # cache miss, different env", - "FOO=1 vp run --details hello # cache hit", - "FOO=2 vp run --details hello # cache hit", + "FOO=1 vp run --verbose hello # cache miss", + "FOO=2 vp run --verbose hello # cache miss, different env", + "FOO=1 vp run --verbose hello # cache hit", + "FOO=2 vp run --verbose hello # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap index 7ca4a904..54c78b50 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> FOO=1 vp run --details hello # cache miss +> FOO=1 vp run --verbose hello # cache miss $ print-env FOO 1 @@ -19,7 +19,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run --details hello # cache miss, different env +> FOO=2 vp run --verbose hello # cache miss, different env $ print-env FOO ✗ cache miss: envs changed, executing 2 @@ -36,7 +36,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache miss: env FOO value changed from '1' to '2' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=1 vp run --details hello # cache hit +> FOO=1 vp run --verbose hello # cache hit $ print-env FOO ✓ cache hit, replaying 1 @@ -53,7 +53,7 @@ Task Details: [1] hello: $ print-env FOO ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run --details hello # cache hit +> FOO=2 vp run --verbose hello # cache hit $ print-env FOO ✓ cache hit, replaying 2 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml index 634aaaa1..ee3eee05 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml @@ -4,7 +4,7 @@ name = "lint dot git" steps = [ "mkdir .git", - "vp run --details lint # cache miss", + "vp run --verbose lint # cache miss", "echo hello > .git/foo.txt # add file inside .git", - "vp run --details lint # cache hit, .git is ignored", + "vp run --verbose lint # cache hit, .git is ignored", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 9e88c112..07ec073f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > mkdir .git -> vp run --details lint # cache miss +> vp run --verbose lint # cache miss $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -32,7 +32,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo hello > .git/foo.txt # add file inside .git -> vp run --details lint # cache hit, .git is ignored +> vp run --verbose lint # cache hit, .git is ignored $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml index 0d8aca38..b55286fa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "shared caching inputs" steps = [ - "vp run --details script1 # cache miss", - "vp run --details script2 # cache hit, same command as script1", + "vp run --verbose script1 # cache miss", + "vp run --verbose script2 # cache hit, same command as script1", "replace-file-content foo.txt initial modified # modify shared input", - "vp run --details script2 # cache miss, input changed", - "vp run --details script1 # cache hit, script2 already warmed cache", + "vp run --verbose script2 # cache miss, input changed", + "vp run --verbose script1 # cache hit, script2 already warmed cache", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap index 1aaf4dcd..41b4c678 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details script1 # cache miss +> vp run --verbose script1 # cache miss $ print-file foo.txt initial content @@ -19,7 +19,7 @@ Task Details: [1] script1: $ print-file foo.txt ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details script2 # cache hit, same command as script1 +> vp run --verbose script2 # cache hit, same command as script1 $ print-file foo.txt ✓ cache hit, replaying initial content @@ -38,7 +38,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content foo.txt initial modified # modify shared input -> vp run --details script2 # cache miss, input changed +> vp run --verbose script2 # cache miss, input changed $ print-file foo.txt ✗ cache miss: content of input 'foo.txt' changed, executing modified content @@ -55,7 +55,7 @@ Task Details: [1] script2: $ print-file foo.txt ✓ → Cache miss: content of input 'foo.txt' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --details script1 # cache hit, script2 already warmed cache +> vp run --verbose script1 # cache hit, script2 already warmed cache $ print-file foo.txt ✓ cache hit, replaying modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml index 5d4e0e1b..355ae668 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml @@ -5,5 +5,5 @@ name = "signal terminated task returns non-zero exit code" platform = "unix" steps = [ - "vp run --details abort # SIGABRT -> exit code 134", + "vp run --verbose abort # SIGABRT -> exit code 134", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap index f8093c42..f316d1f6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[134]> vp run --details abort # SIGABRT -> exit code 134 +[134]> vp run --verbose abort # SIGABRT -> exit code 134 $ node -e "process.kill(process.pid, 6)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap index 6c030045..3c901c41 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap @@ -8,4 +8,4 @@ expression: e2e_outputs $ read-stdin ⊘ cache disabled: no cache config ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap index c2361573..609f3dfe 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap index 9a7344c3..499f04fc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap @@ -14,7 +14,7 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > vp run -r check-tty-cached ~/packages/other$ check-tty ✓ cache hit, replaying stdin:not-tty @@ -27,4 +27,4 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 2/2 cache hit (100%), saved. (Run `vp run --details` for full details) +[vp run] 2/2 cache hit (100%), saved. (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap index e3319747..7d6c2f5d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap index 201fdaf6..25344f86 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap index 2428e3c7..0938afa1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap @@ -24,4 +24,4 @@ stdout:not-tty stderr:not-tty ──────────────────────────────────────────────── -[vp run] 0/4 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/4 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index 9024ed12..109620ba 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -9,4 +9,4 @@ $ echo bar ⊘ cache disabled: built-in command bar ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap index fdc67e71..daa28af3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap @@ -26,4 +26,4 @@ build lib build app ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap index 34c2dd44..b84ab7f1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap @@ -16,4 +16,4 @@ build lib build app ──────────────────────────────────────────────── -[vp run] 0/2 cache hit (0%). (Run `vp run --details` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml index e787ca72..37e88e46 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml @@ -4,19 +4,19 @@ [[e2e]] name = "recursive build runs dependencies before dependents" steps = [ - "vp run --details -r build # core -> lib -> app", + "vp run --verbose -r build # core -> lib -> app", ] [[e2e]] name = "transitive build from app runs all dependencies" cwd = "packages/app" steps = [ - "vp run --details -t build # core -> lib -> app", + "vp run --verbose -t build # core -> lib -> app", ] [[e2e]] name = "transitive build from lib runs only its dependencies" cwd = "packages/lib" steps = [ - "vp run --details -t build # core -> lib", + "vp run --verbose -t build # core -> lib", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index 4916e824..fadeb526 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details -r build # core -> lib -> app +> vp run --verbose -r build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index 3c5401b5..a5939820 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details -t build # core -> lib -> app +> vp run --verbose -t build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index 44523270..bb02592d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details -t build # core -> lib +> vp run --verbose -t build # core -> lib ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index 99f7f3f6..8105feb7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "cache hit after file modification" steps = [ - "vp run --details test-task # cache miss", + "vp run --verbose test-task # cache miss", "replace-file-content main.js foo bar # modify input file", - "vp run --details test-task # cache miss, main.js changed", + "vp run --verbose test-task # cache miss, main.js changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index fbc3443d..70e1df64 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --details test-task # cache miss +> vp run --verbose test-task # cache miss $ echo hello ⊘ cache disabled: built-in command hello @@ -27,7 +27,7 @@ Task Details: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content main.js foo bar # modify input file -> vp run --details test-task # cache miss, main.js changed +> vp run --verbose test-task # cache miss, main.js changed $ echo hello ⊘ cache disabled: built-in command hello From 5d10eb4948eeeb2a28396999439e984ca7f14142 Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 18:11:45 +0800 Subject: [PATCH 04/12] Revert "test: add --verbose to all e2e test runs to prove full summary output is unchanged" This reverts the test-only changes from commit 86019bc3, removing --verbose from e2e test commands so they exercise the compact summary path. The --details to --verbose code rename is preserved. --- .../associate-existing-cache/snapshots.toml | 6 +- .../snapshots/associate existing cache.snap | 47 ++------------ .../builtin-different-cwd/snapshots.toml | 8 +-- .../snapshots/builtin different cwd.snap | 62 ++----------------- .../builtin-non-zero-exit/snapshots.toml | 4 +- ... exit does not show cache not updated.snap | 32 +--------- .../fixtures/cache-disabled/snapshots.toml | 8 +-- .../snapshots/task with cache disabled.snap | 32 +--------- .../snapshots/task with cache enabled.snap | 31 +--------- .../cache-miss-command-change/snapshots.toml | 6 +- .../snapshots/cache miss command change.snap | 51 ++------------- .../cache-miss-reasons/snapshots.toml | 28 ++++----- .../snapshots/cwd changed.snap | 32 +--------- .../snapshots/env added.snap | 32 +--------- .../snapshots/env removed.snap | 32 +--------- .../snapshots/env value changed.snap | 32 +--------- .../snapshots/input content changed.snap | 32 +--------- .../snapshots/pass-through env added.snap | 32 +--------- .../snapshots/pass-through env removed.snap | 32 +--------- .../fixtures/cache-subcommand/snapshots.toml | 6 +- .../snapshots/cache clean.snap | 47 ++------------ .../fixtures/e2e-lint-cache/snapshots.toml | 4 +- .../e2e-lint-cache/snapshots/direct lint.snap | 32 +--------- .../fixtures/exit-codes/snapshots.toml | 4 +- ...ple task failures returns exit code 1.snap | 18 +----- ...e task failure returns task exit code.snap | 16 +---- .../snapshots.toml | 8 +-- .../individual cache for extra args.snap | 62 ++----------------- .../individual-cache-for-envs/snapshots.toml | 8 +-- .../snapshots/individual cache for envs.snap | 62 ++----------------- .../fixtures/lint-dot-git/snapshots.toml | 4 +- .../lint-dot-git/snapshots/lint dot git.snap | 31 +--------- .../shared-caching-inputs/snapshots.toml | 8 +-- .../snapshots/shared caching inputs.snap | 62 ++----------------- .../fixtures/signal-exit/snapshots.toml | 2 +- ...nated task returns non-zero exit code.snap | 16 +---- .../snapshots.toml | 6 +- ...d runs dependencies before dependents.snap | 21 +------ ... build from app runs all dependencies.snap | 21 +------ ...d from lib runs only its dependencies.snap | 18 +----- .../fixtures/vite-task-smoke/snapshots.toml | 4 +- .../cache hit after file modification.snap | 36 ++--------- 42 files changed, 135 insertions(+), 900 deletions(-) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index 9889699d..a7e54885 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "associate existing cache" steps = [ - "vp run --verbose script1 # cache miss", - "vp run --verbose script2 # cache hit, same command as script1", + "vp run script1 # cache miss", + "vp run script2 # cache hit, same command as script1", "json-edit package.json '_.scripts.script2 = \"print world\"' # change script2", - "vp run --verbose script2 # cache miss", + "vp run script2 # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index 3f0eaf33..088de633 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -2,56 +2,17 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose script1 # cache miss +> vp run script1 # cache miss $ print hello hello - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] script1: $ print hello ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose script2 # cache hit, same command as script1 +> vp run script2 # cache hit, same command as script1 $ print hello ✓ cache hit, replaying hello - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] script2: $ print hello ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. > json-edit package.json '_.scripts.script2 = "print world"' # change script2 -> vp run --verbose script2 # cache miss +> vp run script2 # cache miss $ print world ✗ cache miss: args changed, executing world - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] script2: $ print world ✓ - → Cache miss: args changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index 946ebbd1..44289fd4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "builtin different cwd" steps = [ - "cd folder1 && vp run --verbose lint # cache miss in folder1", - "cd folder2 && vp run --verbose lint # cache miss in folder2", + "cd folder1 && vp run lint # cache miss in folder1", + "cd folder2 && vp run lint # cache miss in folder2", "echo 'console.log(1);' > folder2/a.js # modify folder2", - "cd folder1 && vp run --verbose lint # cache hit", - "cd folder2 && vp run --verbose lint # cache miss", + "cd folder1 && vp run lint # cache hit", + "cd folder2 && vp run lint # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index bd3a80cc..b5d86997 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cd folder1 && vp run --verbose lint # cache miss in folder1 +> cd folder1 && vp run lint # cache miss in folder1 $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -21,21 +21,7 @@ $ vp lint Found 2 warnings and 0 errors. Finished in on 2 files with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run --verbose lint # cache miss in folder2 +> cd folder2 && vp run lint # cache miss in folder2 $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -55,22 +41,11 @@ $ vp lint ✓ cache hit, replaying Found 2 warnings and 0 errors. Finished in on 2 files with 90 rules using threads. - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. > echo 'console.log(1);' > folder2/a.js # modify folder2 -> cd folder1 && vp run --verbose lint # cache hit +> cd folder1 && vp run lint # cache hit $ vp lint ✗ cache miss: content of input 'folder2/a.js' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -82,21 +57,7 @@ $ vp lint ✗ cache miss: content of input 'folder2/a.js' changed, executing Found 1 warning and 0 errors. Finished in on 2 files with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache miss: content of input 'folder2/a.js' changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vp run --verbose lint # cache miss +> cd folder2 && vp run lint # cache miss $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -109,16 +70,5 @@ $ vp lint ✓ cache hit, replaying Found 1 warning and 0 errors. Finished in on 2 files with 90 rules using threads. - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml index 86b501b1..821b270b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml @@ -1,6 +1,6 @@ [[e2e]] name = "builtin command with non-zero exit does not show cache not updated" steps = [ - "vp run --verbose lint -- -D no-debugger", - "vp run --verbose lint -- -D no-debugger", + "vp run lint -- -D no-debugger", + "vp run lint -- -D no-debugger", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap index fad4828c..b28e1c11 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run --verbose lint -- -D no-debugger +[1]> vp run lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed @@ -14,21 +14,7 @@ $ vp lint -D no-debugger Found 0 warnings and 1 error. Finished in on 1 file with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -[1]> vp run --verbose lint -- -D no-debugger +[1]> vp run lint -- -D no-debugger $ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed @@ -40,17 +26,3 @@ $ vp lint -D no-debugger Found 0 warnings and 1 error. Finished in on 1 file with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml index afe73ab4..b79bd5cb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml @@ -3,13 +3,13 @@ [[e2e]] name = "task with cache disabled" steps = [ - "vp run --verbose no-cache-task # cache miss", - "vp run --verbose no-cache-task # cache disabled, runs again", + "vp run no-cache-task # cache miss", + "vp run no-cache-task # cache disabled, runs again", ] [[e2e]] name = "task with cache enabled" steps = [ - "vp run --verbose cached-task # cache miss", - "vp run --verbose cached-task # cache hit", + "vp run cached-task # cache miss", + "vp run cached-task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index 856b368d..2b5fd860 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -2,37 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose no-cache-task # cache miss +> vp run no-cache-task # cache miss $ print-file test.txt ⊘ cache disabled: no cache config test content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-disabled-test#no-cache-task: $ print-file test.txt ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose no-cache-task # cache disabled, runs again +> vp run no-cache-task # cache disabled, runs again $ print-file test.txt ⊘ cache disabled: no cache config test content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-disabled-test#no-cache-task: $ print-file test.txt ✓ - → Cache disabled in task configuration -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index 6a12575e..034bb9ca 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -2,37 +2,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose cached-task # cache miss +> vp run cached-task # cache miss $ print-file test.txt test content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-disabled-test#cached-task: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose cached-task # cache hit +> vp run cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] cache-disabled-test#cached-task: $ print-file test.txt ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index 9eeabbee..a70a462b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "cache miss command change" steps = [ - "vp run --verbose task # cache miss", + "vp run task # cache miss", "json-edit package.json '_.scripts.task = \"print baz && print bar\"' # change first subtask", - "vp run --verbose task # first: cache miss, second: cache hit", + "vp run task # first: cache miss, second: cache hit", "json-edit package.json '_.scripts.task = \"print bar\"' # remove first subtask", - "vp run --verbose task # cache hit", + "vp run task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index 0cfd1288..72612d53 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -2,70 +2,31 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose task # cache miss +> vp run task # cache miss $ print foo foo $ print bar bar - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 2 cache misses -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] task: $ print foo ✓ - → Cache miss: no previous cache entry found - ······················································· - [2] task: $ print bar ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask -> vp run --verbose task # first: cache miss, second: cache hit +> vp run task # first: cache miss, second: cache hit $ print baz ✗ cache miss: args changed, executing baz $ print bar ✓ cache hit, replaying bar - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 1 cache hits • 1 cache misses -Performance: 50% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] task: $ print baz ✓ - → Cache miss: args changed - ······················································· - [2] task: $ print bar ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 1/2 cache hit (50%), saved. (Run `vp run --verbose` for full details) > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask -> vp run --verbose task # cache hit +> vp run task # cache hit $ print bar ✓ cache hit, replaying bar - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] task: $ print bar ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 0090d86a..150a6812 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,55 +3,55 @@ [[e2e]] name = "env value changed" steps = [ - "cross-env MY_ENV=1 vp run --verbose test # cache miss", - "cross-env MY_ENV=2 vp run --verbose test # cache miss: env value changed", + "cross-env MY_ENV=1 vp run test # cache miss", + "cross-env MY_ENV=2 vp run test # cache miss: env value changed", ] [[e2e]] name = "env added" steps = [ - "vp run --verbose test # cache miss", - "cross-env MY_ENV=1 vp run --verbose test # cache miss: env added", + "vp run test # cache miss", + "cross-env MY_ENV=1 vp run test # cache miss: env added", ] [[e2e]] name = "env removed" steps = [ - "cross-env MY_ENV=1 vp run --verbose test # cache miss", - "vp run --verbose test # cache miss: env removed", + "cross-env MY_ENV=1 vp run test # cache miss", + "vp run test # cache miss: env removed", ] [[e2e]] name = "pass-through env added" steps = [ - "vp run --verbose test # cache miss", + "vp run test # cache miss", "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # add pass-through env", - "vp run --verbose test # cache miss: pass-through env added", + "vp run test # cache miss: pass-through env added", ] [[e2e]] name = "pass-through env removed" steps = [ "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # setup", - "vp run --verbose test # cache miss", + "vp run test # cache miss", "json-edit vite-task.json \"delete _.tasks.test.passThroughEnvs\" # remove pass-through env", - "vp run --verbose test # cache miss: pass-through env removed", + "vp run test # cache miss: pass-through env removed", ] [[e2e]] name = "cwd changed" steps = [ - "vp run --verbose test # cache miss", + "vp run test # cache miss", "mkdir -p subfolder", "cp test.txt subfolder/test.txt", "json-edit vite-task.json \"_.tasks.test.cwd = 'subfolder'\" # change cwd", - "vp run --verbose test # cache miss: cwd changed", + "vp run test # cache miss: cwd changed", ] [[e2e]] name = "input content changed" steps = [ - "vp run --verbose test # cache miss", + "vp run test # cache miss", "replace-file-content test.txt initial modified # modify input", - "vp run --verbose test # cache miss: input changed", + "vp run test # cache miss: input changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 6d36b6c9..992d75fd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -2,43 +2,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose test # cache miss +> vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > mkdir -p subfolder > cp test.txt subfolder/test.txt > json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd -> vp run --verbose test # cache miss: cwd changed +> vp run test # cache miss: cwd changed ~/subfolder$ print-file test.txt ✗ cache miss: working directory changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: ~/subfolder$ print-file test.txt ✓ - → Cache miss: working directory changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap index 51cf2135..eb641e41 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap @@ -2,37 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose test # cache miss +> vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=1 vp run --verbose test # cache miss: env added +> cross-env MY_ENV=1 vp run test # cache miss: env added $ print-file test.txt ✗ cache miss: envs changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: env MY_ENV=1 added -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap index 37324912..661a63c0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap @@ -2,37 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run --verbose test # cache miss +> cross-env MY_ENV=1 vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose test # cache miss: env removed +> vp run test # cache miss: env removed $ print-file test.txt ✗ cache miss: envs changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: env MY_ENV=1 removed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap index e0c2411c..f55ba1f4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap @@ -2,37 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vp run --verbose test # cache miss +> cross-env MY_ENV=1 vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=2 vp run --verbose test # cache miss: env value changed +> cross-env MY_ENV=2 vp run test # cache miss: env value changed $ print-file test.txt ✗ cache miss: envs changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: env MY_ENV value changed from '1' to '2' -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap index 788d39d0..b1fd05df 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap @@ -2,39 +2,11 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose test # cache miss +> vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > replace-file-content test.txt initial modified # modify input -> vp run --verbose test # cache miss: input changed +> vp run test # cache miss: input changed $ print-file test.txt ✗ cache miss: content of input 'test.txt' changed, executing modified content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: content of input 'test.txt' changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap index fa0470b9..c4b6d331 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap @@ -2,39 +2,11 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose test # cache miss +> vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # add pass-through env -> vp run --verbose test # cache miss: pass-through env added +> vp run test # cache miss: pass-through env added $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: pass-through env 'MY_PASSTHROUGH' added -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap index 3fb6f5f8..72fce09f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap @@ -4,39 +4,11 @@ expression: e2e_outputs --- > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # setup -> vp run --verbose test # cache miss +> vp run test # cache miss $ print-file test.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > json-edit vite-task.json "delete _.tasks.test.passThroughEnvs" # remove pass-through env -> vp run --verbose test # cache miss: pass-through env removed +> vp run test # cache miss: pass-through env removed $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] cache-miss-reasons#test: $ print-file test.txt ✓ - → Cache miss: pass-through env 'MY_PASSTHROUGH' removed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml index ddfdbc27..348802e4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml @@ -1,8 +1,8 @@ [[e2e]] name = "cache clean" steps = [ - "vp run --verbose cached-task # cache miss", - "vp run --verbose cached-task # cache hit", + "vp run cached-task # cache miss", + "vp run cached-task # cache hit", "vp cache clean", - "vp run --verbose cached-task # cache miss after clean", + "vp run cached-task # cache miss after clean", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index 309d0dbd..52c0382d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -2,56 +2,17 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose cached-task # cache miss +> vp run cached-task # cache miss $ print-file test.txt test content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] @test/cache-subcommand#cached-task: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose cached-task # cache hit +> vp run cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] @test/cache-subcommand#cached-task: $ print-file test.txt ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. > vp cache clean -> vp run --verbose cached-task # cache miss after clean +> vp run cached-task # cache miss after clean $ print-file test.txt test content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] @test/cache-subcommand#cached-task: $ print-file test.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml index 6d04d9d6..1117a3f1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "direct lint" steps = [ - "vp run --verbose lint # cache miss", + "vp run lint # cache miss", "echo debugger > main.js # add lint error", - "vp run --verbose lint # cache miss, lint fails", + "vp run lint # cache miss, lint fails", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index c167c298..d1662e35 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -2,27 +2,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose lint # cache miss +> vp run lint # cache miss $ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] e2e-lint-cache#lint: $ vp lint ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo debugger > main.js # add lint error -> vp run --verbose lint # cache miss, lint fails +> vp run lint # cache miss, lint fails $ vp lint ✗ cache miss: content of input '' changed, executing ! eslint(no-debugger): `debugger` statement is not allowed @@ -34,17 +20,3 @@ $ vp lint ✗ cache miss: content of input '' changed, executing Found 1 warning and 0 errors. Finished in on 1 file with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] e2e-lint-cache#lint: $ vp lint ✓ - → Cache miss: content of input '' changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml index 72dd3031..5e7b5ccc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml @@ -3,11 +3,11 @@ [[e2e]] name = "single task failure returns task exit code" steps = [ - "vp run --verbose pkg-a#fail # exits with code 42", + "vp run pkg-a#fail # exits with code 42", ] [[e2e]] name = "multiple task failures returns exit code 1" steps = [ - "vp run --verbose -r fail # multiple failures -> exit code 1", + "vp run -r fail # multiple failures -> exit code 1", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index 414e4897..48441b3e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -2,24 +2,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vp run --verbose -r fail # multiple failures -> exit code 1 +[1]> vp run -r fail # multiple failures -> exit code 1 ~/packages/pkg-a$ node -e "process.exit(42)" ~/packages/pkg-b$ node -e "process.exit(7)" - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 2 cache misses • 2 failed -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] pkg-a#fail: ~/packages/pkg-a$ node -e "process.exit(42)" ✗ (exit code: 42) - → Cache miss: no previous cache entry found - ······················································· - [2] pkg-b#fail: ~/packages/pkg-b$ node -e "process.exit(7)" ✗ (exit code: 7) - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%), 2 failed. (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap index cf1368fc..4f59078e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap @@ -2,19 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[42]> vp run --verbose pkg-a#fail # exits with code 42 +[42]> vp run pkg-a#fail # exits with code 42 ~/packages/pkg-a$ node -e "process.exit(42)" - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] pkg-a#fail: ~/packages/pkg-a$ node -e "process.exit(42)" ✗ (exit code: 42) - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml index 41ed4fe9..d1b8f1d2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for extra args" steps = [ - "vp run --verbose say a # cache miss", - "vp run --verbose say b # cache miss, different args", - "vp run --verbose say a # cache hit", - "vp run --verbose say b # cache hit", + "vp run say a # cache miss", + "vp run say b # cache miss, different args", + "vp run say a # cache hit", + "vp run say b # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index aa49203b..1e4cbf9e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -2,71 +2,21 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose say a # cache miss +> vp run say a # cache miss $ print a a - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] say: $ print a ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose say b # cache miss, different args +> vp run say b # cache miss, different args $ print b b - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] say: $ print b ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose say a # cache hit +> vp run say a # cache hit $ print a ✓ cache hit, replaying a - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] say: $ print a ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose say b # cache hit +[vp run] cache hit, saved. +> vp run say b # cache hit $ print b ✓ cache hit, replaying b - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] say: $ print b ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml index e1a8782c..77193ea2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for envs" steps = [ - "FOO=1 vp run --verbose hello # cache miss", - "FOO=2 vp run --verbose hello # cache miss, different env", - "FOO=1 vp run --verbose hello # cache hit", - "FOO=2 vp run --verbose hello # cache hit", + "FOO=1 vp run hello # cache miss", + "FOO=2 vp run hello # cache miss, different env", + "FOO=1 vp run hello # cache hit", + "FOO=2 vp run hello # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap index 54c78b50..54ec023b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap @@ -2,71 +2,21 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> FOO=1 vp run --verbose hello # cache miss +> FOO=1 vp run hello # cache miss $ print-env FOO 1 - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] hello: $ print-env FOO ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run --verbose hello # cache miss, different env +> FOO=2 vp run hello # cache miss, different env $ print-env FOO ✗ cache miss: envs changed, executing 2 - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] hello: $ print-env FOO ✓ - → Cache miss: env FOO value changed from '1' to '2' -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=1 vp run --verbose hello # cache hit +> FOO=1 vp run hello # cache hit $ print-env FOO ✓ cache hit, replaying 1 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] hello: $ print-env FOO ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vp run --verbose hello # cache hit +[vp run] cache hit, saved. +> FOO=2 vp run hello # cache hit $ print-env FOO ✓ cache hit, replaying 2 - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] hello: $ print-env FOO ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml index ee3eee05..6849eb0b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml @@ -4,7 +4,7 @@ name = "lint dot git" steps = [ "mkdir .git", - "vp run --verbose lint # cache miss", + "vp run lint # cache miss", "echo hello > .git/foo.txt # add file inside .git", - "vp run --verbose lint # cache hit, .git is ignored", + "vp run lint # cache hit, .git is ignored", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 07ec073f..61192a9f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > mkdir .git -> vp run --verbose lint # cache miss +> vp run lint # cache miss $ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -16,23 +16,9 @@ $ vp lint Found 1 warning and 0 errors. Finished in on 1 file with 90 rules using threads. - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo hello > .git/foo.txt # add file inside .git -> vp run --verbose lint # cache hit, .git is ignored +> vp run lint # cache hit, .git is ignored $ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. @@ -45,16 +31,5 @@ $ vp lint ✓ cache hit, replaying Found 1 warning and 0 errors. Finished in on 1 file with 90 rules using threads. - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] lint: $ vp lint ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml index b55286fa..73abab94 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "shared caching inputs" steps = [ - "vp run --verbose script1 # cache miss", - "vp run --verbose script2 # cache hit, same command as script1", + "vp run script1 # cache miss", + "vp run script2 # cache hit, same command as script1", "replace-file-content foo.txt initial modified # modify shared input", - "vp run --verbose script2 # cache miss, input changed", - "vp run --verbose script1 # cache hit, script2 already warmed cache", + "vp run script2 # cache miss, input changed", + "vp run script1 # cache hit, script2 already warmed cache", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap index 41b4c678..ef5cb826 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap @@ -2,73 +2,23 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose script1 # cache miss +> vp run script1 # cache miss $ print-file foo.txt initial content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] script1: $ print-file foo.txt ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose script2 # cache hit, same command as script1 +> vp run script2 # cache hit, same command as script1 $ print-file foo.txt ✓ cache hit, replaying initial content - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] script2: $ print-file foo.txt ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. > replace-file-content foo.txt initial modified # modify shared input -> vp run --verbose script2 # cache miss, input changed +> vp run script2 # cache miss, input changed $ print-file foo.txt ✗ cache miss: content of input 'foo.txt' changed, executing modified content - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] script2: $ print-file foo.txt ✓ - → Cache miss: content of input 'foo.txt' changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vp run --verbose script1 # cache hit, script2 already warmed cache +> vp run script1 # cache hit, script2 already warmed cache $ print-file foo.txt ✓ cache hit, replaying modified content - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 1 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total - -Task Details: ──────────────────────────────────────────────── - [1] script1: $ print-file foo.txt ✓ - → Cache hit - output replayed - saved -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml index 355ae668..0548189b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml @@ -5,5 +5,5 @@ name = "signal terminated task returns non-zero exit code" platform = "unix" steps = [ - "vp run --verbose abort # SIGABRT -> exit code 134", + "vp run abort # SIGABRT -> exit code 134", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap index f316d1f6..a440d1c1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap @@ -2,19 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[134]> vp run --verbose abort # SIGABRT -> exit code 134 +[134]> vp run abort # SIGABRT -> exit code 134 $ node -e "process.kill(process.pid, 6)" - - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed -Performance: 0% cache hit rate - -Task Details: -──────────────────────────────────────────────── - [1] signal-exit-test#abort: $ node -e "process.kill(process.pid, 6)" ✗ (exit code: 134) - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml index 37e88e46..fab682d8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml @@ -4,19 +4,19 @@ [[e2e]] name = "recursive build runs dependencies before dependents" steps = [ - "vp run --verbose -r build # core -> lib -> app", + "vp run -r build # core -> lib -> app", ] [[e2e]] name = "transitive build from app runs all dependencies" cwd = "packages/app" steps = [ - "vp run --verbose -t build # core -> lib -> app", + "vp run -t build # core -> lib -> app", ] [[e2e]] name = "transitive build from lib runs only its dependencies" cwd = "packages/lib" steps = [ - "vp run --verbose -t build # core -> lib", + "vp run -t build # core -> lib", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index fadeb526..884482ce 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose -r build # core -> lib -> app +> vp run -r build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core @@ -12,22 +12,5 @@ Building lib ~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command Building app - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 3 tasks • 0 cache hits • 0 cache misses • 3 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] @topo/core#build: ~/packages/core$ echo 'Building core' ✓ - → Cache disabled for built-in command - ······················································· - [2] @topo/lib#build: ~/packages/lib$ echo 'Building lib' ✓ - → Cache disabled for built-in command - ······················································· - [3] @topo/app#build: ~/packages/app$ echo 'Building app' ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index a5939820..d1ae7619 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose -t build # core -> lib -> app +> vp run -t build # core -> lib -> app ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core @@ -12,22 +12,5 @@ Building lib ~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command Building app - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 3 tasks • 0 cache hits • 0 cache misses • 3 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] @topo/core#build: ~/packages/core$ echo 'Building core' ✓ - → Cache disabled for built-in command - ······················································· - [2] @topo/lib#build: ~/packages/lib$ echo 'Building lib' ✓ - → Cache disabled for built-in command - ······················································· - [3] @topo/app#build: ~/packages/app$ echo 'Building app' ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index bb02592d..a93a7bca 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -2,26 +2,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose -t build # core -> lib +> vp run -t build # core -> lib ~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command Building core ~/packages/lib$ echo 'Building lib' ⊘ cache disabled: built-in command Building lib - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] @topo/core#build: ~/packages/core$ echo 'Building core' ✓ - → Cache disabled for built-in command - ······················································· - [2] @topo/lib#build: ~/packages/lib$ echo 'Building lib' ✓ - → Cache disabled for built-in command -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index 8105feb7..c8530001 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "cache hit after file modification" steps = [ - "vp run --verbose test-task # cache miss", + "vp run test-task # cache miss", "replace-file-content main.js foo bar # modify input file", - "vp run --verbose test-task # cache miss, main.js changed", + "vp run test-task # cache miss, main.js changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 70e1df64..140bb71f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -2,51 +2,23 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vp run --verbose test-task # cache miss +> vp run test-task # cache miss $ echo hello ⊘ cache disabled: built-in command hello $ print-file main.js console.log('foo'); - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 1 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] vite-task-smoke#test-task: $ echo hello ✓ - → Cache disabled for built-in command - ······················································· - [2] vite-task-smoke#test-task: $ print-file main.js ✓ - → Cache miss: no previous cache entry found -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > replace-file-content main.js foo bar # modify input file -> vp run --verbose test-task # cache miss, main.js changed +> vp run test-task # cache miss, main.js changed $ echo hello ⊘ cache disabled: built-in command hello $ print-file main.js ✗ cache miss: content of input 'main.js' changed, executing console.log('bar'); - -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Vite+ Task Runner • Execution Summary -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -Statistics: 2 tasks • 0 cache hits • 1 cache misses • 1 cache disabled -Performance: 0% cache hit rate - -Task Details: ──────────────────────────────────────────────── - [1] vite-task-smoke#test-task: $ echo hello ✓ - → Cache disabled for built-in command - ······················································· - [2] vite-task-smoke#test-task: $ print-file main.js ✓ - → Cache miss: content of input 'main.js' changed -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) From 67d7c5ae35dddeaa745a220200d965938249587c Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 18:19:20 +0800 Subject: [PATCH 05/12] style: use --- separator for compact summary --- crates/vite_task/src/session/reporter/summary.rs | 6 +----- .../snapshots/read file with colon in name.snap | 2 +- .../snapshots/replay logs chronological order.snap | 4 ++-- .../snapshots/multiple tasks get null stdin.snap | 2 +- .../snapshots/multiple tasks, cache disabled.snap | 2 +- .../snapshots/multiple tasks, cache hit.snap | 4 ++-- .../snapshots/multiple tasks, cache miss.snap | 2 +- .../stdio-detection/snapshots/single task, cache hit.snap | 2 +- ... ancestor forces piped for nested single-node graph.snap | 2 +- ...e chains inherit even with multi-node sibling graph.snap | 2 +- .../snapshots/no trailing newline.snap | 2 +- .../snapshots/interactive select with recursive.snap | 2 +- .../interactive select with typo and transitive.snap | 2 +- 13 files changed, 15 insertions(+), 19 deletions(-) diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs index bd40cce4..8a688085 100644 --- a/crates/vite_task/src/session/reporter/summary.rs +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -661,11 +661,7 @@ pub fn format_compact_summary(summary: &LastRunSummary) -> Vec { let mut buf = Vec::new(); // Thin line separator - let _ = writeln!( - buf, - "{}", - "────────────────────────────────────────────────".style(Style::new().bright_black()) - ); + let _ = writeln!(buf, "{}", "---".style(Style::new().bright_black())); if is_single_task { // Single task cache hit diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap index 0049c549..e8dde109 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap @@ -7,5 +7,5 @@ $ node read_node_fs.js > vp run read_colon_in_name # cache hit $ node read_node_fs.js ✓ cache hit, replaying -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap index f31d3581..32199a51 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap @@ -193,7 +193,7 @@ $ node build.js ✓ cache hit, replaying [echo.js] -------------------------------- [build.js] main process end -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > vp run build # cache hit $ node build.js ✓ cache hit, replaying @@ -291,5 +291,5 @@ $ node build.js ✓ cache hit, replaying [echo.js] -------------------------------- [build.js] main process end -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap index 3c901c41..20d787d5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap @@ -7,5 +7,5 @@ expression: e2e_outputs $ read-stdin ⊘ cache disabled: no cache config -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap index 609f3dfe..ee0f3ff2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap @@ -13,5 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap index 499f04fc..eee0924a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap @@ -13,7 +13,7 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > vp run -r check-tty-cached ~/packages/other$ check-tty ✓ cache hit, replaying @@ -26,5 +26,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 2/2 cache hit (100%), saved. (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap index 7d6c2f5d..878c7fda 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap @@ -13,5 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap index 71932f9f..2f1b1839 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache hit.snap @@ -13,5 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap index 25344f86..98410248 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap @@ -13,5 +13,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap index 0938afa1..11a55fb3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap @@ -23,5 +23,5 @@ stdin:not-tty stdout:not-tty stderr:not-tty -──────────────────────────────────────────────── +--- [vp run] 0/4 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index 109620ba..fa67ac90 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -8,5 +8,5 @@ foo $ echo bar ⊘ cache disabled: built-in command bar -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap index daa28af3..7970dc7c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap @@ -25,5 +25,5 @@ build lib ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap index b84ab7f1..cda4274b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap @@ -15,5 +15,5 @@ build lib ~/packages/app$ echo build app ⊘ cache disabled: built-in command build app -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) From fcc662b94410e6f68dececfe8ebf099eb7487ab6 Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 18:50:29 +0800 Subject: [PATCH 06/12] fix: update remaining snapshot files to use --- separator for compact summary --- .../snapshots/associate existing cache.snap | 2 +- .../snapshots/builtin different cwd.snap | 4 ++-- .../cache-disabled/snapshots/task with cache enabled.snap | 2 +- .../snapshots/cache miss command change.snap | 6 +++--- .../fixtures/cache-subcommand/snapshots/cache clean.snap | 2 +- .../multiple task failures returns exit code 1.snap | 2 +- .../snapshots/individual cache for extra args.snap | 4 ++-- .../snapshots/individual cache for envs.snap | 4 ++-- .../fixtures/lint-dot-git/snapshots/lint dot git.snap | 2 +- .../snapshots/shared caching inputs.snap | 4 ++-- ...recursive build runs dependencies before dependents.snap | 2 +- .../transitive build from app runs all dependencies.snap | 2 +- ...ransitive build from lib runs only its dependencies.snap | 2 +- .../snapshots/cache hit after file modification.snap | 4 ++-- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index 088de633..96505a45 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -9,7 +9,7 @@ hello $ print hello ✓ cache hit, replaying hello -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > json-edit package.json '_.scripts.script2 = "print world"' # change script2 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index b5d86997..85835032 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -41,7 +41,7 @@ $ vp lint ✓ cache hit, replaying Found 2 warnings and 0 errors. Finished in on 2 files with 90 rules using threads. -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > echo 'console.log(1);' > folder2/a.js # modify folder2 @@ -70,5 +70,5 @@ $ vp lint ✓ cache hit, replaying Found 1 warning and 0 errors. Finished in on 2 files with 90 rules using threads. -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index 034bb9ca..3014937b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -9,5 +9,5 @@ test content $ print-file test.txt ✓ cache hit, replaying test content -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index 72612d53..d0e41e4f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -9,7 +9,7 @@ foo $ print bar bar -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask @@ -20,7 +20,7 @@ baz $ print bar ✓ cache hit, replaying bar -──────────────────────────────────────────────── +--- [vp run] 1/2 cache hit (50%), saved. (Run `vp run --verbose` for full details) > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask @@ -28,5 +28,5 @@ bar $ print bar ✓ cache hit, replaying bar -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index 52c0382d..ac04c85c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -9,7 +9,7 @@ test content $ print-file test.txt ✓ cache hit, replaying test content -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > vp cache clean diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index 48441b3e..d66fbbff 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -7,5 +7,5 @@ expression: e2e_outputs ~/packages/pkg-b$ node -e "process.exit(7)" -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%), 2 failed. (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index 1e4cbf9e..13672042 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -12,11 +12,11 @@ b $ print a ✓ cache hit, replaying a -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > vp run say b # cache hit $ print b ✓ cache hit, replaying b -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap index 54ec023b..baee0694 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap @@ -12,11 +12,11 @@ $ print-env FOO ✗ cache miss: envs changed, executing $ print-env FOO ✓ cache hit, replaying 1 -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > FOO=2 vp run hello # cache hit $ print-env FOO ✓ cache hit, replaying 2 -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 61192a9f..17184c99 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -31,5 +31,5 @@ $ vp lint ✓ cache hit, replaying Found 1 warning and 0 errors. Finished in on 1 file with 90 rules using threads. -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap index ef5cb826..bc83c8bb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap @@ -9,7 +9,7 @@ initial content $ print-file foo.txt ✓ cache hit, replaying initial content -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. > replace-file-content foo.txt initial modified # modify shared input @@ -20,5 +20,5 @@ modified content $ print-file foo.txt ✓ cache hit, replaying modified content -──────────────────────────────────────────────── +--- [vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index 884482ce..d623687d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -12,5 +12,5 @@ Building lib ~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command Building app -──────────────────────────────────────────────── +--- [vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index d1ae7619..af577395 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -12,5 +12,5 @@ Building lib ~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command Building app -──────────────────────────────────────────────── +--- [vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index a93a7bca..cf093c95 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -9,5 +9,5 @@ Building core ~/packages/lib$ echo 'Building lib' ⊘ cache disabled: built-in command Building lib -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 140bb71f..12e7b040 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -9,7 +9,7 @@ hello $ print-file main.js console.log('foo'); -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) > replace-file-content main.js foo bar # modify input file @@ -20,5 +20,5 @@ hello $ print-file main.js ✗ cache miss: content of input 'main.js' changed, executing console.log('bar'); -──────────────────────────────────────────────── +--- [vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) From fed3a8283ad2fe2967591b82d1b16771c80e45de Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 21:33:22 +0800 Subject: [PATCH 07/12] fix: exclude cache directory from fspy tracking to prevent spurious cache misses Tools like oxlint traverse node_modules/ during execution, which causes fspy to record reads of files in the cache directory (SQLite DB, last-summary.json). When these cache files change between runs, fspy reports them as changed inputs, causing spurious cache misses. Thread cache_dir_relative through Session -> ExecutionContext -> spawn_with_tracking to filter out cache directory accesses alongside the existing .git exclusion. Also adds summary-output e2e test fixture with 10 test cases covering compact summary, --verbose, and --last-details. --- crates/vite_task/src/session/execute/mod.rs | 21 ++++- crates/vite_task/src/session/execute/spawn.rs | 13 ++- crates/vite_task/src/session/mod.rs | 15 +++- .../fixtures/summary-output/package.json | 4 + .../summary-output/packages/a/package.json | 6 ++ .../summary-output/packages/b/package.json | 9 +++ .../summary-output/pnpm-workspace.yaml | 2 + .../fixtures/summary-output/snapshots.toml | 80 +++++++++++++++++++ ...er multi task run shows saved summary.snap | 30 +++++++ ...details after run shows saved summary.snap | 21 +++++ ...ails with no previous run shows error.snap | 6 ++ ... all cache miss shows compact summary.snap | 13 +++ ...multi task verbose shows full summary.snap | 27 +++++++ ...se with cache hits shows full summary.snap | 36 +++++++++ ...with cache hits shows compact summary.snap | 22 +++++ ... task cache hit shows compact summary.snap | 13 +++ ...ngle task cache miss shows no summary.snap | 7 ++ ...ingle task verbose shows full summary.snap | 21 +++++ .../fixtures/summary-output/vite-task.json | 3 + 19 files changed, 343 insertions(+), 6 deletions(-) create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/package.json create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/pnpm-workspace.yaml create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details with no previous run shows error.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap create mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/vite-task.json diff --git a/crates/vite_task/src/session/execute/mod.rs b/crates/vite_task/src/session/execute/mod.rs index 54b7c8d3..80c20ad2 100644 --- a/crates/vite_task/src/session/execute/mod.rs +++ b/crates/vite_task/src/session/execute/mod.rs @@ -5,7 +5,7 @@ use std::{process::Stdio, sync::Arc}; use futures_util::FutureExt; use tokio::io::AsyncWriteExt as _; -use vite_path::AbsolutePath; +use vite_path::{AbsolutePath, RelativePath}; use vite_task_plan::{ ExecutionGraph, ExecutionItemDisplay, ExecutionItemKind, LeafExecutionKind, SpawnCommand, SpawnExecution, @@ -56,6 +56,11 @@ struct ExecutionContext<'a> { /// Base path for resolving relative paths in cache entries. /// Typically the workspace root. cache_base_path: &'a Arc, + /// Cache directory path relative to the workspace root. + /// Used to exclude cache directory accesses from fspy tracking (the cache + /// directory is infrastructure, not a task input). + /// `None` when the cache directory is outside the workspace (custom `VITE_CACHE_PATH`). + cache_dir_relative: Option<&'a RelativePath>, } impl ExecutionContext<'_> { @@ -152,9 +157,14 @@ impl ExecutionContext<'_> { clippy::large_futures, reason = "spawn execution with cache management creates large futures" )] - let _ = - execute_spawn(leaf_reporter, spawn_execution, self.cache, self.cache_base_path) - .await; + let _ = execute_spawn( + leaf_reporter, + spawn_execution, + self.cache, + self.cache_base_path, + self.cache_dir_relative, + ) + .await; } } } @@ -184,6 +194,7 @@ pub async fn execute_spawn( spawn_execution: &SpawnExecution, cache: &ExecutionCache, cache_base_path: &Arc, + cache_dir_relative: Option<&RelativePath>, ) -> SpawnOutcome { let cache_metadata = spawn_execution.cache_metadata.as_ref(); @@ -293,6 +304,7 @@ pub async fn execute_spawn( &mut stdio_config.stdout_writer, &mut stdio_config.stderr_writer, track_result_with_cache_metadata.as_mut().map(|(track_result, _)| track_result), + cache_dir_relative, ) .await { @@ -418,6 +430,7 @@ impl Session<'_> { reporter: &mut *reporter, cache, cache_base_path: &self.workspace_path, + cache_dir_relative: self.cache_dir_relative.as_deref(), }; // Execute the graph. Leaf-level errors are reported through the reporter diff --git a/crates/vite_task/src/session/execute/spawn.rs b/crates/vite_task/src/session/execute/spawn.rs index db63b912..7b8a2d72 100644 --- a/crates/vite_task/src/session/execute/spawn.rs +++ b/crates/vite_task/src/session/execute/spawn.rs @@ -11,7 +11,7 @@ use fspy::AccessMode; use rustc_hash::FxHashSet; use serde::Serialize; use tokio::io::{AsyncReadExt as _, AsyncWrite, AsyncWriteExt as _}; -use vite_path::{AbsolutePath, RelativePathBuf}; +use vite_path::{AbsolutePath, RelativePath, RelativePathBuf}; use vite_task_plan::SpawnCommand; use crate::collections::HashMap; @@ -75,6 +75,7 @@ pub async fn spawn_with_tracking( stdout_writer: &mut (dyn AsyncWrite + Unpin), stderr_writer: &mut (dyn AsyncWrite + Unpin), track_result: Option<&mut SpawnTrackResult>, + cache_dir_relative: Option<&RelativePath>, ) -> anyhow::Result { /// The tracking state of the spawned process enum TrackingState<'a> { @@ -206,6 +207,16 @@ pub async fn spawn_with_tracking( continue; } + // Skip cache directory accesses — the cache directory is infrastructure + // (SQLite DB, last-summary.json), not a task input. Tools like oxlint may + // traverse node_modules/ and read files in the cache directory, which would + // otherwise cause spurious cache misses when those files change between runs. + if let Some(cache_dir) = cache_dir_relative + && relative_path.as_path().strip_prefix(cache_dir).is_ok() + { + continue; + } + if access.mode.contains(AccessMode::READ) { path_reads.entry(relative_path.clone()).or_insert(PathRead { read_dir_entries: false }); } diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 190d72d9..d4a567ff 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -15,7 +15,7 @@ use reporter::{ summary::{LastRunSummary, ReadSummaryError, format_full_summary}, }; use rustc_hash::FxHashMap; -use vite_path::{AbsolutePath, AbsolutePathBuf}; +use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_select::SelectItem; use vite_str::Str; use vite_task_graph::{ @@ -141,6 +141,11 @@ pub struct Session<'a> { /// processes (e.g., parallel `vp lib` commands) start simultaneously. cache: OnceCell, cache_path: AbsolutePathBuf, + /// Cache directory path relative to the workspace root. + /// Used to exclude cache directory accesses from fspy tracking (the cache + /// directory is infrastructure, not a task input). + /// `None` when the cache directory is outside the workspace (custom `VITE_CACHE_PATH`). + cache_dir_relative: Option, } fn get_cache_path_of_workspace(workspace_root: &AbsolutePath) -> AbsolutePathBuf { @@ -198,6 +203,12 @@ impl<'a> Session<'a> { let (workspace_root, _) = find_workspace_root(&cwd)?; let cache_path = get_cache_path_of_workspace(&workspace_root.path); + // Compute the cache directory path relative to the workspace root. + // Used to exclude cache directory accesses from fspy tracking. + // `None` if the cache path is outside the workspace (custom VITE_CACHE_PATH) + // or if stripping the prefix fails. + let cache_dir_relative = cache_path.strip_prefix(&workspace_root.path).ok().flatten(); + // Prepend workspace's node_modules/.bin to PATH let workspace_node_modules_bin = workspace_root.path.join("node_modules").join(".bin"); prepend_path_env(&mut envs, &workspace_node_modules_bin)?; @@ -214,6 +225,7 @@ impl<'a> Session<'a> { plan_request_parser: PlanRequestParser { command_handler: callbacks.command_handler }, cache: OnceCell::new(), cache_path, + cache_dir_relative, }) } @@ -545,6 +557,7 @@ impl<'a> Session<'a> { &spawn_execution, cache, &self.workspace_path, + self.cache_dir_relative.as_deref(), ) .await { diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/package.json new file mode 100644 index 00000000..99f164ce --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/package.json @@ -0,0 +1,4 @@ +{ + "name": "summary-output-test", + "private": true +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json new file mode 100644 index 00000000..e940683c --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json @@ -0,0 +1,6 @@ +{ + "name": "@summary/a", + "scripts": { + "build": "print built-a" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json new file mode 100644 index 00000000..08f6e258 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json @@ -0,0 +1,9 @@ +{ + "name": "@summary/b", + "dependencies": { + "@summary/a": "workspace:*" + }, + "scripts": { + "build": "print built-b" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/pnpm-workspace.yaml new file mode 100644 index 00000000..924b55f4 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml new file mode 100644 index 00000000..ae9adc6a --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml @@ -0,0 +1,80 @@ +# Tests for compact and verbose summary output + +# Single task, cache miss → no summary at all +[[e2e]] +name = "single task cache miss shows no summary" +cwd = "packages/a" +steps = [ + "vp run build", +] + +# Single task, cache hit → compact one-liner +[[e2e]] +name = "single task cache hit shows compact summary" +cwd = "packages/a" +steps = [ + "vp run build # first run, cache miss", + "vp run build # second run, cache hit → compact summary", +] + +# Multi-task (recursive), all cache miss → compact summary with 0 hits +[[e2e]] +name = "multi task all cache miss shows compact summary" +steps = [ + "vp run -r build", +] + +# Multi-task (recursive), some cache hits → compact summary with hit count +[[e2e]] +name = "multi task with cache hits shows compact summary" +steps = [ + "vp run -r build # first run, all miss", + "vp run -r build # second run, all hit", +] + +# Single task with --verbose → full detailed summary +[[e2e]] +name = "single task verbose shows full summary" +cwd = "packages/a" +steps = [ + "vp run -v build", +] + +# Multi-task with --verbose → full detailed summary +[[e2e]] +name = "multi task verbose shows full summary" +steps = [ + "vp run -r -v build", +] + +# Multi-task with --verbose after cache hits +[[e2e]] +name = "multi task verbose with cache hits shows full summary" +steps = [ + "vp run -r build # first run, populate cache", + "vp run -r -v build # second run, verbose with cache hits", +] + +# --last-details with no previous run +[[e2e]] +name = "last details with no previous run shows error" +steps = [ + "vp run --last-details", +] + +# --last-details after a run shows saved summary +[[e2e]] +name = "last details after run shows saved summary" +cwd = "packages/a" +steps = [ + "vp run build # populate summary file", + "vp run --last-details # display saved summary", +] + +# --last-details after a multi-task run +[[e2e]] +name = "last details after multi task run shows saved summary" +steps = [ + "vp run -r build # populate summary file", + "vp run --last-details # display saved summary", +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap new file mode 100644 index 00000000..24272f2c --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap @@ -0,0 +1,30 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -r build # populate summary file +~/packages/a$ print built-a +built-a + +~/packages/b$ print built-b +built-b + +--- +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +> vp run --last-details # display saved summary + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 2 tasks • 0 cache hits • 2 cache misses +Performance: 0% cache hit rate + +Task Details: +──────────────────────────────────────────────── + [1] @summary/a#build: ~/packages/a$ print built-a ✓ + → Cache miss: no previous cache entry found + ······················································· + [2] @summary/b#build: ~/packages/b$ print built-b ✓ + → Cache miss: no previous cache entry found +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap new file mode 100644 index 00000000..01712736 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap @@ -0,0 +1,21 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run build # populate summary file +~/packages/a$ print built-a +built-a +> vp run --last-details # display saved summary + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 1 tasks • 0 cache hits • 1 cache misses +Performance: 0% cache hit rate + +Task Details: +──────────────────────────────────────────────── + [1] @summary/a#build: ~/packages/a$ print built-a ✓ + → Cache miss: no previous cache entry found +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details with no previous run shows error.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details with no previous run shows error.snap new file mode 100644 index 00000000..29df10a7 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details with no previous run shows error.snap @@ -0,0 +1,6 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +[1]> vp run --last-details +No previous run summary found. Run a task first to generate a summary. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap new file mode 100644 index 00000000..f5fa225a --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap @@ -0,0 +1,13 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -r build +~/packages/a$ print built-a +built-a + +~/packages/b$ print built-b +built-b + +--- +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap new file mode 100644 index 00000000..f0d6fbcc --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap @@ -0,0 +1,27 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -r -v build +~/packages/a$ print built-a +built-a + +~/packages/b$ print built-b +built-b + + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 2 tasks • 0 cache hits • 2 cache misses +Performance: 0% cache hit rate + +Task Details: +──────────────────────────────────────────────── + [1] @summary/a#build: ~/packages/a$ print built-a ✓ + → Cache miss: no previous cache entry found + ······················································· + [2] @summary/b#build: ~/packages/b$ print built-b ✓ + → Cache miss: no previous cache entry found +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap new file mode 100644 index 00000000..6adfbe51 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap @@ -0,0 +1,36 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -r build # first run, populate cache +~/packages/a$ print built-a +built-a + +~/packages/b$ print built-b +built-b + +--- +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +> vp run -r -v build # second run, verbose with cache hits +~/packages/a$ print built-a ✓ cache hit, replaying +built-a + +~/packages/b$ print built-b ✓ cache hit, replaying +built-b + + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 2 tasks • 2 cache hits • 0 cache misses +Performance: 100% cache hit rate, saved in total + +Task Details: +──────────────────────────────────────────────── + [1] @summary/a#build: ~/packages/a$ print built-a ✓ + → Cache hit - output replayed - saved + ······················································· + [2] @summary/b#build: ~/packages/b$ print built-b ✓ + → Cache hit - output replayed - saved +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap new file mode 100644 index 00000000..3b57f1a9 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap @@ -0,0 +1,22 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -r build # first run, all miss +~/packages/a$ print built-a +built-a + +~/packages/b$ print built-b +built-b + +--- +[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +> vp run -r build # second run, all hit +~/packages/a$ print built-a ✓ cache hit, replaying +built-a + +~/packages/b$ print built-b ✓ cache hit, replaying +built-b + +--- +[vp run] 2/2 cache hit (100%), saved. (Run `vp run --verbose` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap new file mode 100644 index 00000000..358657d8 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap @@ -0,0 +1,13 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run build # first run, cache miss +~/packages/a$ print built-a +built-a +> vp run build # second run, cache hit → compact summary +~/packages/a$ print built-a ✓ cache hit, replaying +built-a + +--- +[vp run] cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap new file mode 100644 index 00000000..b3fecf79 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap @@ -0,0 +1,7 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run build +~/packages/a$ print built-a +built-a diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap new file mode 100644 index 00000000..28abff9f --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap @@ -0,0 +1,21 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vp run -v build +~/packages/a$ print built-a +built-a + + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 1 tasks • 0 cache hits • 1 cache misses +Performance: 0% cache hit rate + +Task Details: +──────────────────────────────────────────────── + [1] @summary/a#build: ~/packages/a$ print built-a ✓ + → Cache miss: no previous cache entry found +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/vite-task.json new file mode 100644 index 00000000..1d0fe9f2 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/vite-task.json @@ -0,0 +1,3 @@ +{ + "cacheScripts": true +} From 7d49f24fb40ada5d86fbb7541421d516c9f4dfef Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 21:44:53 +0800 Subject: [PATCH 08/12] revert: remove cache directory exclusion from fspy tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cache directory should not be special-cased in fspy. Instead, tests that run tools like oxlint should include a .gitignore with 'node_modules' to prevent the tool from traversing the cache directory — matching the setup of real projects. --- crates/vite_task/src/session/execute/mod.rs | 21 ++++--------------- crates/vite_task/src/session/execute/spawn.rs | 13 +----------- crates/vite_task/src/session/mod.rs | 15 +------------ 3 files changed, 6 insertions(+), 43 deletions(-) diff --git a/crates/vite_task/src/session/execute/mod.rs b/crates/vite_task/src/session/execute/mod.rs index 80c20ad2..54b7c8d3 100644 --- a/crates/vite_task/src/session/execute/mod.rs +++ b/crates/vite_task/src/session/execute/mod.rs @@ -5,7 +5,7 @@ use std::{process::Stdio, sync::Arc}; use futures_util::FutureExt; use tokio::io::AsyncWriteExt as _; -use vite_path::{AbsolutePath, RelativePath}; +use vite_path::AbsolutePath; use vite_task_plan::{ ExecutionGraph, ExecutionItemDisplay, ExecutionItemKind, LeafExecutionKind, SpawnCommand, SpawnExecution, @@ -56,11 +56,6 @@ struct ExecutionContext<'a> { /// Base path for resolving relative paths in cache entries. /// Typically the workspace root. cache_base_path: &'a Arc, - /// Cache directory path relative to the workspace root. - /// Used to exclude cache directory accesses from fspy tracking (the cache - /// directory is infrastructure, not a task input). - /// `None` when the cache directory is outside the workspace (custom `VITE_CACHE_PATH`). - cache_dir_relative: Option<&'a RelativePath>, } impl ExecutionContext<'_> { @@ -157,14 +152,9 @@ impl ExecutionContext<'_> { clippy::large_futures, reason = "spawn execution with cache management creates large futures" )] - let _ = execute_spawn( - leaf_reporter, - spawn_execution, - self.cache, - self.cache_base_path, - self.cache_dir_relative, - ) - .await; + let _ = + execute_spawn(leaf_reporter, spawn_execution, self.cache, self.cache_base_path) + .await; } } } @@ -194,7 +184,6 @@ pub async fn execute_spawn( spawn_execution: &SpawnExecution, cache: &ExecutionCache, cache_base_path: &Arc, - cache_dir_relative: Option<&RelativePath>, ) -> SpawnOutcome { let cache_metadata = spawn_execution.cache_metadata.as_ref(); @@ -304,7 +293,6 @@ pub async fn execute_spawn( &mut stdio_config.stdout_writer, &mut stdio_config.stderr_writer, track_result_with_cache_metadata.as_mut().map(|(track_result, _)| track_result), - cache_dir_relative, ) .await { @@ -430,7 +418,6 @@ impl Session<'_> { reporter: &mut *reporter, cache, cache_base_path: &self.workspace_path, - cache_dir_relative: self.cache_dir_relative.as_deref(), }; // Execute the graph. Leaf-level errors are reported through the reporter diff --git a/crates/vite_task/src/session/execute/spawn.rs b/crates/vite_task/src/session/execute/spawn.rs index 7b8a2d72..db63b912 100644 --- a/crates/vite_task/src/session/execute/spawn.rs +++ b/crates/vite_task/src/session/execute/spawn.rs @@ -11,7 +11,7 @@ use fspy::AccessMode; use rustc_hash::FxHashSet; use serde::Serialize; use tokio::io::{AsyncReadExt as _, AsyncWrite, AsyncWriteExt as _}; -use vite_path::{AbsolutePath, RelativePath, RelativePathBuf}; +use vite_path::{AbsolutePath, RelativePathBuf}; use vite_task_plan::SpawnCommand; use crate::collections::HashMap; @@ -75,7 +75,6 @@ pub async fn spawn_with_tracking( stdout_writer: &mut (dyn AsyncWrite + Unpin), stderr_writer: &mut (dyn AsyncWrite + Unpin), track_result: Option<&mut SpawnTrackResult>, - cache_dir_relative: Option<&RelativePath>, ) -> anyhow::Result { /// The tracking state of the spawned process enum TrackingState<'a> { @@ -207,16 +206,6 @@ pub async fn spawn_with_tracking( continue; } - // Skip cache directory accesses — the cache directory is infrastructure - // (SQLite DB, last-summary.json), not a task input. Tools like oxlint may - // traverse node_modules/ and read files in the cache directory, which would - // otherwise cause spurious cache misses when those files change between runs. - if let Some(cache_dir) = cache_dir_relative - && relative_path.as_path().strip_prefix(cache_dir).is_ok() - { - continue; - } - if access.mode.contains(AccessMode::READ) { path_reads.entry(relative_path.clone()).or_insert(PathRead { read_dir_entries: false }); } diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index d4a567ff..190d72d9 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -15,7 +15,7 @@ use reporter::{ summary::{LastRunSummary, ReadSummaryError, format_full_summary}, }; use rustc_hash::FxHashMap; -use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; +use vite_path::{AbsolutePath, AbsolutePathBuf}; use vite_select::SelectItem; use vite_str::Str; use vite_task_graph::{ @@ -141,11 +141,6 @@ pub struct Session<'a> { /// processes (e.g., parallel `vp lib` commands) start simultaneously. cache: OnceCell, cache_path: AbsolutePathBuf, - /// Cache directory path relative to the workspace root. - /// Used to exclude cache directory accesses from fspy tracking (the cache - /// directory is infrastructure, not a task input). - /// `None` when the cache directory is outside the workspace (custom `VITE_CACHE_PATH`). - cache_dir_relative: Option, } fn get_cache_path_of_workspace(workspace_root: &AbsolutePath) -> AbsolutePathBuf { @@ -203,12 +198,6 @@ impl<'a> Session<'a> { let (workspace_root, _) = find_workspace_root(&cwd)?; let cache_path = get_cache_path_of_workspace(&workspace_root.path); - // Compute the cache directory path relative to the workspace root. - // Used to exclude cache directory accesses from fspy tracking. - // `None` if the cache path is outside the workspace (custom VITE_CACHE_PATH) - // or if stripping the prefix fails. - let cache_dir_relative = cache_path.strip_prefix(&workspace_root.path).ok().flatten(); - // Prepend workspace's node_modules/.bin to PATH let workspace_node_modules_bin = workspace_root.path.join("node_modules").join(".bin"); prepend_path_env(&mut envs, &workspace_node_modules_bin)?; @@ -225,7 +214,6 @@ impl<'a> Session<'a> { plan_request_parser: PlanRequestParser { command_handler: callbacks.command_handler }, cache: OnceCell::new(), cache_path, - cache_dir_relative, }) } @@ -557,7 +545,6 @@ impl<'a> Session<'a> { &spawn_execution, cache, &self.workspace_path, - self.cache_dir_relative.as_deref(), ) .await { From cc005960698a8cd88fe193183620d691df834536 Mon Sep 17 00:00:00 2001 From: branchseer Date: Tue, 24 Feb 2026 22:10:28 +0800 Subject: [PATCH 09/12] fix: always flush reporter writer after graph execution On main, finish_graph_execution always wrote the full summary and flushed. With the compact summary, single-task non-cache-hit produces no summary output, so the flush was skipped. This caused child process output written via Stdio::inherit() to not be committed to the output stream, making it invisible to callers reading the same fd. --- crates/vite_task/src/session/reporter/labeled.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/vite_task/src/session/reporter/labeled.rs b/crates/vite_task/src/session/reporter/labeled.rs index d36bee7c..e901764a 100644 --- a/crates/vite_task/src/session/reporter/labeled.rs +++ b/crates/vite_task/src/session/reporter/labeled.rs @@ -186,9 +186,14 @@ impl GraphExecutionReporter for LabeledGraphReporter { } // Write the summary buffer asynchronously. - if !summary_buf.is_empty() { + // Always flush the writer — even when the summary is empty, a preceding + // spawned process may have written to the same fd via Stdio::inherit() + // and the data must be flushed before the caller reads the output. + { let mut writer = self.writer.borrow_mut(); - let _ = writer.write_all(&summary_buf).await; + if !summary_buf.is_empty() { + let _ = writer.write_all(&summary_buf).await; + } let _ = writer.flush().await; } From 24baf0b312840ce0e6f7dd67cc3bf2aa9b3cda6b Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 25 Feb 2026 09:44:14 +0800 Subject: [PATCH 10/12] refactor: rename ParsedCommand to Command and make resolved types internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename `ParsedCommand` → `Command` and `ParsedRunCommand` → `RunCommand` as the public API types - Rename old `Command` → `ResolvedCommand` and old `RunCommand` → `ResolvedRunCommand` as crate-internal types - `Session::main` and `HandledCommand::ViteTaskCommand` now accept `Command` directly (no `.into_command()` needed) - Fix summary message: `--verbose` → `--last-details` Co-Authored-By: Claude Opus 4.6 --- crates/vite_task/src/cli/mod.rs | 72 ++++++++++--------- crates/vite_task/src/lib.rs | 2 +- crates/vite_task/src/session/mod.rs | 39 +++++++--- .../vite_task/src/session/reporter/summary.rs | 2 +- crates/vite_task_bin/src/lib.rs | 8 +-- crates/vite_task_bin/src/main.rs | 2 +- .../snapshots/cache miss command change.snap | 4 +- ...ple task failures returns exit code 1.snap | 2 +- .../multiple tasks get null stdin.snap | 2 +- .../multiple tasks, cache disabled.snap | 2 +- .../snapshots/multiple tasks, cache hit.snap | 4 +- .../snapshots/multiple tasks, cache miss.snap | 2 +- ...es piped for nested single-node graph.snap | 2 +- ...it even with multi-node sibling graph.snap | 2 +- ...er multi task run shows saved summary.snap | 2 +- ... all cache miss shows compact summary.snap | 2 +- ...se with cache hits shows full summary.snap | 2 +- ...with cache hits shows compact summary.snap | 4 +- .../snapshots/no trailing newline.snap | 2 +- .../interactive select with recursive.snap | 2 +- ...ctive select with typo and transitive.snap | 2 +- ...d runs dependencies before dependents.snap | 2 +- ... build from app runs all dependencies.snap | 2 +- ...d from lib runs only its dependencies.snap | 2 +- .../cache hit after file modification.snap | 4 +- .../tests/plan_snapshots/main.rs | 6 +- 26 files changed, 101 insertions(+), 76 deletions(-) diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 38d75101..87353ee7 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -37,38 +37,38 @@ pub struct RunFlags { } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -// Clap-parsed types (used only at the parsing boundary) +// Public CLI types (clap-parsed) // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ /// Arguments for the `run` subcommand as parsed by clap. /// /// Contains the `--last-details` flag which is resolved into a separate -/// [`Command::RunLastDetails`] variant via [`ParsedCommand::into_command`]. +/// [`ResolvedCommand::RunLastDetails`] variant via [`Command::into_resolved`]. #[derive(Debug, clap::Args)] -pub struct ParsedRunCommand { +pub struct RunCommand { /// `packageName#taskName` or `taskName`. If omitted, lists all available tasks. - task_specifier: Option, + pub(crate) task_specifier: Option, #[clap(flatten)] - flags: RunFlags, + pub(crate) flags: RunFlags, /// Additional arguments to pass to the tasks #[clap(trailing_var_arg = true, allow_hyphen_values = true)] - additional_args: Vec, + pub(crate) additional_args: Vec, /// Display the detailed summary of the last run. #[clap(long, exclusive = true)] - last_details: bool, + pub(crate) last_details: bool, } /// vite task CLI subcommands as parsed by clap. /// -/// Use [`ParsedCommand::into_command`] to resolve into the dispatched [`Command`] -/// enum, which makes `--last-details` exclusive at the type level. +/// Pass directly to [`Session::main`] or [`HandledCommand::ViteTaskCommand`]. +/// The `--last-details` flag on the `run` subcommand is resolved internally. #[derive(Debug, Parser)] -pub enum ParsedCommand { +pub enum Command { /// Run tasks - Run(ParsedRunCommand), + Run(RunCommand), /// Manage the task cache Cache { #[clap(subcommand)] @@ -76,39 +76,35 @@ pub enum ParsedCommand { }, } -impl ParsedCommand { - /// Resolve the clap-parsed command into the dispatched [`Command`] enum. +impl Command { + /// Resolve the clap-parsed command into the dispatched [`ResolvedCommand`] enum. /// /// When `--last-details` is set on the `run` subcommand, this produces - /// [`Command::RunLastDetails`] instead of [`Command::Run`], making the - /// exclusivity enforced at the type level. + /// [`ResolvedCommand::RunLastDetails`] instead of [`ResolvedCommand::Run`], + /// making the exclusivity enforced at the type level. #[must_use] - pub fn into_command(self) -> Command { + pub(crate) fn into_resolved(self) -> ResolvedCommand { match self { - Self::Run(run) if run.last_details => Command::RunLastDetails, - Self::Run(run) => Command::Run(RunCommand { - task_specifier: run.task_specifier, - flags: run.flags, - additional_args: run.additional_args, - }), - Self::Cache { subcmd } => Command::Cache { subcmd }, + Self::Run(run) if run.last_details => ResolvedCommand::RunLastDetails, + Self::Run(run) => ResolvedCommand::Run(run.into_resolved()), + Self::Cache { subcmd } => ResolvedCommand::Cache { subcmd }, } } } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -// Resolved types (used for dispatch — `--last-details` is a separate variant) +// Internal resolved types (used for dispatch — `--last-details` is a separate variant) // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -/// Resolved CLI command for dispatch. +/// Resolved CLI command for internal dispatch. /// -/// Unlike [`ParsedCommand`], this enum makes `--last-details` a separate variant -/// ([`Command::RunLastDetails`]) so that it is exclusive at the type level — +/// Unlike [`Command`], this enum makes `--last-details` a separate variant +/// ([`ResolvedCommand::RunLastDetails`]) so that it is exclusive at the type level — /// there is no way to combine it with task execution fields. #[derive(Debug)] -pub enum Command { +pub enum ResolvedCommand { /// Run tasks with the given parameters. - Run(RunCommand), + Run(ResolvedRunCommand), /// Display the saved detailed summary of the last run (`--last-details`). RunLastDetails, /// Manage the task cache. @@ -118,9 +114,9 @@ pub enum Command { /// Resolved arguments for executing tasks. /// /// Does not contain `last_details` — that case is represented by -/// [`Command::RunLastDetails`] instead. +/// [`ResolvedCommand::RunLastDetails`] instead. #[derive(Debug)] -pub struct RunCommand { +pub struct ResolvedRunCommand { /// `packageName#taskName` or `taskName`. If omitted, lists all available tasks. pub task_specifier: Option, @@ -130,6 +126,18 @@ pub struct RunCommand { pub additional_args: Vec, } +impl RunCommand { + /// Convert to the resolved run command, stripping the `last_details` flag. + #[must_use] + pub(crate) fn into_resolved(self) -> ResolvedRunCommand { + ResolvedRunCommand { + task_specifier: self.task_specifier, + flags: self.flags, + additional_args: self.additional_args, + } + } +} + #[derive(thiserror::Error, Debug)] pub enum CLITaskQueryError { #[error("no task specifier provided")] @@ -142,7 +150,7 @@ pub enum CLITaskQueryError { PackageNameSpecifiedWithRecursive { package_name: Str, task_name: Str }, } -impl RunCommand { +impl ResolvedRunCommand { /// Convert to `QueryPlanRequest`, or return an error if invalid. /// /// # Errors diff --git a/crates/vite_task/src/lib.rs b/crates/vite_task/src/lib.rs index 35c172ac..41e7c04b 100644 --- a/crates/vite_task/src/lib.rs +++ b/crates/vite_task/src/lib.rs @@ -4,7 +4,7 @@ mod maybe_str; pub mod session; // Public exports for vite_task_bin -pub use cli::{CacheSubcommand, Command, ParsedCommand, RunCommand, RunFlags}; +pub use cli::{CacheSubcommand, Command, RunCommand, RunFlags}; pub use session::{CommandHandler, ExitStatus, HandledCommand, Session, SessionCallbacks}; pub use vite_task_graph::{ config::{ diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 190d72d9..eb0c2b52 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -29,7 +29,7 @@ use vite_task_plan::{ }; use vite_workspace::{WorkspaceRoot, find_workspace_root}; -use crate::cli::{CacheSubcommand, Command, RunCommand, RunFlags}; +use crate::cli::{CacheSubcommand, Command, ResolvedCommand, RunCommand, RunFlags}; #[derive(Debug)] enum LazyTaskGraph<'a> { @@ -100,13 +100,13 @@ impl vite_task_plan::PlanRequestParser for PlanRequestParser<'_> { ) -> anyhow::Result> { match self.command_handler.handle_command(command).await? { HandledCommand::Synthesized(synthetic) => Ok(Some(PlanRequest::Synthetic(synthetic))), - HandledCommand::ViteTaskCommand(cli_command) => match cli_command { - Command::Cache { .. } | Command::RunLastDetails => { + HandledCommand::ViteTaskCommand(cli_command) => match cli_command.into_resolved() { + ResolvedCommand::Cache { .. } | ResolvedCommand::RunLastDetails => { Ok(Some(PlanRequest::Synthetic( command.to_synthetic_plan_request(UserCacheConfig::disabled()), ))) } - Command::Run(run_command) => { + ResolvedCommand::Run(run_command) => { match run_command.into_query_plan_request(&command.cwd) { Ok(query_plan_request) => Ok(Some(PlanRequest::Query(query_plan_request))), Err(crate::cli::CLITaskQueryError::MissingTaskSpecifier) => { @@ -227,10 +227,10 @@ impl<'a> Session<'a> { reason = "session is single-threaded, futures do not need to be Send" )] pub async fn main(mut self, command: Command) -> anyhow::Result { - match command { - Command::Cache { ref subcmd } => self.handle_cache_command(subcmd), - Command::RunLastDetails => self.show_last_run_details(), - Command::Run(run_command) => { + match command.into_resolved() { + ResolvedCommand::Cache { ref subcmd } => self.handle_cache_command(subcmd), + ResolvedCommand::RunLastDetails => self.show_last_run_details(), + ResolvedCommand::Run(run_command) => { let cwd = Arc::clone(&self.cwd); let is_interactive = std::io::stdin().is_terminal() && std::io::stdout().is_terminal(); @@ -241,7 +241,7 @@ impl<'a> Session<'a> { let flags = run_command.flags; let additional_args = run_command.additional_args.clone(); - match self.plan_from_cli_run(cwd, run_command).await { + match self.plan_from_cli_run_resolved(cwd, run_command).await { Ok(ref graph) if graph.node_count() == 0 => { // No tasks matched the query — show task selector / "did you mean" self.handle_no_task( @@ -399,8 +399,12 @@ impl<'a> Session<'a> { let selected_label = &select_items[selected_index].label; let task_specifier = TaskSpecifier::parse_raw(selected_label); let show_details = flags.verbose; - let run_command = - RunCommand { task_specifier: Some(task_specifier), flags, additional_args }; + let run_command = RunCommand { + task_specifier: Some(task_specifier), + flags, + additional_args, + last_details: false, + }; let cwd = Arc::clone(&self.cwd); let graph = self.plan_from_cli_run(cwd, run_command).await?; @@ -579,6 +583,19 @@ impl<'a> Session<'a> { &mut self, cwd: Arc, command: RunCommand, + ) -> Result { + self.plan_from_cli_run_resolved(cwd, command.into_resolved()).await + } + + /// Internal: plans execution from a resolved run command. + #[expect( + clippy::future_not_send, + reason = "session is single-threaded, futures do not need to be Send" + )] + async fn plan_from_cli_run_resolved( + &mut self, + cwd: Arc, + command: crate::cli::ResolvedRunCommand, ) -> Result { let query_plan_request = match command.into_query_plan_request(&cwd) { Ok(query_plan_request) => query_plan_request, diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs index 8a688085..8178bd2b 100644 --- a/crates/vite_task/src/session/reporter/summary.rs +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -709,7 +709,7 @@ pub fn format_compact_summary(summary: &LastRunSummary) -> Vec { let _ = write!( buf, ". {}", - "(Run `vp run --verbose` for full details)".style(Style::new().bright_black()), + "(Run `vp run --last-details` for full details)".style(Style::new().bright_black()), ); let _ = writeln!(buf); } diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index 4d4032a7..c2560653 100644 --- a/crates/vite_task_bin/src/lib.rs +++ b/crates/vite_task_bin/src/lib.rs @@ -10,8 +10,8 @@ use rustc_hash::FxHashMap; use vite_path::AbsolutePath; use vite_str::Str; use vite_task::{ - EnabledCacheConfig, HandledCommand, ParsedCommand, ScriptCommand, SessionCallbacks, - UserCacheConfig, get_path_env, plan_request::SyntheticPlanRequest, + Command, EnabledCacheConfig, HandledCommand, ScriptCommand, SessionCallbacks, UserCacheConfig, + get_path_env, plan_request::SyntheticPlanRequest, }; #[derive(Debug, Default)] @@ -85,7 +85,7 @@ pub enum Args { value: Str, }, #[command(flatten)] - Task(ParsedCommand), + Task(Command), } #[async_trait::async_trait(?Send)] @@ -130,7 +130,7 @@ impl vite_task::CommandHandler for CommandHandler { envs: Arc::new(envs), })) } - Args::Task(parsed) => Ok(HandledCommand::ViteTaskCommand(parsed.into_command())), + Args::Task(parsed) => Ok(HandledCommand::ViteTaskCommand(parsed)), } } } diff --git a/crates/vite_task_bin/src/main.rs b/crates/vite_task_bin/src/main.rs index 79b4acb0..b4a1320b 100644 --- a/crates/vite_task_bin/src/main.rs +++ b/crates/vite_task_bin/src/main.rs @@ -21,7 +21,7 @@ async fn run() -> anyhow::Result { let mut owned_callbacks = OwnedSessionCallbacks::default(); let session = Session::init(owned_callbacks.as_callbacks())?; match args { - Args::Task(parsed) => session.main(parsed.into_command()).await, + Args::Task(parsed) => session.main(parsed).await, args => { // If env FOO is set, run `print-env FOO` via Session::exec before proceeding. // In vite-plus, Session::exec is used for auto-install. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index d0e41e4f..8d10e3cf 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -10,7 +10,7 @@ $ print bar bar --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask > vp run task # first: cache miss, second: cache hit @@ -21,7 +21,7 @@ $ print bar ✓ cache hit, replaying bar --- -[vp run] 1/2 cache hit (50%), saved. (Run `vp run --verbose` for full details) +[vp run] 1/2 cache hit (50%), saved. (Run `vp run --last-details` for full details) > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask > vp run task # cache hit diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index d66fbbff..28687d8a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -8,4 +8,4 @@ expression: e2e_outputs ~/packages/pkg-b$ node -e "process.exit(7)" --- -[vp run] 0/2 cache hit (0%), 2 failed. (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%), 2 failed. (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap index 20d787d5..6f6c2e76 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap @@ -8,4 +8,4 @@ expression: e2e_outputs $ read-stdin ⊘ cache disabled: no cache config --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap index ee0f3ff2..4e6c149d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap index eee0924a..45275846 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache hit.snap @@ -14,7 +14,7 @@ stdout:not-tty stderr:not-tty --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > vp run -r check-tty-cached ~/packages/other$ check-tty ✓ cache hit, replaying stdin:not-tty @@ -27,4 +27,4 @@ stdout:not-tty stderr:not-tty --- -[vp run] 2/2 cache hit (100%), saved. (Run `vp run --verbose` for full details) +[vp run] 2/2 cache hit (100%), saved. (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap index 878c7fda..b323837e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache miss.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap index 98410248..b96cd0a4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap @@ -14,4 +14,4 @@ stdout:not-tty stderr:not-tty --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap index 11a55fb3..b0a2eda8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap @@ -24,4 +24,4 @@ stdout:not-tty stderr:not-tty --- -[vp run] 0/4 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/4 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap index 24272f2c..68443d6a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap @@ -10,7 +10,7 @@ built-a built-b --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > vp run --last-details # display saved summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap index f5fa225a..d9feb62d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap @@ -10,4 +10,4 @@ built-a built-b --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap index 6adfbe51..559bd896 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap @@ -10,7 +10,7 @@ built-a built-b --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > vp run -r -v build # second run, verbose with cache hits ~/packages/a$ print built-a ✓ cache hit, replaying built-a diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap index 3b57f1a9..c11e56e9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap @@ -10,7 +10,7 @@ built-a built-b --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > vp run -r build # second run, all hit ~/packages/a$ print built-a ✓ cache hit, replaying built-a @@ -19,4 +19,4 @@ built-a built-b --- -[vp run] 2/2 cache hit (100%), saved. (Run `vp run --verbose` for full details) +[vp run] 2/2 cache hit (100%), saved. (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index fa67ac90..e9dd2352 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -9,4 +9,4 @@ $ echo bar ⊘ cache disabled: built-in command bar --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap index 7970dc7c..1134f6e1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap @@ -26,4 +26,4 @@ build lib build app --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap index cda4274b..c1692f70 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap @@ -16,4 +16,4 @@ build lib build app --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index d623687d..4db6f9ff 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -13,4 +13,4 @@ Building lib Building app --- -[vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/3 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index af577395..40c68f09 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -13,4 +13,4 @@ Building lib Building app --- -[vp run] 0/3 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/3 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index cf093c95..76596b62 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -10,4 +10,4 @@ Building core Building lib --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 12e7b040..30569654 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -10,7 +10,7 @@ $ print-file main.js console.log('foo'); --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) > replace-file-content main.js foo bar # modify input file > vp run test-task # cache miss, main.js changed @@ -21,4 +21,4 @@ $ print-file main.js ✗ cache miss: content of input 'main.js' changed, executi console.log('bar'); --- -[vp run] 0/2 cache hit (0%). (Run `vp run --verbose` for full details) +[vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 6bad3f85..fe5d49d2 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -10,7 +10,7 @@ use rustc_hash::FxHashMap; use tokio::runtime::Runtime; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_str::Str; -use vite_task::{Command, ParsedCommand, Session}; +use vite_task::{Command, Session}; use vite_workspace::find_workspace_root; /// Local parser wrapper for `BuiltInCommand` @@ -18,7 +18,7 @@ use vite_workspace::find_workspace_root; #[command(name = "vp")] enum Cli { #[clap(flatten)] - Command(ParsedCommand), + Command(Command), } #[derive(serde::Deserialize, Debug)] @@ -175,7 +175,7 @@ fn run_case_inner( } }; let Cli::Command(parsed) = cli; - let Command::Run(run_command) = parsed.into_command() else { + let Command::Run(run_command) = parsed else { panic!("only `run` commands supported in plan tests") }; From af03f796c717ff8e1e12832ffe823f50e0b300d1 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 25 Feb 2026 09:49:16 +0800 Subject: [PATCH 11/12] fix: resolve rustdoc link warnings for private types Co-Authored-By: Claude Opus 4.6 --- crates/vite_task/src/cli/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 87353ee7..bdb21736 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -43,7 +43,7 @@ pub struct RunFlags { /// Arguments for the `run` subcommand as parsed by clap. /// /// Contains the `--last-details` flag which is resolved into a separate -/// [`ResolvedCommand::RunLastDetails`] variant via [`Command::into_resolved`]. +/// `ResolvedCommand::RunLastDetails` variant internally. #[derive(Debug, clap::Args)] pub struct RunCommand { /// `packageName#taskName` or `taskName`. If omitted, lists all available tasks. @@ -63,7 +63,9 @@ pub struct RunCommand { /// vite task CLI subcommands as parsed by clap. /// -/// Pass directly to [`Session::main`] or [`HandledCommand::ViteTaskCommand`]. +/// vite task CLI subcommands as parsed by clap. +/// +/// Pass directly to `Session::main` or `HandledCommand::ViteTaskCommand`. /// The `--last-details` flag on the `run` subcommand is resolved internally. #[derive(Debug, Parser)] pub enum Command { From 116730a6f556ea96adcc90ba42ab0c29be9bd189 Mon Sep 17 00:00:00 2001 From: branchseer Date: Wed, 25 Feb 2026 11:06:12 +0800 Subject: [PATCH 12/12] fix: simplify cache disabled inline messages Remove verbose reason suffixes from "cache disabled" inline status messages (": no cache config" and ": built-in command"). Co-Authored-By: Claude Opus 4.6 --- crates/vite_task/src/session/cache/display.rs | 11 ++--------- .../snapshots/task with cache disabled.snap | 4 ++-- .../snapshots/multiple tasks get null stdin.snap | 2 +- .../single task no cache inherits stdin.snap | 2 +- .../snapshots/multiple tasks, cache disabled.snap | 2 +- .../snapshots/single task, cache disabled.snap | 2 +- ...tor forces piped for nested single-node graph.snap | 4 ++-- ...ns inherit even with multi-node sibling graph.snap | 8 ++++---- .../task-list/snapshots/vp run in script.snap | 6 +++--- .../snapshots/no trailing newline.snap | 4 ++-- .../snapshots/interactive long command truncated.snap | 2 +- ...nteractive enter with no results does nothing.snap | 2 +- .../snapshots/interactive escape clears query.snap | 2 +- .../snapshots/interactive scroll long list.snap | 2 +- .../interactive search other package task.snap | 2 +- ...active search preserves rating within package.snap | 2 +- .../snapshots/interactive search then select.snap | 2 +- .../interactive search with hash skips reorder.snap | 2 +- .../snapshots/interactive select task from lib.snap | 2 +- .../snapshots/interactive select task.snap | 2 +- .../snapshots/interactive select with recursive.snap | 4 ++-- .../interactive select with typo and transitive.snap | 4 ++-- .../snapshots/interactive select with typo.snap | 2 +- ...ive build runs dependencies before dependents.snap | 6 +++--- ...ansitive build from app runs all dependencies.snap | 6 +++--- ...ive build from lib runs only its dependencies.snap | 4 ++-- .../snapshots/cache hit after file modification.snap | 4 ++-- 27 files changed, 44 insertions(+), 51 deletions(-) diff --git a/crates/vite_task/src/session/cache/display.rs b/crates/vite_task/src/session/cache/display.rs index a527f0bc..7bf46c96 100644 --- a/crates/vite_task/src/session/cache/display.rs +++ b/crates/vite_task/src/session/cache/display.rs @@ -9,7 +9,7 @@ use vite_str::Str; use vite_task_plan::cache_metadata::SpawnFingerprint; use super::{CacheMiss, FingerprintMismatch}; -use crate::session::event::{CacheDisabledReason, CacheStatus}; +use crate::session::event::CacheStatus; /// Describes a single atomic change between two spawn fingerprints. /// @@ -216,13 +216,6 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option { }; Some(vite_str::format!("✗ cache miss: {reason}, executing")) } - CacheStatus::Disabled(reason) => { - // Show inline message for disabled cache - let message = match reason { - CacheDisabledReason::InProcessExecution => "cache disabled: built-in command", - CacheDisabledReason::NoCacheMetadata => "cache disabled: no cache config", - }; - Some(vite_str::format!("⊘ {message}")) - } + CacheStatus::Disabled(_) => Some(Str::from("⊘ cache disabled")), } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index 2b5fd860..0dcf4d0a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run no-cache-task # cache miss -$ print-file test.txt ⊘ cache disabled: no cache config +$ print-file test.txt ⊘ cache disabled test content > vp run no-cache-task # cache disabled, runs again -$ print-file test.txt ⊘ cache disabled: no cache config +$ print-file test.txt ⊘ cache disabled test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap index 6f6c2e76..6726177c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/multiple tasks get null stdin.snap @@ -5,7 +5,7 @@ expression: e2e_outputs > echo from-stdin | vp run -r read-stdin ~/packages/other$ read-stdin -$ read-stdin ⊘ cache disabled: no cache config +$ read-stdin ⊘ cache disabled --- [vp run] 0/2 cache hit (0%). (Run `vp run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap index f4dcaa58..1496b7ea 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/snapshots/single task no cache inherits stdin.snap @@ -3,5 +3,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > echo from-stdin | vp run read-stdin -$ read-stdin ⊘ cache disabled: no cache config +$ read-stdin ⊘ cache disabled from-stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap index 4e6c149d..c349e240 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/multiple tasks, cache disabled.snap @@ -8,7 +8,7 @@ stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:not-tty stdout:not-tty stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap index e910f7a7..b4f62e70 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-detection/snapshots/single task, cache disabled.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run check-tty -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:tty stdout:tty stderr:tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap index b96cd0a4..af2428c0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run -r foo-nested -~/packages/other$ check-tty ⊘ cache disabled: no cache config +~/packages/other$ check-tty ⊘ cache disabled stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:not-tty stdout:not-tty stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap index b0a2eda8..a88e1731 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/single-node chains inherit even with multi-node sibling graph.snap @@ -3,22 +3,22 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run foo -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:tty stdout:tty stderr:tty -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:tty stdout:tty stderr:tty -~/packages/other$ check-tty ⊘ cache disabled: no cache config +~/packages/other$ check-tty ⊘ cache disabled stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty ⊘ cache disabled: no cache config +$ check-tty ⊘ cache disabled stdin:not-tty stdout:not-tty stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap index 3db8e285..3e933d32 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/vp run in script.snap @@ -4,7 +4,7 @@ expression: e2e_outputs --- > vp run list-tasks @ expect-milestone: task-select::0 -$ vp run ⊘ cache disabled: no cache config +$ vp run ⊘ cache disabled Search task (↑/↓ to move, enter to select): > hello: echo hello from root list-tasks: vp run @@ -13,6 +13,6 @@ Search task (↑/↓ to move, enter to select): app#test: echo test app lib#build: echo build lib @ write-key: enter -$ vp run ⊘ cache disabled: no cache config -$ echo hello from root ⊘ cache disabled: built-in command +$ vp run ⊘ cache disabled +$ echo hello from root ⊘ cache disabled hello from root diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index e9dd2352..442d5f93 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -3,9 +3,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run hello # runs echo -n hello -$ echo -n foo ⊘ cache disabled: built-in command +$ echo -n foo ⊘ cache disabled foo -$ echo bar ⊘ cache disabled: built-in command +$ echo bar ⊘ cache disabled bar --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap index 8ae89966..6b3f2572 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots/interactive long command truncated.snap @@ -38,5 +38,5 @@ Search task (↑/↓ to move, enter to select): > long-cmd: echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa… test: echo test app @ write-key: enter -~/packages/app$ echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ⊘ cache disabled: built-in command +~/packages/app$ echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ⊘ cache disabled aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap index 2fed61dc..502ef93c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap @@ -40,5 +40,5 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap index f48b4f5e..ebfff74c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive escape clears query.snap @@ -40,5 +40,5 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap index 2e284abf..42f79c81 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive scroll long list.snap @@ -65,5 +65,5 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap index f2df5d9e..f0a8b8d7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search other package task.snap @@ -23,5 +23,5 @@ Search task (↑/↓ to move, enter to select): Search task (↑/↓ to move, enter to select): typec > lib#typecheck: echo typecheck lib @ write-key: enter -~/packages/lib$ echo typecheck lib ⊘ cache disabled: built-in command +~/packages/lib$ echo typecheck lib ⊘ cache disabled typecheck lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap index a984bcfa..e1ea8627 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search preserves rating within package.snap @@ -35,5 +35,5 @@ Search task (↑/↓ to move, enter to select): t app#test: echo test app (…1 more) @ write-key: enter -~/packages/lib$ echo test lib ⊘ cache disabled: built-in command +~/packages/lib$ echo test lib ⊘ cache disabled test lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap index 55ca0beb..f4900488 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search then select.snap @@ -24,5 +24,5 @@ Search task (↑/↓ to move, enter to select): lin > lint: echo lint app lib#lint: echo lint lib @ write-key: enter -~/packages/app$ echo lint app ⊘ cache disabled: built-in command +~/packages/app$ echo lint app ⊘ cache disabled lint app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap index bc16084b..626115d9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive search with hash skips reorder.snap @@ -26,5 +26,5 @@ Search task (↑/↓ to move, enter to select): lib# lib#test: echo test lib lib#typecheck: echo typecheck lib @ write-key: enter -~/packages/lib$ echo build lib ⊘ cache disabled: built-in command +~/packages/lib$ echo build lib ⊘ cache disabled build lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap index 47959505..a0131bd7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task from lib.snap @@ -19,5 +19,5 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/lib$ echo build lib ⊘ cache disabled: built-in command +~/packages/lib$ echo build lib ⊘ cache disabled build lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap index e2cd9031..a10f8adb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select task.snap @@ -35,5 +35,5 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/app$ echo lint app ⊘ cache disabled: built-in command +~/packages/app$ echo lint app ⊘ cache disabled lint app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap index 1134f6e1..02494552 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with recursive.snap @@ -19,10 +19,10 @@ Search task (↑/↓ to move, enter to select): task-select-test#format: echo format root (…3 more) @ write-key: enter -~/packages/lib$ echo build lib ⊘ cache disabled: built-in command +~/packages/lib$ echo build lib ⊘ cache disabled build lib -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap index c1692f70..43af27ab 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo and transitive.snap @@ -9,10 +9,10 @@ Search task (↑/↓ to move, enter to select): buid > build: echo build app lib#build: echo build lib @ write-key: enter -~/packages/lib$ echo build lib ⊘ cache disabled: built-in command +~/packages/lib$ echo build lib ⊘ cache disabled build lib -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap index 4c434ce9..5e0ff641 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive select with typo.snap @@ -9,5 +9,5 @@ Search task (↑/↓ to move, enter to select): buid > build: echo build app lib#build: echo build lib @ write-key: enter -~/packages/app$ echo build app ⊘ cache disabled: built-in command +~/packages/app$ echo build app ⊘ cache disabled build app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap index 4db6f9ff..65b3a8e6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/recursive build runs dependencies before dependents.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run -r build # core -> lib -> app -~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command +~/packages/core$ echo 'Building core' ⊘ cache disabled Building core -~/packages/lib$ echo 'Building lib' ⊘ cache disabled: built-in command +~/packages/lib$ echo 'Building lib' ⊘ cache disabled Building lib -~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command +~/packages/app$ echo 'Building app' ⊘ cache disabled Building app --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap index 40c68f09..db8a1f2e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from app runs all dependencies.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run -t build # core -> lib -> app -~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command +~/packages/core$ echo 'Building core' ⊘ cache disabled Building core -~/packages/lib$ echo 'Building lib' ⊘ cache disabled: built-in command +~/packages/lib$ echo 'Building lib' ⊘ cache disabled Building lib -~/packages/app$ echo 'Building app' ⊘ cache disabled: built-in command +~/packages/app$ echo 'Building app' ⊘ cache disabled Building app --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap index 76596b62..908c547d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots/transitive build from lib runs only its dependencies.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run -t build # core -> lib -~/packages/core$ echo 'Building core' ⊘ cache disabled: built-in command +~/packages/core$ echo 'Building core' ⊘ cache disabled Building core -~/packages/lib$ echo 'Building lib' ⊘ cache disabled: built-in command +~/packages/lib$ echo 'Building lib' ⊘ cache disabled Building lib --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 30569654..bcb1e6a3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vp run test-task # cache miss -$ echo hello ⊘ cache disabled: built-in command +$ echo hello ⊘ cache disabled hello $ print-file main.js @@ -14,7 +14,7 @@ console.log('foo'); > replace-file-content main.js foo bar # modify input file > vp run test-task # cache miss, main.js changed -$ echo hello ⊘ cache disabled: built-in command +$ echo hello ⊘ cache disabled hello $ print-file main.js ✗ cache miss: content of input 'main.js' changed, executing