@microsoft/api-extractor 7.50.1 → 7.51.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/CHANGELOG.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "@microsoft/api-extractor",
3
3
  "entries": [
4
+ {
5
+ "version": "7.51.0",
6
+ "tag": "@microsoft/api-extractor_v7.51.0",
7
+ "date": "Thu, 27 Feb 2025 01:10:39 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Add a `docModel.releaseTagsToTrim` property to `api-extractor.json` to specify which release tags should be trimmed when the doc model is produced."
12
+ }
13
+ ]
14
+ }
15
+ },
4
16
  {
5
17
  "version": "7.50.1",
6
18
  "tag": "@microsoft/api-extractor_v7.50.1",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @microsoft/api-extractor
2
2
 
3
- This log was last generated on Sat, 22 Feb 2025 01:11:11 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 27 Feb 2025 01:10:39 GMT and should not be manually modified.
4
+
5
+ ## 7.51.0
6
+ Thu, 27 Feb 2025 01:10:39 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Add a `docModel.releaseTagsToTrim` property to `api-extractor.json` to specify which release tags should be trimmed when the doc model is produced.
4
11
 
5
12
  ## 7.50.1
6
13
  Sat, 22 Feb 2025 01:11:11 GMT
package/dist/rollup.d.ts CHANGED
@@ -12,6 +12,7 @@ import { IRigConfig } from '@rushstack/rig-package';
12
12
  import { JsonSchema } from '@rushstack/node-core-library';
13
13
  import { NewlineKind } from '@rushstack/node-core-library';
14
14
  import { PackageJsonLookup } from '@rushstack/node-core-library';
15
+ import { ReleaseTag } from '@microsoft/api-extractor-model';
15
16
  import type * as tsdoc from '@microsoft/tsdoc';
16
17
  import { TSDocConfigFile } from '@microsoft/tsdoc-config';
17
18
  import { TSDocConfiguration } from '@microsoft/tsdoc';
@@ -240,8 +241,11 @@ export declare class ExtractorConfig {
240
241
  get reportTempFilePath(): string;
241
242
  /** {@inheritDoc IConfigApiReport.includeForgottenExports} */
242
243
  readonly apiReportIncludeForgottenExports: boolean;
243
- /** {@inheritDoc IConfigDocModel.enabled} */
244
- readonly docModelEnabled: boolean;
244
+ /**
245
+ * If specified, the doc model is enabled and the specified options will be used.
246
+ * @beta
247
+ */
248
+ readonly docModelGenerationOptions: IApiModelGenerationOptions | undefined;
245
249
  /** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
246
250
  readonly apiJsonFilePath: string;
247
251
  /** {@inheritDoc IConfigDocModel.includeForgottenExports} */
@@ -679,6 +683,16 @@ export declare class ExtractorResult {
679
683
  constructor(properties: ExtractorResult);
680
684
  }
681
685
 
686
+ /**
687
+ * @beta
688
+ */
689
+ export declare interface IApiModelGenerationOptions {
690
+ /**
691
+ * The release tags to trim.
692
+ */
693
+ releaseTagsToTrim: Set<ReleaseTag>;
694
+ }
695
+
682
696
  /**
683
697
  * Options for {@link CompilerState.create}
684
698
  * @public
@@ -859,6 +873,12 @@ export declare interface IConfigDocModel {
859
873
  * Can be omitted if you don't need source code links in your API documentation reference.
860
874
  */
861
875
  projectFolderUrl?: string;
876
+ /**
877
+ * Specifies a list of release tags that will be trimmed from the doc model.
878
+ *
879
+ * @defaultValue `["@internal"]`
880
+ */
881
+ releaseTagsToTrim?: ReleaseTagForTrim[];
862
882
  }
863
883
 
864
884
  /**
@@ -1338,4 +1358,10 @@ export declare interface IExtractorMessagesConfig {
1338
1358
  tsdocMessageReporting?: IConfigMessageReportingTable;
1339
1359
  }
1340
1360
 
1361
+ /**
1362
+ * The allowed release tags that can be used to mark API items.
1363
+ * @public
1364
+ */
1365
+ export declare type ReleaseTagForTrim = '@internal' | '@alpha' | '@beta' | '@public';
1366
+
1341
1367
  export { }
@@ -138,18 +138,18 @@ class Extractor {
138
138
  const collector = new Collector_1.Collector({
139
139
  program: compilerState.program,
140
140
  messageRouter,
141
- extractorConfig: extractorConfig,
141
+ extractorConfig,
142
142
  sourceMapper
143
143
  });
144
144
  collector.analyze();
145
145
  DocCommentEnhancer_1.DocCommentEnhancer.analyze(collector);
146
146
  ValidationEnhancer_1.ValidationEnhancer.analyze(collector);
147
- const modelBuilder = new ApiModelGenerator_1.ApiModelGenerator(collector);
147
+ const modelBuilder = new ApiModelGenerator_1.ApiModelGenerator(collector, extractorConfig);
148
148
  const apiPackage = modelBuilder.buildApiPackage();
149
149
  if (messageRouter.showDiagnostics) {
150
150
  messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages
151
151
  }
152
- if (extractorConfig.docModelEnabled) {
152
+ if (modelBuilder.docModelEnabled) {
153
153
  messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDocModelFile, 'Writing: ' + extractorConfig.apiJsonFilePath);
154
154
  apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {
155
155
  toolPackage: Extractor.packageName,
@@ -1 +1 @@
1
- {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,oEAOsC;AAEtC,uDAAoF;AACpF,sDAAmD;AACnD,yEAAqF;AACrF,uEAAoE;AAEpE,yEAAsE;AACtE,+EAA4E;AAC5E,wEAAqE;AACrE,wEAAqE;AACrE,mDAAgD;AAEhD,8DAA2D;AAC3D,yDAAsD;AACtD,0DAA0D;AAC1D,4DAAyD;AA+DzD;;;;GAIG;AACH,MAAa,eAAe;IA4C1B,gBAAgB;IAChB,YAAmB,UAA2B;QAC5C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,I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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 * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\nimport {\n FileSystem,\n type NewlineKind,\n PackageJsonLookup,\n type IPackageJson,\n type INodePackageJson,\n Path\n} from '@rushstack/node-core-library';\n\nimport { ExtractorConfig, type IExtractorConfigApiReport } from './ExtractorConfig';\nimport { Collector } from '../collector/Collector';\nimport { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';\nimport { ApiModelGenerator } from '../generators/ApiModelGenerator';\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { ApiReportGenerator } from '../generators/ApiReportGenerator';\nimport { PackageMetadataManager } from '../analyzer/PackageMetadataManager';\nimport { ValidationEnhancer } from '../enhancers/ValidationEnhancer';\nimport { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';\nimport { CompilerState } from './CompilerState';\nimport type { ExtractorMessage } from './ExtractorMessage';\nimport { MessageRouter } from '../collector/MessageRouter';\nimport { ConsoleMessageId } from './ConsoleMessageId';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\nimport { SourceMapper } from '../collector/SourceMapper';\n\n/**\n * Runtime options for Extractor.\n *\n * @public\n */\nexport interface IExtractorInvokeOptions {\n /**\n * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor\n * can reuse the same TypeScript compiler analysis.\n */\n compilerState?: CompilerState;\n\n /**\n * Indicates that API Extractor is running as part of a local build, e.g. on developer's\n * machine.\n *\n * @remarks\n * This disables certain validation that would normally be performed for a ship/production build. For example,\n * the *.api.md report file is automatically updated in a local build.\n *\n * The default value is false.\n */\n localBuild?: boolean;\n\n /**\n * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.\n */\n showVerboseMessages?: boolean;\n\n /**\n * If true, API Extractor will print diagnostic information used for troubleshooting problems.\n * These messages will be included as {@link ExtractorLogLevel.Verbose} output.\n *\n * @remarks\n * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.\n */\n showDiagnostics?: boolean;\n\n /**\n * Specifies an alternate folder path to be used when loading the TypeScript system typings.\n *\n * @remarks\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 \"--typescriptCompilerFolder\"\n * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will\n * use those system typings instead.\n */\n typescriptCompilerFolder?: string;\n\n /**\n * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by\n * API Extractor. The callback can customize the message, handle it, or discard it.\n *\n * @remarks\n * If a `messageCallback` is not provided, then by default API Extractor will print the messages to\n * the STDERR/STDOUT console.\n */\n messageCallback?: (message: ExtractorMessage) => void;\n}\n\n/**\n * This object represents the outcome of an invocation of API Extractor.\n *\n * @public\n */\nexport class ExtractorResult {\n /**\n * The TypeScript compiler state that was used.\n */\n public readonly compilerState: CompilerState;\n\n /**\n * The API Extractor configuration that was used.\n */\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task\n * would normally return a nonzero process exit code, indicating that the operation failed.\n *\n * @remarks\n *\n * Normally the operation \"succeeds\" if `errorCount` and `warningCount` are both zero. However if\n * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation \"succeeds\" if `errorCount` is zero\n * (i.e. warnings are ignored).\n */\n public readonly succeeded: boolean;\n\n /**\n * Returns true if the API report was found to have changed.\n */\n public readonly apiReportChanged: boolean;\n\n /**\n * Reports the number of errors encountered during analysis.\n *\n * @remarks\n * This does not count exceptions, where unexpected issues prematurely abort the operation.\n */\n public readonly errorCount: number;\n\n /**\n * Reports the number of warnings encountered during analysis.\n *\n * @remarks\n * This does not count warnings that are emitted in the API report file.\n */\n public readonly warningCount: number;\n\n /** @internal */\n public constructor(properties: ExtractorResult) {\n this.compilerState = properties.compilerState;\n this.extractorConfig = properties.extractorConfig;\n this.succeeded = properties.succeeded;\n this.apiReportChanged = properties.apiReportChanged;\n this.errorCount = properties.errorCount;\n this.warningCount = properties.warningCount;\n }\n}\n\n/**\n * The starting point for invoking the API Extractor tool.\n * @public\n */\nexport class Extractor {\n /**\n * Returns the version number of the API Extractor NPM package.\n */\n public static get version(): string {\n return Extractor._getPackageJson().version;\n }\n\n /**\n * Returns the package name of the API Extractor NPM package.\n */\n public static get packageName(): string {\n return Extractor._getPackageJson().name;\n }\n\n private static _getPackageJson(): IPackageJson {\n return PackageJsonLookup.loadOwnPackageJson(__dirname);\n }\n\n /**\n * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.\n */\n public static loadConfigAndInvoke(\n configFilePath: string,\n options?: IExtractorInvokeOptions\n ): ExtractorResult {\n const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);\n\n return Extractor.invoke(extractorConfig, options);\n }\n\n /**\n * Invoke API Extractor using an already prepared `ExtractorConfig` object.\n */\n public static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult {\n if (!options) {\n options = {};\n }\n\n const localBuild: boolean = options.localBuild || false;\n\n let compilerState: CompilerState | undefined;\n if (options.compilerState) {\n compilerState = options.compilerState;\n } else {\n compilerState = CompilerState.create(extractorConfig, options);\n }\n\n const sourceMapper: SourceMapper = new SourceMapper();\n\n const messageRouter: MessageRouter = new MessageRouter({\n workingPackageFolder: extractorConfig.packageFolder,\n messageCallback: options.messageCallback,\n messagesConfig: extractorConfig.messages || {},\n showVerboseMessages: !!options.showVerboseMessages,\n showDiagnostics: !!options.showDiagnostics,\n tsdocConfiguration: extractorConfig.tsdocConfiguration,\n sourceMapper\n });\n\n if (extractorConfig.tsdocConfigFile.filePath && !extractorConfig.tsdocConfigFile.fileNotFound) {\n if (!Path.isEqual(extractorConfig.tsdocConfigFile.filePath, ExtractorConfig._tsdocBaseFilePath)) {\n messageRouter.logVerbose(\n ConsoleMessageId.UsingCustomTSDocConfig,\n 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath\n );\n }\n }\n\n this._checkCompilerCompatibility(extractorConfig, messageRouter);\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic('');\n messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');\n messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('Compiler options');\n const serializedCompilerOptions: object = MessageRouter.buildJsonDumpObject(\n (compilerState.program as ts.Program).getCompilerOptions()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('TSDoc configuration');\n // Convert the TSDocConfiguration into a tsdoc.json representation\n const combinedConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(\n extractorConfig.tsdocConfiguration\n );\n const serializedTSDocConfig: object = MessageRouter.buildJsonDumpObject(\n combinedConfigFile.saveToObject()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));\n messageRouter.logDiagnosticFooter();\n }\n\n const collector: Collector = new Collector({\n program: compilerState.program as ts.Program,\n messageRouter,\n extractorConfig: extractorConfig,\n sourceMapper\n });\n\n collector.analyze();\n\n DocCommentEnhancer.analyze(collector);\n ValidationEnhancer.analyze(collector);\n\n const modelBuilder: ApiModelGenerator = new ApiModelGenerator(collector);\n const apiPackage: ApiPackage = modelBuilder.buildApiPackage();\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages\n }\n\n if (extractorConfig.docModelEnabled) {\n messageRouter.logVerbose(\n ConsoleMessageId.WritingDocModelFile,\n 'Writing: ' + extractorConfig.apiJsonFilePath\n );\n apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {\n toolPackage: Extractor.packageName,\n toolVersion: Extractor.version,\n\n newlineConversion: extractorConfig.newlineKind,\n ensureFolderExists: true,\n testMode: extractorConfig.testMode\n });\n }\n\n function writeApiReport(reportConfig: IExtractorConfigApiReport): boolean {\n return Extractor._writeApiReport(\n collector,\n extractorConfig,\n messageRouter,\n extractorConfig.reportTempFolder,\n extractorConfig.reportFolder,\n reportConfig,\n localBuild\n );\n }\n\n let anyReportChanged: boolean = false;\n if (extractorConfig.apiReportEnabled) {\n for (const reportConfig of extractorConfig.reportConfigs) {\n anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;\n }\n }\n\n if (extractorConfig.rollupEnabled) {\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.publicTrimmedFilePath,\n DtsRollupKind.PublicRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.alphaTrimmedFilePath,\n DtsRollupKind.AlphaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.betaTrimmedFilePath,\n DtsRollupKind.BetaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.untrimmedFilePath,\n DtsRollupKind.InternalRelease,\n extractorConfig.newlineKind\n );\n }\n\n if (extractorConfig.tsdocMetadataEnabled) {\n // Write the tsdoc-metadata.json file for this project\n PackageMetadataManager.writeTsdocMetadataFile(\n extractorConfig.tsdocMetadataFilePath,\n extractorConfig.newlineKind\n );\n }\n\n // Show all the messages that we collected during analysis\n messageRouter.handleRemainingNonConsoleMessages();\n\n // Determine success\n let succeeded: boolean;\n if (localBuild) {\n // For a local build, fail if there were errors (but ignore warnings)\n succeeded = messageRouter.errorCount === 0;\n } else {\n // For a production build, fail if there were any errors or warnings\n succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;\n }\n\n return new ExtractorResult({\n compilerState,\n extractorConfig,\n succeeded,\n apiReportChanged: anyReportChanged,\n errorCount: messageRouter.errorCount,\n warningCount: messageRouter.warningCount\n });\n }\n\n /**\n * Generates the API report at the specified release level, writes it to the specified file path, and compares\n * the output to the existing report (if one exists).\n *\n * @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior\n * to comparison with an existing report.\n * @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to\n * which the new report will be written post-comparison.\n * @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.\n *\n * @returns Whether or not the newly generated report differs from the existing report (if one exists).\n */\n private static _writeApiReport(\n collector: Collector,\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter,\n reportTempDirectoryPath: string,\n reportDirectoryPath: string,\n reportConfig: IExtractorConfigApiReport,\n localBuild: boolean\n ): boolean {\n let apiReportChanged: boolean = false;\n\n const actualApiReportPath: string = path.resolve(reportTempDirectoryPath, reportConfig.fileName);\n const actualApiReportShortPath: string = extractorConfig._getShortFilePath(actualApiReportPath);\n\n const expectedApiReportPath: string = path.resolve(reportDirectoryPath, reportConfig.fileName);\n const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(expectedApiReportPath);\n\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingApiReport,\n `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`\n );\n\n const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(\n collector,\n reportConfig.variant\n );\n\n // Write the actual file\n FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n\n // Compare it against the expected file\n if (FileSystem.exists(expectedApiReportPath)) {\n const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);\n\n if (\n !ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)\n ) {\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'You have changed the API signature for this project.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n // For a local build, just copy the file automatically.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCopied,\n `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`\n );\n\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n }\n } else {\n messageRouter.logVerbose(\n ConsoleMessageId.ApiReportUnchanged,\n `The API report is up to date: ${actualApiReportShortPath}`\n );\n }\n } else {\n // The target file does not exist, so we are setting up the API review file for the first time.\n //\n // NOTE: People sometimes make a mistake where they move a project and forget to update the \"reportFolder\"\n // setting, which causes a new file to silently get written to the wrong place. This can be confusing.\n // Thus we treat the initial creation of the file specially.\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'The API report file is missing.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);\n if (!FileSystem.exists(expectedApiReportFolder)) {\n messageRouter.logError(\n ConsoleMessageId.ApiReportFolderMissing,\n 'Unable to create the API report file. Please make sure the target folder exists:\\n' +\n expectedApiReportFolder\n );\n } else {\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n convertLineEndings: extractorConfig.newlineKind\n });\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCreated,\n 'The API report file was missing, so a new file was created. Please add this file to Git:\\n' +\n expectedApiReportPath\n );\n }\n }\n }\n return apiReportChanged;\n }\n\n private static _checkCompilerCompatibility(\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter\n ): void {\n messageRouter.logInfo(\n ConsoleMessageId.Preamble,\n `Analysis will use the bundled TypeScript version ${ts.version}`\n );\n\n try {\n const typescriptPath: string = resolve.sync('typescript', {\n basedir: extractorConfig.projectFolder,\n preserveSymlinks: false\n });\n const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();\n const packageJson: INodePackageJson | undefined =\n packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);\n if (packageJson && packageJson.version && semver.valid(packageJson.version)) {\n // Consider a newer MINOR release to be incompatible\n const ourMajor: number = semver.major(ts.version);\n const ourMinor: number = semver.minor(ts.version);\n\n const theirMajor: number = semver.major(packageJson.version);\n const theirMinor: number = semver.minor(packageJson.version);\n\n if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {\n messageRouter.logInfo(\n ConsoleMessageId.CompilerVersionNotice,\n `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +\n ` bundled compiler engine; consider upgrading API Extractor.`\n );\n }\n }\n } catch (e) {\n // The compiler detection heuristic is not expected to work in many configurations\n }\n }\n\n private static _generateRollupDtsFile(\n collector: Collector,\n outputPath: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n if (outputPath !== '') {\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingDtsRollup,\n `Writing package typings: ${outputPath}`\n );\n DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,oEAOsC;AAEtC,uDAAoF;AACpF,sDAAmD;AACnD,yEAAqF;AACrF,uEAAoE;AAEpE,yEAAsE;AACtE,+EAA4E;AAC5E,wEAAqE;AACrE,wEAAqE;AACrE,mDAAgD;AAEhD,8DAA2D;AAC3D,yDAAsD;AACtD,0DAA0D;AAC1D,4DAAyD;AA+DzD;;;;GAIG;AACH,MAAa,eAAe;IA4C1B,gBAAgB;IAChB,Y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ACjC,4BAA4B,UAAU,EAAE,CACzC,CAAC;YACF,uCAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AA5XD,8BA4XC","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 * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\nimport {\n FileSystem,\n type NewlineKind,\n PackageJsonLookup,\n type IPackageJson,\n type INodePackageJson,\n Path\n} from '@rushstack/node-core-library';\n\nimport { ExtractorConfig, type IExtractorConfigApiReport } from './ExtractorConfig';\nimport { Collector } from '../collector/Collector';\nimport { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';\nimport { ApiModelGenerator } from '../generators/ApiModelGenerator';\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { ApiReportGenerator } from '../generators/ApiReportGenerator';\nimport { PackageMetadataManager } from '../analyzer/PackageMetadataManager';\nimport { ValidationEnhancer } from '../enhancers/ValidationEnhancer';\nimport { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';\nimport { CompilerState } from './CompilerState';\nimport type { ExtractorMessage } from './ExtractorMessage';\nimport { MessageRouter } from '../collector/MessageRouter';\nimport { ConsoleMessageId } from './ConsoleMessageId';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\nimport { SourceMapper } from '../collector/SourceMapper';\n\n/**\n * Runtime options for Extractor.\n *\n * @public\n */\nexport interface IExtractorInvokeOptions {\n /**\n * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor\n * can reuse the same TypeScript compiler analysis.\n */\n compilerState?: CompilerState;\n\n /**\n * Indicates that API Extractor is running as part of a local build, e.g. on developer's\n * machine.\n *\n * @remarks\n * This disables certain validation that would normally be performed for a ship/production build. For example,\n * the *.api.md report file is automatically updated in a local build.\n *\n * The default value is false.\n */\n localBuild?: boolean;\n\n /**\n * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.\n */\n showVerboseMessages?: boolean;\n\n /**\n * If true, API Extractor will print diagnostic information used for troubleshooting problems.\n * These messages will be included as {@link ExtractorLogLevel.Verbose} output.\n *\n * @remarks\n * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.\n */\n showDiagnostics?: boolean;\n\n /**\n * Specifies an alternate folder path to be used when loading the TypeScript system typings.\n *\n * @remarks\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 \"--typescriptCompilerFolder\"\n * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will\n * use those system typings instead.\n */\n typescriptCompilerFolder?: string;\n\n /**\n * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by\n * API Extractor. The callback can customize the message, handle it, or discard it.\n *\n * @remarks\n * If a `messageCallback` is not provided, then by default API Extractor will print the messages to\n * the STDERR/STDOUT console.\n */\n messageCallback?: (message: ExtractorMessage) => void;\n}\n\n/**\n * This object represents the outcome of an invocation of API Extractor.\n *\n * @public\n */\nexport class ExtractorResult {\n /**\n * The TypeScript compiler state that was used.\n */\n public readonly compilerState: CompilerState;\n\n /**\n * The API Extractor configuration that was used.\n */\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task\n * would normally return a nonzero process exit code, indicating that the operation failed.\n *\n * @remarks\n *\n * Normally the operation \"succeeds\" if `errorCount` and `warningCount` are both zero. However if\n * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation \"succeeds\" if `errorCount` is zero\n * (i.e. warnings are ignored).\n */\n public readonly succeeded: boolean;\n\n /**\n * Returns true if the API report was found to have changed.\n */\n public readonly apiReportChanged: boolean;\n\n /**\n * Reports the number of errors encountered during analysis.\n *\n * @remarks\n * This does not count exceptions, where unexpected issues prematurely abort the operation.\n */\n public readonly errorCount: number;\n\n /**\n * Reports the number of warnings encountered during analysis.\n *\n * @remarks\n * This does not count warnings that are emitted in the API report file.\n */\n public readonly warningCount: number;\n\n /** @internal */\n public constructor(properties: ExtractorResult) {\n this.compilerState = properties.compilerState;\n this.extractorConfig = properties.extractorConfig;\n this.succeeded = properties.succeeded;\n this.apiReportChanged = properties.apiReportChanged;\n this.errorCount = properties.errorCount;\n this.warningCount = properties.warningCount;\n }\n}\n\n/**\n * The starting point for invoking the API Extractor tool.\n * @public\n */\nexport class Extractor {\n /**\n * Returns the version number of the API Extractor NPM package.\n */\n public static get version(): string {\n return Extractor._getPackageJson().version;\n }\n\n /**\n * Returns the package name of the API Extractor NPM package.\n */\n public static get packageName(): string {\n return Extractor._getPackageJson().name;\n }\n\n private static _getPackageJson(): IPackageJson {\n return PackageJsonLookup.loadOwnPackageJson(__dirname);\n }\n\n /**\n * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.\n */\n public static loadConfigAndInvoke(\n configFilePath: string,\n options?: IExtractorInvokeOptions\n ): ExtractorResult {\n const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);\n\n return Extractor.invoke(extractorConfig, options);\n }\n\n /**\n * Invoke API Extractor using an already prepared `ExtractorConfig` object.\n */\n public static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult {\n if (!options) {\n options = {};\n }\n\n const localBuild: boolean = options.localBuild || false;\n\n let compilerState: CompilerState | undefined;\n if (options.compilerState) {\n compilerState = options.compilerState;\n } else {\n compilerState = CompilerState.create(extractorConfig, options);\n }\n\n const sourceMapper: SourceMapper = new SourceMapper();\n\n const messageRouter: MessageRouter = new MessageRouter({\n workingPackageFolder: extractorConfig.packageFolder,\n messageCallback: options.messageCallback,\n messagesConfig: extractorConfig.messages || {},\n showVerboseMessages: !!options.showVerboseMessages,\n showDiagnostics: !!options.showDiagnostics,\n tsdocConfiguration: extractorConfig.tsdocConfiguration,\n sourceMapper\n });\n\n if (extractorConfig.tsdocConfigFile.filePath && !extractorConfig.tsdocConfigFile.fileNotFound) {\n if (!Path.isEqual(extractorConfig.tsdocConfigFile.filePath, ExtractorConfig._tsdocBaseFilePath)) {\n messageRouter.logVerbose(\n ConsoleMessageId.UsingCustomTSDocConfig,\n 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath\n );\n }\n }\n\n this._checkCompilerCompatibility(extractorConfig, messageRouter);\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic('');\n messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');\n messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('Compiler options');\n const serializedCompilerOptions: object = MessageRouter.buildJsonDumpObject(\n (compilerState.program as ts.Program).getCompilerOptions()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('TSDoc configuration');\n // Convert the TSDocConfiguration into a tsdoc.json representation\n const combinedConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(\n extractorConfig.tsdocConfiguration\n );\n const serializedTSDocConfig: object = MessageRouter.buildJsonDumpObject(\n combinedConfigFile.saveToObject()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));\n messageRouter.logDiagnosticFooter();\n }\n\n const collector: Collector = new Collector({\n program: compilerState.program as ts.Program,\n messageRouter,\n extractorConfig,\n sourceMapper\n });\n\n collector.analyze();\n\n DocCommentEnhancer.analyze(collector);\n ValidationEnhancer.analyze(collector);\n\n const modelBuilder: ApiModelGenerator = new ApiModelGenerator(collector, extractorConfig);\n const apiPackage: ApiPackage = modelBuilder.buildApiPackage();\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages\n }\n\n if (modelBuilder.docModelEnabled) {\n messageRouter.logVerbose(\n ConsoleMessageId.WritingDocModelFile,\n 'Writing: ' + extractorConfig.apiJsonFilePath\n );\n apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {\n toolPackage: Extractor.packageName,\n toolVersion: Extractor.version,\n\n newlineConversion: extractorConfig.newlineKind,\n ensureFolderExists: true,\n testMode: extractorConfig.testMode\n });\n }\n\n function writeApiReport(reportConfig: IExtractorConfigApiReport): boolean {\n return Extractor._writeApiReport(\n collector,\n extractorConfig,\n messageRouter,\n extractorConfig.reportTempFolder,\n extractorConfig.reportFolder,\n reportConfig,\n localBuild\n );\n }\n\n let anyReportChanged: boolean = false;\n if (extractorConfig.apiReportEnabled) {\n for (const reportConfig of extractorConfig.reportConfigs) {\n anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;\n }\n }\n\n if (extractorConfig.rollupEnabled) {\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.publicTrimmedFilePath,\n DtsRollupKind.PublicRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.alphaTrimmedFilePath,\n DtsRollupKind.AlphaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.betaTrimmedFilePath,\n DtsRollupKind.BetaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.untrimmedFilePath,\n DtsRollupKind.InternalRelease,\n extractorConfig.newlineKind\n );\n }\n\n if (extractorConfig.tsdocMetadataEnabled) {\n // Write the tsdoc-metadata.json file for this project\n PackageMetadataManager.writeTsdocMetadataFile(\n extractorConfig.tsdocMetadataFilePath,\n extractorConfig.newlineKind\n );\n }\n\n // Show all the messages that we collected during analysis\n messageRouter.handleRemainingNonConsoleMessages();\n\n // Determine success\n let succeeded: boolean;\n if (localBuild) {\n // For a local build, fail if there were errors (but ignore warnings)\n succeeded = messageRouter.errorCount === 0;\n } else {\n // For a production build, fail if there were any errors or warnings\n succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;\n }\n\n return new ExtractorResult({\n compilerState,\n extractorConfig,\n succeeded,\n apiReportChanged: anyReportChanged,\n errorCount: messageRouter.errorCount,\n warningCount: messageRouter.warningCount\n });\n }\n\n /**\n * Generates the API report at the specified release level, writes it to the specified file path, and compares\n * the output to the existing report (if one exists).\n *\n * @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior\n * to comparison with an existing report.\n * @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to\n * which the new report will be written post-comparison.\n * @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.\n *\n * @returns Whether or not the newly generated report differs from the existing report (if one exists).\n */\n private static _writeApiReport(\n collector: Collector,\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter,\n reportTempDirectoryPath: string,\n reportDirectoryPath: string,\n reportConfig: IExtractorConfigApiReport,\n localBuild: boolean\n ): boolean {\n let apiReportChanged: boolean = false;\n\n const actualApiReportPath: string = path.resolve(reportTempDirectoryPath, reportConfig.fileName);\n const actualApiReportShortPath: string = extractorConfig._getShortFilePath(actualApiReportPath);\n\n const expectedApiReportPath: string = path.resolve(reportDirectoryPath, reportConfig.fileName);\n const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(expectedApiReportPath);\n\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingApiReport,\n `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`\n );\n\n const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(\n collector,\n reportConfig.variant\n );\n\n // Write the actual file\n FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n\n // Compare it against the expected file\n if (FileSystem.exists(expectedApiReportPath)) {\n const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);\n\n if (\n !ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)\n ) {\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'You have changed the API signature for this project.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n // For a local build, just copy the file automatically.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCopied,\n `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`\n );\n\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n }\n } else {\n messageRouter.logVerbose(\n ConsoleMessageId.ApiReportUnchanged,\n `The API report is up to date: ${actualApiReportShortPath}`\n );\n }\n } else {\n // The target file does not exist, so we are setting up the API review file for the first time.\n //\n // NOTE: People sometimes make a mistake where they move a project and forget to update the \"reportFolder\"\n // setting, which causes a new file to silently get written to the wrong place. This can be confusing.\n // Thus we treat the initial creation of the file specially.\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'The API report file is missing.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);\n if (!FileSystem.exists(expectedApiReportFolder)) {\n messageRouter.logError(\n ConsoleMessageId.ApiReportFolderMissing,\n 'Unable to create the API report file. Please make sure the target folder exists:\\n' +\n expectedApiReportFolder\n );\n } else {\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n convertLineEndings: extractorConfig.newlineKind\n });\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCreated,\n 'The API report file was missing, so a new file was created. Please add this file to Git:\\n' +\n expectedApiReportPath\n );\n }\n }\n }\n return apiReportChanged;\n }\n\n private static _checkCompilerCompatibility(\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter\n ): void {\n messageRouter.logInfo(\n ConsoleMessageId.Preamble,\n `Analysis will use the bundled TypeScript version ${ts.version}`\n );\n\n try {\n const typescriptPath: string = resolve.sync('typescript', {\n basedir: extractorConfig.projectFolder,\n preserveSymlinks: false\n });\n const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();\n const packageJson: INodePackageJson | undefined =\n packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);\n if (packageJson && packageJson.version && semver.valid(packageJson.version)) {\n // Consider a newer MINOR release to be incompatible\n const ourMajor: number = semver.major(ts.version);\n const ourMinor: number = semver.minor(ts.version);\n\n const theirMajor: number = semver.major(packageJson.version);\n const theirMinor: number = semver.minor(packageJson.version);\n\n if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {\n messageRouter.logInfo(\n ConsoleMessageId.CompilerVersionNotice,\n `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +\n ` bundled compiler engine; consider upgrading API Extractor.`\n );\n }\n }\n } catch (e) {\n // The compiler detection heuristic is not expected to work in many configurations\n }\n }\n\n private static _generateRollupDtsFile(\n collector: Collector,\n outputPath: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n if (outputPath !== '') {\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingDtsRollup,\n `Writing package typings: ${outputPath}`\n );\n DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);\n }\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { JsonSchema, PackageJsonLookup, type INodePackageJson, NewlineKind } from '@rushstack/node-core-library';
2
2
  import { type IRigConfig } from '@rushstack/rig-package';
3
- import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
4
3
  import { EnumMemberOrder } from '@microsoft/api-extractor-model';
5
4
  import { TSDocConfiguration } from '@microsoft/tsdoc';
6
5
  import { TSDocConfigFile } from '@microsoft/tsdoc-config';
6
+ import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
7
+ import type { IApiModelGenerationOptions } from '../generators/ApiModelGenerator';
7
8
  /**
8
9
  * Options for {@link ExtractorConfig.tryLoadForFolder}.
9
10
  *
@@ -176,8 +177,11 @@ export declare class ExtractorConfig {
176
177
  get reportTempFilePath(): string;
177
178
  /** {@inheritDoc IConfigApiReport.includeForgottenExports} */
178
179
  readonly apiReportIncludeForgottenExports: boolean;
179
- /** {@inheritDoc IConfigDocModel.enabled} */
180
- readonly docModelEnabled: boolean;
180
+ /**
181
+ * If specified, the doc model is enabled and the specified options will be used.
182
+ * @beta
183
+ */
184
+ readonly docModelGenerationOptions: IApiModelGenerationOptions | undefined;
181
185
  /** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
182
186
  readonly apiJsonFilePath: string;
183
187
  /** {@inheritDoc IConfigDocModel.includeForgottenExports} */
@@ -1 +1 @@
1
- {"version":3,"file":"ExtractorConfig.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,UAAU,EAEV,iBAAiB,EACjB,KAAK,gBAAgB,EAKrB,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,UAAU,EAAa,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA8B1D;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC;;OAEG;IACH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,GAAG,eAAe;IAiB7E;;;;;;;OAOG;WACW,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAoFzD,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAmG9C,OAAO,CAAC,MAAM,CAAC,8BAA8B;IAgB7C;;;;OAIG;WACW,OAAO,CAAC,OAAO,EAAE,8BAA8B,GAAG,eAAe;IA0b/E;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAYrC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAgCtC;;OAEG;WACW,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAatC"}
@@ -34,11 +34,11 @@ const resolve = __importStar(require("resolve"));
34
34
  const lodash = require("lodash");
35
35
  const node_core_library_1 = require("@rushstack/node-core-library");
36
36
  const rig_package_1 = require("@rushstack/rig-package");
37
- const PackageMetadataManager_1 = require("../analyzer/PackageMetadataManager");
38
- const MessageRouter_1 = require("../collector/MessageRouter");
39
37
  const api_extractor_model_1 = require("@microsoft/api-extractor-model");
40
38
  const tsdoc_1 = require("@microsoft/tsdoc");
41
39
  const tsdoc_config_1 = require("@microsoft/tsdoc-config");
40
+ const PackageMetadataManager_1 = require("../analyzer/PackageMetadataManager");
41
+ const MessageRouter_1 = require("../collector/MessageRouter");
42
42
  const api_extractor_schema_json_1 = __importDefault(require("../schemas/api-extractor.schema.json"));
43
43
  /**
44
44
  * The `ExtractorConfig` class loads, validates, interprets, and represents the api-extractor.json config file.
@@ -64,38 +64,38 @@ class ExtractorConfig {
64
64
  const completeConfig = this._getCompleteReportConfig();
65
65
  return completeConfig === undefined ? '' : path.join(this.reportTempFolder, completeConfig.fileName);
66
66
  }
67
- constructor(parameters) {
68
- this.projectFolder = parameters.projectFolder;
69
- this.packageJson = parameters.packageJson;
70
- this.packageFolder = parameters.packageFolder;
71
- this.mainEntryPointFilePath = parameters.mainEntryPointFilePath;
72
- this.bundledPackages = parameters.bundledPackages;
73
- this.tsconfigFilePath = parameters.tsconfigFilePath;
74
- this.overrideTsconfig = parameters.overrideTsconfig;
75
- this.skipLibCheck = parameters.skipLibCheck;
76
- this.apiReportEnabled = parameters.apiReportEnabled;
77
- this.apiReportIncludeForgottenExports = parameters.apiReportIncludeForgottenExports;
78
- this.reportConfigs = parameters.reportConfigs;
79
- this.reportFolder = parameters.reportFolder;
80
- this.reportTempFolder = parameters.reportTempFolder;
81
- this.docModelEnabled = parameters.docModelEnabled;
82
- this.apiJsonFilePath = parameters.apiJsonFilePath;
83
- this.docModelIncludeForgottenExports = parameters.docModelIncludeForgottenExports;
84
- this.projectFolderUrl = parameters.projectFolderUrl;
85
- this.rollupEnabled = parameters.rollupEnabled;
86
- this.untrimmedFilePath = parameters.untrimmedFilePath;
87
- this.alphaTrimmedFilePath = parameters.alphaTrimmedFilePath;
88
- this.betaTrimmedFilePath = parameters.betaTrimmedFilePath;
89
- this.publicTrimmedFilePath = parameters.publicTrimmedFilePath;
90
- this.omitTrimmingComments = parameters.omitTrimmingComments;
91
- this.tsdocMetadataEnabled = parameters.tsdocMetadataEnabled;
92
- this.tsdocMetadataFilePath = parameters.tsdocMetadataFilePath;
93
- this.tsdocConfigFile = parameters.tsdocConfigFile;
94
- this.tsdocConfiguration = parameters.tsdocConfiguration;
95
- this.newlineKind = parameters.newlineKind;
96
- this.messages = parameters.messages;
97
- this.testMode = parameters.testMode;
98
- this.enumMemberOrder = parameters.enumMemberOrder;
67
+ constructor({ projectFolder, packageJson, packageFolder, mainEntryPointFilePath, bundledPackages, tsconfigFilePath, overrideTsconfig, skipLibCheck, apiReportEnabled, apiReportIncludeForgottenExports, reportConfigs, reportFolder, reportTempFolder, docModelGenerationOptions, apiJsonFilePath, docModelIncludeForgottenExports, projectFolderUrl, rollupEnabled, untrimmedFilePath, alphaTrimmedFilePath, betaTrimmedFilePath, publicTrimmedFilePath, omitTrimmingComments, tsdocMetadataEnabled, tsdocMetadataFilePath, tsdocConfigFile, tsdocConfiguration, newlineKind, messages, testMode, enumMemberOrder }) {
68
+ this.projectFolder = projectFolder;
69
+ this.packageJson = packageJson;
70
+ this.packageFolder = packageFolder;
71
+ this.mainEntryPointFilePath = mainEntryPointFilePath;
72
+ this.bundledPackages = bundledPackages;
73
+ this.tsconfigFilePath = tsconfigFilePath;
74
+ this.overrideTsconfig = overrideTsconfig;
75
+ this.skipLibCheck = skipLibCheck;
76
+ this.apiReportEnabled = apiReportEnabled;
77
+ this.apiReportIncludeForgottenExports = apiReportIncludeForgottenExports;
78
+ this.reportConfigs = reportConfigs;
79
+ this.reportFolder = reportFolder;
80
+ this.reportTempFolder = reportTempFolder;
81
+ this.docModelGenerationOptions = docModelGenerationOptions;
82
+ this.apiJsonFilePath = apiJsonFilePath;
83
+ this.docModelIncludeForgottenExports = docModelIncludeForgottenExports;
84
+ this.projectFolderUrl = projectFolderUrl;
85
+ this.rollupEnabled = rollupEnabled;
86
+ this.untrimmedFilePath = untrimmedFilePath;
87
+ this.alphaTrimmedFilePath = alphaTrimmedFilePath;
88
+ this.betaTrimmedFilePath = betaTrimmedFilePath;
89
+ this.publicTrimmedFilePath = publicTrimmedFilePath;
90
+ this.omitTrimmingComments = omitTrimmingComments;
91
+ this.tsdocMetadataEnabled = tsdocMetadataEnabled;
92
+ this.tsdocMetadataFilePath = tsdocMetadataFilePath;
93
+ this.tsdocConfigFile = tsdocConfigFile;
94
+ this.tsdocConfiguration = tsdocConfiguration;
95
+ this.newlineKind = newlineKind;
96
+ this.messages = messages;
97
+ this.testMode = testMode;
98
+ this.enumMemberOrder = enumMemberOrder;
99
99
  }
100
100
  /**
101
101
  * Returns a JSON-like string representing the `ExtractorConfig` state, which can be printed to a console
@@ -371,7 +371,7 @@ class ExtractorConfig {
371
371
  * loaded from an alternate source, and/or customized after loading.
372
372
  */
373
373
  static prepare(options) {
374
- var _a, _b, _c, _d, _e, _f;
374
+ var _a, _b, _c, _d, _e, _f, _g;
375
375
  const filenameForErrors = options.configObjectFullPath || 'the configuration object';
376
376
  const configObject = options.configObject;
377
377
  if (configObject.extends) {
@@ -538,15 +538,44 @@ class ExtractorConfig {
538
538
  reportTempFolder = ExtractorConfig._resolvePathWithTokens('reportTempFolder', apiReportConfig.reportTempFolder, tokenContext);
539
539
  }
540
540
  }
541
- let docModelEnabled = false;
541
+ let docModelGenerationOptions = undefined;
542
542
  let apiJsonFilePath = '';
543
543
  let docModelIncludeForgottenExports = false;
544
544
  let projectFolderUrl;
545
- if (configObject.docModel) {
546
- docModelEnabled = !!configObject.docModel.enabled;
545
+ if ((_f = configObject.docModel) === null || _f === void 0 ? void 0 : _f.enabled) {
547
546
  apiJsonFilePath = ExtractorConfig._resolvePathWithTokens('apiJsonFilePath', configObject.docModel.apiJsonFilePath, tokenContext);
548
547
  docModelIncludeForgottenExports = !!configObject.docModel.includeForgottenExports;
549
548
  projectFolderUrl = configObject.docModel.projectFolderUrl;
549
+ const releaseTagsToTrim = new Set();
550
+ const releaseTagsToTrimOption = configObject.docModel.releaseTagsToTrim || ['@internal'];
551
+ for (const releaseTagToTrim of releaseTagsToTrimOption) {
552
+ let releaseTag;
553
+ switch (releaseTagToTrim) {
554
+ case '@internal': {
555
+ releaseTag = api_extractor_model_1.ReleaseTag.Internal;
556
+ break;
557
+ }
558
+ case '@alpha': {
559
+ releaseTag = api_extractor_model_1.ReleaseTag.Alpha;
560
+ break;
561
+ }
562
+ case '@beta': {
563
+ releaseTag = api_extractor_model_1.ReleaseTag.Beta;
564
+ break;
565
+ }
566
+ case '@public': {
567
+ releaseTag = api_extractor_model_1.ReleaseTag.Public;
568
+ break;
569
+ }
570
+ default: {
571
+ throw new Error(`The release tag "${releaseTagToTrim}" is not supported`);
572
+ }
573
+ }
574
+ releaseTagsToTrim.add(releaseTag);
575
+ }
576
+ docModelGenerationOptions = {
577
+ releaseTagsToTrim
578
+ };
550
579
  }
551
580
  let tsdocMetadataEnabled = false;
552
581
  let tsdocMetadataFilePath = '';
@@ -600,7 +629,7 @@ class ExtractorConfig {
600
629
  newlineKind = node_core_library_1.NewlineKind.CrLf;
601
630
  break;
602
631
  }
603
- const enumMemberOrder = (_f = configObject.enumMemberOrder) !== null && _f !== void 0 ? _f : api_extractor_model_1.EnumMemberOrder.ByName;
632
+ const enumMemberOrder = (_g = configObject.enumMemberOrder) !== null && _g !== void 0 ? _g : api_extractor_model_1.EnumMemberOrder.ByName;
604
633
  extractorConfigParameters = {
605
634
  projectFolder: projectFolder,
606
635
  packageJson,
@@ -615,7 +644,7 @@ class ExtractorConfig {
615
644
  reportFolder,
616
645
  reportTempFolder,
617
646
  apiReportIncludeForgottenExports,
618
- docModelEnabled,
647
+ docModelGenerationOptions,
619
648
  apiJsonFilePath,
620
649
  docModelIncludeForgottenExports,
621
650
  projectFolderUrl,