dart_apitool
0.23.2, released 4 months ago by bmwtech.dev
Analyze and diff public APIs of Dart packages to check semantic versioning.
What it does
Dart API Tool analyzes the public API of a package, creates a model of it, and compares it against another version. It helps maintainers verify that version numbers follow semantic versioning correctly by detecting breaking changes.
AI-written summary of version 0.23.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to automate semver checking in your package CI pipeline.
- You need to compare public APIs between different package versions, git branches, or local directories.
Skip it when
- You need a general-purpose linter or formatter for source code.
- You want to analyze implementation details or internal logic rather than public APIs.
Strengths
- Supports local paths, pub.dev packages, and Git repositories with specific tags or branches.
- Integrates smoothly into CI workflows to catch accidental breaking changes early.
Weaknesses
- It cannot cover all potential API changes or look into internal implementations.
- Relies heavily on the accuracy of the analyzer and public exports.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 18
Install globally via dart pub global activate dart_apitool.
dart-apitool diff --old pub://my_package/1.0.0 --new .Works with
Packages commonly used together with dart_apitool: ones it builds on, ones built on it, and its own family.
- analyzerdart_apitool depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamldart_apitool depends on itA Dart library for parsing YAML documents into Dart data structures.
- pub_semverdart_apitool depends on itVersions and version constraints implementing pub's versioning policy.
- package_configdart_apitool depends on itRead and write Dart package configuration files.
- pubspec_parsedart_apitool depends on itParse pubspec.yaml files with a type‑safe API and detailed error reporting.
- json_annotationdart_apitool depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- argsdart_apitool depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- freezed_annotationdart_apitool depends on itAnnotations for the freezed code-generator.