Skip to content

Commit f1cde35

Browse files
committed
Add ExtractorResult.apiReportChanged boolean
1 parent a185e79 commit f1cde35

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ export class ExtractorResult {
9494
*/
9595
public readonly succeeded: boolean;
9696

97+
/**
98+
* Returns true if the API report was found to have changed.
99+
*/
100+
public readonly apiReportChanged: boolean;
101+
97102
/**
98103
* Reports the number of errors encountered during analysis.
99104
*
@@ -115,6 +120,7 @@ export class ExtractorResult {
115120
this.compilerState = properties.compilerState;
116121
this.extractorConfig = properties.extractorConfig;
117122
this.succeeded = properties.succeeded;
123+
this.apiReportChanged = properties.apiReportChanged;
118124
this.errorCount = properties.errorCount;
119125
this.warningCount = properties.warningCount;
120126
}
@@ -199,6 +205,8 @@ export class Extractor {
199205
});
200206
}
201207

208+
let apiReportChanged: boolean = false;
209+
202210
if (extractorConfig.apiReportEnabled) {
203211
const actualApiReportPath: string = extractorConfig.reportTempFilePath;
204212
const actualApiReviewShortPath: string = extractorConfig._getShortFilePath(extractorConfig.reportTempFilePath);
@@ -239,6 +247,8 @@ export class Extractor {
239247
convertLineEndings: NewlineKind.CrLf
240248
});
241249
}
250+
251+
apiReportChanged = true;
242252
} else {
243253
messageRouter.logVerbose(ConsoleMessageId.ApiReportUnchanged,
244254
`The API signature is up to date: ${actualApiReviewShortPath}`);
@@ -281,6 +291,7 @@ export class Extractor {
281291
compilerState,
282292
extractorConfig,
283293
succeeded,
294+
apiReportChanged,
284295
errorCount: messageRouter.errorCount,
285296
warningCount: messageRouter.warningCount
286297
});

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ export function runScenarios(buildConfigPath: string): void {
9090
localBuild: true,
9191
showVerboseMessages: true,
9292
messageCallback: (message: ExtractorMessage) => {
93-
// This will get fixed with https://github.com/Microsoft/web-build-tools/issues/1133
9493
if (message.messageId === ConsoleMessageId.ApiReportCopied) {
9594
// ignore the "You have changed the public API signature for this project."
96-
// warning for now.
95+
// warning for until the above issue #1018 is fixed.
9796
message.handled = true;
9897
}
9998
},

‎common/reviews/api/api-extractor.api.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export const enum ExtractorMessageId {
123123
export class ExtractorResult {
124124
// @internal
125125
constructor(properties: ExtractorResult);
126+
readonly apiReportChanged: boolean;
126127
readonly compilerState: CompilerState;
127128
readonly errorCount: number;
128129
readonly extractorConfig: ExtractorConfig;

0 commit comments

Comments
 (0)