Skip to content

Commit 6357d49

Browse files
committed
The API reports now use the file extension ".api.md" instead of ".api.ts" since they don't contain semantically valid TypeScript, and this was confusing some tools
1 parent c8c2149 commit 6357d49

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

apps/api-extractor/src/api/Extractor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface IExtractorOptions {
6565
/**
6666
* Indicates that API Extractor is running as part of a local build, e.g. on developer's
6767
* machine. This disables certain validation that would normally be performed
68-
* for a ship/production build. For example, the *.api.ts review file is
68+
* for a ship/production build. For example, the *.api.md review file is
6969
* automatically local in a debug build.
7070
*
7171
* The default value is false.
@@ -418,7 +418,7 @@ export class Extractor {
418418
}
419419

420420
if (this.actualConfig.apiReviewFile.enabled) {
421-
const apiReviewFilename: string = packageBaseName + '.api.ts';
421+
const apiReviewFilename: string = packageBaseName + '.api.md';
422422

423423
const actualApiReviewPath: string = path.resolve(this._absoluteRootFolder,
424424
this.actualConfig.apiReviewFile.tempFolder, apiReviewFilename);

apps/api-extractor/src/api/IExtractorConfig.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface IExtractorValidationRulesConfig {
111111
}
112112

113113
/**
114-
* Configures how the API review files (*.api.ts) will be generated.
114+
* Configures how the API review files (*.api.md) will be generated.
115115
*
116116
* @public
117117
*/
@@ -124,9 +124,9 @@ export interface IExtractorApiReviewFileConfig {
124124
/**
125125
* The file path of the folder containing API review file, relative to
126126
* the project folder. This is part of an API review workflow: During a build,
127-
* the API Extractor will output an API file, e.g. "my-project/temp/my-project.api.ts".
127+
* the API Extractor will output an API file, e.g. "my-project/temp/my-project.api.md".
128128
* It will then compare this file against the last reviewed file,
129-
* e.g. "../api-review/my-project.api.ts" (assuming that apiReviewFolder is "../api-review").
129+
* e.g. "../api-review/my-project.api.md" (assuming that apiReviewFolder is "../api-review").
130130
* If the files are different, the build will fail with an error message that instructs
131131
* the developer to update the approved file, and then commit it to Git. When they
132132
* create a Pull Request, a branch policy will look for changes under "api-review/*"
@@ -140,7 +140,7 @@ export interface IExtractorApiReviewFileConfig {
140140
apiReviewFolder?: string;
141141

142142
/**
143-
* The *.api.ts report is saved into this folder. During a production build
143+
* The *.api.md report is saved into this folder. During a production build
144144
* (i.e. when IExtractorRuntimeOptions.productionBuild=true) the temporary file will
145145
* be compared with the file in apiReviewFolder; if there are differences, and error
146146
* will be reported. During a non-production build, the temporary file will be
@@ -311,7 +311,7 @@ export interface IExtractorMessageReportingRuleConfig {
311311
logLevel: ExtractorMessageLogLevel;
312312

313313
/**
314-
* If API Extractor is configured to write an API review file (.api.ts), then the message will be written
314+
* If API Extractor is configured to write an API review file (.api.md), then the message will be written
315315
* inside that file. If the API review file is NOT being written, then the message is instead logged according
316316
* to the `logLevel` option.
317317
*/

apps/api-extractor/src/cli/RunAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class RunAction extends CommandLineAction {
4949
parameterShortName: '-l',
5050
description: 'Indicates that API Extractor is running as part of a local build,'
5151
+ ' e.g. on a developer\'s machine. This disables certain validation that would'
52-
+ ' normally be performed for a ship/production build. For example, the *.api.ts'
52+
+ ' normally be performed for a ship/production build. For example, the *.api.md'
5353
+ ' review file is automatically copied in a local build.'
5454
});
5555

apps/api-extractor/src/schemas/api-extractor.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
},
9393

9494
"apiReviewFile": {
95-
"description": "Configures how the API review files (*.api.ts) will be generated.",
95+
"description": "Configures how the API review files (*.api.md) will be generated.",
9696
"type": "object",
9797
"properties": {
9898
"enabled": {
@@ -104,7 +104,7 @@
104104
"type": "string"
105105
},
106106
"tempFolder": {
107-
"description": "The *.api.ts report is saved into this folder. During a production build, the temporary file will be compared with the file in apiReviewFolder; if there are differences, and error will be reported. The default value is \"./temp\".",
107+
"description": "The *.api.md report is saved into this folder. During a production build, the temporary file will be compared with the file in apiReviewFolder; if there are differences, and error will be reported. The default value is \"./temp\".",
108108
"type": "string"
109109
}
110110
},
@@ -231,7 +231,7 @@
231231
},
232232
"addToApiReviewFile": {
233233
"type": "boolean",
234-
"description": "If API Extractor is configured to write an API review file (.api.ts), then the message will be written inside that file. If the API review file is NOT being written, then the message is instead logged according to the \"logLevel\" option."
234+
"description": "If API Extractor is configured to write an API review file (.api.md), then the message will be written inside that file. If the API review file is NOT being written, then the message is instead logged according to the \"logLevel\" option."
235235
}
236236
},
237237
"additionalProperties": false,

build-tests/api-extractor-scenarios/src/runScenarios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export function runScenarios(buildConfigPath: string): void {
7474
JsonFile.save(apiExtractorJson, apiExtractorJsonPath, { ensureFolderExists: true });
7575

7676
// Create an empty file to force API Extractor to create a missing output file
77-
// TODO: Add an api-extractor option to force creation of a missing .api.ts file
77+
// TODO: Add an api-extractor option to force creation of a missing .api.md file
7878
// See GitHub issue https://github.com/Microsoft/web-build-tools/issues/1018
79-
FileSystem.writeFile(`./etc/test-outputs/${scenarioFolderName}/api-extractor-scenarios.api.ts`, '',
79+
FileSystem.writeFile(`./etc/test-outputs/${scenarioFolderName}/api-extractor-scenarios.api.md`, '',
8080
{ ensureFolderExists: true });
8181
}
8282

0 commit comments

Comments
 (0)