X Tutup
Skip to content

Commit 0bca818

Browse files
authored
Merge branch 'master' into octogonz/ae-relative-paths
2 parents ac13f61 + 18b3485 commit 0bca818

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Collector } from '../collector/Collector';
1414
import { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';
1515
import { ApiModelGenerator } from '../generators/ApiModelGenerator';
1616
import { ApiPackage } from '@microsoft/api-extractor-model';
17-
import { ReviewFileGenerator } from '../generators/ReviewFileGenerator';
17+
import { ApiReportGenerator } from '../generators/ApiReportGenerator';
1818
import { PackageMetadataManager } from '../analyzer/PackageMetadataManager';
1919
import { ValidationEnhancer } from '../enhancers/ValidationEnhancer';
2020
import { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';
@@ -216,7 +216,7 @@ export class Extractor {
216216
const expectedApiReportPath: string = extractorConfig.reportFilePath;
217217
const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportFilePath);
218218

219-
const actualApiReportContent: string = ReviewFileGenerator.generateReviewFileContent(collector);
219+
const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(collector);
220220

221221
// Write the actual file
222222
FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {
@@ -228,7 +228,7 @@ export class Extractor {
228228
if (FileSystem.exists(expectedApiReportPath)) {
229229
const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);
230230

231-
if (!ReviewFileGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
231+
if (!ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
232232
apiReportChanged = true;
233233

234234
if (!localBuild) {

apps/api-extractor/src/collector/Collector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface ICollectorOptions {
5252

5353
/**
5454
* The `Collector` manages the overall data set that is used by `ApiModelGenerator`,
55-
* `DtsRollupGenerator`, and `ReviewFileGenerator`. Starting from the working package's entry point,
55+
* `DtsRollupGenerator`, and `ApiReportGenerator`. Starting from the working package's entry point,
5656
* the `Collector` collects all exported symbols, determines how to import any symbols they reference,
5757
* assigns unique names, and sorts everything into a normalized alphabetical ordering.
5858
*/

apps/api-extractor/src/generators/ReviewFileGenerator.ts renamed to apps/api-extractor/src/generators/ApiReportGenerator.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { ExtractorMessage } from '../api/ExtractorMessage';
1818
import { StringWriter } from './StringWriter';
1919
import { DtsEmitHelpers } from './DtsEmitHelpers';
2020

21-
export class ReviewFileGenerator {
21+
export class ApiReportGenerator {
2222
/**
2323
* Compares the contents of two API files that were created using ApiFileGenerator,
2424
* and returns true if they are equivalent. Note that these files are not normally edited
@@ -101,15 +101,15 @@ export class ReviewFileGenerator {
101101
messagesToReport.push(message);
102102
}
103103

104-
stringWriter.write(ReviewFileGenerator._getAedocSynopsis(collector, astDeclaration, messagesToReport));
104+
stringWriter.write(ApiReportGenerator._getAedocSynopsis(collector, astDeclaration, messagesToReport));
105105

106106
const span: Span = new Span(astDeclaration.declaration);
107107

108108
const declarationMetadata: DeclarationMetadata = collector.fetchMetadata(astDeclaration);
109109
if (declarationMetadata.isPreapproved) {
110-
ReviewFileGenerator._modifySpanForPreapproved(span);
110+
ApiReportGenerator._modifySpanForPreapproved(span);
111111
} else {
112-
ReviewFileGenerator._modifySpan(collector, span, entity, astDeclaration, false);
112+
ApiReportGenerator._modifySpan(collector, span, entity, astDeclaration, false);
113113
}
114114

115115
span.writeModifiedText(stringWriter.stringBuilder);
@@ -121,7 +121,7 @@ export class ReviewFileGenerator {
121121
for (const exportToEmit of exportsToEmit.values()) {
122122
// Write any associated messages
123123
for (const message of exportToEmit.associatedMessages) {
124-
ReviewFileGenerator._writeLineAsComments(stringWriter,
124+
ApiReportGenerator._writeLineAsComments(stringWriter,
125125
'Warning: ' + message.formatMessageWithoutLocation());
126126
}
127127

@@ -138,18 +138,18 @@ export class ReviewFileGenerator {
138138
.fetchUnassociatedMessagesForReviewFile();
139139
if (unassociatedMessages.length > 0) {
140140
stringWriter.writeLine();
141-
ReviewFileGenerator._writeLineAsComments(stringWriter, 'Warnings were encountered during analysis:');
142-
ReviewFileGenerator._writeLineAsComments(stringWriter, '');
141+
ApiReportGenerator._writeLineAsComments(stringWriter, 'Warnings were encountered during analysis:');
142+
ApiReportGenerator._writeLineAsComments(stringWriter, '');
143143
for (const unassociatedMessage of unassociatedMessages) {
144-
ReviewFileGenerator._writeLineAsComments(stringWriter, unassociatedMessage.formatMessageWithLocation(
144+
ApiReportGenerator._writeLineAsComments(stringWriter, unassociatedMessage.formatMessageWithLocation(
145145
collector.workingPackage.packageFolder
146146
));
147147
}
148148
}
149149

150150
if (collector.workingPackage.tsdocComment === undefined) {
151151
stringWriter.writeLine();
152-
ReviewFileGenerator._writeLineAsComments(stringWriter, '(No @packageDocumentation comment for this package)');
152+
ApiReportGenerator._writeLineAsComments(stringWriter, '(No @packageDocumentation comment for this package)');
153153
}
154154

155155
// Write the closing delimiter for the Markdown code fence
@@ -294,16 +294,16 @@ export class ReviewFileGenerator {
294294
if (!insideTypeLiteral) {
295295
const messagesToReport: ExtractorMessage[] = collector.messageRouter
296296
.fetchAssociatedMessagesForReviewFile(childAstDeclaration);
297-
const aedocSynopsis: string = ReviewFileGenerator._getAedocSynopsis(collector, childAstDeclaration,
297+
const aedocSynopsis: string = ApiReportGenerator._getAedocSynopsis(collector, childAstDeclaration,
298298
messagesToReport);
299-
const indentedAedocSynopsis: string = ReviewFileGenerator._addIndentAfterNewlines(aedocSynopsis,
299+
const indentedAedocSynopsis: string = ApiReportGenerator._addIndentAfterNewlines(aedocSynopsis,
300300
child.getIndent());
301301

302302
child.modification.prefix = indentedAedocSynopsis + child.modification.prefix;
303303
}
304304
}
305305

306-
ReviewFileGenerator._modifySpan(collector, child, entity, childAstDeclaration, insideTypeLiteral);
306+
ApiReportGenerator._modifySpan(collector, child, entity, childAstDeclaration, insideTypeLiteral);
307307
}
308308
}
309309
}
@@ -369,7 +369,7 @@ export class ReviewFileGenerator {
369369
const stringWriter: StringWriter = new StringWriter();
370370

371371
for (const message of messagesToReport) {
372-
ReviewFileGenerator._writeLineAsComments(stringWriter, 'Warning: ' + message.formatMessageWithoutLocation());
372+
ApiReportGenerator._writeLineAsComments(stringWriter, 'Warning: ' + message.formatMessageWithoutLocation());
373373
}
374374

375375
const declarationMetadata: DeclarationMetadata = collector.fetchMetadata(astDeclaration);
@@ -411,10 +411,10 @@ export class ReviewFileGenerator {
411411

412412
if (footerParts.length > 0) {
413413
if (messagesToReport.length > 0) {
414-
ReviewFileGenerator._writeLineAsComments(stringWriter, ''); // skip a line after the warnings
414+
ApiReportGenerator._writeLineAsComments(stringWriter, ''); // skip a line after the warnings
415415
}
416416

417-
ReviewFileGenerator._writeLineAsComments(stringWriter, footerParts.join(' '));
417+
ApiReportGenerator._writeLineAsComments(stringWriter, footerParts.join(' '));
418418
}
419419

420420
return stringWriter.toString();

apps/api-extractor/src/generators/DtsEmitHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { StringWriter } from './StringWriter';
1010
import { Collector } from '../collector/Collector';
1111

1212
/**
13-
* Some common code shared between DtsRollupGenerator and ReviewFileGenerator.
13+
* Some common code shared between DtsRollupGenerator and ApiReportGenerator.
1414
*/
1515
export class DtsEmitHelpers {
1616
public static emitImport(stringWriter: StringWriter, collectorEntity: CollectorEntity, astImport: AstImport): void {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/api-extractor",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor",
10+
"email": "4673363+octogonz@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)
X Tutup