@microsoft/api-extractor 7.40.5 → 7.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rollup.d.ts +4 -4
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/aedoc/PackageDocComment.js +2 -1
- package/lib/aedoc/PackageDocComment.js.map +1 -1
- package/lib/analyzer/PackageMetadataManager.js +2 -1
- package/lib/analyzer/PackageMetadataManager.js.map +1 -1
- package/lib/api/CompilerState.d.ts.map +1 -1
- package/lib/api/CompilerState.js +2 -2
- package/lib/api/CompilerState.js.map +1 -1
- package/lib/api/ConsoleMessageId.d.ts +1 -1
- package/lib/api/ConsoleMessageId.d.ts.map +1 -1
- package/lib/api/ConsoleMessageId.js +71 -0
- package/lib/api/ConsoleMessageId.js.map +1 -1
- package/lib/api/Extractor.js +12 -11
- package/lib/api/Extractor.js.map +1 -1
- package/lib/api/ExtractorLogLevel.d.ts +1 -1
- package/lib/api/ExtractorLogLevel.d.ts.map +1 -1
- package/lib/api/ExtractorLogLevel.js +44 -0
- package/lib/api/ExtractorLogLevel.js.map +1 -1
- package/lib/api/ExtractorMessage.d.ts +1 -1
- package/lib/api/ExtractorMessage.d.ts.map +1 -1
- package/lib/api/ExtractorMessage.js +48 -7
- package/lib/api/ExtractorMessage.js.map +1 -1
- package/lib/api/ExtractorMessageId.d.ts +1 -1
- package/lib/api/ExtractorMessageId.d.ts.map +1 -1
- package/lib/api/ExtractorMessageId.js +106 -1
- package/lib/api/ExtractorMessageId.js.map +1 -1
- package/lib/cli/ApiExtractorCommandLine.d.ts.map +1 -1
- package/lib/cli/ApiExtractorCommandLine.js +2 -5
- package/lib/cli/ApiExtractorCommandLine.js.map +1 -1
- package/lib/cli/InitAction.d.ts.map +1 -1
- package/lib/cli/InitAction.js +3 -6
- package/lib/cli/InitAction.js.map +1 -1
- package/lib/cli/RunAction.d.ts.map +1 -1
- package/lib/cli/RunAction.js +3 -6
- package/lib/cli/RunAction.js.map +1 -1
- package/lib/collector/Collector.js +8 -7
- package/lib/collector/Collector.js.map +1 -1
- package/lib/collector/MessageRouter.d.ts.map +1 -1
- package/lib/collector/MessageRouter.js +34 -35
- package/lib/collector/MessageRouter.js.map +1 -1
- package/lib/enhancers/DocCommentEnhancer.js +5 -4
- package/lib/enhancers/DocCommentEnhancer.js.map +1 -1
- package/lib/enhancers/ValidationEnhancer.js +6 -5
- package/lib/enhancers/ValidationEnhancer.js.map +1 -1
- package/lib/generators/ApiReportGenerator.js +2 -1
- package/lib/generators/ApiReportGenerator.js.map +1 -1
- package/lib/index.js +15 -1
- package/lib/index.js.map +1 -1
- package/lib/start.js +3 -6
- package/lib/start.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorLogLevel.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"ExtractorLogLevel.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;OAKG;IACH,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,OAAO,YAAY;IAEnB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,IAAI,SAAS;CACd"}
|
|
@@ -2,4 +2,48 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.ExtractorLogLevel = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is part of the {@link IConfigFile} structure.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
var ExtractorLogLevel;
|
|
15
|
+
(function (ExtractorLogLevel) {
|
|
16
|
+
/**
|
|
17
|
+
* The message will be displayed as an error.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Errors typically cause the build to fail and return a nonzero exit code.
|
|
21
|
+
*/
|
|
22
|
+
ExtractorLogLevel["Error"] = "error";
|
|
23
|
+
/**
|
|
24
|
+
* The message will be displayed as an warning.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Warnings typically cause a production build fail and return a nonzero exit code. For a non-production build
|
|
28
|
+
* (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.
|
|
29
|
+
*/
|
|
30
|
+
ExtractorLogLevel["Warning"] = "warning";
|
|
31
|
+
/**
|
|
32
|
+
* The message will be displayed as an informational message.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Informational messages may contain newlines to ensure nice formatting of the output,
|
|
36
|
+
* however word-wrapping is the responsibility of the message handler.
|
|
37
|
+
*/
|
|
38
|
+
ExtractorLogLevel["Info"] = "info";
|
|
39
|
+
/**
|
|
40
|
+
* The message will be displayed only when "verbose" output is requested, e.g. using the `--verbose`
|
|
41
|
+
* command line option.
|
|
42
|
+
*/
|
|
43
|
+
ExtractorLogLevel["Verbose"] = "verbose";
|
|
44
|
+
/**
|
|
45
|
+
* The message will be discarded entirely.
|
|
46
|
+
*/
|
|
47
|
+
ExtractorLogLevel["None"] = "none";
|
|
48
|
+
})(ExtractorLogLevel || (exports.ExtractorLogLevel = ExtractorLogLevel = {}));
|
|
5
49
|
//# sourceMappingURL=ExtractorLogLevel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorLogLevel.js","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport
|
|
1
|
+
{"version":3,"file":"ExtractorLogLevel.js","sourceRoot":"","sources":["../../src/api/ExtractorLogLevel.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;GAOG;AACH,IAAY,iBAqCX;AArCD,WAAY,iBAAiB;IAC3B;;;;;OAKG;IACH,oCAAe,CAAA;IAEf;;;;;;OAMG;IACH,wCAAmB,CAAA;IAEnB;;;;;;OAMG;IACH,kCAAa,CAAA;IAEb;;;OAGG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,kCAAa,CAAA;AACf,CAAC,EArCW,iBAAiB,iCAAjB,iBAAiB,QAqC5B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.\n *\n * @remarks\n * This is part of the {@link IConfigFile} structure.\n *\n * @public\n */\nexport enum ExtractorLogLevel {\n /**\n * The message will be displayed as an error.\n *\n * @remarks\n * Errors typically cause the build to fail and return a nonzero exit code.\n */\n Error = 'error',\n\n /**\n * The message will be displayed as an warning.\n *\n * @remarks\n * Warnings typically cause a production build fail and return a nonzero exit code. For a non-production build\n * (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.\n */\n Warning = 'warning',\n\n /**\n * The message will be displayed as an informational message.\n *\n * @remarks\n * Informational messages may contain newlines to ensure nice formatting of the output,\n * however word-wrapping is the responsibility of the message handler.\n */\n Info = 'info',\n\n /**\n * The message will be displayed only when \"verbose\" output is requested, e.g. using the `--verbose`\n * command line option.\n */\n Verbose = 'verbose',\n\n /**\n * The message will be discarded entirely.\n */\n None = 'none'\n}\n"]}
|
|
@@ -22,7 +22,7 @@ export interface IExtractorMessageProperties {
|
|
|
22
22
|
* Specifies a category of messages for use with {@link ExtractorMessage}.
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export declare
|
|
25
|
+
export declare enum ExtractorMessageCategory {
|
|
26
26
|
/**
|
|
27
27
|
* Messages originating from the TypeScript compiler.
|
|
28
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorMessage.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"ExtractorMessage.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,o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,OAAO,EAOhC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,QAAQ,IAAI,iBAAiB,CAEvC;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAY3C;IAED;;;;;;;OAOG;IACI,yBAAyB,CAAC,wBAAwB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAoB/E,4BAA4B,IAAI,MAAM;CAG9C"}
|
|
@@ -2,8 +2,49 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.ExtractorMessage = void 0;
|
|
5
|
+
exports.ExtractorMessage = exports.ExtractorMessageCategory = void 0;
|
|
6
|
+
const ExtractorLogLevel_1 = require("./ExtractorLogLevel");
|
|
6
7
|
const SourceFileLocationFormatter_1 = require("../analyzer/SourceFileLocationFormatter");
|
|
8
|
+
/**
|
|
9
|
+
* Specifies a category of messages for use with {@link ExtractorMessage}.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
var ExtractorMessageCategory;
|
|
13
|
+
(function (ExtractorMessageCategory) {
|
|
14
|
+
/**
|
|
15
|
+
* Messages originating from the TypeScript compiler.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* These strings begin with the prefix "TS" and have a numeric error code.
|
|
19
|
+
* Example: `TS2551`
|
|
20
|
+
*/
|
|
21
|
+
ExtractorMessageCategory["Compiler"] = "Compiler";
|
|
22
|
+
/**
|
|
23
|
+
* Messages related to parsing of TSDoc comments.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* These strings begin with the prefix "tsdoc-".
|
|
27
|
+
* Example: `tsdoc-link-tag-unescaped-text`
|
|
28
|
+
*/
|
|
29
|
+
ExtractorMessageCategory["TSDoc"] = "TSDoc";
|
|
30
|
+
/**
|
|
31
|
+
* Messages related to API Extractor's analysis.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* These strings begin with the prefix "ae-".
|
|
35
|
+
* Example: `ae-extra-release-tag`
|
|
36
|
+
*/
|
|
37
|
+
ExtractorMessageCategory["Extractor"] = "Extractor";
|
|
38
|
+
/**
|
|
39
|
+
* Console messages communicate the progress of the overall operation. They may include newlines to ensure
|
|
40
|
+
* nice formatting. They are output in real time, and cannot be routed to the API Report file.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* These strings begin with the prefix "console-".
|
|
44
|
+
* Example: `console-writing-typings-file`
|
|
45
|
+
*/
|
|
46
|
+
ExtractorMessageCategory["Console"] = "console";
|
|
47
|
+
})(ExtractorMessageCategory || (exports.ExtractorMessageCategory = ExtractorMessageCategory = {}));
|
|
7
48
|
/**
|
|
8
49
|
* This object is used to report an error or warning that occurred during API Extractor's analysis.
|
|
9
50
|
*
|
|
@@ -20,7 +61,7 @@ class ExtractorMessage {
|
|
|
20
61
|
this.sourceFileColumn = options.sourceFileColumn;
|
|
21
62
|
this.properties = options.properties || {};
|
|
22
63
|
this._handled = false;
|
|
23
|
-
this._logLevel = options.logLevel ||
|
|
64
|
+
this._logLevel = options.logLevel || ExtractorLogLevel_1.ExtractorLogLevel.None;
|
|
24
65
|
}
|
|
25
66
|
/**
|
|
26
67
|
* If the {@link IExtractorInvokeOptions.messageCallback} sets this property to true, it will prevent the message
|
|
@@ -61,11 +102,11 @@ class ExtractorMessage {
|
|
|
61
102
|
}
|
|
62
103
|
set logLevel(value) {
|
|
63
104
|
switch (value) {
|
|
64
|
-
case
|
|
65
|
-
case
|
|
66
|
-
case
|
|
67
|
-
case
|
|
68
|
-
case
|
|
105
|
+
case ExtractorLogLevel_1.ExtractorLogLevel.Error:
|
|
106
|
+
case ExtractorLogLevel_1.ExtractorLogLevel.Info:
|
|
107
|
+
case ExtractorLogLevel_1.ExtractorLogLevel.None:
|
|
108
|
+
case ExtractorLogLevel_1.ExtractorLogLevel.Verbose:
|
|
109
|
+
case ExtractorLogLevel_1.ExtractorLogLevel.Warning:
|
|
69
110
|
break;
|
|
70
111
|
default:
|
|
71
112
|
throw new Error('Invalid log level');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorMessage.js","sourceRoot":"","sources":["../../src/api/ExtractorMessage.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;
|
|
1
|
+
{"version":3,"file":"ExtractorMessage.js","sourceRoot":"","sources":["../../src/api/ExtractorMessage.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,2DAAwD;AAExD,yFAAsF;AAmBtF;;;GAGG;AACH,IAAY,wBAqCX;AArCD,WAAY,wBAAwB;IAClC;;;;;;OAMG;IACH,iDAAqB,CAAA;IAErB;;;;;;OAMG;IACH,2CAAe,CAAA;IAEf;;;;;;OAMG;IACH,mDAAuB,CAAA;IAEvB;;;;;;;OAOG;IACH,+CAAmB,CAAA;AACrB,CAAC,EArCW,wBAAwB,wCAAxB,wBAAwB,QAqCnC;AAgBD;;;;GAIG;AACH,MAAa,gBAAgB;IA2C3B,gBAAgB;IAChB,YAAmB,OAAiC;QAClD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAE3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI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;QAED,MAAM,IAAI,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAE9C,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,4BAA4B;QACjC,OAAO,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5C,CAAC;CACF;AAhJD,4CAgJC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type * as tsdoc from '@microsoft/tsdoc';\nimport type { ExtractorMessageId } from './ExtractorMessageId';\nimport { ExtractorLogLevel } from './ExtractorLogLevel';\nimport type { ConsoleMessageId } from './ConsoleMessageId';\nimport { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter';\n\n/**\n * Used by {@link ExtractorMessage.properties}.\n *\n * @public\n */\nexport interface IExtractorMessageProperties {\n /**\n * A declaration can have multiple names if it is exported more than once.\n * If an `ExtractorMessage` applies to a specific export name, this property can indicate that.\n *\n * @remarks\n *\n * Used by {@link ExtractorMessageId.InternalMissingUnderscore}.\n */\n readonly exportName?: string;\n}\n\n/**\n * Specifies a category of messages for use with {@link ExtractorMessage}.\n * @public\n */\nexport enum ExtractorMessageCategory {\n /**\n * Messages originating from the TypeScript compiler.\n *\n * @remarks\n * These strings begin with the prefix \"TS\" and have a numeric error code.\n * Example: `TS2551`\n */\n Compiler = 'Compiler',\n\n /**\n * Messages related to parsing of TSDoc comments.\n *\n * @remarks\n * These strings begin with the prefix \"tsdoc-\".\n * Example: `tsdoc-link-tag-unescaped-text`\n */\n TSDoc = 'TSDoc',\n\n /**\n * Messages related to API Extractor's analysis.\n *\n * @remarks\n * These strings begin with the prefix \"ae-\".\n * Example: `ae-extra-release-tag`\n */\n Extractor = 'Extractor',\n\n /**\n * Console messages communicate the progress of the overall operation. They may include newlines to ensure\n * nice formatting. They are output in real time, and cannot be routed to the API Report file.\n *\n * @remarks\n * These strings begin with the prefix \"console-\".\n * Example: `console-writing-typings-file`\n */\n Console = 'console'\n}\n\n/**\n * Constructor options for `ExtractorMessage`.\n */\nexport interface IExtractorMessageOptions {\n category: ExtractorMessageCategory;\n messageId: tsdoc.TSDocMessageId | ExtractorMessageId | ConsoleMessageId | string;\n text: string;\n sourceFilePath?: string;\n sourceFileLine?: number;\n sourceFileColumn?: number;\n properties?: IExtractorMessageProperties;\n logLevel?: ExtractorLogLevel;\n}\n\n/**\n * This object is used to report an error or warning that occurred during API Extractor's analysis.\n *\n * @public\n */\nexport class ExtractorMessage {\n private _handled: boolean;\n private _logLevel: ExtractorLogLevel;\n\n /**\n * The category of issue.\n */\n public readonly category: ExtractorMessageCategory;\n\n /**\n * A text string that uniquely identifies the issue type. This identifier can be used to suppress\n * or configure the reporting of issues, and also to search for help about an issue.\n */\n public readonly messageId: tsdoc.TSDocMessageId | ExtractorMessageId | ConsoleMessageId | string;\n\n /**\n * The text description of this issue.\n */\n public readonly text: string;\n\n /**\n * The absolute path to the affected input source file, if there is one.\n */\n public readonly sourceFilePath: string | undefined;\n\n /**\n * The line number where the issue occurred in the input source file. This is not used if `sourceFilePath`\n * is undefined. The first line number is 1.\n */\n public readonly sourceFileLine: number | undefined;\n\n /**\n * The column number where the issue occurred in the input source file. This is not used if `sourceFilePath`\n * is undefined. The first column number is 1.\n */\n public readonly sourceFileColumn: number | undefined;\n\n /**\n * Additional contextual information about the message that may be useful when reporting errors.\n * All properties are optional.\n */\n public readonly properties: IExtractorMessageProperties;\n\n /** @internal */\n public constructor(options: IExtractorMessageOptions) {\n this.category = options.category;\n this.messageId = options.messageId;\n this.text = options.text;\n this.sourceFilePath = options.sourceFilePath;\n this.sourceFileLine = options.sourceFileLine;\n this.sourceFileColumn = options.sourceFileColumn;\n this.properties = options.properties || {};\n\n this._handled = false;\n this._logLevel = options.logLevel || ExtractorLogLevel.None;\n }\n\n /**\n * If the {@link IExtractorInvokeOptions.messageCallback} sets this property to true, it will prevent the message\n * from being displayed by API Extractor.\n *\n * @remarks\n * If the `messageCallback` routes the message to a custom handler (e.g. a toolchain logger), it should\n * assign `handled = true` to prevent API Extractor from displaying it. Assigning `handled = true` for all messages\n * would effectively disable all console output from the `Extractor` API.\n *\n * If `handled` is set to true, the message will still be included in the count of errors/warnings;\n * to discard a message entirely, instead assign `logLevel = none`.\n */\n public get handled(): boolean {\n return this._handled;\n }\n\n public set handled(value: boolean) {\n if (this._handled && !value) {\n throw new Error(\n 'One a message has been marked as handled, the \"handled\" property cannot be set to false'\n );\n }\n this._handled = value;\n }\n\n /**\n * Specifies how the message should be reported.\n *\n * @remarks\n * If the {@link IExtractorInvokeOptions.messageCallback} handles the message (i.e. sets `handled = true`),\n * it can use the `logLevel` to determine how to display the message.\n *\n * Alternatively, if API Extractor is handling the message, the `messageCallback` could assign `logLevel` to change\n * how it will be processed. However, in general the recommended practice is to configure message routing\n * using the `messages` section in api-extractor.json.\n *\n * To discard a message entirely, assign `logLevel = none`.\n */\n public get logLevel(): ExtractorLogLevel {\n return this._logLevel;\n }\n\n public set logLevel(value: ExtractorLogLevel) {\n switch (value) {\n case ExtractorLogLevel.Error:\n case ExtractorLogLevel.Info:\n case ExtractorLogLevel.None:\n case ExtractorLogLevel.Verbose:\n case ExtractorLogLevel.Warning:\n break;\n default:\n throw new Error('Invalid log level');\n }\n this._logLevel = value;\n }\n\n /**\n * Returns the message formatted with its identifier and file position.\n * @remarks\n * Example:\n * ```\n * src/folder/File.ts:123:4 - (ae-extra-release-tag) The doc comment should not contain more than one release tag.\n * ```\n */\n public formatMessageWithLocation(workingPackageFolderPath: string | undefined): string {\n let result: string = '';\n\n if (this.sourceFilePath) {\n result += SourceFileLocationFormatter.formatPath(this.sourceFilePath, {\n sourceFileLine: this.sourceFileLine,\n sourceFileColumn: this.sourceFileColumn,\n workingPackageFolderPath\n });\n\n if (result.length > 0) {\n result += ' - ';\n }\n }\n\n result += this.formatMessageWithoutLocation();\n\n return result;\n }\n\n public formatMessageWithoutLocation(): string {\n return `(${this.messageId}) ${this.text}`;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorMessageId.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessageId.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,
|
|
1
|
+
{"version":3,"file":"ExtractorMessageId.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorMessageId.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,eAAe,yBAAyB;IAExC;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,oBAAoB;IAEhC;;OAEG;IACH,oBAAoB,8BAA8B;IAElD;;OAEG;IACH,uBAAuB,iCAAiC;IAExD;;OAEG;IACH,iBAAiB,2BAA2B;IAE5C;;OAEG;IACH,mBAAmB,6BAA6B;IAEhD;;OAEG;IACH,eAAe,wBAAwB;IAEvC;;OAEG;IACH,yBAAyB,mCAAmC;IAE5D;;OAEG;IACH,uBAAuB,kCAAkC;IAEzD;;OAEG;IACH,0BAA0B,oCAAoC;IAE9D;;OAEG;IACH,wBAAwB,mCAAmC;IAE3D;;OAEG;IACH,6BAA6B,uCAAuC;IAEpE;;;;;;;OAOG;IACH,wBAAwB,kCAAkC;IAE1D;;OAEG;IACH,gBAAgB,0BAA0B;IAE1C;;OAEG;IACH,cAAc,uBAAuB;IAErC;;OAEG;IACH,cAAc,wBAAwB;IAEtC;;OAEG;IACH,aAAa,sBAAsB;IAEnC;;;OAGG;IACH,kBAAkB,6BAA6B;CAChD;AAED,eAAO,MAAM,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAmB7C,CAAC"}
|
|
@@ -2,7 +2,112 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.allExtractorMessageIds = void 0;
|
|
5
|
+
exports.allExtractorMessageIds = exports.ExtractorMessageId = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifiers for messages reported by API Extractor during its analysis.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
*
|
|
11
|
+
* These strings are possible values for the {@link ExtractorMessage.messageId} property
|
|
12
|
+
* when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Extractor}.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
var ExtractorMessageId;
|
|
17
|
+
(function (ExtractorMessageId) {
|
|
18
|
+
/**
|
|
19
|
+
* "The doc comment should not contain more than one release tag."
|
|
20
|
+
*/
|
|
21
|
+
ExtractorMessageId["ExtraReleaseTag"] = "ae-extra-release-tag";
|
|
22
|
+
/**
|
|
23
|
+
* "Missing documentation for ___."
|
|
24
|
+
* @remarks
|
|
25
|
+
* The `ae-undocumented` message is only generated if the API report feature is enabled.
|
|
26
|
+
*
|
|
27
|
+
* Because the API report file already annotates undocumented items with `// (undocumented)`,
|
|
28
|
+
* the `ae-undocumented` message is not logged by default. To see it, add a setting such as:
|
|
29
|
+
* ```json
|
|
30
|
+
* "messages": {
|
|
31
|
+
* "extractorMessageReporting": {
|
|
32
|
+
* "ae-undocumented": {
|
|
33
|
+
* "logLevel": "warning"
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
ExtractorMessageId["Undocumented"] = "ae-undocumented";
|
|
40
|
+
/**
|
|
41
|
+
* "This symbol has another declaration with a different release tag."
|
|
42
|
+
*/
|
|
43
|
+
ExtractorMessageId["DifferentReleaseTags"] = "ae-different-release-tags";
|
|
44
|
+
/**
|
|
45
|
+
* "The symbol ___ is marked as ___, but its signature references ___ which is marked as ___."
|
|
46
|
+
*/
|
|
47
|
+
ExtractorMessageId["IncompatibleReleaseTags"] = "ae-incompatible-release-tags";
|
|
48
|
+
/**
|
|
49
|
+
* "___ is part of the package's API, but it is missing a release tag (`@alpha`, `@beta`, `@public`, or `@internal`)."
|
|
50
|
+
*/
|
|
51
|
+
ExtractorMessageId["MissingReleaseTag"] = "ae-missing-release-tag";
|
|
52
|
+
/**
|
|
53
|
+
* "The `@packageDocumentation` comment must appear at the top of entry point *.d.ts file."
|
|
54
|
+
*/
|
|
55
|
+
ExtractorMessageId["MisplacedPackageTag"] = "ae-misplaced-package-tag";
|
|
56
|
+
/**
|
|
57
|
+
* "The symbol ___ needs to be exported by the entry point ___."
|
|
58
|
+
*/
|
|
59
|
+
ExtractorMessageId["ForgottenExport"] = "ae-forgotten-export";
|
|
60
|
+
/**
|
|
61
|
+
* "The name ___ should be prefixed with an underscore because the declaration is marked as `@internal`."
|
|
62
|
+
*/
|
|
63
|
+
ExtractorMessageId["InternalMissingUnderscore"] = "ae-internal-missing-underscore";
|
|
64
|
+
/**
|
|
65
|
+
* "Mixed release tags are not allowed for ___ because one of its declarations is marked as `@internal`."
|
|
66
|
+
*/
|
|
67
|
+
ExtractorMessageId["InternalMixedReleaseTag"] = "ae-internal-mixed-release-tag";
|
|
68
|
+
/**
|
|
69
|
+
* "The `@preapproved` tag cannot be applied to ___ because it is not a supported declaration type."
|
|
70
|
+
*/
|
|
71
|
+
ExtractorMessageId["PreapprovedUnsupportedType"] = "ae-preapproved-unsupported-type";
|
|
72
|
+
/**
|
|
73
|
+
* "The `@preapproved` tag cannot be applied to ___ without an `@internal` release tag."
|
|
74
|
+
*/
|
|
75
|
+
ExtractorMessageId["PreapprovedBadReleaseTag"] = "ae-preapproved-bad-release-tag";
|
|
76
|
+
/**
|
|
77
|
+
* "The `@inheritDoc` reference could not be resolved."
|
|
78
|
+
*/
|
|
79
|
+
ExtractorMessageId["UnresolvedInheritDocReference"] = "ae-unresolved-inheritdoc-reference";
|
|
80
|
+
/**
|
|
81
|
+
* "The `@inheritDoc` tag needs a TSDoc declaration reference; signature matching is not supported yet."
|
|
82
|
+
*
|
|
83
|
+
* @privateRemarks
|
|
84
|
+
* In the future, we will implement signature matching so that you can write `{@inheritDoc}` and API Extractor
|
|
85
|
+
* will find a corresponding member from a base class (or implemented interface). Until then, the tag
|
|
86
|
+
* always needs an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.
|
|
87
|
+
*/
|
|
88
|
+
ExtractorMessageId["UnresolvedInheritDocBase"] = "ae-unresolved-inheritdoc-base";
|
|
89
|
+
/**
|
|
90
|
+
* "The `@inheritDoc` tag for ___ refers to its own declaration."
|
|
91
|
+
*/
|
|
92
|
+
ExtractorMessageId["CyclicInheritDoc"] = "ae-cyclic-inherit-doc";
|
|
93
|
+
/**
|
|
94
|
+
* "The `@link` reference could not be resolved."
|
|
95
|
+
*/
|
|
96
|
+
ExtractorMessageId["UnresolvedLink"] = "ae-unresolved-link";
|
|
97
|
+
/**
|
|
98
|
+
* "The doc comment for the property ___ must appear on the getter, not the setter."
|
|
99
|
+
*/
|
|
100
|
+
ExtractorMessageId["SetterWithDocs"] = "ae-setter-with-docs";
|
|
101
|
+
/**
|
|
102
|
+
* "The property ___ has a setter but no getter."
|
|
103
|
+
*/
|
|
104
|
+
ExtractorMessageId["MissingGetter"] = "ae-missing-getter";
|
|
105
|
+
/**
|
|
106
|
+
* "Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension.
|
|
107
|
+
* Troubleshooting tips: `https://api-extractor.com/link/dts-error`"
|
|
108
|
+
*/
|
|
109
|
+
ExtractorMessageId["WrongInputFileType"] = "ae-wrong-input-file-type";
|
|
110
|
+
})(ExtractorMessageId || (exports.ExtractorMessageId = ExtractorMessageId = {}));
|
|
6
111
|
exports.allExtractorMessageIds = new Set([
|
|
7
112
|
'ae-extra-release-tag',
|
|
8
113
|
'ae-undocumented',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorMessageId.js","sourceRoot":"","sources":["../../src/api/ExtractorMessageId.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;
|
|
1
|
+
{"version":3,"file":"ExtractorMessageId.js","sourceRoot":"","sources":["../../src/api/ExtractorMessageId.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;GASG;AACH,IAAY,kBA8GX;AA9GD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,8DAAwC,CAAA;IAExC;;;;;;;;;;;;;;;;OAgBG;IACH,sDAAgC,CAAA;IAEhC;;OAEG;IACH,wEAAkD,CAAA;IAElD;;OAEG;IACH,8EAAwD,CAAA;IAExD;;OAEG;IACH,kEAA4C,CAAA;IAE5C;;OAEG;IACH,sEAAgD,CAAA;IAEhD;;OAEG;IACH,6DAAuC,CAAA;IAEvC;;OAEG;IACH,kFAA4D,CAAA;IAE5D;;OAEG;IACH,+EAAyD,CAAA;IAEzD;;OAEG;IACH,oFAA8D,CAAA;IAE9D;;OAEG;IACH,iFAA2D,CAAA;IAE3D;;OAEG;IACH,0FAAoE,CAAA;IAEpE;;;;;;;OAOG;IACH,gFAA0D,CAAA;IAE1D;;OAEG;IACH,gEAA0C,CAAA;IAE1C;;OAEG;IACH,2DAAqC,CAAA;IAErC;;OAEG;IACH,4DAAsC,CAAA;IAEtC;;OAEG;IACH,yDAAmC,CAAA;IAEnC;;;OAGG;IACH,qEAA+C,CAAA;AACjD,CAAC,EA9GW,kBAAkB,kCAAlB,kBAAkB,QA8G7B;AAEY,QAAA,sBAAsB,GAAgB,IAAI,GAAG,CAAS;IACjE,sBAAsB;IACtB,iBAAiB;IACjB,2BAA2B;IAC3B,8BAA8B;IAC9B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;IACrB,gCAAgC;IAChC,+BAA+B;IAC/B,iCAAiC;IACjC,gCAAgC;IAChC,oCAAoC;IACpC,+BAA+B;IAC/B,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,0BAA0B;CAC3B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Unique identifiers for messages reported by API Extractor during its analysis.\n *\n * @remarks\n *\n * These strings are possible values for the {@link ExtractorMessage.messageId} property\n * when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Extractor}.\n *\n * @public\n */\nexport enum ExtractorMessageId {\n /**\n * \"The doc comment should not contain more than one release tag.\"\n */\n ExtraReleaseTag = 'ae-extra-release-tag',\n\n /**\n * \"Missing documentation for ___.\"\n * @remarks\n * The `ae-undocumented` message is only generated if the API report feature is enabled.\n *\n * Because the API report file already annotates undocumented items with `// (undocumented)`,\n * the `ae-undocumented` message is not logged by default. To see it, add a setting such as:\n * ```json\n * \"messages\": {\n * \"extractorMessageReporting\": {\n * \"ae-undocumented\": {\n * \"logLevel\": \"warning\"\n * }\n * }\n * }\n * ```\n */\n Undocumented = 'ae-undocumented',\n\n /**\n * \"This symbol has another declaration with a different release tag.\"\n */\n DifferentReleaseTags = 'ae-different-release-tags',\n\n /**\n * \"The symbol ___ is marked as ___, but its signature references ___ which is marked as ___.\"\n */\n IncompatibleReleaseTags = 'ae-incompatible-release-tags',\n\n /**\n * \"___ is part of the package's API, but it is missing a release tag (`@alpha`, `@beta`, `@public`, or `@internal`).\"\n */\n MissingReleaseTag = 'ae-missing-release-tag',\n\n /**\n * \"The `@packageDocumentation` comment must appear at the top of entry point *.d.ts file.\"\n */\n MisplacedPackageTag = 'ae-misplaced-package-tag',\n\n /**\n * \"The symbol ___ needs to be exported by the entry point ___.\"\n */\n ForgottenExport = 'ae-forgotten-export',\n\n /**\n * \"The name ___ should be prefixed with an underscore because the declaration is marked as `@internal`.\"\n */\n InternalMissingUnderscore = 'ae-internal-missing-underscore',\n\n /**\n * \"Mixed release tags are not allowed for ___ because one of its declarations is marked as `@internal`.\"\n */\n InternalMixedReleaseTag = 'ae-internal-mixed-release-tag',\n\n /**\n * \"The `@preapproved` tag cannot be applied to ___ because it is not a supported declaration type.\"\n */\n PreapprovedUnsupportedType = 'ae-preapproved-unsupported-type',\n\n /**\n * \"The `@preapproved` tag cannot be applied to ___ without an `@internal` release tag.\"\n */\n PreapprovedBadReleaseTag = 'ae-preapproved-bad-release-tag',\n\n /**\n * \"The `@inheritDoc` reference could not be resolved.\"\n */\n UnresolvedInheritDocReference = 'ae-unresolved-inheritdoc-reference',\n\n /**\n * \"The `@inheritDoc` tag needs a TSDoc declaration reference; signature matching is not supported yet.\"\n *\n * @privateRemarks\n * In the future, we will implement signature matching so that you can write `{@inheritDoc}` and API Extractor\n * will find a corresponding member from a base class (or implemented interface). Until then, the tag\n * always needs an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.\n */\n UnresolvedInheritDocBase = 'ae-unresolved-inheritdoc-base',\n\n /**\n * \"The `@inheritDoc` tag for ___ refers to its own declaration.\"\n */\n CyclicInheritDoc = 'ae-cyclic-inherit-doc',\n\n /**\n * \"The `@link` reference could not be resolved.\"\n */\n UnresolvedLink = 'ae-unresolved-link',\n\n /**\n * \"The doc comment for the property ___ must appear on the getter, not the setter.\"\n */\n SetterWithDocs = 'ae-setter-with-docs',\n\n /**\n * \"The property ___ has a setter but no getter.\"\n */\n MissingGetter = 'ae-missing-getter',\n\n /**\n * \"Incorrect file type; API Extractor expects to analyze compiler outputs with the .d.ts file extension.\n * Troubleshooting tips: `https://api-extractor.com/link/dts-error`\"\n */\n WrongInputFileType = 'ae-wrong-input-file-type'\n}\n\nexport const allExtractorMessageIds: Set<string> = new Set<string>([\n 'ae-extra-release-tag',\n 'ae-undocumented',\n 'ae-different-release-tags',\n 'ae-incompatible-release-tags',\n 'ae-missing-release-tag',\n 'ae-misplaced-package-tag',\n 'ae-forgotten-export',\n 'ae-internal-missing-underscore',\n 'ae-internal-mixed-release-tag',\n 'ae-preapproved-unsupported-type',\n 'ae-preapproved-bad-release-tag',\n 'ae-unresolved-inheritdoc-reference',\n 'ae-unresolved-inheritdoc-base',\n 'ae-cyclic-inherit-doc',\n 'ae-unresolved-link',\n 'ae-setter-with-docs',\n 'ae-missing-getter',\n 'ae-wrong-input-file-type'\n]);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiExtractorCommandLine.d.ts","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiExtractorCommandLine.d.ts","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAiC,MAAM,4BAA4B,CAAC;AAO9F,qBAAa,uBAAwB,SAAQ,iBAAiB;IAC5D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2B;;IAqB3D,SAAS,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBpC,OAAO,CAAC,gBAAgB;CAIzB"}
|
|
@@ -24,15 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
__setModuleDefault(result, mod);
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
28
|
exports.ApiExtractorCommandLine = void 0;
|
|
32
|
-
const colors_1 = __importDefault(require("colors"));
|
|
33
29
|
const os = __importStar(require("os"));
|
|
34
30
|
const ts_command_line_1 = require("@rushstack/ts-command-line");
|
|
35
31
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
32
|
+
const terminal_1 = require("@rushstack/terminal");
|
|
36
33
|
const RunAction_1 = require("./RunAction");
|
|
37
34
|
const InitAction_1 = require("./InitAction");
|
|
38
35
|
class ApiExtractorCommandLine extends ts_command_line_1.CommandLineParser {
|
|
@@ -62,7 +59,7 @@ class ApiExtractorCommandLine extends ts_command_line_1.CommandLineParser {
|
|
|
62
59
|
console.error(os.EOL + error.stack);
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
|
-
console.error(os.EOL +
|
|
62
|
+
console.error(os.EOL + terminal_1.Colorize.red('ERROR: ' + error.message.trim()));
|
|
66
63
|
}
|
|
67
64
|
process.exitCode = 1;
|
|
68
65
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiExtractorCommandLine.js","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D
|
|
1
|
+
{"version":3,"file":"ApiExtractorCommandLine.js","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,uCAAyB;AAEzB,gEAA8F;AAC9F,oEAA6D;AAC7D,kDAA+C;AAE/C,2CAAwC;AACxC,6CAA0C;AAE1C,MAAa,uBAAwB,SAAQ,mCAAiB;IAG5D;QACE,KAAK,CAAC;YACJ,YAAY,EAAE,eAAe;YAC7B,eAAe,EACb,wFAAwF;gBACxF,0GAA0G;gBAC1G,qGAAqG;gBACrG,oGAAoG;gBACpG,wEAAwE;SAC3E,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,sEAAsE;SACpF,CAAC,CAAC;IACL,CAAC;IAES,SAAS;QACjB,WAAW;QACX,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;YAC/B,iCAAa,CAAC,eAAe,GAAG,IAAI,CAAC;QACvC,CAAC;QAED,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACvC,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;gBAC/B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,mBAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACzE,CAAC;YAED,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC;CACF;AA3CD,0DA2CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as os from 'os';\n\nimport { CommandLineParser, type CommandLineFlagParameter } from '@rushstack/ts-command-line';\nimport { InternalError } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\n\nimport { RunAction } from './RunAction';\nimport { InitAction } from './InitAction';\n\nexport class ApiExtractorCommandLine extends CommandLineParser {\n private readonly _debugParameter: CommandLineFlagParameter;\n\n public constructor() {\n super({\n toolFilename: 'api-extractor',\n toolDescription:\n 'API Extractor helps you build better TypeScript libraries. It analyzes the main entry' +\n ' point for your package, collects the inventory of exported declarations, and then generates three kinds' +\n ' of output: an API report file (.api.md) to facilitate reviews, a declaration rollup (.d.ts) to be' +\n ' published with your NPM package, and a doc model file (.api.json) to be used with a documentation' +\n ' tool such as api-documenter. For details, please visit the web site.'\n });\n this._populateActions();\n\n this._debugParameter = this.defineFlagParameter({\n parameterLongName: '--debug',\n parameterShortName: '-d',\n description: 'Show the full call stack if an error occurs while executing the tool'\n });\n }\n\n protected onExecute(): Promise<void> {\n // override\n if (this._debugParameter.value) {\n InternalError.breakInDebugger = true;\n }\n\n return super.onExecute().catch((error) => {\n if (this._debugParameter.value) {\n console.error(os.EOL + error.stack);\n } else {\n console.error(os.EOL + Colorize.red('ERROR: ' + error.message.trim()));\n }\n\n process.exitCode = 1;\n });\n }\n\n private _populateActions(): void {\n this.addAction(new InitAction(this));\n this.addAction(new RunAction(this));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitAction.d.ts","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InitAction.d.ts","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGzE,qBAAa,UAAW,SAAQ,iBAAiB;gBAC5B,MAAM,EAAE,uBAAuB;cAWlC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAsB3C"}
|
package/lib/cli/InitAction.js
CHANGED
|
@@ -24,15 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
__setModuleDefault(result, mod);
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
28
|
exports.InitAction = void 0;
|
|
32
|
-
const colors_1 = __importDefault(require("colors"));
|
|
33
29
|
const path = __importStar(require("path"));
|
|
34
30
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
35
31
|
const ts_command_line_1 = require("@rushstack/ts-command-line");
|
|
32
|
+
const terminal_1 = require("@rushstack/terminal");
|
|
36
33
|
const ExtractorConfig_1 = require("../api/ExtractorConfig");
|
|
37
34
|
class InitAction extends ts_command_line_1.CommandLineAction {
|
|
38
35
|
constructor(parser) {
|
|
@@ -49,11 +46,11 @@ class InitAction extends ts_command_line_1.CommandLineAction {
|
|
|
49
46
|
const inputFilePath = path.resolve(__dirname, '../schemas/api-extractor-template.json');
|
|
50
47
|
const outputFilePath = path.resolve(ExtractorConfig_1.ExtractorConfig.FILENAME);
|
|
51
48
|
if (node_core_library_1.FileSystem.exists(outputFilePath)) {
|
|
52
|
-
console.log(
|
|
49
|
+
console.log(terminal_1.Colorize.red('The output file already exists:'));
|
|
53
50
|
console.log('\n ' + outputFilePath + '\n');
|
|
54
51
|
throw new Error('Unable to write output file');
|
|
55
52
|
}
|
|
56
|
-
console.log(
|
|
53
|
+
console.log(terminal_1.Colorize.green('Writing file: ') + outputFilePath);
|
|
57
54
|
node_core_library_1.FileSystem.copyFile({
|
|
58
55
|
sourcePath: inputFilePath,
|
|
59
56
|
destinationPath: outputFilePath
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitAction.js","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D
|
|
1
|
+
{"version":3,"file":"InitAction.js","sourceRoot":"","sources":["../../src/cli/InitAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,oEAA0D;AAC1D,gEAA+D;AAC/D,kDAA+C;AAG/C,4DAAyD;AAEzD,MAAa,UAAW,SAAQ,mCAAiB;IAC/C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO,EAAE,aAAa,iCAAe,CAAC,QAAQ,cAAc;YAC5D,aAAa,EACX,iFAAiF;gBACjF,IAAI,iCAAe,CAAC,QAAQ,0EAA0E;gBACtG,qDAAqD;SACxD,CAAC,CAAC;IACL,CAAC;IAES,KAAK,CAAC,SAAS;QACvB,WAAW;QACX,MAAM,aAAa,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;QAChG,MAAM,cAAc,GAAW,IAAI,CAAC,OAAO,CAAC,iCAAe,CAAC,QAAQ,CAAC,CAAC;QAEtE,IAAI,8BAAU,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,mBAAQ,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,cAAc,GAAG,IAAI,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,mBAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,CAAC;QAC/D,8BAAU,CAAC,QAAQ,CAAC;YAClB,UAAU,EAAE,aAAa;YACzB,eAAe,EAAE,cAAc;SAChC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACT,qFAAqF;YACnF,oDAAoD,CACvD,CAAC;IACJ,CAAC;CACF;AAlCD,gCAkCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport { FileSystem } from '@rushstack/node-core-library';\nimport { CommandLineAction } from '@rushstack/ts-command-line';\nimport { Colorize } from '@rushstack/terminal';\n\nimport type { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\nimport { ExtractorConfig } from '../api/ExtractorConfig';\n\nexport class InitAction extends CommandLineAction {\n public constructor(parser: ApiExtractorCommandLine) {\n super({\n actionName: 'init',\n summary: `Create an ${ExtractorConfig.FILENAME} config file`,\n documentation:\n `Use this command when setting up API Extractor for a new project. It writes an` +\n ` ${ExtractorConfig.FILENAME} config file template with code comments that describe all the settings.` +\n ` The file will be written in the current directory.`\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const inputFilePath: string = path.resolve(__dirname, '../schemas/api-extractor-template.json');\n const outputFilePath: string = path.resolve(ExtractorConfig.FILENAME);\n\n if (FileSystem.exists(outputFilePath)) {\n console.log(Colorize.red('The output file already exists:'));\n console.log('\\n ' + outputFilePath + '\\n');\n throw new Error('Unable to write output file');\n }\n\n console.log(Colorize.green('Writing file: ') + outputFilePath);\n FileSystem.copyFile({\n sourcePath: inputFilePath,\n destinationPath: outputFilePath\n });\n\n console.log(\n '\\nThe recommended location for this file is in the project\\'s \"config\" subfolder,\\n' +\n 'or else in the top-level folder with package.json.'\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunAction.d.ts","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RunAction.d.ts","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,iBAAiB,EAGlB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGzE,qBAAa,SAAU,SAAQ,iBAAiB;IAC9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAA6B;IAClE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA2B;IAC3D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2B;IAC7D,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA2B;IACjE,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA6B;gBAEpD,MAAM,EAAE,uBAAuB;cAiDlC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CA6E3C"}
|
package/lib/cli/RunAction.js
CHANGED
|
@@ -24,15 +24,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
__setModuleDefault(result, mod);
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
|
-
};
|
|
30
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
28
|
exports.RunAction = void 0;
|
|
32
|
-
const colors_1 = __importDefault(require("colors"));
|
|
33
29
|
const os = __importStar(require("os"));
|
|
34
30
|
const path = __importStar(require("path"));
|
|
35
31
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
32
|
+
const terminal_1 = require("@rushstack/terminal");
|
|
36
33
|
const ts_command_line_1 = require("@rushstack/ts-command-line");
|
|
37
34
|
const Extractor_1 = require("../api/Extractor");
|
|
38
35
|
const ExtractorConfig_1 = require("../api/ExtractorConfig");
|
|
@@ -135,10 +132,10 @@ class RunAction extends ts_command_line_1.CommandLineAction {
|
|
|
135
132
|
else {
|
|
136
133
|
process.exitCode = 1;
|
|
137
134
|
if (extractorResult.errorCount > 0) {
|
|
138
|
-
console.log(os.EOL +
|
|
135
|
+
console.log(os.EOL + terminal_1.Colorize.red('API Extractor completed with errors'));
|
|
139
136
|
}
|
|
140
137
|
else {
|
|
141
|
-
console.log(os.EOL +
|
|
138
|
+
console.log(os.EOL + terminal_1.Colorize.yellow('API Extractor completed with warnings'));
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
}
|
package/lib/cli/RunAction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunAction.js","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,oDAA4B;AAC5B,uCAAyB;AACzB,2CAA6B;AAC7B,oEAAsG;AAEtG,gEAIoC;AAEpC,gDAAmE;AAGnE,4DAA8F;AAE9F,MAAa,SAAU,SAAQ,mCAAiB;IAO9C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,mCAAmC;YAC5C,aAAa,EAAE,mCAAmC;SACnD,CAAC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;IACH,CAAC;CACF;AArID,8BAqIC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport colors from 'colors';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { PackageJsonLookup, FileSystem, type IPackageJson, Path } from '@rushstack/node-core-library';\n\nimport {\n CommandLineAction,\n type CommandLineStringParameter,\n type CommandLineFlagParameter\n} from '@rushstack/ts-command-line';\n\nimport { Extractor, type ExtractorResult } from '../api/Extractor';\n\nimport type { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\nimport { ExtractorConfig, type IExtractorConfigPrepareOptions } from '../api/ExtractorConfig';\n\nexport class RunAction extends CommandLineAction {\n private readonly _configFileParameter: CommandLineStringParameter;\n private readonly _localParameter: CommandLineFlagParameter;\n private readonly _verboseParameter: CommandLineFlagParameter;\n private readonly _diagnosticsParameter: CommandLineFlagParameter;\n private readonly _typescriptCompilerFolder: CommandLineStringParameter;\n\n public constructor(parser: ApiExtractorCommandLine) {\n super({\n actionName: 'run',\n summary: 'Invoke API Extractor on a project',\n documentation: 'Invoke API Extractor on a project'\n });\n\n this._configFileParameter = this.defineStringParameter({\n parameterLongName: '--config',\n parameterShortName: '-c',\n argumentName: 'FILE',\n description: `Use the specified ${ExtractorConfig.FILENAME} file path, rather than guessing its location`\n });\n\n this._localParameter = this.defineFlagParameter({\n parameterLongName: '--local',\n parameterShortName: '-l',\n description:\n 'Indicates that API Extractor is running as part of a local build,' +\n \" e.g. on a developer's machine. This disables certain validation that would\" +\n ' normally be performed for a ship/production build. For example, the *.api.md' +\n ' report file is automatically copied in a local build.'\n });\n\n this._verboseParameter = this.defineFlagParameter({\n parameterLongName: '--verbose',\n parameterShortName: '-v',\n description: 'Show additional informational messages in the output.'\n });\n\n this._diagnosticsParameter = this.defineFlagParameter({\n parameterLongName: '--diagnostics',\n description:\n 'Show diagnostic messages used for troubleshooting problems with API Extractor.' +\n ' This flag also enables the \"--verbose\" flag.'\n });\n\n this._typescriptCompilerFolder = this.defineStringParameter({\n parameterLongName: '--typescript-compiler-folder',\n argumentName: 'PATH',\n description:\n 'API Extractor uses its own TypeScript compiler engine to analyze your project. If your project' +\n ' is built with a significantly different TypeScript version, sometimes API Extractor may report compilation' +\n ' errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the' +\n ' \"--typescriptCompilerFolder\" option to specify the folder path where you installed the TypeScript package,' +\n \" and API Extractor's compiler will use those system typings instead.\"\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const lookup: PackageJsonLookup = new PackageJsonLookup();\n let configFilename: string;\n\n let typescriptCompilerFolder: string | undefined = this._typescriptCompilerFolder.value;\n if (typescriptCompilerFolder) {\n typescriptCompilerFolder = path.normalize(typescriptCompilerFolder);\n\n if (FileSystem.exists(typescriptCompilerFolder)) {\n typescriptCompilerFolder = lookup.tryGetPackageFolderFor(typescriptCompilerFolder);\n const typescriptCompilerPackageJson: IPackageJson | undefined = typescriptCompilerFolder\n ? lookup.tryLoadPackageJsonFor(typescriptCompilerFolder)\n : undefined;\n if (!typescriptCompilerPackageJson) {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a package.`\n );\n } else if (typescriptCompilerPackageJson.name !== 'typescript') {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a TypeScript` +\n ' compiler package.'\n );\n }\n } else {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter does not exist.`\n );\n }\n }\n\n let extractorConfig: ExtractorConfig;\n\n if (this._configFileParameter.value) {\n configFilename = path.normalize(this._configFileParameter.value);\n if (!FileSystem.exists(configFilename)) {\n throw new Error('Config file not found: ' + this._configFileParameter.value);\n }\n\n extractorConfig = ExtractorConfig.loadFileAndPrepare(configFilename);\n } else {\n const prepareOptions: IExtractorConfigPrepareOptions | undefined = ExtractorConfig.tryLoadForFolder({\n startingFolder: '.'\n });\n\n if (!prepareOptions || !prepareOptions.configObjectFullPath) {\n throw new Error(`Unable to find an ${ExtractorConfig.FILENAME} file`);\n }\n\n const configObjectShortPath: string = Path.formatConcisely({\n pathToConvert: prepareOptions.configObjectFullPath,\n baseFolder: process.cwd()\n });\n console.log(`Using configuration from ${configObjectShortPath}`);\n\n extractorConfig = ExtractorConfig.prepare(prepareOptions);\n }\n\n const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {\n localBuild: this._localParameter.value,\n showVerboseMessages: this._verboseParameter.value,\n showDiagnostics: this._diagnosticsParameter.value,\n typescriptCompilerFolder: typescriptCompilerFolder\n });\n\n if (extractorResult.succeeded) {\n console.log(os.EOL + 'API Extractor completed successfully');\n } else {\n process.exitCode = 1;\n\n if (extractorResult.errorCount > 0) {\n console.log(os.EOL + colors.red('API Extractor completed with errors'));\n } else {\n console.log(os.EOL + colors.yellow('API Extractor completed with warnings'));\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RunAction.js","sourceRoot":"","sources":["../../src/cli/RunAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,uCAAyB;AACzB,2CAA6B;AAC7B,oEAAsG;AACtG,kDAA+C;AAC/C,gEAIoC;AAEpC,gDAAmE;AAEnE,4DAA8F;AAE9F,MAAa,SAAU,SAAQ,mCAAiB;IAO9C,YAAmB,MAA+B;QAChD,KAAK,CAAC;YACJ,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,mCAAmC;YAC5C,aAAa,EAAE,mCAAmC;SACnD,CAAC,CAAC;QAEH,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACrD,iBAAiB,EAAE,UAAU;YAC7B,kBAAkB,EAAE,IAAI;YACxB,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,qBAAqB,iCAAe,CAAC,QAAQ,+CAA+C;SAC1G,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;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UAAU,EAAE,OAAO,CAAC,GAAG,EAAE;aAC1B,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,4BAA4B,qBAAqB,EAAE,CAAC,CAAC;YAEjE,eAAe,GAAG,iCAAe,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5D,CAAC;QAED,MAAM,eAAe,GAAoB,qBAAS,CAAC,MAAM,CAAC,eAAe,EAAE;YACzE,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK;YACtC,mBAAmB,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK;YACjD,eAAe,EAAE,IAAI,CAAC,qBAAqB,CAAC,KAAK;YACjD,wBAAwB,EAAE,wBAAwB;SACnD,CAAC,CAAC;QAEH,IAAI,eAAe,CAAC,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,sCAAsC,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAErB,IAAI,eAAe,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,mBAAQ,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;YAC5E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,mBAAQ,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;IACH,CAAC;CACF;AArID,8BAqIC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as os from 'os';\nimport * as path from 'path';\nimport { PackageJsonLookup, FileSystem, type IPackageJson, Path } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\nimport {\n CommandLineAction,\n type CommandLineStringParameter,\n type CommandLineFlagParameter\n} from '@rushstack/ts-command-line';\n\nimport { Extractor, type ExtractorResult } from '../api/Extractor';\nimport type { ApiExtractorCommandLine } from './ApiExtractorCommandLine';\nimport { ExtractorConfig, type IExtractorConfigPrepareOptions } from '../api/ExtractorConfig';\n\nexport class RunAction extends CommandLineAction {\n private readonly _configFileParameter: CommandLineStringParameter;\n private readonly _localParameter: CommandLineFlagParameter;\n private readonly _verboseParameter: CommandLineFlagParameter;\n private readonly _diagnosticsParameter: CommandLineFlagParameter;\n private readonly _typescriptCompilerFolder: CommandLineStringParameter;\n\n public constructor(parser: ApiExtractorCommandLine) {\n super({\n actionName: 'run',\n summary: 'Invoke API Extractor on a project',\n documentation: 'Invoke API Extractor on a project'\n });\n\n this._configFileParameter = this.defineStringParameter({\n parameterLongName: '--config',\n parameterShortName: '-c',\n argumentName: 'FILE',\n description: `Use the specified ${ExtractorConfig.FILENAME} file path, rather than guessing its location`\n });\n\n this._localParameter = this.defineFlagParameter({\n parameterLongName: '--local',\n parameterShortName: '-l',\n description:\n 'Indicates that API Extractor is running as part of a local build,' +\n \" e.g. on a developer's machine. This disables certain validation that would\" +\n ' normally be performed for a ship/production build. For example, the *.api.md' +\n ' report file is automatically copied in a local build.'\n });\n\n this._verboseParameter = this.defineFlagParameter({\n parameterLongName: '--verbose',\n parameterShortName: '-v',\n description: 'Show additional informational messages in the output.'\n });\n\n this._diagnosticsParameter = this.defineFlagParameter({\n parameterLongName: '--diagnostics',\n description:\n 'Show diagnostic messages used for troubleshooting problems with API Extractor.' +\n ' This flag also enables the \"--verbose\" flag.'\n });\n\n this._typescriptCompilerFolder = this.defineStringParameter({\n parameterLongName: '--typescript-compiler-folder',\n argumentName: 'PATH',\n description:\n 'API Extractor uses its own TypeScript compiler engine to analyze your project. If your project' +\n ' is built with a significantly different TypeScript version, sometimes API Extractor may report compilation' +\n ' errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the' +\n ' \"--typescriptCompilerFolder\" option to specify the folder path where you installed the TypeScript package,' +\n \" and API Extractor's compiler will use those system typings instead.\"\n });\n }\n\n protected async onExecute(): Promise<void> {\n // override\n const lookup: PackageJsonLookup = new PackageJsonLookup();\n let configFilename: string;\n\n let typescriptCompilerFolder: string | undefined = this._typescriptCompilerFolder.value;\n if (typescriptCompilerFolder) {\n typescriptCompilerFolder = path.normalize(typescriptCompilerFolder);\n\n if (FileSystem.exists(typescriptCompilerFolder)) {\n typescriptCompilerFolder = lookup.tryGetPackageFolderFor(typescriptCompilerFolder);\n const typescriptCompilerPackageJson: IPackageJson | undefined = typescriptCompilerFolder\n ? lookup.tryLoadPackageJsonFor(typescriptCompilerFolder)\n : undefined;\n if (!typescriptCompilerPackageJson) {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a package.`\n );\n } else if (typescriptCompilerPackageJson.name !== 'typescript') {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter is not a TypeScript` +\n ' compiler package.'\n );\n }\n } else {\n throw new Error(\n `The path specified in the ${this._typescriptCompilerFolder.longName} parameter does not exist.`\n );\n }\n }\n\n let extractorConfig: ExtractorConfig;\n\n if (this._configFileParameter.value) {\n configFilename = path.normalize(this._configFileParameter.value);\n if (!FileSystem.exists(configFilename)) {\n throw new Error('Config file not found: ' + this._configFileParameter.value);\n }\n\n extractorConfig = ExtractorConfig.loadFileAndPrepare(configFilename);\n } else {\n const prepareOptions: IExtractorConfigPrepareOptions | undefined = ExtractorConfig.tryLoadForFolder({\n startingFolder: '.'\n });\n\n if (!prepareOptions || !prepareOptions.configObjectFullPath) {\n throw new Error(`Unable to find an ${ExtractorConfig.FILENAME} file`);\n }\n\n const configObjectShortPath: string = Path.formatConcisely({\n pathToConvert: prepareOptions.configObjectFullPath,\n baseFolder: process.cwd()\n });\n console.log(`Using configuration from ${configObjectShortPath}`);\n\n extractorConfig = ExtractorConfig.prepare(prepareOptions);\n }\n\n const extractorResult: ExtractorResult = Extractor.invoke(extractorConfig, {\n localBuild: this._localParameter.value,\n showVerboseMessages: this._verboseParameter.value,\n showDiagnostics: this._diagnosticsParameter.value,\n typescriptCompilerFolder: typescriptCompilerFolder\n });\n\n if (extractorResult.succeeded) {\n console.log(os.EOL + 'API Extractor completed successfully');\n } else {\n process.exitCode = 1;\n\n if (extractorResult.errorCount > 0) {\n console.log(os.EOL + Colorize.red('API Extractor completed with errors'));\n } else {\n console.log(os.EOL + Colorize.yellow('API Extractor completed with warnings'));\n }\n }\n }\n}\n"]}
|