@microsoft/api-extractor 7.52.7 → 7.52.8
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/CHANGELOG.json +12 -0
- package/CHANGELOG.md +8 -1
- package/lib/cli/ApiExtractorCommandLine.d.ts.map +1 -1
- package/lib/cli/ApiExtractorCommandLine.js +7 -5
- package/lib/cli/ApiExtractorCommandLine.js.map +1 -1
- package/lib/cli/RunAction.d.ts.map +1 -1
- package/lib/cli/RunAction.js +1 -1
- package/lib/cli/RunAction.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "7.52.8",
|
|
6
|
+
"tag": "@microsoft/api-extractor_v7.52.8",
|
|
7
|
+
"date": "Tue, 13 May 2025 02:09:20 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Fixes API extractor error handling when changed APIs are encountered and the \"--local\" flag is not specified"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "7.52.7",
|
|
6
18
|
"tag": "@microsoft/api-extractor_v7.52.7",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @microsoft/api-extractor
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 13 May 2025 02:09:20 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 7.52.8
|
|
6
|
+
Tue, 13 May 2025 02:09:20 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- Fixes API extractor error handling when changed APIs are encountered and the "--local" flag is not specified
|
|
4
11
|
|
|
5
12
|
## 7.52.7
|
|
6
13
|
Thu, 01 May 2025 15:11:33 GMT
|
|
@@ -1 +1 @@
|
|
|
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;;cAqBlC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
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;;cAqBlC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBxD,OAAO,CAAC,gBAAgB;CAIzB"}
|
|
@@ -69,11 +69,13 @@ class ApiExtractorCommandLine extends ts_command_line_1.CommandLineParser {
|
|
|
69
69
|
process.exitCode = 0;
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
if (!(error instanceof node_core_library_1.AlreadyReportedError)) {
|
|
73
|
+
if (this._debugParameter.value) {
|
|
74
|
+
console.error(os.EOL + error.stack);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
console.error(os.EOL + terminal_1.Colorize.red('ERROR: ' + error.message.trim()));
|
|
78
|
+
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiExtractorCommandLine.js","sourceRoot":"","sources":["../../src/cli/ApiExtractorCommandLine.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;oBAC/B,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;gBACtC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,mBAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBACzE,CAAC;YACH,CAAC;QACH,CAAC;IACH,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;AA9CD,0DA8CC","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 { AlreadyReportedError, 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 override async onExecuteAsync(): Promise<void> {\n if (this._debugParameter.value) {\n InternalError.breakInDebugger = true;\n }\n\n process.exitCode = 1;\n try {\n await super.onExecuteAsync();\n process.exitCode = 0;\n } catch (error) {\n if (!(error instanceof AlreadyReportedError)) {\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 }\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":"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":"AAaA,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;cAiDzB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CA2EzD"}
|
package/lib/cli/RunAction.js
CHANGED
|
@@ -139,13 +139,13 @@ class RunAction extends ts_command_line_1.CommandLineAction {
|
|
|
139
139
|
console.log(os.EOL + 'API Extractor completed successfully');
|
|
140
140
|
}
|
|
141
141
|
else {
|
|
142
|
-
process.exitCode = 1;
|
|
143
142
|
if (extractorResult.errorCount > 0) {
|
|
144
143
|
console.log(os.EOL + terminal_1.Colorize.red('API Extractor completed with errors'));
|
|
145
144
|
}
|
|
146
145
|
else {
|
|
147
146
|
console.log(os.EOL + terminal_1.Colorize.yellow('API Extractor completed with warnings'));
|
|
148
147
|
}
|
|
148
|
+
throw new node_core_library_1.AlreadyReportedError();
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
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,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;YAC9C,iBAAiB,EAAE,SAAS;YAC5B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EACT,mEAAmE;gBACnE,6EAA6E;gBAC7E,+EAA+E;gBAC/E,wDAAwD;SAC3D,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC;YAChD,iBAAiB,EAAE,WAAW;YAC9B,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,uDAAuD;SACrE,CAAC,CAAC;QAEH,IAAI,C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I,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;AApID,8BAoIC","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 override async onExecuteAsync(): Promise<void> {\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"]}
|
|
1
|
+
{"version":3,"file":"RunAction.js","sourceRoot":"","s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aAAM,CAAC;YACN,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;YACD,MAAM,IAAI,wCAAoB,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAnID,8BAmIC","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 {\n PackageJsonLookup,\n FileSystem,\n type IPackageJson,\n Path,\n AlreadyReportedError\n} 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 override async onExecuteAsync(): Promise<void> {\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 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 throw new AlreadyReportedError();\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor",
|
|
3
|
-
"version": "7.52.
|
|
3
|
+
"version": "7.52.8",
|
|
4
4
|
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@microsoft/api-extractor-model": "7.30.6",
|
|
44
44
|
"@rushstack/rig-package": "0.5.3",
|
|
45
45
|
"@rushstack/node-core-library": "5.13.1",
|
|
46
|
-
"@rushstack/
|
|
47
|
-
"@rushstack/
|
|
46
|
+
"@rushstack/ts-command-line": "5.0.1",
|
|
47
|
+
"@rushstack/terminal": "0.15.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@rushstack/heft": "0.73.2",
|