Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 49 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ fixedbitset = "0.5"
tower-lsp = "0.20"
tokio = { version = "1", features = ["full"] }

# Browser
open = "5"

# File watching
notify = "8"
notify-debouncer-mini = "0.7"
Expand Down
1 change: 1 addition & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[files]
extend-exclude = [
"editors/vscode/dist/",
"crates/cli/viz-assets/",
"*.js.map",
"tests/fixtures/",
"reference/",
Expand Down
1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rayon = { workspace = true }
notify-debouncer-mini = { workspace = true }
tempfile = { workspace = true }
rustc-hash = { workspace = true }
open = { workspace = true }

[lib]
name = "fallow_cli"
Expand Down
31 changes: 31 additions & 0 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mod report;
mod schema;
mod validate;
mod vital_signs;
mod viz;
mod watch;

use check::{CheckOptions, IssueFilters, TraceOptions};
Expand Down Expand Up @@ -349,6 +350,21 @@ enum Command {
#[arg(long, value_name = "PATH")]
from: Option<PathBuf>,
},

/// Generate an interactive HTML treemap visualization of the codebase
Viz {
/// Output file path (default: fallow-viz.html in project root)
#[arg(long = "out", value_name = "PATH")]
output: Option<PathBuf>,

/// Don't open the output file in the browser
#[arg(long)]
no_open: bool,

/// Visualization output format
#[arg(long = "viz-format", default_value = "html")]
viz_format: viz::VizFormat,
},
}

#[derive(Clone, clap::ValueEnum)]
Expand Down Expand Up @@ -915,6 +931,21 @@ fn main() -> ExitCode {
dry_run,
from,
} => migrate::run_migrate(&root, toml, dry_run, from.as_deref()),
Command::Viz {
output: viz_output,
no_open,
viz_format,
} => viz::run_viz(&viz::VizOptions {
root: &root,
config_path: &cli.config,
no_cache: cli.no_cache,
threads,
quiet,
production: cli.production,
output_path: viz_output.as_deref(),
no_open,
format: viz_format,
}),
},
}
}
Expand Down
Loading
Loading