Skip to content

Commit 14359ec

Browse files
authored
Merge pull request microsoft#1213 from Microsoft/octogonz/rename-api-review-file
[api-extractor] Rename "API Review File" to "API Report File"
2 parents 97a2feb + f9bae9f commit 14359ec

54 files changed

Lines changed: 121 additions & 110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/api-extractor/src/api/ConsoleMessageId.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const enum ConsoleMessageId {
4444
ApiReportUnchanged = 'console-api-report-unchanged',
4545

4646
/**
47-
* "The API review file has not been set up. Do this by copying ___ to ___ and committing it."
47+
* "The API report file has not been set up. Do this by copying ___ to ___ and committing it."
4848
*/
4949
ApiReportMissing = 'console-api-report-missing'
5050
}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface IExtractorInvokeOptions {
3636
/**
3737
* Indicates that API Extractor is running as part of a local build, e.g. on developer's
3838
* machine. This disables certain validation that would normally be performed
39-
* for a ship/production build. For example, the *.api.md review file is
39+
* for a ship/production build. For example, the *.api.md report file is
4040
* automatically updated in a local build.
4141
*
4242
* The default value is false.
@@ -209,40 +209,40 @@ export class Extractor {
209209

210210
if (extractorConfig.apiReportEnabled) {
211211
const actualApiReportPath: string = extractorConfig.reportTempFilePath;
212-
const actualApiReviewShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportTempFilePath);
212+
const actualApiReportShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportTempFilePath);
213213

214-
const expectedApiReviewPath: string = extractorConfig.reportFilePath;
215-
const expectedApiReviewShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportFilePath);
214+
const expectedApiReportPath: string = extractorConfig.reportFilePath;
215+
const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportFilePath);
216216

217-
const actualApiReviewContent: string = ReviewFileGenerator.generateReviewFileContent(collector);
217+
const actualApiReportContent: string = ReviewFileGenerator.generateReviewFileContent(collector);
218218

219219
// Write the actual file
220-
FileSystem.writeFile(actualApiReportPath, actualApiReviewContent, {
220+
FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {
221221
ensureFolderExists: true,
222222
convertLineEndings: NewlineKind.CrLf
223223
});
224224

225225
// Compare it against the expected file
226-
if (FileSystem.exists(expectedApiReviewPath)) {
227-
const expectedApiReviewContent: string = FileSystem.readFile(expectedApiReviewPath);
226+
if (FileSystem.exists(expectedApiReportPath)) {
227+
const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);
228228

229-
if (!ReviewFileGenerator.areEquivalentApiFileContents(actualApiReviewContent, expectedApiReviewContent)) {
229+
if (!ReviewFileGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
230230
if (!localBuild) {
231231
// For production, issue a warning that will break the CI build.
232232
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied,
233233
'You have changed the public API signature for this project.'
234234
// @microsoft/gulp-core-build seems to run JSON.stringify() on the error messages for some reason,
235235
// so try to avoid escaped characters:
236-
+ ` Please overwrite ${expectedApiReviewShortPath} with a`
237-
+ ` copy of ${actualApiReviewShortPath}`
236+
+ ` Please overwrite ${expectedApiReportShortPath} with a`
237+
+ ` copy of ${actualApiReportShortPath}`
238238
+ ' and then request an API review. See the Git repository README.md for more info.');
239239
} else {
240240
// For a local build, just copy the file automatically.
241241
messageRouter.logWarning(ConsoleMessageId.ApiReportCopied,
242242
'You have changed the public API signature for this project.'
243-
+ ` Updating ${expectedApiReviewShortPath}`);
243+
+ ` Updating ${expectedApiReportShortPath}`);
244244

245-
FileSystem.writeFile(expectedApiReviewPath, actualApiReviewContent, {
245+
FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
246246
ensureFolderExists: true,
247247
convertLineEndings: NewlineKind.CrLf
248248
});
@@ -251,15 +251,15 @@ export class Extractor {
251251
apiReportChanged = true;
252252
} else {
253253
messageRouter.logVerbose(ConsoleMessageId.ApiReportUnchanged,
254-
`The API signature is up to date: ${actualApiReviewShortPath}`);
254+
`The API signature is up to date: ${actualApiReportShortPath}`);
255255
}
256256
} else {
257257
// NOTE: This warning seems like a nuisance, but it has caught genuine mistakes.
258258
// For example, when projects were moved into category folders, the relative path for
259-
// the API review files ended up in the wrong place.
260-
messageRouter.logError(ConsoleMessageId.ApiReportMissing, `The API review file has not been set up.`
261-
+ ` Do this by copying ${actualApiReviewShortPath}`
262-
+ ` to ${expectedApiReviewShortPath} and committing it.`);
259+
// the API report files ended up in the wrong place.
260+
messageRouter.logError(ConsoleMessageId.ApiReportMissing, `The API report file has not been set up.`
261+
+ ` Do this by copying ${actualApiReportShortPath}`
262+
+ ` to ${expectedApiReportShortPath} and committing it.`);
263263
}
264264
}
265265

‎apps/api-extractor/src/api/IConfigFile.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface IConfigCompiler {
5353
}
5454

5555
/**
56-
* Configures how the API review files (*.api.md) will be generated.
56+
* Configures how the API report files (*.api.md) will be generated.
5757
*
5858
* @remarks
5959
* This is part of the {@link IConfigFile} structure.
@@ -213,16 +213,16 @@ export interface IConfigMessageReportingRule {
213213
* Specifies whether the message should be written to the the tool's output log.
214214
*
215215
* @remarks
216-
* Note that the `addToApiReviewFile` property may supersede this option.
216+
* Note that the `addToApiReportFile` property may supersede this option.
217217
*/
218218
logLevel: ExtractorLogLevel;
219219

220220
/**
221-
* If API Extractor is configured to write an API review file (.api.md), then the message will be written
222-
* inside that file. If the API review file is NOT being written, then the message is instead logged according
221+
* If API Extractor is configured to write an API report file (.api.md), then the message will be written
222+
* inside that file. If the API report file is NOT being written, then the message is instead logged according
223223
* to the `logLevel` option.
224224
*/
225-
addToApiReviewFile?: boolean;
225+
addToApiReportFile?: boolean;
226226
}
227227

228228
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class RunAction extends CommandLineAction {
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'
5252
+ ' normally be performed for a ship/production build. For example, the *.api.md'
53-
+ ' review file is automatically copied in a local build.'
53+
+ ' report file is automatically copied in a local build.'
5454
});
5555

5656
this._verboseParameter = this.defineFlagParameter({

‎apps/api-extractor/src/collector/MessageRouter.ts‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { ConsoleMessageId } from '../api/ConsoleMessageId';
2727

2828
interface IReportingRule {
2929
logLevel: ExtractorLogLevel;
30-
addToApiReviewFile: boolean;
30+
addToApiReportFile: boolean;
3131
}
3232

3333
export class MessageRouter {
@@ -37,19 +37,19 @@ export class MessageRouter {
3737
// All messages
3838
private readonly _messages: ExtractorMessage[];
3939

40-
// For each AstDeclaration, the messages associated with it. This is used when addToApiReviewFile=true
40+
// For each AstDeclaration, the messages associated with it. This is used when addToApiReportFile=true
4141
private readonly _associatedMessagesForAstDeclaration: Map<AstDeclaration, ExtractorMessage[]>;
4242

4343
private readonly _sourceMapper: SourceMapper;
4444

4545
// Normalized representation of the routing rules from api-extractor.json
4646
private _reportingRuleByMessageId: Map<string, IReportingRule> = new Map<string, IReportingRule>();
4747
private _compilerDefaultRule: IReportingRule = { logLevel: ExtractorLogLevel.None,
48-
addToApiReviewFile: false };
48+
addToApiReportFile: false };
4949
private _extractorDefaultRule: IReportingRule = { logLevel: ExtractorLogLevel.None,
50-
addToApiReviewFile: false };
50+
addToApiReportFile: false };
5151
private _tsdocDefaultRule: IReportingRule = { logLevel: ExtractorLogLevel.None,
52-
addToApiReviewFile: false };
52+
addToApiReportFile: false };
5353

5454
public errorCount: number = 0;
5555
public warningCount: number = 0;
@@ -131,7 +131,7 @@ export class MessageRouter {
131131
private static _getNormalizedRule(rule: IConfigMessageReportingRule): IReportingRule {
132132
return {
133133
logLevel: rule.logLevel || 'none',
134-
addToApiReviewFile: rule.addToApiReviewFile || false
134+
addToApiReportFile: rule.addToApiReportFile || false
135135
};
136136
}
137137

@@ -265,61 +265,61 @@ export class MessageRouter {
265265
}
266266

267267
/**
268-
* This is used when writing the API review file. It looks up any messages that were configured to get emitted
269-
* in the API review file and returns them. It also records that they were emitted, which suppresses them from
268+
* This is used when writing the API report file. It looks up any messages that were configured to get emitted
269+
* in the API report file and returns them. It also records that they were emitted, which suppresses them from
270270
* being shown on the console.
271271
*/
272272
public fetchAssociatedMessagesForReviewFile(astDeclaration: AstDeclaration): ExtractorMessage[] {
273-
const messagesForApiReviewFile: ExtractorMessage[] = [];
273+
const messagesForApiReportFile: ExtractorMessage[] = [];
274274

275275
const associatedMessages: ExtractorMessage[] = this._associatedMessagesForAstDeclaration.get(astDeclaration) || [];
276276
for (const associatedMessage of associatedMessages) {
277277

278278
// Make sure we didn't already report this message for some reason
279279
if (!associatedMessage.handled) {
280280

281-
// Is this message type configured to go in the API review file?
281+
// Is this message type configured to go in the API report file?
282282
const reportingRule: IReportingRule = this._getRuleForMessage(associatedMessage);
283-
if (reportingRule.addToApiReviewFile) {
283+
if (reportingRule.addToApiReportFile) {
284284

285-
// Include it in the result, and record that it went to the API review file
286-
messagesForApiReviewFile.push(associatedMessage);
285+
// Include it in the result, and record that it went to the API report file
286+
messagesForApiReportFile.push(associatedMessage);
287287
associatedMessage.handled = true;
288288
}
289289
}
290290

291291
}
292292

293-
this._sortMessagesForOutput(messagesForApiReviewFile);
294-
return messagesForApiReviewFile;
293+
this._sortMessagesForOutput(messagesForApiReportFile);
294+
return messagesForApiReportFile;
295295
}
296296

297297
/**
298-
* This returns all remaining messages that were flagged with `addToApiReviewFile`, but which were not
298+
* This returns all remaining messages that were flagged with `addToApiReportFile`, but which were not
299299
* retreieved using `fetchAssociatedMessagesForReviewFile()`.
300300
*/
301301
public fetchUnassociatedMessagesForReviewFile(): ExtractorMessage[] {
302-
const messagesForApiReviewFile: ExtractorMessage[] = [];
302+
const messagesForApiReportFile: ExtractorMessage[] = [];
303303

304304
for (const unassociatedMessage of this.messages) {
305305

306306
// Make sure we didn't already report this message for some reason
307307
if (!unassociatedMessage.handled) {
308308

309-
// Is this message type configured to go in the API review file?
309+
// Is this message type configured to go in the API report file?
310310
const reportingRule: IReportingRule = this._getRuleForMessage(unassociatedMessage);
311-
if (reportingRule.addToApiReviewFile) {
311+
if (reportingRule.addToApiReportFile) {
312312

313-
// Include it in the result, and record that it went to the API review file
314-
messagesForApiReviewFile.push(unassociatedMessage);
313+
// Include it in the result, and record that it went to the API report file
314+
messagesForApiReportFile.push(unassociatedMessage);
315315
unassociatedMessage.handled = true;
316316
}
317317
}
318318

319319
}
320320

321-
this._sortMessagesForOutput(messagesForApiReviewFile);
322-
return messagesForApiReviewFile;
321+
this._sortMessagesForOutput(messagesForApiReportFile);
322+
return messagesForApiReportFile;
323323
}
324324

325325
/**

‎apps/api-extractor/src/generators/ReviewFileGenerator.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class ReviewFileGenerator {
3737
const stringWriter: StringWriter = new StringWriter();
3838

3939
stringWriter.writeLine([
40-
`## API Review File for "${collector.workingPackage.name}"`,
40+
`## API Report File for "${collector.workingPackage.name}"`,
4141
``,
4242
`> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).`,
4343
``

‎apps/api-extractor/src/schemas/api-extractor-defaults.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@
4343
},
4444
"ae-forgotten-export": {
4545
"logLevel": "warning",
46-
"addToApiReviewFile": true
46+
"addToApiReportFile": true
4747
},
4848
"ae-incompatible-release-tags": {
4949
"logLevel": "warning",
50-
"addToApiReviewFile": true
50+
"addToApiReportFile": true
5151
},
5252
"ae-internal-missing-underscore": {
5353
"logLevel": "warning",
54-
"addToApiReviewFile": true
54+
"addToApiReportFile": true
5555
},
5656
"ae-unresolved-inheritdoc-reference": {
5757
"logLevel": "warning",
58-
"addToApiReviewFile": true
58+
"addToApiReportFile": true
5959
},
6060
"ae-unresolved-inheritdoc-base": {
6161
"logLevel": "warning",
62-
"addToApiReviewFile": true
62+
"addToApiReportFile": true
6363
}
6464
},
6565
"tsdocMessageReporting": {

‎apps/api-extractor/src/schemas/api-extractor-template.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"default": {
227227
/**
228228
* Specifies whether the message should be written to the the tool's output log. Note that
229-
* the "addToApiReviewFile" property may supersede this option.
229+
* the "addToApiReportFile" property may supersede this option.
230230
*
231231
* Possible values: "error", "warning", "none"
232232
*
@@ -239,18 +239,18 @@
239239
// "logLevel": "warning",
240240

241241
/**
242-
* When addToApiReviewFile is true: If API Extractor is configured to write an API report file (.api.md),
242+
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
243243
* then the message will be written inside that file; otherwise, the message is instead logged according to
244244
* the "logLevel" option.
245245
*
246246
* DEFAULT VALUE: false
247247
*/
248-
// "addToApiReviewFile": false
248+
// "addToApiReportFile": false
249249
},
250250

251251
// "TS2551": {
252252
// "logLevel": "warning",
253-
// "addToApiReviewFile": true
253+
// "addToApiReportFile": true
254254
// },
255255
//
256256
// . . .
@@ -266,12 +266,12 @@
266266
"extractorMessageReporting": {
267267
"default": {
268268
// "logLevel": "warning",
269-
// "addToApiReviewFile": false
269+
// "addToApiReportFile": false
270270
},
271271

272272
// "ae-extra-release-tag": {
273273
// "logLevel": "warning",
274-
// "addToApiReviewFile": true
274+
// "addToApiReportFile": true
275275
// },
276276
//
277277
// . . .
@@ -287,12 +287,12 @@
287287
"tsdocMessageReporting": {
288288
"default": {
289289
// "logLevel": "warning",
290-
// "addToApiReviewFile": false
290+
// "addToApiReportFile": false
291291
}
292292

293293
// "tsdoc-link-tag-unescaped-text": {
294294
// "logLevel": "warning",
295-
// "addToApiReviewFile": true
295+
// "addToApiReportFile": true
296296
// },
297297
//
298298
// . . .

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@
164164
"properties": {
165165
"logLevel": {
166166
"type": "string",
167-
"description": "Specifies whether the message should be written to the the tool's output log. Note that the \"addToApiReviewFile\" property may supersede this option.",
167+
"description": "Specifies whether the message should be written to the the tool's output log. Note that the \"addToApiReportFile\" property may supersede this option.",
168168
"enum": [ "error", "warning", "none" ]
169169
},
170-
"addToApiReviewFile": {
170+
"addToApiReportFile": {
171171
"type": "boolean",
172172
"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."
173173
}

‎build-tests/api-documenter-test/etc/api-documenter-test.api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Review File for "api-documenter-test"
1+
## API Report File for "api-documenter-test"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44

0 commit comments

Comments
 (0)