Skip to content

Commit 33e01f8

Browse files
branchseerclaude
andcommitted
fix: normalize .. in fspy paths for cross-platform consistency
fspy reports paths with `..` components (e.g. `packages/sub-pkg/../shared/src/utils.ts`) on macOS but normalized paths on Linux/Windows. Always clean `..` before storing to ensure consistent cache miss messages across platforms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4311180 commit 33e01f8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

crates/vite_task/src/session/execute/spawn.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,15 @@ pub async fn spawn_with_tracking(
206206
return None;
207207
}
208208

209-
// Clean `..` components only for glob matching — fspy may report paths
210-
// like `packages/sub-pkg/../shared/dist/output.js` that won't match
211-
// workspace-root-relative negative globs without normalization.
212-
if !resolved_negatives.is_empty() {
213-
let cleaned = relative.clean();
214-
if resolved_negatives.iter().any(|neg| neg.is_match(cleaned.as_str())) {
215-
return None;
216-
}
209+
// Clean `..` components — fspy may report paths like
210+
// `packages/sub-pkg/../shared/dist/output.js`. Normalize them for
211+
// consistent behavior across platforms and clean user-facing messages.
212+
let relative = relative.clean();
213+
214+
if !resolved_negatives.is_empty()
215+
&& resolved_negatives.iter().any(|neg| neg.is_match(relative.as_str()))
216+
{
217+
return None;
217218
}
218219

219220
Some(relative)

crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export const shared = 'initial';
99
> replace-file-content packages/shared/src/utils.ts initial modified
1010

1111
> vp run sub-pkg#dotdot-auto-negative
12-
~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.jscache miss: content of input 'packages/sub-pkg/../shared/src/utils.ts' changed, executing
12+
~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.jscache miss: content of input 'packages/shared/src/utils.ts' changed, executing
1313
export const shared = 'modified';
1414
// initial output

0 commit comments

Comments
 (0)