Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/vite_task/src/session/cache/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option<Str> {
match cache_status {
CacheStatus::Hit { .. } => {
// Show "cache hit" indicator when replaying from cache
Some(Str::from(" cache hit, replaying"))
Some(Str::from(" cache hit, replaying"))
}
CacheStatus::Miss(CacheMiss::NotFound) => {
// No inline message for "not found" case - just show command
Expand Down Expand Up @@ -176,10 +176,10 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option<Str> {
FingerprintMismatch::InputConfig => "input configuration changed",
FingerprintMismatch::InputChanged { kind, path } => {
let desc = format_input_change_str(*kind, path.as_str());
return Some(vite_str::format!(" cache miss: {desc}, executing"));
return Some(vite_str::format!(" cache miss: {desc}, executing"));
}
};
Some(vite_str::format!(" cache miss: {reason}, executing"))
Some(vite_str::format!(" cache miss: {reason}, executing"))
}
CacheStatus::Disabled(_) => Some(Str::from("⊘ cache disabled")),
}
Expand Down
4 changes: 2 additions & 2 deletions crates/vite_task/src/session/reporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl<T: owo_colors::OwoColorize> ColorizeExt for T {
}

const COMMAND_STYLE: Style = Style::new().blue();
const CACHE_MISS_STYLE: Style = Style::new().purple();
const CACHE_MISS_STYLE: Style = Style::new().bright_black();

/// Format the display's cwd as a string relative to the workspace root.
/// Returns an empty string if the cwd equals the workspace root.
Expand Down Expand Up @@ -261,7 +261,7 @@ fn format_error_message(message: &str) -> Str {

/// Format the "cache hit, logs replayed" message for synthetic executions without display info.
fn format_cache_hit_message() -> Str {
vite_str::format!("{}\n", " cache hit, logs replayed".style(Style::new().green().dimmed()))
vite_str::format!("{}\n", " cache hit, logs replayed".style(Style::new().green().dimmed()))
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ expression: e2e_outputs
$ print hello
hello
> vt run script2 # cache hit, same command as script1
$ print hello cache hit, replaying
$ print hello cache hit, replaying
hello

---
vt run: cache hit, <duration> saved.
> json-edit package.json '_.scripts.script2 = "print world"' # change script2

> vt run script2 # cache miss
$ print world cache miss: args changed, executing
$ print world cache miss: args changed, executing
world
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $ vt lint
Found 2 warnings and 0 errors.
Finished in <duration> on 2 files with 93 rules using <n> threads.
> cd folder2 && vt run lint # cache miss in folder2
$ vt lint cache hit, replaying
$ vt lint cache hit, replaying

! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
,-[folder1/a.js:1:1]
Expand All @@ -46,7 +46,7 @@ vt run: cache hit, <duration> saved.
> echo 'console.log(1);' > folder2/a.js # modify folder2

> cd folder1 && vt run lint # cache hit
$ vt lint cache miss: 'folder2/a.js' modified, executing
$ vt lint cache miss: 'folder2/a.js' modified, executing

! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
,-[folder1/a.js:1:1]
Expand All @@ -58,7 +58,7 @@ $ vt lint ✗ cache miss: 'folder2/a.js' modified, executing
Found 1 warning and 0 errors.
Finished in <duration> on 2 files with 93 rules using <n> threads.
> cd folder2 && vt run lint # cache miss
$ vt lint cache hit, replaying
$ vt lint cache hit, replaying

! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed.
,-[folder1/a.js:1:1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ expression: e2e_outputs
$ print-file test.txt
test content
> vt run cached-task # cache hit
$ print-file test.txt cache hit, replaying
$ print-file test.txt cache hit, replaying
test content

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
> json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask

> vt run task # first: cache miss, second: cache hit
$ print baz cache miss: args changed, executing
$ print baz cache miss: args changed, executing
baz

$ print bar cache hit, replaying
$ print bar cache hit, replaying
bar

---
vt run: 1/2 cache hit (50%), <duration> saved. (Run `vt run --last-details` for full details)
> json-edit package.json '_.scripts.task = "print bar"' # remove first subtask

> vt run task # cache hit
$ print bar cache hit, replaying
$ print bar cache hit, replaying
bar

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ initial content
> json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd

> vt run test # cache miss: cwd changed
~/subfolder$ print-file test.txt cache miss: working directory changed, executing
~/subfolder$ print-file test.txt cache miss: working directory changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ expression: e2e_outputs
$ print-file test.txt
initial content
> cross-env MY_ENV=1 vt run test # cache miss: env added
$ print-file test.txt cache miss: envs changed, executing
$ print-file test.txt cache miss: envs changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ expression: e2e_outputs
$ print-file test.txt
initial content
> vt run test # cache miss: env removed
$ print-file test.txt cache miss: envs changed, executing
$ print-file test.txt cache miss: envs changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ expression: e2e_outputs
$ print-file test.txt
initial content
> cross-env MY_ENV=2 vt run test # cache miss: env value changed
$ print-file test.txt cache miss: envs changed, executing
$ print-file test.txt cache miss: envs changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ glob-test
> replace-file-content test.txt initial modified # modify glob input

> vt run glob-test # cache miss: input modified
$ print glob-test cache miss: 'test.txt' modified, executing
$ print glob-test cache miss: 'test.txt' modified, executing
glob-test
> echo new content > new.txt # add a new .txt file

> vt run glob-test # cache miss: input added
$ print glob-test cache miss: 'new.txt' added in workspace root, executing
$ print glob-test cache miss: 'new.txt' added in workspace root, executing
glob-test
> rm extra.txt # remove a .txt file

> vt run glob-test # cache miss: input removed
$ print glob-test cache miss: 'extra.txt' removed from workspace root, executing
$ print glob-test cache miss: 'extra.txt' removed from workspace root, executing
glob-test
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ initial content
> replace-file-content test.txt initial modified # modify input

> vt run test # cache miss: input modified
$ print-file test.txt cache miss: 'test.txt' modified, executing
$ print-file test.txt cache miss: 'test.txt' modified, executing
modified content
> rm test.txt # remove tracked input

> vt run test # cache miss: input removed
$ print-file test.txt cache miss: 'test.txt' removed from workspace root, executing
$ print-file test.txt cache miss: 'test.txt' removed from workspace root, executing
test.txt: not found
> echo new content > test.txt # recreate previously removed file

> vt run test # cache miss: input added
$ print-file test.txt cache miss: 'test.txt' added in workspace root, executing
$ print-file test.txt cache miss: 'test.txt' added in workspace root, executing
new content
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ initial content
> json-edit vite-task.json "_.tasks.test.input = ['test.txt']" # change input config

> vt run test # cache miss: configuration changed
$ print-file test.txt cache miss: input configuration changed, executing
$ print-file test.txt cache miss: input configuration changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ initial content
> json-edit vite-task.json "_.tasks.test.untrackedEnv = ['MY_UNTRACKED']" # add untracked env

> vt run test # cache miss: untracked env added
$ print-file test.txt cache miss: untracked env config changed, executing
$ print-file test.txt cache miss: untracked env config changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ initial content
> json-edit vite-task.json "delete _.tasks.test.untrackedEnv" # remove untracked env

> vt run test # cache miss: untracked env removed
$ print-file test.txt cache miss: untracked env config changed, executing
$ print-file test.txt cache miss: untracked env config changed, executing
initial content
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ expression: e2e_outputs
$ print-file test.txt
test content
> vt run cached-task # cache hit
$ print-file test.txt cache hit, replaying
$ print-file test.txt cache hit, replaying
test content

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ expression: e2e_outputs
> vt run read_colon_in_name # cache miss
$ node read_node_fs.js
> vt run read_colon_in_name # cache hit
$ node read_node_fs.js cache hit, replaying
$ node read_node_fs.js cache hit, replaying

---
vt run: cache hit, <duration> saved.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Finished in <duration> on 0 files with 93 rules using <n> threads.
> echo debugger > main.js # add lint error

> vt run lint # cache miss, lint fails
$ vt lint cache miss: 'main.js' added in workspace root, executing
$ vt lint cache miss: 'main.js' added in workspace root, executing

! eslint(no-debugger): `debugger` statement is not allowed
,-[main.js:1:1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const root = 'initial';
> replace-file-content src/root.ts initial modified

> vt run root-glob-test
$ print-file src/root.ts cache miss: 'src/root.ts' modified, executing
$ print-file src/root.ts cache miss: 'src/root.ts' modified, executing
export const root = 'modified';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const root = 'initial';
> replace-file-content packages/sub-pkg/src/sub.ts initial modified

> vt run root-glob-test
$ print-file src/root.ts cache hit, replaying
$ print-file src/root.ts cache hit, replaying
export const root = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const root = 'initial';
> replace-file-content other/other.ts initial modified

> vt run root-glob-test
$ print-file src/root.ts cache hit, replaying
$ print-file src/root.ts cache hit, replaying
export const root = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const root = 'initial';
> replace-file-content src/root.ts initial modified

> vt run root-glob-with-cwd
~/src$ print-file root.ts cache miss: 'src/root.ts' modified, executing
~/src$ print-file root.ts cache miss: 'src/root.ts' modified, executing
export const root = 'modified';
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const sub = 'initial';
> replace-file-content packages/sub-pkg/src/sub.ts initial modified

> vt run sub-pkg#sub-glob-test
~/packages/sub-pkg$ print-file src/sub.ts cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing
~/packages/sub-pkg$ print-file src/sub.ts cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing
export const sub = 'modified';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const sub = 'initial';
> replace-file-content src/root.ts initial modified

> vt run sub-pkg#sub-glob-test
~/packages/sub-pkg$ print-file src/sub.ts cache hit, replaying
~/packages/sub-pkg$ print-file src/sub.ts cache hit, replaying
export const sub = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const sub = 'initial';
> replace-file-content packages/sub-pkg/other/other.ts initial modified

> vt run sub-pkg#sub-glob-test
~/packages/sub-pkg$ print-file src/sub.ts cache hit, replaying
~/packages/sub-pkg$ print-file src/sub.ts cache hit, replaying
export const sub = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const sub = 'initial';
> replace-file-content packages/sub-pkg/src/sub.ts initial modified

> vt run sub-pkg#sub-glob-with-cwd
~/packages/sub-pkg/src$ print-file sub.ts cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing
~/packages/sub-pkg/src$ print-file sub.ts cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing
export const sub = 'modified';
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ a
$ print b
b
> vt run say a # cache hit
$ print a cache hit, replaying
$ print a cache hit, replaying
a

---
vt run: cache hit, <duration> saved.
> vt run say b # cache hit
$ print b cache hit, replaying
$ print b cache hit, replaying
b

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ expression: e2e_outputs
$ print-env FOO
1
> FOO=2 vt run hello # cache miss, different env
$ print-env FOO cache miss: envs changed, executing
$ print-env FOO cache miss: envs changed, executing
2
> FOO=1 vt run hello # cache hit
$ print-env FOO cache hit, replaying
$ print-env FOO cache hit, replaying
1

---
vt run: cache hit, <duration> saved.
> FOO=2 vt run hello # cache hit
$ print-env FOO cache hit, replaying
$ print-env FOO cache hit, replaying
2

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const main = 'initial';
> replace-file-content src/utils.ts initial modified

> vt run auto-only
$ print-file src/main.ts cache hit, replaying
$ print-file src/main.ts cache hit, replaying
export const main = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const main = 'initial';
> replace-file-content src/main.ts initial modified

> vt run auto-only
$ print-file src/main.ts cache miss: 'src/main.ts' modified, executing
$ print-file src/main.ts cache miss: 'src/main.ts' modified, executing
export const main = 'modified';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const main = 'initial';
> replace-file-content dist/output.js initial modified

> vt run auto-with-negative
$ print-file src/main.ts dist/output.js cache hit, replaying
$ print-file src/main.ts dist/output.js cache hit, replaying
export const main = 'initial';
// initial output

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const main = 'initial';
> replace-file-content src/main.ts initial modified

> vt run auto-with-negative
$ print-file src/main.ts dist/output.js cache miss: 'src/main.ts' modified, executing
$ print-file src/main.ts dist/output.js cache miss: 'src/main.ts' modified, executing
export const main = 'modified';
// initial output
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const main = 'initial';
> replace-file-content src/main.ts initial modified

> vt run empty-inputs
$ print-file src/main.ts cache hit, replaying
$ print-file src/main.ts cache hit, replaying
export const main = 'initial';

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const main = 'initial';
> json-edit vite-task.json "_.tasks['empty-inputs'].command = 'print-file src/utils.ts'"

> vt run empty-inputs
$ print-file src/utils.ts cache miss: args changed, executing
$ print-file src/utils.ts cache miss: args changed, executing
export const utils = 'initial';
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export const main = 'initial';
> replace-file-content src/main.ts initial modified

> vt run folder-input
$ print-file src/main.ts cache hit, replaying
$ print-file src/main.ts cache hit, replaying
export const main = 'initial';

---
vt run: cache hit, <duration> saved.
> rm -rf src

> vt run folder-input
$ print-file src/main.ts cache hit, replaying
$ print-file src/main.ts cache hit, replaying
export const main = 'initial';

---
Expand Down
Loading
Loading