feat: add BuildCodeGraph use case, sink orchestration out of presentation

This commit is contained in:
2026-06-17 13:21:09 +02:00
parent 8f68714977
commit 7487cea0e2
6 changed files with 266 additions and 30 deletions

View File

@@ -3,9 +3,11 @@
mod diagram_renderer;
mod file_discovery;
mod output_writer;
mod project_analyzer;
mod source_analyzer;
pub use diagram_renderer::FakeDiagramRenderer;
pub use file_discovery::FakeFileDiscovery;
pub use output_writer::FakeOutputWriter;
pub use project_analyzer::FakeProjectAnalyzer;
pub use source_analyzer::FakeSourceAnalyzer;

View File

@@ -0,0 +1,23 @@
use std::path::Path;
use archlens_domain::{CodeGraph, DomainError, ports::ProjectAnalyzer};
pub struct FakeProjectAnalyzer {
graph: CodeGraph,
}
impl FakeProjectAnalyzer {
pub fn new(graph: CodeGraph) -> Self {
Self { graph }
}
pub fn empty() -> Self {
Self { graph: CodeGraph::new() }
}
}
impl ProjectAnalyzer for FakeProjectAnalyzer {
fn analyze(&self, _root: &Path) -> Result<CodeGraph, DomainError> {
Ok(self.graph.clone())
}
}