Skip to content

Commit e4dae7c

Browse files
authored
feat: task graph loading (#48)
# feat: Add vite_task_graph crate for task dependency management This PR introduces a new `vite_task_graph` crate that provides a robust implementation for building and managing task dependency graphs in monorepo workspaces. The crate handles package discovery, task resolution, and dependency tracking between tasks. Key changes: - Created new `vite_task_graph` crate with clean API for task graph management - Implemented `TaskGraph` structure to represent task dependencies with proper edge types - Added support for explicit and topological dependency types - Migrated test fixtures from `vite_task` to `vite_task_graph` for better organization - Added snapshot testing for task graph validation - Renamed `get_package_graph` to `discover_package_graph` and added `load_package_graph` in workspace module
1 parent edf07c7 commit e4dae7c

File tree

73 files changed

+1550
-1216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1550
-1216
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ color-eyre = "0.6.5"
5050
compact_str = "0.9.0"
5151
const_format = "0.2.34"
5252
constcat = "0.6.1"
53+
copy_dir = "0.1.3"
5354
crossterm = { version = "0.29.0", features = ["event-stream"] }
5455
csv-async = { version = "1.3.1", features = ["tokio"] }
5556
ctor = "0.6"
@@ -70,6 +71,7 @@ fspy_test_utils = { path = "crates/fspy_test_utils" }
7071
futures = "0.3.31"
7172
futures-core = "0.3.31"
7273
futures-util = "0.3.31"
74+
insta = "1.44.3"
7375
itertools = "0.14.0"
7476
libc = "0.2.172"
7577
memmap2 = "0.9.7"
@@ -95,7 +97,7 @@ serde_yml = "0.0.12"
9597
sha2 = "0.10.9"
9698
shared_memory = "0.12.4"
9799
shell-escape = "0.1.5"
98-
smallvec = { version = "2.0.0-alpha.11", features = ["std"] }
100+
smallvec = { version = "2.0.0-alpha.12", features = ["std"] }
99101
stackalloc = "1.2.1"
100102
supports-color = "3.0.1"
101103
syscalls = { version = "0.6.18", default-features = false }
@@ -113,6 +115,7 @@ tree-sitter-bash = "0.23.1"
113115
tui-term = "0.2.0"
114116
twox-hash = "2.1.1"
115117
uuid = "1.18.1"
118+
vec1 = "1.12.1"
116119
vite_glob = { path = "crates/vite_glob" }
117120
vite_path = { path = "crates/vite_path" }
118121
vite_str = { path = "crates/vite_str" }

crates/vite_path/src/absolute.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{
22
ffi::OsStr,
33
fmt::Display,
4+
hash::Hash,
45
ops::Deref,
56
path::{Path, PathBuf},
67
sync::Arc,
@@ -11,7 +12,7 @@ use ref_cast::{RefCastCustom, ref_cast_custom};
1112
use crate::relative::{FromPathError, InvalidPathDataError, RelativePathBuf};
1213

1314
/// A path that is guaranteed to be absolute
14-
#[derive(RefCastCustom, Debug, PartialEq, Eq)]
15+
#[derive(RefCastCustom, Debug, PartialEq, Eq, PartialOrd, Ord)]
1516
#[repr(transparent)]
1617
pub struct AbsolutePath(Path);
1718
impl AsRef<Self> for AbsolutePath {
@@ -31,6 +32,12 @@ impl PartialEq<AbsolutePathBuf> for &AbsolutePath {
3132
}
3233
}
3334

35+
impl Hash for AbsolutePath {
36+
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
37+
self.0.hash(state);
38+
}
39+
}
40+
3441
impl AbsolutePath {
3542
/// Creates a [`AbsolutePath`] if the give path is absolute.
3643
pub fn new<P: AsRef<Path> + ?Sized>(path: &P) -> Option<&Self> {

0 commit comments

Comments
 (0)