Commit e27b3f1
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
- packages/cli
- binding
- src
- exec
- snap-tests-global/command-exec
- snap-tests
- command-exec-cwd
- command-exec-monorepo-filter-v2
- packages
- app-a
- app-b
- lib-c
- command-exec-monorepo-order
- packages/cycle-a
- command-exec-monorepo
- command-exec
- command-vp-alias
- rfcs
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
0 commit comments