Skip to content

Commit e27b3f1

Browse files
authored
refactor(exec): replace custom filter with vite-task's upstream filter API (#661)
Replace the 903-line custom filter implementation (filter.rs) with calls to vite_workspace's reusable PackageQueryArgs/IndexedPackageGraph/FilterResolution API. This reduces ~800 lines of duplicated code and enables future features like --filter-prod. Key changes: - Delete filter.rs entirely; remove mod filter from mod.rs - Add -F short flag alias for --filter in args.rs - Add build_package_query_args() helper to convert ExecFlags → PackageQueryArgs - Rewrite workspace.rs selection to use IndexedPackageGraph::resolve_query() - Topological sort now uses FilterResolution.package_subgraph edges - Bump all 6 vite-task deps to rev 57bf15f Behavioral improvements: - --filter "a b" now splits by whitespace into two filters (pnpm compat) - Unmatched filters emit per-filter warnings - -w --filter is additive (root + filtered packages) - -r --filter: filter wins over recursive (unchanged) Add command-exec-monorepo-filter-v2 snap test covering all new behaviors.
1 parent e999934 commit e27b3f1

30 files changed

Lines changed: 896 additions & 1559 deletions

File tree

Cargo.lock

Lines changed: 57 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ dunce = "1.0.5"
8383
fast-glob = "1.0.0"
8484
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
8585
form_urlencoded = "1.2.1"
86-
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
86+
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
8787
futures = "0.3.31"
8888
futures-util = "0.3.31"
8989
glob = "0.3.2"
@@ -182,14 +182,14 @@ vfs = "0.12.1"
182182
vite_command = { path = "crates/vite_command" }
183183
vite_error = { path = "crates/vite_error" }
184184
vite_js_runtime = { path = "crates/vite_js_runtime" }
185-
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
185+
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
186186
vite_install = { path = "crates/vite_install" }
187187
vite_migration = { path = "crates/vite_migration" }
188188
vite_shared = { path = "crates/vite_shared" }
189-
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
190-
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
191-
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
192-
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "97e7aac732da3147d8762a8862933c4889bbcdfb" }
189+
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
190+
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
191+
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
192+
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "9e1287e797190ea29793655b239cdaa7a55edd21" }
193193
walkdir = "2.5.0"
194194
wax = "0.6.0"
195195
which = "8.0.0"

crates/vite_shared/src/output.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ pub fn note(msg: &str) {
4444
pub fn success(msg: &str) {
4545
println!("{} {msg}", CHECK.green());
4646
}
47+
48+
/// Print a raw message to stdout with no prefix or formatting.
49+
#[allow(clippy::print_stdout, clippy::disallowed_macros)]
50+
pub fn raw(msg: &str) {
51+
println!("{msg}");
52+
}

packages/cli/binding/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ anyhow = { workspace = true }
1111
async-trait = { workspace = true }
1212
clap = { workspace = true, features = ["derive"] }
1313
fspy = { workspace = true }
14-
glob = { workspace = true }
1514
rustc-hash = { workspace = true }
1615
napi = { workspace = true }
1716
napi-derive = { workspace = true }

0 commit comments

Comments
 (0)