Skip to content

Commit db0eaf2

Browse files
author
Greg Soltis
authored
feat(Turborepo): support inputs for file hash watching (#7907)
### Description - adds support for `inputs` that are contained within a package to daemon file hashing. `inputs` are tracked after the first request for them. ### Testing Instructions Added tests that use `inputs`. Closes TURBO-2762
1 parent 9783846 commit db0eaf2

3 files changed

Lines changed: 284 additions & 45 deletions

File tree

crates/turborepo-filewatch/src/globwatcher.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ impl GlobSet {
3333
inputs.extend(self.exclude_raw.iter().cloned());
3434
inputs
3535
}
36+
37+
pub fn matches(&self, input: &RelativeUnixPath) -> bool {
38+
self.include.values().any(|glob| glob.is_match(input)) && !self.exclude.is_match(input)
39+
}
3640
}
3741

3842
impl std::fmt::Debug for GlobSet {
@@ -133,6 +137,16 @@ impl GlobSet {
133137
};
134138
Self::from_raw(includes, excludes)
135139
}
140+
141+
pub fn is_package_local(&self) -> bool {
142+
self.include
143+
.keys()
144+
.all(|raw_glob| !raw_glob.starts_with("../"))
145+
&& self
146+
.exclude_raw
147+
.iter()
148+
.all(|raw_glob| !raw_glob.starts_with("../"))
149+
}
136150
}
137151

138152
#[derive(Debug, Error)]

0 commit comments

Comments
 (0)