init: archlens — architecture diagram generator
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Hex arch + DDD, tree-sitter parsing, Mermaid/ASCII output. Supports Rust + Python. 92 tests. CI, diff, --check for staleness detection.
This commit is contained in:
10
crates/adapters/stdout-writer/Cargo.toml
Normal file
10
crates/adapters/stdout-writer/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "archlens-stdout-writer"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
archlens-domain.workspace = true
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
3
crates/adapters/stdout-writer/src/lib.rs
Normal file
3
crates/adapters/stdout-writer/src/lib.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod stdout_output_writer;
|
||||
|
||||
pub use stdout_output_writer::StdoutOutputWriter;
|
||||
24
crates/adapters/stdout-writer/src/stdout_output_writer.rs
Normal file
24
crates/adapters/stdout-writer/src/stdout_output_writer.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use archlens_domain::{DomainError, RenderOutput, ports::OutputWriter};
|
||||
|
||||
pub struct StdoutOutputWriter;
|
||||
|
||||
impl Default for StdoutOutputWriter {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl StdoutOutputWriter {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl OutputWriter for StdoutOutputWriter {
|
||||
fn write(&self, output: &RenderOutput) -> Result<(), DomainError> {
|
||||
for file in output.files() {
|
||||
println!("{}", file.content());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
12
crates/adapters/stdout-writer/tests/stdout_writer_tests.rs
Normal file
12
crates/adapters/stdout-writer/tests/stdout_writer_tests.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use archlens_domain::{RenderOutput, RenderedFile, ports::OutputWriter};
|
||||
use archlens_stdout_writer::StdoutOutputWriter;
|
||||
|
||||
#[test]
|
||||
fn writes_without_error() {
|
||||
let writer = StdoutOutputWriter::new();
|
||||
let file = RenderedFile::new("arch.mmd", "classDiagram").unwrap();
|
||||
let output = RenderOutput::single(file);
|
||||
|
||||
let result = writer.write(&output);
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
Reference in New Issue
Block a user