rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor]: support custom access modifiers for API stripping

Open Hotell opened this issue 3 years ago • 0 comments

Summary

API-Documenter already custom tags via TSDoc. We need similar functionality for access modifier annotations to leverage api stripping based on our needs.

Please check following RFC for more details.

In short we would like to leverage additional acces modifiers for API stripping such as:

  • @rc for Release Candidate
  • @unstable to express @alpha/@beta/@rc via one tag which is all we need

To implement this dtsRollup API config will need to be extended to something like following:

{
"dtsRollup": {
    "enabled": true,
    "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
    "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",,
    "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
    "customTrimmedFilePaths": {
         // custom annotation key needs to match with custom tsdoc
         "@rc":  "<projectFolder>/dist/rc/index.d.ts"
         "@unstable":  "<projectFolder>/dist/unstable/index.d.ts"
          ...
      }
  }
}

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.18.1
Operating system? macos 12
API Extractor scenario? reporting (.api.md) / rollups (.d.ts) / docs (.api.json)
Would you consider contributing a PR? Maybe
TypeScript compiler version? 4.3.5
Node.js version (node -v)? 16

Related issues

  • https://github.com/microsoft/rushstack/pull/1950
  • https://github.com/microsoft/rushstack/issues/519
  • https://github.com/microsoft/rushstack/pull/1296
  • https://github.com/microsoft/tsdoc/issues/21

Hotell avatar Jul 28 '22 16:07 Hotell