Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3dcf72b
feat: add cwd and args info to snapshot headers
branchseer Feb 27, 2026
ba58a8f
feat: enforce snapshot metadata matching with require_full_match
branchseer Feb 27, 2026
5dc4bd0
refactor: remove unused multiple task specifier support from query sy…
branchseer Feb 25, 2026
ed343cd
add pnpm-filter docs
branchseer Feb 26, 2026
7f415b4
update pnpm-filter docs
branchseer Feb 26, 2026
7d83886
feat: filter packages with --filter
branchseer Feb 27, 2026
02e5c44
refactor: drop edge weights from task graph snapshot serialization
branchseer Feb 27, 2026
6e6975d
test: add transitive flag with package#task specifier tests
branchseer Feb 27, 2026
7a7c34e
feat: support directory glob patterns in --filter
branchseer Feb 27, 2026
ad94ba3
feat: split --filter values by whitespace for pnpm compatibility
branchseer Feb 27, 2026
07e6d87
refactor: upgrade wax to 0.7.0 and use Glob::partition for directory …
branchseer Feb 27, 2026
f2fc4e6
test: add directory filter plan tests for traversal and nested scripts
branchseer Feb 27, 2026
ab71594
refactor: replace manual path normalization with path-clean crate
branchseer Feb 27, 2026
47eea2f
refactor: remove unused PackageNamePattern::matches_name, inline glob…
branchseer Feb 27, 2026
13d7fd2
test: update filter snapshots for new info headers
branchseer Feb 27, 2026
c540e79
fix: resolve CI failures in package_filter tests and clippy
branchseer Feb 27, 2026
b18c2fa
refactor: extract PackageQueryArgs from CLI into vite_workspace
branchseer Feb 28, 2026
3664752
test: add plan snapshot tests for braced paths, name+dir intersection…
branchseer Feb 28, 2026
1486697
remove pnpm-filter.md
branchseer Feb 28, 2026
deed31a
refactor: use wax::Glob::partition to detect glob patterns in name fi…
branchseer Feb 28, 2026
f24e35d
fix: discard traversal on unbraced path selectors to match pnpm
branchseer Feb 28, 2026
f24504a
feat: add -w/--workspace-root flag to select workspace root package
branchseer Feb 28, 2026
a6da491
test: fix filter snapshots that didn't demonstrate claimed behavior
branchseer Feb 28, 2026
0d1679a
cargo shear --fix
branchseer Feb 28, 2026
ef7ca99
refactor: store original filter strings for unmatched_selectors
branchseer Feb 28, 2026
942c9cc
feat: warn on stderr when --filter matches no packages
branchseer Feb 28, 2026
8d72ff4
fix: resolve CI failures in package_filter tests and clippy
branchseer Feb 28, 2026
6fce91e
refactor: make PackageQueryArgs fields private
branchseer Feb 28, 2026
86cf493
docs: reword PackageQueryArgs help to be command-agnostic
branchseer Feb 28, 2026
42c822f
add is_cwd_only
branchseer Mar 1, 2026
50e76ea
refactor: use exhaustive match in into_package_query and validate emp…
branchseer Mar 1, 2026
30bd66a
refactor: include package_name in exhaustive match tuple
branchseer Mar 1, 2026
8f84368
refactor: tighten match arm patterns in into_package_query
branchseer Mar 1, 2026
ee9a08b
feat: error on ambiguous package name in `pkg#task` specifier
branchseer Mar 1, 2026
462763a
fix: display ambiguous package paths without quoting
branchseer Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ os_str_bytes = "7.1.1"
ouroboros = "0.18.5"
owo-colors = { version = "4.1.0", features = ["supports-colors"] }
passfd = { git = "https://github.com/polachok/passfd", rev = "d55881752c16aced1a49a75f9c428d38d3767213", default-features = false }
path-clean = "1.0.1"
pathdiff = "0.2.3"
petgraph = "0.8.2"
phf = { version = "0.11.3", features = ["macros"] }
Expand Down Expand Up @@ -145,7 +146,7 @@ vite_task_graph = { path = "crates/vite_task_graph" }
vite_task_plan = { path = "crates/vite_task_plan" }
vite_workspace = { path = "crates/vite_workspace" }
vt100 = "0.16.2"
wax = "0.6.0"
wax = "0.7.0"
which = "8.0.0"
widestring = "1.2.0"
winapi = "0.3.9"
Expand Down
2 changes: 1 addition & 1 deletion crates/vite_glob/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod error;
use std::path::Path;

pub use error::Error;
use wax::{Glob, Pattern};
use wax::{Glob, Program};

/// If there are no negated patterns, it will follow the first match wins semantics.
/// Otherwise, it will follow the last match wins semantics.
Expand Down
39 changes: 18 additions & 21 deletions crates/vite_graph_ser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ pub trait GetKey {
}

#[derive(Serialize)]
#[serde(bound = "E: Serialize, N: Serialize")]
struct DiGraphNodeItem<'a, N: GetKey, E> {
#[serde(bound = "N: Serialize")]
struct DiGraphNodeItem<'a, N: GetKey> {
key: N::Key<'a>,
node: &'a N,
neighbors: Vec<(N::Key<'a>, &'a E)>,
neighbors: Vec<N::Key<'a>>,
}

/// A wrapper around `DiGraph` that serializes nodes by their keys.
///
/// Only node connectivity is recorded — edge weights are ignored in the output.
#[derive(Serialize)]
#[serde(transparent)]
pub struct SerializeByKey<'a, N: GetKey + Serialize, E: Serialize, Ix: petgraph::graph::IndexType>(
pub struct SerializeByKey<'a, N: GetKey + Serialize, E, Ix: petgraph::graph::IndexType>(
#[serde(serialize_with = "serialize_by_key")] pub &'a DiGraph<N, E, Ix>,
);

Expand All @@ -45,25 +47,20 @@ pub struct SerializeByKey<'a, N: GetKey + Serialize, E: Serialize, Ix: petgraph:
///
/// # Panics
/// Panics if an edge references a node index not present in the graph.
pub fn serialize_by_key<
N: GetKey + Serialize,
E: Serialize,
Ix: petgraph::graph::IndexType,
S: Serializer,
>(
pub fn serialize_by_key<N: GetKey + Serialize, E, Ix: petgraph::graph::IndexType, S: Serializer>(
graph: &DiGraph<N, E, Ix>,
serializer: S,
) -> Result<S::Ok, S::Error> {
let mut items = Vec::<DiGraphNodeItem<'_, N, E>>::with_capacity(graph.node_count());
let mut items = Vec::<DiGraphNodeItem<'_, N>>::with_capacity(graph.node_count());
for (node_idx, node) in graph.node_references() {
let mut neighbors = Vec::<(N::Key<'_>, &E)>::new();
let mut neighbors = Vec::<N::Key<'_>>::new();

for edge in graph.edges(node_idx) {
let target_idx = edge.target();
let target_node = graph.node_weight(target_idx).unwrap();
neighbors.push((target_node.key().map_err(serde::ser::Error::custom)?, edge.weight()));
neighbors.push(target_node.key().map_err(serde::ser::Error::custom)?);
}
neighbors.sort_unstable_by(|a, b| a.0.cmp(&b.0));
neighbors.sort_unstable();
items.push(DiGraphNodeItem {
key: node.key().map_err(serde::ser::Error::custom)?,
node,
Expand Down Expand Up @@ -101,19 +98,19 @@ mod tests {
#[derive(Serialize)]
struct GraphWrapper {
#[serde(serialize_with = "serialize_by_key")]
graph: DiGraph<TestNode, &'static str>,
graph: DiGraph<TestNode, ()>,
}

#[test]
fn test_serialize_graph_happy_path() {
let mut graph = DiGraph::<TestNode, &'static str>::new();
let mut graph = DiGraph::<TestNode, ()>::new();
let a = graph.add_node(TestNode { id: "a", value: 1 });
let b = graph.add_node(TestNode { id: "b", value: 2 });
let c = graph.add_node(TestNode { id: "c", value: 3 });

graph.add_edge(a, b, "a->b");
graph.add_edge(a, c, "a->c");
graph.add_edge(b, c, "b->c");
graph.add_edge(a, b, ());
graph.add_edge(a, c, ());
graph.add_edge(b, c, ());

let json = serde_json::to_value(GraphWrapper { graph }).unwrap();
assert_eq!(
Expand All @@ -123,12 +120,12 @@ mod tests {
{
"key": "a",
"node": {"id": "a", "value": 1},
"neighbors": [["b", "a->b"], ["c", "a->c"]]
"neighbors": ["b", "c"]
},
{
"key": "b",
"node": {"id": "b", "value": 2},
"neighbors": [["c", "b->c"]]
"neighbors": ["c"]
},
{
"key": "c",
Expand Down
Loading