feat(api_summary): Move api_summary package into the tools monorepo#2412
Conversation
- Copy `pkg/api_summary` from `dart-lang/sdk` to `pkgs/api_summary`. - Remove SDK workspace resolution (`resolution: workspace`). - Set specific dependency version constraints instead of `any`. - Add package-specific GitHub Actions workflow (`.github/workflows/api_summary.yaml`). - Update `README.md` using the repository's `readme_update.dart` script. - Add build status and pub.dev badges to the package-specific `README.md`. - Configure strict analyzer language options and extra lint rules. - Format and refactor the code to fully satisfy all new lint rules.
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthAPI leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Unused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with
Breaking changes
|
| Package | Change | Current Version | New Version | Needed Version | Looking good? |
|---|---|---|---|---|---|
| api_summary | Breaking | 0.0.0 | 0.0.0 | 0.0.0 Report was not created for package:api_summary 0.1.0-wip (dir=/home/runner/work/tools/tools/current_repo/pkgs/api_summary). Error: Error: Exception: Package not available (could not find package api_summary at https://pub.dev). |
This check can be disabled by tagging the PR with skip-breaking-check.
Coverage ⚠️
| File | Coverage |
|---|---|
| pkgs/api_summary/bin/api_summary.dart | 💔 Not covered |
| pkgs/api_summary/example/example.dart | 💔 Not covered |
| pkgs/api_summary/lib/api_summary.dart | 💔 Not covered |
| pkgs/api_summary/lib/src/api_description.dart | 💚 95 % |
| pkgs/api_summary/lib/src/api_summary_customizer.dart | 💚 100 % |
| pkgs/api_summary/lib/src/extensions.dart | 💚 100 % |
| pkgs/api_summary/lib/src/member_sorting.dart | 💚 85 % |
| pkgs/api_summary/lib/src/node.dart | 💚 100 % |
| pkgs/api_summary/lib/src/unique_namer.dart | 💚 100 % |
| pkgs/api_summary/lib/src/uri_sorting.dart | 💚 100 % |
This check for test coverage is informational (issues shown here will not fail the PR).
This check can be disabled by tagging the PR with skip-coverage-check.
There was a problem hiding this comment.
Code Review
This pull request introduces a new experimental package, api_summary, which generates human-readable text summaries of a Dart package's public API for auditing purposes. The implementation includes a CLI tool, core logic for traversing analyzer elements, and a customizable visitor pattern. Review feedback focuses on improving the robustness of the package as a foundational component. Key issues identified include risky assumptions about the number of analysis contexts, unsafe type casting of file and library results, and logic errors that incorrectly skip factory constructors for enums and sealed or abstract classes.
pkg/api_summaryfromdart-lang/sdktopkgs/api_summary.resolution: workspace).any..github/workflows/api_summary.yaml).README.mdusing the repository'sreadme_update.dartscript.README.md.