Skip to content

Commit c9cf98c

Browse files
committed
PR feedback
1 parent 780b1c7 commit c9cf98c

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
export const enum ConsoleMessageId {
1515
/**
16-
* "'Found metadata in ___"
16+
* "Found metadata in ___"
1717
*/
1818
FoundTSDocMetadata = 'console-found-tsdoc-metadata',
1919

@@ -28,8 +28,15 @@ export const enum ConsoleMessageId {
2828
WritingDtsRollup = 'console-writing-dts-rollup',
2929

3030
/**
31-
* "You have changed the public API signature for this project. Please copy the file ___ to ___,
32-
* or else perform a local build (which does this automatically). See the Git repo documentation for more info.
31+
* "You have changed the public API signature for this project.
32+
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
33+
* See the Git repo documentation for more info."
34+
*
35+
* OR
36+
*
37+
* "The API report file is missing.
38+
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
39+
* See the Git repo documentation for more info."
3340
*/
3441
ApiReportNotCopied = 'console-api-report-not-copied',
3542

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class Extractor {
236236
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied,
237237
'You have changed the public API signature for this project.'
238238
+ ` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",`
239-
+ ` or else perform a local build (which does this automatically).`
239+
+ ` or perform a local build (which does this automatically).`
240240
+ ` See the Git repo documentation for more info.`);
241241
} else {
242242
// For a local build, just copy the file automatically.
@@ -264,16 +264,11 @@ export class Extractor {
264264
if (!localBuild) {
265265
// For a production build, issue a warning that will break the CI build.
266266
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied,
267-
'You have changed the public API signature for this project.'
267+
'The API report file is missing.'
268268
+ ` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",`
269-
+ ` or else perform a local build (which does this automatically).`
269+
+ ` or perform a local build (which does this automatically).`
270270
+ ` See the Git repo documentation for more info.`);
271271
} else {
272-
messageRouter.logWarning(ConsoleMessageId.ApiReportCreated,
273-
'The API report file was missing, so a new file was created. Please add this file to Git:\n'
274-
+ expectedApiReportPath
275-
);
276-
277272
const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);
278273
if (!FileSystem.exists(expectedApiReportFolder)) {
279274
messageRouter.logError(ConsoleMessageId.ApiReportFolderMissing,
@@ -284,6 +279,10 @@ export class Extractor {
284279
FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
285280
convertLineEndings: NewlineKind.CrLf
286281
});
282+
messageRouter.logWarning(ConsoleMessageId.ApiReportCreated,
283+
'The API report file was missing, so a new file was created. Please add this file to Git:\n'
284+
+ expectedApiReportPath
285+
);
287286
}
288287
}
289288
}

0 commit comments

Comments
 (0)