Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-extractor] Feature Request: Include additional tags in API reports #4988

Open
Josmithr opened this issue Nov 1, 2024 · 2 comments
Open
Labels
effort: easy Probably a quick fix. Want to contribute? :-) enhancement The issue is asking for a new feature or design change

Comments

@Josmithr
Copy link
Contributor

Josmithr commented Nov 1, 2024

API-Extractor automatically includes release tags and a few other selected tags (e.g., @sealed) on API members in the API reports it generates. We would like to be able to configure this to include additional tags, including custom TSDoc tags.

Ideally, we could specify something like:

...
"apiReport": {
	"enabled": true,
	...
	"tags-to-report": ["@sealed", "@virtual", "@foo", "@bar", ...],
},
...

And the generated report would list those tags above any API member in the report whose TSDoc comment contains those tags.

For now, our immediate need would be met with just modifier tags, but I could also see use in reporting other TSDoc tag kinds, so restricting this feature to only modifier tags probably doesn't make sense.

@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Nov 1, 2024
@octogonz octogonz added enhancement The issue is asking for a new feature or design change effort: easy Probably a quick fix. Want to contribute? :-) labels Nov 1, 2024
@ahnpnl
Copy link

ahnpnl commented Nov 5, 2024

I'm using workaround by doing the following:

  • Enable docModel in extract-api.json
  • Create tsdoc.json to define custom tags on the same level with extract-api.json
  • Run api-extractor to generate something.api.json
  • Read content of something.api.json to get docComment from and parse it with TSDocParser.parseString
  • Process the result from TSDocParser.parseString to get .customBlocks and get information of custom tags from customBlocks

@octogonz
Copy link
Collaborator

octogonz commented Nov 5, 2024

@Josmithr and I looked at this on Friday. Although a bit of further discussion is needed to decide the config setting (should it be inheritable?), the feature makes sense to me. 👍 It also seems easy to implement.

If someone has time to make a PR, let me know, and we can work together to finish the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: easy Probably a quick fix. Want to contribute? :-) enhancement The issue is asking for a new feature or design change
Projects
Status: Needs triage
Development

No branches or pull requests

3 participants