modularity_cli
CLI tools for analyzing and visualizing Modularity module dependency graphs.
Provides utilities to introspect a module tree at build time and render the resulting dependency graph in a browser.
Key Classes
- GraphVisualizer -- generates and opens dependency graph visualizations.
- ModuleGraphData, ModuleNode, ModuleEdge -- structured graph data.
- DependencyRecord -- metadata about a single DI registration.
- DependencyRegistrationKind -- registration strategy (singleton/factory/instance).
Quick Start
dart
import 'package:modularity_cli/modularity_cli.dart';
void main() async {
await GraphVisualizer.visualize(
AppModule(),
renderer: GraphRenderer.g6,
);
}Classes
| Class | Description |
|---|---|
| DependencyRecord | Metadata about a single dependency registration captured by RecordingBinder. |
| GraphVisualizer | Generate and display module dependency graphs in a browser. |
| ModuleBindingsAnalyzer | Analyzes a Module tree and produces ModuleBindingsSnapshot for each node by running its binds and exports phases against a RecordingBinder. |
| ModuleBindingsSnapshot | Immutable snapshot of a Module's dependency registrations. |
| ModuleEdge | Represents a directed relationship between two modules in the graph. |
| ModuleGraphData | Complete graph data structure containing all ModuleNodes and ModuleEdges. |
| ModuleNode | Represents a single module as a node in the dependency graph. |
| RecordingBinder | Binder implementation that records registrations without instantiating any dependencies. |
Enums
| Enum | Description |
|---|---|
| DependencyRegistrationKind | Classification of how a dependency is registered in a Binder. |
| GraphRenderer | Available visualization renderers. |
| ModuleEdgeType | Types of directed relationships between modules in the dependency graph. |
Extensions
| Extension | on | Description |
|---|---|---|
| DependencyRegistrationKindLabel | DependencyRegistrationKind | Provide a human-readable label for each DependencyRegistrationKind value. |