-
-
Notifications
You must be signed in to change notification settings - Fork 141
chore(developer): consolidate api-extractor usage in Developer #16135
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # api-extractor.template.json | ||
|
|
||
| * Reference: https://api-extractor.com | ||
|
|
||
| api-extractor.template.json contains a template for api-extractor; these parameters | ||
| cannot be passed in to the tool, so we modify this template as needed with the following | ||
| parameters: | ||
|
|
||
| * `$keyman_root`: the `$KEYMAN_ROOT` variable, with backslash \ translated to forward slash / | ||
| * `$index_d_ts`: the filename `index.d.ts` or the corresponding filename for the | ||
| entry point of the project | ||
| * `$project_path`: the path for the module, relative to the base of the repo | ||
| * `$report_temp`: a temporary path for output files for api-extractor | ||
| * `$report_folder`: target folder for completed api-extractor API documentation | ||
|
|
||
| # tsdoc.template.json | ||
|
|
||
| * Reference: https://tsdoc.org/pages/packages/tsdoc-config/ | ||
|
|
||
| tsdoc.template.json is copied (unmodified) from this folder into tsdoc.json in | ||
| project folders (alongside tsconfig.json) before running api-extractor and | ||
| removed again afterwards; there is no way to specify an alternate location for | ||
| the file. | ||
|
|
||
| tsdoc.template.json includes a definition for "@since" which has been proposed in | ||
| https://github.com/microsoft/tsdoc/issues/136. | ||
|
|
||
| # Notes | ||
|
|
||
| These files are used by `typescript_run_api_extractor()` in typescript.inc.sh. | ||
|
|
||
| This is setup only for Developer projects at this time as outputs go into | ||
| developer/docs and developer/build; future generalization requires changing only | ||
| `$report_temp` and `$report_folder` parameters in | ||
| `typescript_run_api_extractor()`. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "$keyman_root/common/tools/api-extractor/api-extractor.base.json", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we would put the variables we replace in uppercase they would be easier to spot. |
||
| "mainEntryPointFilePath": "<projectFolder>/build/src/$index_d_ts", | ||
| "docModel": { | ||
| "enabled": true, | ||
| "projectFolderUrl": "http://github.com/keymanapp/keyman/tree/master/$project_path", | ||
| "apiJsonFilePath": "$report_temp/<unscopedPackageName>.api.json" | ||
| }, | ||
| "apiReport": { | ||
| "enabled": true, | ||
| "reportFolder": "$report_folder/", | ||
| "reportTempFolder": "$report_temp/" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", | ||
| "extends": ["@microsoft/api-extractor/extends/tsdoc-base.json"], | ||
| "tagDefinitions": [ | ||
| { | ||
| "tagName": "@since", | ||
| "syntaxKind": "block", | ||
| "allowMultiple": false | ||
| } | ||
| ], | ||
|
|
||
| "supportForTags": { | ||
| "@since": true | ||
| } | ||
| } |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,5 +39,5 @@ do_build() { | |||||
| builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo | ||||||
| builder_run_action configure node_select_version_and_npm_ci | ||||||
| builder_run_action build do_build | ||||||
| builder_run_action api api-extractor run --local --verbose | ||||||
| builder_run_action api typescript_run_api_extractor developer/src/kmc-copy main.d.ts | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd guess this should be
Suggested change
(similarly in the other |
||||||
| builder_run_action test typescript_run_eslint_mocha_tests | ||||||
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to move this sentence to the top of the file. Also, a sentence what api-extractor does or why we do it might be helpful. I guess we're talking about https://api-extractor.com/ ?
We could also reference .github/workflows/api-verification.yml which maybe does a similar thing for the desktop platforms.