From 0c5bbf5bc13f0ff4c02368e49ab9891cf21b676f Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 25 Mar 2026 10:58:37 -0400 Subject: [PATCH] refactor(graphviz): move graph_render module from fabro-workflows to fabro-graphviz Co-Authored-By: Claude Opus 4.6 (1M context) --- Cargo.lock | 1 + lib/crates/fabro-api/src/server.rs | 2 +- lib/crates/fabro-cli/src/commands/graph.rs | 4 ++-- lib/crates/fabro-graphviz/Cargo.toml | 1 + lib/crates/fabro-graphviz/src/lib.rs | 1 + .../src/graph_render.rs => fabro-graphviz/src/render.rs} | 0 lib/crates/fabro-workflows/src/lib.rs | 8 +++----- 7 files changed, 9 insertions(+), 8 deletions(-) rename lib/crates/{fabro-workflows/src/graph_render.rs => fabro-graphviz/src/render.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 0111c74fb..d3ff3e508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1474,6 +1474,7 @@ dependencies = [ name = "fabro-graphviz" version = "0.176.2" dependencies = [ + "anyhow", "nom", "regex", "serde", diff --git a/lib/crates/fabro-api/src/server.rs b/lib/crates/fabro-api/src/server.rs index 685a873cc..9279208e4 100644 --- a/lib/crates/fabro-api/src/server.rs +++ b/lib/crates/fabro-api/src/server.rs @@ -1510,7 +1510,7 @@ async fn get_retro( /// Render DOT source to a styled SVG via `render_dot` on a blocking thread. pub(crate) async fn render_dot_svg(dot_source: &str) -> Response { - use fabro_workflows::graph_render::{render_dot, GraphFormat}; + use fabro_graphviz::render::{render_dot, GraphFormat}; let source = dot_source.to_owned(); match tokio::task::spawn_blocking(move || render_dot(&source, GraphFormat::Svg)).await { diff --git a/lib/crates/fabro-cli/src/commands/graph.rs b/lib/crates/fabro-cli/src/commands/graph.rs index ec7113760..cecc3a48c 100644 --- a/lib/crates/fabro-cli/src/commands/graph.rs +++ b/lib/crates/fabro-cli/src/commands/graph.rs @@ -68,7 +68,7 @@ pub fn run(args: &GraphArgs, styles: &Styles) -> anyhow::Result<()> { let source = read_workflow_file(&dot_path)?; let source = apply_direction(&source, args.direction); - let rendered = fabro_workflows::graph_render::render_dot(&source, args.format.into())?; + let rendered = fabro_graphviz::render::render_dot(&source, args.format.into())?; if let Some(ref output_path) = args.output { std::fs::write(output_path, &rendered)?; @@ -91,7 +91,7 @@ pub enum GraphOutputFormat { Png, } -impl From for fabro_workflows::graph_render::GraphFormat { +impl From for fabro_graphviz::render::GraphFormat { fn from(value: GraphOutputFormat) -> Self { match value { GraphOutputFormat::Svg => Self::Svg, diff --git a/lib/crates/fabro-graphviz/Cargo.toml b/lib/crates/fabro-graphviz/Cargo.toml index 1f8351f6e..d617c9b4c 100644 --- a/lib/crates/fabro-graphviz/Cargo.toml +++ b/lib/crates/fabro-graphviz/Cargo.toml @@ -9,6 +9,7 @@ description = "Graphviz DOT parser and typed graph data model" doctest = false [dependencies] +anyhow.workspace = true nom = "7" regex = { workspace = true } serde = { workspace = true } diff --git a/lib/crates/fabro-graphviz/src/lib.rs b/lib/crates/fabro-graphviz/src/lib.rs index bb646a9ae..a38f04df6 100644 --- a/lib/crates/fabro-graphviz/src/lib.rs +++ b/lib/crates/fabro-graphviz/src/lib.rs @@ -3,6 +3,7 @@ pub mod error; pub mod fidelity; pub mod graph; pub mod parser; +pub mod render; pub mod stylesheet; pub use fidelity::Fidelity; diff --git a/lib/crates/fabro-workflows/src/graph_render.rs b/lib/crates/fabro-graphviz/src/render.rs similarity index 100% rename from lib/crates/fabro-workflows/src/graph_render.rs rename to lib/crates/fabro-graphviz/src/render.rs diff --git a/lib/crates/fabro-workflows/src/lib.rs b/lib/crates/fabro-workflows/src/lib.rs index d30fb14c7..6bba79fec 100644 --- a/lib/crates/fabro-workflows/src/lib.rs +++ b/lib/crates/fabro-workflows/src/lib.rs @@ -95,21 +95,19 @@ pub mod checkpoint; pub mod conclusion; pub mod condition; pub mod context; -pub mod graph; -pub mod lifecycle; -pub mod node_handler; pub mod cost; pub mod devcontainer_bridge; pub mod error; pub mod event; pub mod git; +pub mod graph; pub mod graph_ops; -pub mod graph_render; pub mod handler; +pub mod lifecycle; +pub mod node_handler; pub mod operations; pub mod outcome; pub mod pipeline; -pub mod preamble; pub mod pull_request; pub mod run_dir; pub mod run_lookup;