dart_inspect 1.0.6
dart_inspect: ^1.0.6 copied to clipboard
Dart source inspection tool and CLI for reporting imports, classes, and fields using the analyzer AST, with Markdown and programmatic support.
1.0.6 #
-
CLI (
bin/dart_inspect.dart):- Added
--ignore-generatedoption to ignore generated Dart files (e.g.,.g.dart,.freezed.dart).
- Added
-
DartInspectOptions(lib/src/dart_inspect_base.dart):- Added
ignoreGeneratedboolean option to control ignoring generated files. - Updated
flagsandoptionsgetters to includeignoreGenerated.
- Added
-
DartInspect(lib/src/dart_inspect_base.dart):- Added
generatedFilesExtensionlist with common generated file suffixes. - Added
isGeneratedFilemethod to detect generated files by suffix. - Updated
scanCodeto skip processing files identified as generated whenignoreGeneratedis enabled.
- Added
1.0.5 #
-
CLI (
bin/dart_inspect.dart):- Updated usage to accept either a directory or a file as input path.
- Improved path handling in
main:- Detects if input path is a file or directory.
- Handles non-existent paths and unsupported path types with appropriate error messages and exit codes.
-
DartInspectReporterand subclasses (reporter_markdown.dart,reporter_mermaid.dart,reporter_simple.dart):- Renamed constructor parameter from
directorytopathto reflect that input can be a file or directory. - Updated all references and documentation accordingly.
- Updated output headers to use
Pathinstead ofDirectory.
- Renamed constructor parameter from
1.0.4 #
DartInspectReporterMermaid:buildReport:- Sanitized class names in Mermaid output to replace special characters
$,(,),{,}with underscores. - Limited class stereotypes to show only the last stereotype instead of multiple.
- Sanitized class names in relationship arrows.
- Sanitized class names in Mermaid output to replace special characters
_sanitize:- Extended to replace additional special characters
$,(,),{,}with underscores.
- Extended to replace additional special characters
1.0.3 #
-
CLI (
bin/dart_inspect.dart):- Added new option
--no-empty-classesto exclude empty classes from the report. - Added new option
--sort-entriesto sort fields and classes alphabetically (default: false).
- Added new option
-
DartInspectOptions(lib/src/dart_inspect_base.dart):- Added
noEmptyClassesboolean option to exclude empty classes. - Updated constructor, flags, and options getters to support
noEmptyClasses.
- Added
-
Refactor
DartClassFieldstoDartClassInfo:- Added fields:
interfaces,mixins,superClass,isAbstract,isInterface,isMixin. - Updated JSON, Markdown, Mermaid, and string serialization to include class hierarchy and modifiers.
- Added equality, hashCode, and comparison operators for sorting and deduplication.
- Updated
DartInspectto yieldDartClassInfowith inheritance and interface info. - Updated tests to use
DartClassInfo.
- Added fields:
-
DartInspect:- Extracts and reports class
superClass,interfaces, andmixins. - Yields
DartClassInfoinstead ofDartClassFields. - Updated class scanning logic to skip empty classes when
noEmptyClassesis enabled.
- Extracts and reports class
-
DartInspectReporterMarkdown:- Groups reports by file path for stable output.
- Supports rendering
DartClassInfowith hierarchy and modifiers.
-
DartInspectReporterMermaid:- Collects full
DartClassInfoobjects keyed by class name. - Renders class stereotypes (
abstract,interface,mixin). - Renders inheritance (
extends), interface implementation (implements), and mixins as Mermaid relationships. - Deduplicates fields in Mermaid output.
- Collects full
-
DartInspectReporterSimple:- Groups reports by file path.
- Sorts and renders
DartClassInfowith hierarchy info.
-
ReportInfo:- Implements
Comparablefor sorting by file path and class name.
- Implements
-
DartImportInfo:- Implements
Comparablefor sorting by URI.
- Implements
-
collection: ^1.19.1
1.0.2 #
-
Added Mermaid output format support:
- CLI option
--mermaidto generate Mermaid class diagrams. DartInspectOptionsincludesmermaidflag with validation againstmarkdown.DartInspectReporterMermaidreporter generates MermaidclassDiagramoutput with classes, fields, and relationships.ReportInfosubclasses (DartClassFields,DartImportInfo,DartFileImports) implementtoMermaid()for Mermaid serialization.- CLI enforces mutually exclusive output formats:
--simple(default),--markdown,--mermaid. - README updated with Mermaid usage instructions, examples, and format notes.
- CLI option
-
Refactored reporters:
- Introduced abstract base class
DartInspectReporterfor output format implementations. DartInspectReporterSimpleandDartInspectReporterMarkdownrefactored to use the new base class.
- Introduced abstract base class
-
dart_inspect.dartCLI:- Simplified output logic by delegating to reporter classes.
- Added validation for mutually exclusive format options.
- Added Mermaid format support.
-
DartInspectOptions:- Added
mermaidboolean flag. - Updated
simplegetter to excludemermaidandmarkdown. - Added assertions to prevent incompatible options (
markdownandmermaid).
- Added
-
ReportInfoclasses:- Added
toMermaid()method to support Mermaid output. DartClassFields.toMermaid()outputs Mermaid class with fields.DartImportInfo.toMermaid()outputs Mermaid dependency edges with optional labels.DartFileImports.toMermaid()outputs Mermaid class node and import edges.
- Added
-
Updated
pubspec.yamldependencies:testto ^1.31.0dependency_validatorto ^5.0.5
1.0.1 #
bin/dart_inspect.dart:- Reduced Markdown output separator from 80 dashes to 3 dashes to save tokens.
1.0.0 #
- Initial version.