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] Eliminate "tsdoc" field from package.json #959

Closed
octogonz opened this issue Nov 27, 2018 · 2 comments
Closed

[api-extractor] Eliminate "tsdoc" field from package.json #959

octogonz opened this issue Nov 27, 2018 · 2 comments
Labels
enhancement The issue is asking for a new feature or design change

Comments

@octogonz
Copy link
Collaborator

API Extractor 6 required you to add a tsdoc field like this to your package.json if you are using .d.ts rollups:

{
  "name": "my-library",
   "tsdoc": { 
    "tsdocFlavor": "AEDoc" 
  },
  ...
}

The reason is that the analysis needs to parse code comments from the external library in order to determine basic properties, such as whether an API is marked as @beta or not. However, there's a LOT of junk in the node_modules folder, so we would not want to assume the tags have the meanings we expect, without some indicator that the library was built for API Extractor. In API Extractor 7 this requirement would apply to all analysis, not just .d.ts rollups. It's a little cumbersome, though.

@iclanton and I discussed this today and came up a with a better design: When API Extractor runs, it outputs a file such as dist/api-metadata.json which describes the version of API Extractor and some other basic information about the run. This file would NOT be added to Git, but would be published as part of the NPM package.

This will tell API Extractor that it is safe to parse and use TSDoc tags that it finds it the code comments for .d.ts files belonging to that package.

It also avoids the need to publish the .api.json files, which are quite large, and sometimes contain information that is not meant to be public.

@octogonz octogonz added the enhancement The issue is asking for a new feature or design change label Nov 27, 2018
@octogonz
Copy link
Collaborator Author

octogonz commented Nov 27, 2018

We could standardize this as a feature of @microsoft/tsdoc.

@octogonz
Copy link
Collaborator Author

Fixed by #960

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is asking for a new feature or design change
Projects
None yet
Development

No branches or pull requests

1 participant