devlens 1.1.0
devlens: ^1.1.0 copied to clipboard
Flutter Dependency Explorer. A developer tool to analyze any Flutter or Dart project and generate an interactive architecture and dependency visualization map.
π DevLens #
Flutter Dependency Explorer. A developer tool to analyze any Flutter or Dart project and generate an interactive architecture and dependency visualization map.
β¨ Features #
- π Fast Parsing: Scans your entire
lib/directory in milliseconds. - π¦ Dependency Mapping: Accurately maps both
package:and relative imports. - ποΈ Architecture Analysis: Categorizes files by types like
Screen,Bloc,Repository, andModel. - π JSON Export: Generates a standard JSON graph model that can be consumed by visualizers.
π Getting Started #
Installation #
Activate the CLI globally via pub:
dart pub global activate devlens
Usage #
Run the scanner in the root of any Flutter or Dart project:
devlens scan
You can also specify a specific path:
devlens scan --path /path/to/your/flutter_project
πΊοΈ How it Works & Where Everything Goes #
When you run devlens scan, here is what happens under the hood and where the outputs are generated:
1. Parsing Phase [Click to expand]
The
DartParser scans through your project's lib/ directory, reading every .dart file. It extracts dependencies and identifies the type of each component (e.g., is it a State, Screen, or Repository?).
2. Graph Generation [Click to expand]
The parsed files are converted into a connected
DependencyGraph. This engine models the nodes (files) and edges (imports) of your architecture.
3. Output (.dep_explorer/) [Click to expand]
Once the scan is complete, DevLens creates a new directory in your project root called
.dep_explorer/. Inside this folder, it generates a
graph.json file (and other reports) containing the full dependency tree, which can be loaded into visualization tools!
π Source Code Architecture #
Curious about how DevLens itself is built? Here's a quick overview of our source code:
- π
bin/: Contains the executable entrypoint (devlens.dart). - π
lib/cli/: The command-line interface logic and command runner. - π
lib/packages/parser/: The Dart analyzer code that reads your files. - π
lib/packages/graph_engine/: Data structures for the dependency graph. - π
lib/packages/reports/: Exporters that write the.dep_explorer/outputs.
π€ Contributing #
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.