microsoft/rushstack

[api-extractor] Allow generation of API reports per release level

Josmithr opened this issue · 1 comments

Use Case

My team has begun using API-Extractor in our mono-repository to help manage our API surfaces via release-tag-based trimming. We plan to begin leveraging the generated API report files to enforce special PR review requirements for API changes.

We have gone through the process of tagging all of our exports with the appropriate release tags based on our support commitments, but we have a known problem with APIs over-exposing members to support testing, etc. This has resulted in huge numbers of @internalexports. While we eventually want to reign these imports in, right now we are more focused on stabilizing our externally facing APIs.

Since API-Extractor generates only a single API report including all API members (including internal ones), it is difficult for us to enable PR gating requirements based on changes to them. Ideally, we would be able to differentiate between release levels, and apply the appropriate gating on a per-release-level basis, which we would likely leverage for preview APIs as well.

Feature Proposal

Just as API-Extractor can surface separate rollups on a per-release-level basis, operating on release tags, we would like to be able to generate separate API reports for each release level. With a separate report per level, we can enforce different levels of gating depending on the support guarantees we have made for each.

As an added benefit, each generated report would end up mirroring the rollups generated by API-Extractor’s trimming logic. Separate reports would offer a nice at-a-glance view of what will be in each of the typing rollups we end up offering to consumers.

Standard questions

Question Answer
Would you consider contributing a PR? Yes

A potential implementation of this functionality can be found here: #4621