Skip to content

Commit 09513bc

Browse files
committed
feat: add read accessors to PackageQueryArgs
Add `is_recursive()`, `is_workspace_root()`, and `filter()` accessor methods so downstream consumers can inspect the parsed flags before calling `into_package_query()`. This is needed for vp exec to determine workspace mode and root-exclusion logic without accessing private fields.
1 parent f013ff7 commit 09513bc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

crates/vite_workspace/src/package_filter.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ Match packages by name, directory, or glob pattern.
245245
}
246246

247247
impl PackageQueryArgs {
248+
/// Whether `--recursive` / `-r` was set.
249+
pub fn is_recursive(&self) -> bool {
250+
self.recursive
251+
}
252+
253+
/// Whether `--workspace-root` / `-w` was set.
254+
pub fn is_workspace_root(&self) -> bool {
255+
self.workspace_root
256+
}
257+
258+
/// The `--filter` / `-F` values (possibly empty).
259+
pub fn filter(&self) -> &[Str] {
260+
&self.filter
261+
}
262+
248263
/// Convert CLI arguments into an opaque [`PackageQuery`].
249264
///
250265
/// `package_name` is the optional package name from a `package#task` specifier.

0 commit comments

Comments
 (0)