Skip to content

Commit e3ac798

Browse files
committed
feat(workspace): add is_workspace_mode() to PackageQueryArgs
Single semantic method replacing individual accessor methods, returns true when any workspace-level selection flag is active.
1 parent 42f1427 commit e3ac798

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/vite_workspace/src/package_filter.rs

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

247247
impl PackageQueryArgs {
248+
/// Whether any workspace-level selection flag is active
249+
/// (`--recursive`, `--workspace-root`, or `--filter`).
250+
pub fn is_workspace_mode(&self) -> bool {
251+
self.recursive || self.workspace_root || !self.filter.is_empty()
252+
}
253+
248254
/// Convert CLI arguments into an opaque [`PackageQuery`].
249255
///
250256
/// `package_name` is the optional package name from a `package#task` specifier.

0 commit comments

Comments
 (0)