Skip to content

Commit 6844d20

Browse files
authored
test(plan): render task graph snapshots as mermaid markdown (#477)
## Motivation Task graph plan snapshots are easier to review as Markdown diagrams than as generated JSONC. This PR replaces successful `task_graph.jsonc` snapshots with `task_graph.md` files that contain a compact Mermaid `flowchart TD` plus redacted task detail sections, while keeping query snapshot behavior unchanged.
1 parent d57ce13 commit 6844d20

100 files changed

Lines changed: 8441 additions & 8441 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/vite_task_graph/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ serde_json = { workspace = true }
1919
thiserror = { workspace = true }
2020
tracing = { workspace = true }
2121
vec1 = { workspace = true, features = ["serde"] }
22-
vite_graph_ser = { workspace = true }
2322
vite_path = { workspace = true }
2423
vite_str = { workspace = true }
2524
vite_workspace = { workspace = true }

crates/vite_task_graph/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ pub struct TaskNode {
8484
pub source: TaskSource,
8585
}
8686

87-
impl vite_graph_ser::GetKey for TaskNode {
88-
type Key<'a> = (&'a AbsolutePath, &'a str);
89-
90-
#[expect(clippy::disallowed_types, reason = "trait requires String as error type")]
91-
fn key(&self) -> Result<Self::Key<'_>, String> {
92-
Ok((&self.task_display.package_path, &self.task_display.task_name))
93-
}
94-
}
95-
9687
#[derive(Debug, thiserror::Error)]
9788
pub enum TaskGraphLoadError {
9889
#[error("Failed to load package graph")]

crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/task_graph.jsonc

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# task graph
2+
3+
```mermaid
4+
flowchart TD
5+
task_0["<workspace>/#env-test"]
6+
task_1["<workspace>/#hello"]
7+
```
8+
9+
## `<workspace>/#env-test`
10+
11+
```json
12+
{
13+
"task_display": {
14+
"package_name": "additional-envs",
15+
"task_name": "env-test",
16+
"package_path": "<workspace>/"
17+
},
18+
"resolved_config": {
19+
"commands": [
20+
"TEST_VAR=hello_world vt tool print-env TEST_VAR"
21+
],
22+
"resolved_options": {
23+
"cwd": "<workspace>/",
24+
"cache_config": {
25+
"env_config": {
26+
"fingerprinted_envs": [],
27+
"untracked_env": [
28+
"<default untracked envs>"
29+
]
30+
},
31+
"input_config": {
32+
"includes_auto": true,
33+
"positive_globs": [],
34+
"negative_globs": []
35+
},
36+
"output_config": {
37+
"includes_auto": true,
38+
"positive_globs": [],
39+
"negative_globs": []
40+
}
41+
}
42+
}
43+
},
44+
"source": "PackageJsonScript"
45+
}
46+
```
47+
48+
## `<workspace>/#hello`
49+
50+
```json
51+
{
52+
"task_display": {
53+
"package_name": "additional-envs",
54+
"task_name": "hello",
55+
"package_path": "<workspace>/"
56+
},
57+
"resolved_config": {
58+
"commands": [
59+
"echo hello"
60+
],
61+
"resolved_options": {
62+
"cwd": "<workspace>/",
63+
"cache_config": {
64+
"env_config": {
65+
"fingerprinted_envs": [],
66+
"untracked_env": [
67+
"<default untracked envs>"
68+
]
69+
},
70+
"input_config": {
71+
"includes_auto": true,
72+
"positive_globs": [],
73+
"negative_globs": []
74+
},
75+
"output_config": {
76+
"includes_auto": true,
77+
"positive_globs": [],
78+
"negative_globs": []
79+
}
80+
}
81+
}
82+
},
83+
"source": "PackageJsonScript"
84+
}
85+
```
86+

crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/task_graph.jsonc

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)