@microsoft/api-extractor 7.52.8 → 7.52.10
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 +33 -0
- package/CHANGELOG.md +13 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/analyzer/TypeScriptInternals.js +1 -1
- package/lib/analyzer/TypeScriptInternals.js.map +1 -1
- package/lib/collector/Collector.js +2 -5
- package/lib/collector/Collector.js.map +1 -1
- package/lib/generators/ApiReportGenerator.d.ts.map +1 -1
- package/lib/generators/ApiReportGenerator.js +0 -1
- package/lib/generators/ApiReportGenerator.js.map +1 -1
- package/lib/generators/DtsRollupGenerator.d.ts.map +1 -1
- package/lib/generators/DtsRollupGenerator.js +0 -1
- package/lib/generators/DtsRollupGenerator.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "7.52.10",
|
|
6
|
+
"tag": "@microsoft/api-extractor_v7.52.10",
|
|
7
|
+
"date": "Fri, 01 Aug 2025 00:12:48 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Upgrades the minimatch dependency from ~3.0.3 to 10.0.3 across the entire Rush monorepo to address a Regular Expression Denial of Service (ReDoS) vulnerability in the underlying brace-expansion dependency."
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "7.52.9",
|
|
18
|
+
"tag": "@microsoft/api-extractor_v7.52.9",
|
|
19
|
+
"date": "Wed, 23 Jul 2025 20:55:57 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"dependency": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Updating dependency \"@microsoft/api-extractor-model\" to `7.30.7`"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `5.14.0`"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"comment": "Updating dependency \"@rushstack/terminal\" to `0.15.4`"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.0.2`"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
4
37
|
{
|
|
5
38
|
"version": "7.52.8",
|
|
6
39
|
"tag": "@microsoft/api-extractor_v7.52.8",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @microsoft/api-extractor
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 01 Aug 2025 00:12:48 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 7.52.10
|
|
6
|
+
Fri, 01 Aug 2025 00:12:48 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- Upgrades the minimatch dependency from ~3.0.3 to 10.0.3 across the entire Rush monorepo to address a Regular Expression Denial of Service (ReDoS) vulnerability in the underlying brace-expansion dependency.
|
|
11
|
+
|
|
12
|
+
## 7.52.9
|
|
13
|
+
Wed, 23 Jul 2025 20:55:57 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
4
16
|
|
|
5
17
|
## 7.52.8
|
|
6
18
|
Tue, 13 May 2025 02:09:20 GMT
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -43,7 +43,7 @@ class TypeScriptInternals {
|
|
|
43
43
|
static getImmediateAliasedSymbol(symbol, typeChecker) {
|
|
44
44
|
// Compiler internal:
|
|
45
45
|
// https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/checker.ts
|
|
46
|
-
return typeChecker.getImmediateAliasedSymbol(symbol);
|
|
46
|
+
return typeChecker.getImmediateAliasedSymbol(symbol);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Returns the Symbol for the provided Declaration. This is a workaround for a missing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeScriptInternals.js","sourceRoot":"","sources":["../../src/analyzer/TypeScriptInternals.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,uDAAuD;AAEvD,+CAAiC;AACjC,oEAA6D;AAS7D,MAAa,mBAAmB;IACvB,MAAM,CAAC,yBAAyB,CAAC,MAAiB,EAAE,WAA2B;QACpF,qBAAqB;QACrB,8EAA8E;QAC9E,OAAQ,WAAmB,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"TypeScriptInternals.js","sourceRoot":"","sources":["../../src/analyzer/TypeScriptInternals.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,uDAAuD;AAEvD,+CAAiC;AACjC,oEAA6D;AAS7D,MAAa,mBAAmB;IACvB,MAAM,CAAC,yBAAyB,CAAC,MAAiB,EAAE,WAA2B;QACpF,qBAAqB;QACrB,8EAA8E;QAC9E,OAAQ,WAAmB,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,0BAA0B,CACtC,WAA2B,EAC3B,OAAuB;QAEvB,IAAI,MAAM,GAA2B,WAAmB,CAAC,MAAM,CAAC;QAChE,IAAI,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,EAAE,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YACpE,MAAM,IAAI,GAAmC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;YAClF,MAAM,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC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;IACI,MAAM,CAAC,eAAe,CAAC,MAAiB;QAC7C,OAAQ,MAAc,CAAC,MAAM,CAAC;IAChC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,iBAAiB,CAAC,WAA2B;QACzD,OAAQ,WAAmB,CAAC,WAAW,CAAC;IAC1C,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,OAAmB;;QACzD,MAAM,UAAU,GAAQ,OAAO,CAAC;QAChC,MAAM,mBAAmB,GACvB,MAAA,UAAU,CAAC,kCAAkC,mCAAI,UAAU,CAAC,cAAc,CAAC;QAE7E,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,MAAM,IAAI,iCAAa,CAAC,8EAA8E,CAAC,CAAC;QAC1G,CAAC;QACD,MAAM,WAAW,GAAQ,mBAAmB,EAAE,CAAC;QAC/C,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;YACjC,MAAM,IAAI,iCAAa,CAAC,qCAAqC,CAAC,CAAC;QACjE,CAAC;QACD,MAAM,QAAQ,GAAQ,WAAW,CAAC,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC5B,MAAM,IAAI,iCAAa,CAAC,oCAAoC,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,UAAU,CAAC,IAAyD;QAChF,0IAA0I;QAC1I,OAAQ,EAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CACF;AA3ID,kDA2IC","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/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as ts from 'typescript';\nimport { InternalError } from '@rushstack/node-core-library';\n\n/**\n * Exposes the TypeScript compiler internals for detecting global variable names.\n */\nexport interface IGlobalVariableAnalyzer {\n hasGlobalName(name: string): boolean;\n}\n\nexport class TypeScriptInternals {\n public static getImmediateAliasedSymbol(symbol: ts.Symbol, typeChecker: ts.TypeChecker): ts.Symbol {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/checker.ts\n return (typeChecker as any).getImmediateAliasedSymbol(symbol);\n }\n\n /**\n * Returns the Symbol for the provided Declaration. This is a workaround for a missing\n * feature of the TypeScript Compiler API. It is the only apparent way to reach\n * certain data structures, and seems to always work, but is not officially documented.\n *\n * @returns The associated Symbol. If there is no semantic information (e.g. if the\n * declaration is an extra semicolon somewhere), then \"undefined\" is returned.\n */\n public static tryGetSymbolForDeclaration(\n declaration: ts.Declaration,\n checker: ts.TypeChecker\n ): ts.Symbol | undefined {\n let symbol: ts.Symbol | undefined = (declaration as any).symbol;\n if (symbol && symbol.escapedName === ts.InternalSymbolName.Computed) {\n const name: ts.DeclarationName | undefined = ts.getNameOfDeclaration(declaration);\n symbol = (name && checker.getSymbolAtLocation(name)) || symbol;\n }\n return symbol;\n }\n\n /**\n * Returns whether the provided Symbol is a TypeScript \"late-bound\" Symbol (i.e. was created by the Checker\n * for a computed property based on its type, rather than by the Binder).\n */\n public static isLateBoundSymbol(symbol: ts.Symbol): boolean {\n if (\n // eslint-disable-next-line no-bitwise\n symbol.flags & ts.SymbolFlags.Transient &&\n (ts as any).getCheckFlags(symbol) === (ts as any).CheckFlags.Late\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Retrieves the comment ranges associated with the specified node.\n */\n public static getJSDocCommentRanges(node: ts.Node, text: string): ts.CommentRange[] | undefined {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v2.4.2/src/compiler/utilities.ts#L616\n\n return (ts as any).getJSDocCommentRanges.apply(this, arguments);\n }\n\n /**\n * Retrieves the (unescaped) value of an string literal, numeric literal, or identifier.\n */\n public static getTextOfIdentifierOrLiteral(\n node: ts.Identifier | ts.StringLiteralLike | ts.NumericLiteral\n ): string {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/utilities.ts#L2721\n\n return (ts as any).getTextOfIdentifierOrLiteral(node);\n }\n\n /**\n * Retrieves the (cached) module resolution information for a module name that was exported from a SourceFile.\n * The compiler populates this cache as part of analyzing the source file.\n */\n public static getResolvedModule(\n program: ts.Program,\n sourceFile: ts.SourceFile,\n moduleNameText: string,\n mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined\n ): ts.ResolvedModuleFull | undefined {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v5.3.3/src/compiler/types.ts#L4698\n const result: ts.ResolvedModuleWithFailedLookupLocations | undefined = (program as any).getResolvedModule(\n sourceFile,\n moduleNameText,\n mode\n );\n return result?.resolvedModule;\n }\n\n /**\n * Gets the mode required for module resolution required with the addition of Node16/nodenext\n */\n public static getModeForUsageLocation(\n file: ts.SourceFile,\n usage: ts.StringLiteralLike,\n compilerOptions: ts.CompilerOptions\n ): ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined {\n // Compiler internal:\n // https://github.com/microsoft/TypeScript/blob/v5.8.2/src/compiler/program.ts#L931\n\n return ts.getModeForUsageLocation?.(file, usage, compilerOptions);\n }\n\n /**\n * Returns ts.Symbol.parent if it exists.\n */\n public static getSymbolParent(symbol: ts.Symbol): ts.Symbol | undefined {\n return (symbol as any).parent;\n }\n\n /**\n * In an statement like `export default class X { }`, the `Symbol.name` will be `default`\n * whereas the `localSymbol` is `X`.\n */\n public static tryGetLocalSymbol(declaration: ts.Declaration): ts.Symbol | undefined {\n return (declaration as any).localSymbol;\n }\n\n public static getGlobalVariableAnalyzer(program: ts.Program): IGlobalVariableAnalyzer {\n const anyProgram: any = program;\n const typeCheckerInstance: any =\n anyProgram.getDiagnosticsProducingTypeChecker ?? anyProgram.getTypeChecker;\n\n if (!typeCheckerInstance) {\n throw new InternalError('Missing Program.getDiagnosticsProducingTypeChecker or Program.getTypeChecker');\n }\n const typeChecker: any = typeCheckerInstance();\n if (!typeChecker.getEmitResolver) {\n throw new InternalError('Missing TypeChecker.getEmitResolver');\n }\n const resolver: any = typeChecker.getEmitResolver();\n if (!resolver.hasGlobalName) {\n throw new InternalError('Missing EmitResolver.hasGlobalName');\n }\n return resolver;\n }\n\n /**\n * Returns whether a variable is declared with the const keyword\n */\n public static isVarConst(node: ts.VariableDeclaration | ts.VariableDeclarationList): boolean {\n // Compiler internal: https://github.com/microsoft/TypeScript/blob/71286e3d49c10e0e99faac360a6bbd40f12db7b6/src/compiler/utilities.ts#L925\n return (ts as any).isVarConst(node);\n }\n}\n"]}
|
|
@@ -34,16 +34,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
36
|
})();
|
|
37
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
-
};
|
|
40
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
38
|
exports.Collector = void 0;
|
|
42
39
|
const ts = __importStar(require("typescript"));
|
|
43
40
|
const tsdoc = __importStar(require("@microsoft/tsdoc"));
|
|
44
41
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
45
42
|
const api_extractor_model_1 = require("@microsoft/api-extractor-model");
|
|
46
|
-
const minimatch_1 =
|
|
43
|
+
const minimatch_1 = require("minimatch");
|
|
47
44
|
const ExtractorMessageId_1 = require("../api/ExtractorMessageId");
|
|
48
45
|
const CollectorEntity_1 = require("./CollectorEntity");
|
|
49
46
|
const AstSymbolTable_1 = require("../analyzer/AstSymbolTable");
|
|
@@ -138,7 +135,7 @@ class Collector {
|
|
|
138
135
|
else {
|
|
139
136
|
// If the entry isn't an exact package name, assume glob pattern and search for matches
|
|
140
137
|
for (const dependencyName of dependencyNames) {
|
|
141
|
-
if ((0, minimatch_1.
|
|
138
|
+
if ((0, minimatch_1.minimatch)(dependencyName, packageNameOrPattern)) {
|
|
142
139
|
resolvedPackageNames.add(dependencyName);
|
|
143
140
|
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I,CAAC,2BAA2B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;wBAC7C,CAAC;oBACH,CAAC;oBAED,KAAK,MAAM,qBAAqB,IAAI,sBAAsB,EAAE,CAAC;wBAC3D,MAAM,SAAS,GAAuB,IAAI,CAAC,oCAAoC,CAC7E,cAAc,EACd,qBAAqB,EACrB,8BAA8B,CAC/B,CAAC;wBACF,IAAI,SAAS,EAAE,CAAC;4BACd,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;wBACjD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,oCAAoC,CAC1C,cAAsB,EACtB,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAoB,EACxC,8BAAuC;QAEvC,MAAM,SAAS,GAAW,cAAc,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC7D,IAAI,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAChD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAxgCD,8BAwgCC","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 ts from 'typescript';\nimport * as tsdoc from '@microsoft/tsdoc';\nimport {\n PackageJsonLookup,\n Sort,\n InternalError,\n type INodePackageJson,\n PackageName\n} from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\nimport minimatch from 'minimatch';\n\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\n\nimport { CollectorEntity } from './CollectorEntity';\nimport { AstSymbolTable } from '../analyzer/AstSymbolTable';\nimport type { AstEntity } from '../analyzer/AstEntity';\nimport type { AstModule, IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { AstDeclaration } from '../analyzer/AstDeclaration';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { WorkingPackage } from './WorkingPackage';\nimport { PackageDocComment } from '../aedoc/PackageDocComment';\nimport { type DeclarationMetadata, InternalDeclarationMetadata } from './DeclarationMetadata';\nimport { ApiItemMetadata, type IApiItemMetadataOptions } from './ApiItemMetadata';\nimport { SymbolMetadata } from './SymbolMetadata';\nimport { TypeScriptInternals, type IGlobalVariableAnalyzer } from '../analyzer/TypeScriptInternals';\nimport type { MessageRouter } from './MessageRouter';\nimport { AstReferenceResolver } from '../analyzer/AstReferenceResolver';\nimport { ExtractorConfig } from '../api/ExtractorConfig';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport { AstImport } from '../analyzer/AstImport';\nimport type { SourceMapper } from './SourceMapper';\n\n/**\n * Options for Collector constructor.\n */\nexport interface ICollectorOptions {\n /**\n * Configuration for the TypeScript compiler. The most important options to set are:\n *\n * - target: ts.ScriptTarget.ES5\n * - module: ts.ModuleKind.CommonJS\n * - moduleResolution: ts.ModuleResolutionKind.NodeJs\n * - rootDir: inputFolder\n */\n program: ts.Program;\n\n messageRouter: MessageRouter;\n\n extractorConfig: ExtractorConfig;\n\n sourceMapper: SourceMapper;\n}\n\n/**\n * The `Collector` manages the overall data set that is used by `ApiModelGenerator`,\n * `DtsRollupGenerator`, and `ApiReportGenerator`. Starting from the working package's entry point,\n * the `Collector` collects all exported symbols, determines how to import any symbols they reference,\n * assigns unique names, and sorts everything into a normalized alphabetical ordering.\n */\nexport class Collector {\n public readonly program: ts.Program;\n public readonly typeChecker: ts.TypeChecker;\n public readonly globalVariableAnalyzer: IGlobalVariableAnalyzer;\n public readonly astSymbolTable: AstSymbolTable;\n public readonly astReferenceResolver: AstReferenceResolver;\n\n public readonly packageJsonLookup: PackageJsonLookup;\n public readonly messageRouter: MessageRouter;\n\n public readonly workingPackage: WorkingPackage;\n\n public readonly extractorConfig: ExtractorConfig;\n\n public readonly sourceMapper: SourceMapper;\n\n /**\n * The `ExtractorConfig.bundledPackages` names in a set.\n */\n public readonly bundledPackageNames: ReadonlySet<string>;\n\n private readonly _program: ts.Program;\n\n private readonly _tsdocParser: tsdoc.TSDocParser;\n\n private _astEntryPoint: AstModule | undefined;\n\n private readonly _entities: CollectorEntity[] = [];\n private readonly _entitiesByAstEntity: Map<AstEntity, CollectorEntity> = new Map<\n AstEntity,\n CollectorEntity\n >();\n private readonly _entitiesBySymbol: Map<ts.Symbol, CollectorEntity> = new Map<ts.Symbol, CollectorEntity>();\n\n private readonly _starExportedExternalModulePaths: string[] = [];\n\n private readonly _dtsTypeReferenceDirectives: Set<string> = new Set<string>();\n private readonly _dtsLibReferenceDirectives: Set<string> = new Set<string>();\n\n // Used by getOverloadIndex()\n private readonly _cachedOverloadIndexesByDeclaration: Map<AstDeclaration, number>;\n\n public constructor(options: ICollectorOptions) {\n this.packageJsonLookup = new PackageJsonLookup();\n\n this._program = options.program;\n this.extractorConfig = options.extractorConfig;\n this.sourceMapper = options.sourceMapper;\n\n const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(\n this.extractorConfig.mainEntryPointFilePath\n );\n\n if (!entryPointSourceFile) {\n throw new Error('Unable to load file: ' + this.extractorConfig.mainEntryPointFilePath);\n }\n\n if (!this.extractorConfig.packageFolder || !this.extractorConfig.packageJson) {\n // TODO: We should be able to analyze projects that don't have any package.json.\n // The ExtractorConfig class is already designed to allow this.\n throw new Error('Unable to find a package.json file for the project being analyzed');\n }\n\n this.workingPackage = new WorkingPackage({\n packageFolder: this.extractorConfig.packageFolder,\n packageJson: this.extractorConfig.packageJson,\n entryPointSourceFile\n });\n\n this.messageRouter = options.messageRouter;\n\n this.program = options.program;\n this.typeChecker = options.program.getTypeChecker();\n this.globalVariableAnalyzer = TypeScriptInternals.getGlobalVariableAnalyzer(this.program);\n\n this._tsdocParser = new tsdoc.TSDocParser(this.extractorConfig.tsdocConfiguration);\n\n // Resolve package name patterns and store concrete set of bundled package dependency names\n this.bundledPackageNames = Collector._resolveBundledPackagePatterns(\n this.extractorConfig.bundledPackages,\n this.extractorConfig.packageJson\n );\n\n this.astSymbolTable = new AstSymbolTable(\n this.program,\n this.typeChecker,\n this.packageJsonLookup,\n this.bundledPackageNames,\n this.messageRouter\n );\n this.astReferenceResolver = new AstReferenceResolver(this);\n\n this._cachedOverloadIndexesByDeclaration = new Map<AstDeclaration, number>();\n }\n\n /**\n * Resolve provided `bundledPackages` names and glob patterns to a list of explicit package names.\n *\n * @remarks\n * Explicit package names will be included in the output unconditionally. However, wildcard patterns will\n * only be matched against the various dependencies listed in the provided package.json (if there was one).\n * Patterns will be matched against `dependencies`, `devDependencies`, `optionalDependencies`, and `peerDependencies`.\n *\n * @param bundledPackages - The list of package names and/or glob patterns to resolve.\n * @param packageJson - The package.json of the package being processed (if there is one).\n * @returns The set of resolved package names to be bundled during analysis.\n */\n private static _resolveBundledPackagePatterns(\n bundledPackages: string[],\n packageJson: INodePackageJson | undefined\n ): ReadonlySet<string> {\n if (bundledPackages.length === 0) {\n // If no `bundledPackages` were specified, then there is nothing to resolve.\n // Return an empty set.\n return new Set<string>();\n }\n\n // Accumulate all declared dependencies.\n // Any wildcard patterns in `bundledPackages` will be resolved against these.\n const dependencyNames: Set<string> = new Set<string>();\n Object.keys(packageJson?.dependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.devDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.peerDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.optionalDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n\n // The set of resolved package names to be populated and returned\n const resolvedPackageNames: Set<string> = new Set<string>();\n\n for (const packageNameOrPattern of bundledPackages) {\n // If the string is an exact package name, use it regardless of package.json contents\n if (PackageName.isValidName(packageNameOrPattern)) {\n resolvedPackageNames.add(packageNameOrPattern);\n } else {\n // If the entry isn't an exact package name, assume glob pattern and search for matches\n for (const dependencyName of dependencyNames) {\n if (minimatch(dependencyName, packageNameOrPattern)) {\n resolvedPackageNames.add(dependencyName);\n }\n }\n }\n }\n return resolvedPackageNames;\n }\n\n /**a\n * Returns a list of names (e.g. \"example-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference types=\"example-library\" />\n * ```\n */\n public get dtsTypeReferenceDirectives(): ReadonlySet<string> {\n return this._dtsTypeReferenceDirectives;\n }\n\n /**\n * A list of names (e.g. \"runtime-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference lib=\"runtime-library\" />\n * ```\n */\n public get dtsLibReferenceDirectives(): ReadonlySet<string> {\n return this._dtsLibReferenceDirectives;\n }\n\n public get entities(): ReadonlyArray<CollectorEntity> {\n return this._entities;\n }\n\n /**\n * A list of module specifiers (e.g. `\"@rushstack/node-core-library/lib/FileSystem\"`) that should be emitted\n * as star exports (e.g. `export * from \"@rushstack/node-core-library/lib/FileSystem\"`).\n */\n public get starExportedExternalModulePaths(): ReadonlyArray<string> {\n return this._starExportedExternalModulePaths;\n }\n\n /**\n * Perform the analysis.\n */\n public analyze(): void {\n if (this._astEntryPoint) {\n throw new Error('DtsRollupGenerator.analyze() was already called');\n }\n\n // This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)\n // with semantic information (i.e. symbols). The \"diagnostics\" are a subset of the everyday\n // compile errors that would result from a full compilation.\n for (const diagnostic of this._program.getSemanticDiagnostics()) {\n this.messageRouter.addCompilerDiagnostic(diagnostic);\n }\n\n const sourceFiles: readonly ts.SourceFile[] = this.program.getSourceFiles();\n\n if (this.messageRouter.showDiagnostics) {\n this.messageRouter.logDiagnosticHeader('Root filenames');\n for (const fileName of this.program.getRootFileNames()) {\n this.messageRouter.logDiagnostic(fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n\n this.messageRouter.logDiagnosticHeader('Files analyzed by compiler');\n for (const sourceFile of sourceFiles) {\n this.messageRouter.logDiagnostic(sourceFile.fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n }\n\n // We can throw this error earlier in CompilerState.ts, but intentionally wait until after we've logged the\n // associated diagnostic message above to make debugging easier for developers.\n // Typically there will be many such files -- to avoid too much noise, only report the first one.\n const badSourceFile: ts.SourceFile | undefined = sourceFiles.find(\n ({ fileName }) => !ExtractorConfig.hasDtsFileExtension(fileName)\n );\n if (badSourceFile) {\n this.messageRouter.addAnalyzerIssueForPosition(\n ExtractorMessageId.WrongInputFileType,\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 badSourceFile,\n 0\n );\n }\n\n // Build the entry point\n const entryPointSourceFile: ts.SourceFile = this.workingPackage.entryPointSourceFile;\n\n const astEntryPoint: AstModule =\n this.astSymbolTable.fetchAstModuleFromWorkingPackage(entryPointSourceFile);\n this._astEntryPoint = astEntryPoint;\n\n const packageDocCommentTextRange: ts.TextRange | undefined = PackageDocComment.tryFindInSourceFile(\n entryPointSourceFile,\n this\n );\n\n if (packageDocCommentTextRange) {\n const range: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n entryPointSourceFile.text,\n packageDocCommentTextRange.pos,\n packageDocCommentTextRange.end\n );\n\n this.workingPackage.tsdocParserContext = this._tsdocParser.parseRange(range);\n\n this.messageRouter.addTsdocMessages(this.workingPackage.tsdocParserContext, entryPointSourceFile);\n\n this.workingPackage.tsdocComment = this.workingPackage.tsdocParserContext!.docComment;\n }\n\n const { exportedLocalEntities, starExportedExternalModules, visitedAstModules }: IAstModuleExportInfo =\n this.astSymbolTable.fetchAstModuleExportInfo(astEntryPoint);\n\n // Create a CollectorEntity for each top-level export.\n const processedAstEntities: AstEntity[] = [];\n for (const [exportName, astEntity] of exportedLocalEntities) {\n this._createCollectorEntity(astEntity, exportName);\n processedAstEntities.push(astEntity);\n }\n\n // Recursively create the remaining CollectorEntities after the top-level entities\n // have been processed.\n const alreadySeenAstEntities: Set<AstEntity> = new Set<AstEntity>();\n for (const astEntity of processedAstEntities) {\n this._recursivelyCreateEntities(astEntity, alreadySeenAstEntities);\n if (astEntity instanceof AstSymbol) {\n this.fetchSymbolMetadata(astEntity);\n }\n }\n\n // Ensure references are collected from any intermediate files that\n // only include exports\n const nonExternalSourceFiles: Set<ts.SourceFile> = new Set();\n for (const { sourceFile, isExternal } of visitedAstModules) {\n if (!nonExternalSourceFiles.has(sourceFile) && !isExternal) {\n nonExternalSourceFiles.add(sourceFile);\n }\n }\n\n // Here, we're collecting reference directives from all non-external source files\n // that were encountered while looking for exports, but only those references that\n // were explicitly written by the developer and marked with the `preserve=\"true\"`\n // attribute. In TS >= 5.5, only references that are explicitly authored and marked\n // with `preserve=\"true\"` are included in the output. See https://github.com/microsoft/TypeScript/pull/57681\n //\n // The `_collectReferenceDirectives` function pulls in all references in files that\n // contain definitions, but does not examine files that only reexport from other\n // files. Here, we're looking through files that were missed by `_collectReferenceDirectives`,\n // but only collecting references that were explicitly marked with `preserve=\"true\"`.\n // It is intuitive for developers to include references that they explicitly want part of\n // their public API in a file like the entrypoint, which is likely to only contain reexports,\n // and this picks those up.\n this._collectReferenceDirectivesFromSourceFiles(nonExternalSourceFiles, true);\n\n this._makeUniqueNames();\n\n for (const starExportedExternalModule of starExportedExternalModules) {\n if (starExportedExternalModule.externalModulePath !== undefined) {\n this._starExportedExternalModulePaths.push(starExportedExternalModule.externalModulePath);\n }\n }\n\n Sort.sortBy(this._entities, (x) => x.getSortKey());\n Sort.sortSet(this._dtsTypeReferenceDirectives);\n Sort.sortSet(this._dtsLibReferenceDirectives);\n this._starExportedExternalModulePaths.sort();\n }\n\n /**\n * For a given ts.Identifier that is part of an AstSymbol that we analyzed, return the CollectorEntity that\n * it refers to. Returns undefined if it doesn't refer to anything interesting.\n * @remarks\n * Throws an Error if the ts.Identifier is not part of node tree that was analyzed.\n */\n public tryGetEntityForNode(identifier: ts.Identifier | ts.ImportTypeNode): CollectorEntity | undefined {\n const astEntity: AstEntity | undefined = this.astSymbolTable.tryGetEntityForNode(identifier);\n if (astEntity) {\n return this._entitiesByAstEntity.get(astEntity);\n }\n return undefined;\n }\n\n /**\n * For a given analyzed ts.Symbol, return the CollectorEntity that it refers to. Returns undefined if it\n * doesn't refer to anything interesting.\n */\n public tryGetEntityForSymbol(symbol: ts.Symbol): CollectorEntity | undefined {\n return this._entitiesBySymbol.get(symbol);\n }\n\n /**\n * Returns the associated `CollectorEntity` for the given `astEntity`, if one was created during analysis.\n */\n public tryGetCollectorEntity(astEntity: AstEntity): CollectorEntity | undefined {\n return this._entitiesByAstEntity.get(astEntity);\n }\n\n public fetchSymbolMetadata(astSymbol: AstSymbol): SymbolMetadata {\n if (astSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol);\n }\n return astSymbol.symbolMetadata as SymbolMetadata;\n }\n\n public fetchDeclarationMetadata(astDeclaration: AstDeclaration): DeclarationMetadata {\n if (astDeclaration.declarationMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the DeclarationMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.declarationMetadata as DeclarationMetadata;\n }\n\n public fetchApiItemMetadata(astDeclaration: AstDeclaration): ApiItemMetadata {\n if (astDeclaration.apiItemMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the ApiItemMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.apiItemMetadata as ApiItemMetadata;\n }\n\n public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined {\n if (astEntity instanceof AstSymbol) {\n return this.fetchSymbolMetadata(astEntity);\n }\n if (astEntity instanceof AstImport) {\n if (astEntity.astSymbol) {\n return this.fetchSymbolMetadata(astEntity.astSymbol);\n }\n }\n return undefined;\n }\n\n public isAncillaryDeclaration(astDeclaration: AstDeclaration): boolean {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n return declarationMetadata.isAncillary;\n }\n\n public getNonAncillaryDeclarations(astSymbol: AstSymbol): ReadonlyArray<AstDeclaration> {\n const result: AstDeclaration[] = [];\n for (const astDeclaration of astSymbol.astDeclarations) {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n if (!declarationMetadata.isAncillary) {\n result.push(astDeclaration);\n }\n }\n return result;\n }\n\n /**\n * Removes the leading underscore, for example: \"_Example\" --> \"example*Example*_\"\n *\n * @remarks\n * This causes internal definitions to sort alphabetically case-insensitive, then case-sensitive, and\n * initially ignoring the underscore prefix, while still deterministically comparing it.\n * The star is used as a delimiter because it is not a legal identifier character.\n */\n public static getSortKeyIgnoringUnderscore(identifier: string | undefined): string {\n if (!identifier) return '';\n\n let parts: string[];\n\n if (identifier[0] === '_') {\n const withoutUnderscore: string = identifier.substr(1);\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\n } else {\n parts = [identifier.toLowerCase(), '*', identifier];\n }\n\n return parts.join('');\n }\n\n /**\n * For function-like signatures, this returns the TSDoc \"overload index\" which can be used to identify\n * a specific overload.\n */\n public getOverloadIndex(astDeclaration: AstDeclaration): number {\n const allDeclarations: ReadonlyArray<AstDeclaration> = astDeclaration.astSymbol.astDeclarations;\n if (allDeclarations.length === 1) {\n return 1; // trivial case\n }\n\n let overloadIndex: number | undefined = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n\n if (overloadIndex === undefined) {\n // TSDoc index selectors are positive integers counting from 1\n let nextIndex: number = 1;\n for (const other of allDeclarations) {\n // Filter out other declarations that are not overloads. For example, an overloaded function can also\n // be a namespace.\n if (other.declaration.kind === astDeclaration.declaration.kind) {\n this._cachedOverloadIndexesByDeclaration.set(other, nextIndex);\n ++nextIndex;\n }\n }\n overloadIndex = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n }\n\n if (overloadIndex === undefined) {\n // This should never happen\n throw new InternalError('Error calculating overload index for declaration');\n }\n\n return overloadIndex;\n }\n\n private _createCollectorEntity(\n astEntity: AstEntity,\n exportName?: string,\n parent?: CollectorEntity\n ): CollectorEntity {\n let entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\n\n if (!entity) {\n entity = new CollectorEntity(astEntity);\n\n this._entitiesByAstEntity.set(astEntity, entity);\n if (astEntity instanceof AstSymbol) {\n this._entitiesBySymbol.set(astEntity.followedSymbol, entity);\n } else if (astEntity instanceof AstNamespaceImport) {\n this._entitiesBySymbol.set(astEntity.symbol, entity);\n }\n this._entities.push(entity);\n this._collectReferenceDirectives(astEntity);\n }\n\n if (exportName) {\n if (parent) {\n entity.addLocalExportName(exportName, parent);\n } else {\n entity.addExportName(exportName);\n }\n }\n\n return entity;\n }\n\n private _recursivelyCreateEntities(astEntity: AstEntity, alreadySeenAstEntities: Set<AstEntity>): void {\n if (alreadySeenAstEntities.has(astEntity)) return;\n alreadySeenAstEntities.add(astEntity);\n\n if (astEntity instanceof AstSymbol) {\n astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => {\n for (const referencedAstEntity of astDeclaration.referencedAstEntities) {\n if (referencedAstEntity instanceof AstSymbol) {\n // We only create collector entities for root-level symbols. For example, if a symbol is\n // nested inside a namespace, only the namespace gets a collector entity. Note that this\n // is not true for AstNamespaceImports below.\n if (referencedAstEntity.parentAstSymbol === undefined) {\n this._createCollectorEntity(referencedAstEntity);\n }\n } else {\n this._createCollectorEntity(referencedAstEntity);\n }\n\n this._recursivelyCreateEntities(referencedAstEntity, alreadySeenAstEntities);\n }\n });\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(this);\n const parentEntity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\n if (!parentEntity) {\n // This should never happen, as we've already created entities for all AstNamespaceImports.\n throw new InternalError(\n `Failed to get CollectorEntity for AstNamespaceImport with namespace name \"${astEntity.namespaceName}\"`\n );\n }\n\n for (const [localExportName, localAstEntity] of astModuleExportInfo.exportedLocalEntities) {\n // Create a CollectorEntity for each local export within an AstNamespaceImport entity.\n this._createCollectorEntity(localAstEntity, localExportName, parentEntity);\n this._recursivelyCreateEntities(localAstEntity, alreadySeenAstEntities);\n }\n }\n }\n\n /**\n * Ensures a unique name for each item in the package typings file.\n */\n private _makeUniqueNames(): void {\n // The following examples illustrate the nameForEmit heuristics:\n //\n // Example 1:\n // class X { } <--- nameForEmit should be \"A\" to simplify things and reduce possibility of conflicts\n // export { X as A };\n //\n // Example 2:\n // class X { } <--- nameForEmit should be \"X\" because choosing A or B would be nondeterministic\n // export { X as A };\n // export { X as B };\n //\n // Example 3:\n // class X { } <--- nameForEmit should be \"X_1\" because Y has a stronger claim to the name\n // export { X as A };\n // export { X as B };\n // class Y { } <--- nameForEmit should be \"X\"\n // export { Y as X };\n\n // Set of names that should NOT be used when generating a unique nameForEmit\n const usedNames: Set<string> = new Set<string>();\n\n // First collect the names of explicit package exports, and perform a sanity check.\n for (const entity of this._entities) {\n for (const exportName of entity.exportNames) {\n if (usedNames.has(exportName)) {\n // This should be impossible\n throw new InternalError(`A package cannot have two exports with the name \"${exportName}\"`);\n }\n usedNames.add(exportName);\n }\n }\n\n // Ensure that each entity has a unique nameForEmit\n for (const entity of this._entities) {\n // What name would we ideally want to emit it as?\n let idealNameForEmit: string;\n\n // If this entity is exported exactly once, then we prefer the exported name\n if (\n entity.singleExportName !== undefined &&\n entity.singleExportName !== ts.InternalSymbolName.Default\n ) {\n idealNameForEmit = entity.singleExportName;\n } else {\n // otherwise use the local name\n idealNameForEmit = entity.astEntity.localName;\n }\n\n if (idealNameForEmit.includes('.')) {\n // For an ImportType with a namespace chain, only the top namespace is imported.\n idealNameForEmit = idealNameForEmit.split('.')[0];\n }\n\n // If the idealNameForEmit happens to be the same as one of the exports, then we're safe to use that...\n if (entity.exportNames.has(idealNameForEmit)) {\n // ...except that if it conflicts with a global name, then the global name wins\n if (!this.globalVariableAnalyzer.hasGlobalName(idealNameForEmit)) {\n // ...also avoid \"default\" which can interfere with \"export { default } from 'some-module;'\"\n if (idealNameForEmit !== 'default') {\n entity.nameForEmit = idealNameForEmit;\n continue;\n }\n }\n }\n\n // Generate a unique name based on idealNameForEmit\n let suffix: number = 1;\n let nameForEmit: string = idealNameForEmit;\n\n // Choose a name that doesn't conflict with usedNames or a global name\n while (\n nameForEmit === 'default' ||\n usedNames.has(nameForEmit) ||\n this.globalVariableAnalyzer.hasGlobalName(nameForEmit)\n ) {\n nameForEmit = `${idealNameForEmit}_${++suffix}`;\n }\n entity.nameForEmit = nameForEmit;\n usedNames.add(nameForEmit);\n }\n }\n\n private _fetchSymbolMetadata(astSymbol: AstSymbol): void {\n if (astSymbol.symbolMetadata) {\n return;\n }\n\n // When we solve an astSymbol, then we always also solve all of its parents and all of its declarations.\n // The parent is solved first.\n if (astSymbol.parentAstSymbol && astSymbol.parentAstSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol.parentAstSymbol);\n }\n\n // Construct the DeclarationMetadata objects, and detect any ancillary declarations\n this._calculateDeclarationMetadataForDeclarations(astSymbol);\n\n // Calculate the ApiItemMetadata objects\n for (const astDeclaration of astSymbol.astDeclarations) {\n this._calculateApiItemMetadata(astDeclaration);\n }\n\n // The most public effectiveReleaseTag for all declarations\n let maxEffectiveReleaseTag: ReleaseTag = ReleaseTag.None;\n\n for (const astDeclaration of astSymbol.astDeclarations) {\n // We know we solved this above\n const apiItemMetadata: ApiItemMetadata = astDeclaration.apiItemMetadata as ApiItemMetadata;\n\n const effectiveReleaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;\n\n if (effectiveReleaseTag > maxEffectiveReleaseTag) {\n maxEffectiveReleaseTag = effectiveReleaseTag;\n }\n }\n\n // Update this last when we're sure no exceptions were thrown\n astSymbol.symbolMetadata = new SymbolMetadata({\n maxEffectiveReleaseTag\n });\n }\n\n private _calculateDeclarationMetadataForDeclarations(astSymbol: AstSymbol): void {\n // Initialize DeclarationMetadata for each declaration\n for (const astDeclaration of astSymbol.astDeclarations) {\n if (astDeclaration.declarationMetadata) {\n throw new InternalError(\n 'AstDeclaration.declarationMetadata is not expected to have been initialized yet'\n );\n }\n\n const metadata: InternalDeclarationMetadata = new InternalDeclarationMetadata();\n metadata.tsdocParserContext = this._parseTsdocForAstDeclaration(astDeclaration);\n\n astDeclaration.declarationMetadata = metadata;\n }\n\n // Detect ancillary declarations\n for (const astDeclaration of astSymbol.astDeclarations) {\n // For a getter/setter pair, make the setter ancillary to the getter\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n let foundGetter: boolean = false;\n for (const getterAstDeclaration of astDeclaration.astSymbol.astDeclarations) {\n if (getterAstDeclaration.declaration.kind === ts.SyntaxKind.GetAccessor) {\n // Associate it with the getter\n this._addAncillaryDeclaration(getterAstDeclaration, astDeclaration);\n\n foundGetter = true;\n }\n }\n\n if (!foundGetter) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingGetter,\n `The property \"${astDeclaration.astSymbol.localName}\" has a setter but no getter.`,\n astDeclaration\n );\n }\n }\n }\n }\n\n private _addAncillaryDeclaration(\n mainAstDeclaration: AstDeclaration,\n ancillaryAstDeclaration: AstDeclaration\n ): void {\n const mainMetadata: InternalDeclarationMetadata =\n mainAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n const ancillaryMetadata: InternalDeclarationMetadata =\n ancillaryAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n\n if (mainMetadata.ancillaryDeclarations.indexOf(ancillaryAstDeclaration) >= 0) {\n return; // already added\n }\n\n if (mainAstDeclaration.astSymbol !== ancillaryAstDeclaration.astSymbol) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because declarations do not' +\n ' belong to the same symbol'\n );\n }\n\n if (mainMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the target is ancillary itself'\n );\n }\n\n if (ancillaryMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because source is already ancillary' +\n ' to another declaration'\n );\n }\n\n if (mainAstDeclaration.apiItemMetadata || ancillaryAstDeclaration.apiItemMetadata) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the API item metadata' +\n ' has already been constructed'\n );\n }\n\n ancillaryMetadata.isAncillary = true;\n mainMetadata.ancillaryDeclarations.push(ancillaryAstDeclaration);\n }\n\n private _calculateApiItemMetadata(astDeclaration: AstDeclaration): void {\n const declarationMetadata: InternalDeclarationMetadata =\n astDeclaration.declarationMetadata as InternalDeclarationMetadata;\n if (declarationMetadata.isAncillary) {\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n if (declarationMetadata.tsdocParserContext) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.SetterWithDocs,\n `The doc comment for the property \"${astDeclaration.astSymbol.localName}\"` +\n ` must appear on the getter, not the setter.`,\n astDeclaration\n );\n }\n }\n\n // We never calculate ApiItemMetadata for an ancillary declaration; instead, it is assigned when\n // the main declaration is processed.\n return;\n }\n\n const options: IApiItemMetadataOptions = {\n declaredReleaseTag: ReleaseTag.None,\n effectiveReleaseTag: ReleaseTag.None,\n isEventProperty: false,\n isOverride: false,\n isSealed: false,\n isVirtual: false,\n isPreapproved: false,\n releaseTagSameAsParent: false\n };\n\n const parserContext: tsdoc.ParserContext | undefined = declarationMetadata.tsdocParserContext;\n if (parserContext) {\n const modifierTagSet: tsdoc.StandardModifierTagSet = parserContext.docComment.modifierTagSet;\n\n let declaredReleaseTag: ReleaseTag = ReleaseTag.None;\n let extraReleaseTags: boolean = false;\n\n if (modifierTagSet.isPublic()) {\n declaredReleaseTag = ReleaseTag.Public;\n }\n if (modifierTagSet.isBeta()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Beta;\n }\n }\n if (modifierTagSet.isAlpha()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Alpha;\n }\n }\n if (modifierTagSet.isInternal()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Internal;\n }\n }\n\n if (extraReleaseTags) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.ExtraReleaseTag,\n 'The doc comment should not contain more than one release tag',\n astDeclaration\n );\n }\n }\n\n options.declaredReleaseTag = declaredReleaseTag;\n\n options.isEventProperty = modifierTagSet.isEventProperty();\n options.isOverride = modifierTagSet.isOverride();\n options.isSealed = modifierTagSet.isSealed();\n options.isVirtual = modifierTagSet.isVirtual();\n const preapprovedTag: tsdoc.TSDocTagDefinition | void =\n this.extractorConfig.tsdocConfiguration.tryGetTagDefinition('@preapproved');\n\n if (preapprovedTag && modifierTagSet.hasTag(preapprovedTag)) {\n // This feature only makes sense for potentially big declarations.\n switch (astDeclaration.declaration.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.EnumDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n case ts.SyntaxKind.ModuleDeclaration:\n if (declaredReleaseTag === ReleaseTag.Internal) {\n options.isPreapproved = true;\n } else {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedBadReleaseTag,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` without an @internal release tag`,\n astDeclaration\n );\n }\n break;\n default:\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedUnsupportedType,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` because it is not a supported declaration type`,\n astDeclaration\n );\n break;\n }\n }\n }\n\n // This needs to be set regardless of whether or not a parserContext exists\n if (astDeclaration.parent) {\n const parentApiItemMetadata: ApiItemMetadata = this.fetchApiItemMetadata(astDeclaration.parent);\n options.effectiveReleaseTag =\n options.declaredReleaseTag === ReleaseTag.None\n ? parentApiItemMetadata.effectiveReleaseTag\n : options.declaredReleaseTag;\n\n options.releaseTagSameAsParent =\n parentApiItemMetadata.effectiveReleaseTag === options.effectiveReleaseTag;\n } else {\n options.effectiveReleaseTag = options.declaredReleaseTag;\n }\n\n if (options.effectiveReleaseTag === ReleaseTag.None) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n // Don't report missing release tags for forgotten exports (unless we're including forgotten exports\n // in either the API report or doc model).\n const astSymbol: AstSymbol = astDeclaration.astSymbol;\n const entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astSymbol.rootAstSymbol);\n if (\n entity &&\n (entity.consumable ||\n this.extractorConfig.apiReportIncludeForgottenExports ||\n this.extractorConfig.docModelIncludeForgottenExports)\n ) {\n // We also don't report errors for the default export of an entry point, since its doc comment\n // isn't easy to obtain from the .d.ts file\n if (astSymbol.rootAstSymbol.localName !== '_default') {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingReleaseTag,\n `\"${entity.astEntity.localName}\" is part of the package's API, but it is missing ` +\n `a release tag (@alpha, @beta, @public, or @internal)`,\n astSymbol\n );\n }\n }\n }\n\n options.effectiveReleaseTag = ReleaseTag.Public;\n }\n\n const apiItemMetadata: ApiItemMetadata = new ApiItemMetadata(options);\n if (parserContext) {\n apiItemMetadata.tsdocComment = parserContext.docComment;\n }\n\n astDeclaration.apiItemMetadata = apiItemMetadata;\n\n // Lastly, share the result with any ancillary declarations\n for (const ancillaryDeclaration of declarationMetadata.ancillaryDeclarations) {\n ancillaryDeclaration.apiItemMetadata = apiItemMetadata;\n }\n }\n\n private _parseTsdocForAstDeclaration(astDeclaration: AstDeclaration): tsdoc.ParserContext | undefined {\n const declaration: ts.Declaration = astDeclaration.declaration;\n let nodeForComment: ts.Node = declaration;\n\n if (ts.isVariableDeclaration(declaration)) {\n // Variable declarations are special because they can be combined into a list. For example:\n //\n // /** A */ export /** B */ const /** C */ x = 1, /** D **/ [ /** E */ y, z] = [3, 4];\n //\n // The compiler will only emit comments A and C in the .d.ts file, so in general there isn't a well-defined\n // way to document these parts. API Extractor requires you to break them into separate exports like this:\n //\n // /** A */ export const x = 1;\n //\n // But _getReleaseTagForDeclaration() still receives a node corresponding to \"x\", so we need to walk upwards\n // and find the containing statement in order for getJSDocCommentRanges() to read the comment that we expect.\n const statement: ts.VariableStatement | undefined = TypeScriptHelpers.findFirstParent(\n declaration,\n ts.SyntaxKind.VariableStatement\n ) as ts.VariableStatement | undefined;\n if (statement !== undefined) {\n // For a compound declaration, fall back to looking for C instead of A\n if (statement.declarationList.declarations.length === 1) {\n nodeForComment = statement;\n }\n }\n }\n\n const sourceFileText: string = declaration.getSourceFile().text;\n const ranges: ts.CommentRange[] =\n TypeScriptInternals.getJSDocCommentRanges(nodeForComment, sourceFileText) || [];\n\n if (ranges.length === 0) {\n return undefined;\n }\n\n // We use the JSDoc comment block that is closest to the definition, i.e.\n // the last one preceding it\n const range: ts.TextRange = ranges[ranges.length - 1];\n\n const tsdocTextRange: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n sourceFileText,\n range.pos,\n range.end\n );\n\n const parserContext: tsdoc.ParserContext = this._tsdocParser.parseRange(tsdocTextRange);\n\n this.messageRouter.addTsdocMessages(parserContext, declaration.getSourceFile(), astDeclaration);\n\n // We delete the @privateRemarks block as early as possible, to ensure that it never leaks through\n // into one of the output files.\n parserContext.docComment.privateRemarks = undefined;\n\n return parserContext;\n }\n\n private _collectReferenceDirectives(astEntity: AstEntity): void {\n // Here, we're collecting reference directives from source files that contain extracted\n // definitions (i.e. - files that contain `export class ...`, `export interface ...`, ...).\n // These references may or may not include the `preserve=\"true\" attribute. In TS < 5.5,\n // references that end up in .D.TS files may or may not be explicity written by the developer.\n // In TS >= 5.5, only references that are explicitly authored and are marked with\n // `preserve=\"true\"` are included in the output. See https://github.com/microsoft/TypeScript/pull/57681\n //\n // The calls to `_collectReferenceDirectivesFromSourceFiles` in this function are\n // preserving existing behavior, which is to include all reference directives\n // regardless of whether they are explicitly authored or not, but only in files that\n // contain definitions.\n\n if (astEntity instanceof AstSymbol) {\n const sourceFiles: ts.SourceFile[] = astEntity.astDeclarations.map((astDeclaration) =>\n astDeclaration.declaration.getSourceFile()\n );\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles, false);\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile];\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles, false);\n }\n }\n\n private _collectReferenceDirectivesFromSourceFiles(\n sourceFiles: Iterable<ts.SourceFile>,\n onlyIncludeExplicitlyPreserved: boolean\n ): void {\n const seenFilenames: Set<string> = new Set<string>();\n\n for (const sourceFile of sourceFiles) {\n if (sourceFile?.fileName) {\n const {\n fileName,\n typeReferenceDirectives,\n libReferenceDirectives,\n text: sourceFileText\n } = sourceFile;\n if (!seenFilenames.has(fileName)) {\n seenFilenames.add(fileName);\n\n for (const typeReferenceDirective of typeReferenceDirectives) {\n const name: string | undefined = this._getReferenceDirectiveFromSourceFile(\n sourceFileText,\n typeReferenceDirective,\n onlyIncludeExplicitlyPreserved\n );\n if (name) {\n this._dtsTypeReferenceDirectives.add(name);\n }\n }\n\n for (const libReferenceDirective of libReferenceDirectives) {\n const reference: string | undefined = this._getReferenceDirectiveFromSourceFile(\n sourceFileText,\n libReferenceDirective,\n onlyIncludeExplicitlyPreserved\n );\n if (reference) {\n this._dtsLibReferenceDirectives.add(reference);\n }\n }\n }\n }\n }\n }\n\n private _getReferenceDirectiveFromSourceFile(\n sourceFileText: string,\n { pos, end, preserve }: ts.FileReference,\n onlyIncludeExplicitlyPreserved: boolean\n ): string | undefined {\n const reference: string = sourceFileText.substring(pos, end);\n if (preserve || !onlyIncludeExplicitlyPreserved) {\n return reference;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Collector.js","sourceRoot":"","sources":["../../src/collector/Collector.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,wDAA0C;AAC1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B,CAAC;wBACF,IAAI,SAAS,EAAE,CAAC;4BACd,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;wBACjD,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,oCAAoC,CAC1C,cAAsB,EACtB,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAoB,EACxC,8BAAuC;QAEvC,MAAM,SAAS,GAAW,cAAc,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC7D,IAAI,QAAQ,IAAI,CAAC,8BAA8B,EAAE,CAAC;YAChD,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAxgCD,8BAwgCC","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 ts from 'typescript';\nimport * as tsdoc from '@microsoft/tsdoc';\nimport {\n PackageJsonLookup,\n Sort,\n InternalError,\n type INodePackageJson,\n PackageName\n} from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\nimport { minimatch } from 'minimatch';\n\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\n\nimport { CollectorEntity } from './CollectorEntity';\nimport { AstSymbolTable } from '../analyzer/AstSymbolTable';\nimport type { AstEntity } from '../analyzer/AstEntity';\nimport type { AstModule, IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { AstDeclaration } from '../analyzer/AstDeclaration';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { WorkingPackage } from './WorkingPackage';\nimport { PackageDocComment } from '../aedoc/PackageDocComment';\nimport { type DeclarationMetadata, InternalDeclarationMetadata } from './DeclarationMetadata';\nimport { ApiItemMetadata, type IApiItemMetadataOptions } from './ApiItemMetadata';\nimport { SymbolMetadata } from './SymbolMetadata';\nimport { TypeScriptInternals, type IGlobalVariableAnalyzer } from '../analyzer/TypeScriptInternals';\nimport type { MessageRouter } from './MessageRouter';\nimport { AstReferenceResolver } from '../analyzer/AstReferenceResolver';\nimport { ExtractorConfig } from '../api/ExtractorConfig';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport { AstImport } from '../analyzer/AstImport';\nimport type { SourceMapper } from './SourceMapper';\n\n/**\n * Options for Collector constructor.\n */\nexport interface ICollectorOptions {\n /**\n * Configuration for the TypeScript compiler. The most important options to set are:\n *\n * - target: ts.ScriptTarget.ES5\n * - module: ts.ModuleKind.CommonJS\n * - moduleResolution: ts.ModuleResolutionKind.NodeJs\n * - rootDir: inputFolder\n */\n program: ts.Program;\n\n messageRouter: MessageRouter;\n\n extractorConfig: ExtractorConfig;\n\n sourceMapper: SourceMapper;\n}\n\n/**\n * The `Collector` manages the overall data set that is used by `ApiModelGenerator`,\n * `DtsRollupGenerator`, and `ApiReportGenerator`. Starting from the working package's entry point,\n * the `Collector` collects all exported symbols, determines how to import any symbols they reference,\n * assigns unique names, and sorts everything into a normalized alphabetical ordering.\n */\nexport class Collector {\n public readonly program: ts.Program;\n public readonly typeChecker: ts.TypeChecker;\n public readonly globalVariableAnalyzer: IGlobalVariableAnalyzer;\n public readonly astSymbolTable: AstSymbolTable;\n public readonly astReferenceResolver: AstReferenceResolver;\n\n public readonly packageJsonLookup: PackageJsonLookup;\n public readonly messageRouter: MessageRouter;\n\n public readonly workingPackage: WorkingPackage;\n\n public readonly extractorConfig: ExtractorConfig;\n\n public readonly sourceMapper: SourceMapper;\n\n /**\n * The `ExtractorConfig.bundledPackages` names in a set.\n */\n public readonly bundledPackageNames: ReadonlySet<string>;\n\n private readonly _program: ts.Program;\n\n private readonly _tsdocParser: tsdoc.TSDocParser;\n\n private _astEntryPoint: AstModule | undefined;\n\n private readonly _entities: CollectorEntity[] = [];\n private readonly _entitiesByAstEntity: Map<AstEntity, CollectorEntity> = new Map<\n AstEntity,\n CollectorEntity\n >();\n private readonly _entitiesBySymbol: Map<ts.Symbol, CollectorEntity> = new Map<ts.Symbol, CollectorEntity>();\n\n private readonly _starExportedExternalModulePaths: string[] = [];\n\n private readonly _dtsTypeReferenceDirectives: Set<string> = new Set<string>();\n private readonly _dtsLibReferenceDirectives: Set<string> = new Set<string>();\n\n // Used by getOverloadIndex()\n private readonly _cachedOverloadIndexesByDeclaration: Map<AstDeclaration, number>;\n\n public constructor(options: ICollectorOptions) {\n this.packageJsonLookup = new PackageJsonLookup();\n\n this._program = options.program;\n this.extractorConfig = options.extractorConfig;\n this.sourceMapper = options.sourceMapper;\n\n const entryPointSourceFile: ts.SourceFile | undefined = options.program.getSourceFile(\n this.extractorConfig.mainEntryPointFilePath\n );\n\n if (!entryPointSourceFile) {\n throw new Error('Unable to load file: ' + this.extractorConfig.mainEntryPointFilePath);\n }\n\n if (!this.extractorConfig.packageFolder || !this.extractorConfig.packageJson) {\n // TODO: We should be able to analyze projects that don't have any package.json.\n // The ExtractorConfig class is already designed to allow this.\n throw new Error('Unable to find a package.json file for the project being analyzed');\n }\n\n this.workingPackage = new WorkingPackage({\n packageFolder: this.extractorConfig.packageFolder,\n packageJson: this.extractorConfig.packageJson,\n entryPointSourceFile\n });\n\n this.messageRouter = options.messageRouter;\n\n this.program = options.program;\n this.typeChecker = options.program.getTypeChecker();\n this.globalVariableAnalyzer = TypeScriptInternals.getGlobalVariableAnalyzer(this.program);\n\n this._tsdocParser = new tsdoc.TSDocParser(this.extractorConfig.tsdocConfiguration);\n\n // Resolve package name patterns and store concrete set of bundled package dependency names\n this.bundledPackageNames = Collector._resolveBundledPackagePatterns(\n this.extractorConfig.bundledPackages,\n this.extractorConfig.packageJson\n );\n\n this.astSymbolTable = new AstSymbolTable(\n this.program,\n this.typeChecker,\n this.packageJsonLookup,\n this.bundledPackageNames,\n this.messageRouter\n );\n this.astReferenceResolver = new AstReferenceResolver(this);\n\n this._cachedOverloadIndexesByDeclaration = new Map<AstDeclaration, number>();\n }\n\n /**\n * Resolve provided `bundledPackages` names and glob patterns to a list of explicit package names.\n *\n * @remarks\n * Explicit package names will be included in the output unconditionally. However, wildcard patterns will\n * only be matched against the various dependencies listed in the provided package.json (if there was one).\n * Patterns will be matched against `dependencies`, `devDependencies`, `optionalDependencies`, and `peerDependencies`.\n *\n * @param bundledPackages - The list of package names and/or glob patterns to resolve.\n * @param packageJson - The package.json of the package being processed (if there is one).\n * @returns The set of resolved package names to be bundled during analysis.\n */\n private static _resolveBundledPackagePatterns(\n bundledPackages: string[],\n packageJson: INodePackageJson | undefined\n ): ReadonlySet<string> {\n if (bundledPackages.length === 0) {\n // If no `bundledPackages` were specified, then there is nothing to resolve.\n // Return an empty set.\n return new Set<string>();\n }\n\n // Accumulate all declared dependencies.\n // Any wildcard patterns in `bundledPackages` will be resolved against these.\n const dependencyNames: Set<string> = new Set<string>();\n Object.keys(packageJson?.dependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.devDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.peerDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n Object.keys(packageJson?.optionalDependencies ?? {}).forEach((dep) => dependencyNames.add(dep));\n\n // The set of resolved package names to be populated and returned\n const resolvedPackageNames: Set<string> = new Set<string>();\n\n for (const packageNameOrPattern of bundledPackages) {\n // If the string is an exact package name, use it regardless of package.json contents\n if (PackageName.isValidName(packageNameOrPattern)) {\n resolvedPackageNames.add(packageNameOrPattern);\n } else {\n // If the entry isn't an exact package name, assume glob pattern and search for matches\n for (const dependencyName of dependencyNames) {\n if (minimatch(dependencyName, packageNameOrPattern)) {\n resolvedPackageNames.add(dependencyName);\n }\n }\n }\n }\n return resolvedPackageNames;\n }\n\n /**a\n * Returns a list of names (e.g. \"example-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference types=\"example-library\" />\n * ```\n */\n public get dtsTypeReferenceDirectives(): ReadonlySet<string> {\n return this._dtsTypeReferenceDirectives;\n }\n\n /**\n * A list of names (e.g. \"runtime-library\") that should appear in a reference like this:\n *\n * ```\n * /// <reference lib=\"runtime-library\" />\n * ```\n */\n public get dtsLibReferenceDirectives(): ReadonlySet<string> {\n return this._dtsLibReferenceDirectives;\n }\n\n public get entities(): ReadonlyArray<CollectorEntity> {\n return this._entities;\n }\n\n /**\n * A list of module specifiers (e.g. `\"@rushstack/node-core-library/lib/FileSystem\"`) that should be emitted\n * as star exports (e.g. `export * from \"@rushstack/node-core-library/lib/FileSystem\"`).\n */\n public get starExportedExternalModulePaths(): ReadonlyArray<string> {\n return this._starExportedExternalModulePaths;\n }\n\n /**\n * Perform the analysis.\n */\n public analyze(): void {\n if (this._astEntryPoint) {\n throw new Error('DtsRollupGenerator.analyze() was already called');\n }\n\n // This runs a full type analysis, and then augments the Abstract Syntax Tree (i.e. declarations)\n // with semantic information (i.e. symbols). The \"diagnostics\" are a subset of the everyday\n // compile errors that would result from a full compilation.\n for (const diagnostic of this._program.getSemanticDiagnostics()) {\n this.messageRouter.addCompilerDiagnostic(diagnostic);\n }\n\n const sourceFiles: readonly ts.SourceFile[] = this.program.getSourceFiles();\n\n if (this.messageRouter.showDiagnostics) {\n this.messageRouter.logDiagnosticHeader('Root filenames');\n for (const fileName of this.program.getRootFileNames()) {\n this.messageRouter.logDiagnostic(fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n\n this.messageRouter.logDiagnosticHeader('Files analyzed by compiler');\n for (const sourceFile of sourceFiles) {\n this.messageRouter.logDiagnostic(sourceFile.fileName);\n }\n this.messageRouter.logDiagnosticFooter();\n }\n\n // We can throw this error earlier in CompilerState.ts, but intentionally wait until after we've logged the\n // associated diagnostic message above to make debugging easier for developers.\n // Typically there will be many such files -- to avoid too much noise, only report the first one.\n const badSourceFile: ts.SourceFile | undefined = sourceFiles.find(\n ({ fileName }) => !ExtractorConfig.hasDtsFileExtension(fileName)\n );\n if (badSourceFile) {\n this.messageRouter.addAnalyzerIssueForPosition(\n ExtractorMessageId.WrongInputFileType,\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 badSourceFile,\n 0\n );\n }\n\n // Build the entry point\n const entryPointSourceFile: ts.SourceFile = this.workingPackage.entryPointSourceFile;\n\n const astEntryPoint: AstModule =\n this.astSymbolTable.fetchAstModuleFromWorkingPackage(entryPointSourceFile);\n this._astEntryPoint = astEntryPoint;\n\n const packageDocCommentTextRange: ts.TextRange | undefined = PackageDocComment.tryFindInSourceFile(\n entryPointSourceFile,\n this\n );\n\n if (packageDocCommentTextRange) {\n const range: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n entryPointSourceFile.text,\n packageDocCommentTextRange.pos,\n packageDocCommentTextRange.end\n );\n\n this.workingPackage.tsdocParserContext = this._tsdocParser.parseRange(range);\n\n this.messageRouter.addTsdocMessages(this.workingPackage.tsdocParserContext, entryPointSourceFile);\n\n this.workingPackage.tsdocComment = this.workingPackage.tsdocParserContext!.docComment;\n }\n\n const { exportedLocalEntities, starExportedExternalModules, visitedAstModules }: IAstModuleExportInfo =\n this.astSymbolTable.fetchAstModuleExportInfo(astEntryPoint);\n\n // Create a CollectorEntity for each top-level export.\n const processedAstEntities: AstEntity[] = [];\n for (const [exportName, astEntity] of exportedLocalEntities) {\n this._createCollectorEntity(astEntity, exportName);\n processedAstEntities.push(astEntity);\n }\n\n // Recursively create the remaining CollectorEntities after the top-level entities\n // have been processed.\n const alreadySeenAstEntities: Set<AstEntity> = new Set<AstEntity>();\n for (const astEntity of processedAstEntities) {\n this._recursivelyCreateEntities(astEntity, alreadySeenAstEntities);\n if (astEntity instanceof AstSymbol) {\n this.fetchSymbolMetadata(astEntity);\n }\n }\n\n // Ensure references are collected from any intermediate files that\n // only include exports\n const nonExternalSourceFiles: Set<ts.SourceFile> = new Set();\n for (const { sourceFile, isExternal } of visitedAstModules) {\n if (!nonExternalSourceFiles.has(sourceFile) && !isExternal) {\n nonExternalSourceFiles.add(sourceFile);\n }\n }\n\n // Here, we're collecting reference directives from all non-external source files\n // that were encountered while looking for exports, but only those references that\n // were explicitly written by the developer and marked with the `preserve=\"true\"`\n // attribute. In TS >= 5.5, only references that are explicitly authored and marked\n // with `preserve=\"true\"` are included in the output. See https://github.com/microsoft/TypeScript/pull/57681\n //\n // The `_collectReferenceDirectives` function pulls in all references in files that\n // contain definitions, but does not examine files that only reexport from other\n // files. Here, we're looking through files that were missed by `_collectReferenceDirectives`,\n // but only collecting references that were explicitly marked with `preserve=\"true\"`.\n // It is intuitive for developers to include references that they explicitly want part of\n // their public API in a file like the entrypoint, which is likely to only contain reexports,\n // and this picks those up.\n this._collectReferenceDirectivesFromSourceFiles(nonExternalSourceFiles, true);\n\n this._makeUniqueNames();\n\n for (const starExportedExternalModule of starExportedExternalModules) {\n if (starExportedExternalModule.externalModulePath !== undefined) {\n this._starExportedExternalModulePaths.push(starExportedExternalModule.externalModulePath);\n }\n }\n\n Sort.sortBy(this._entities, (x) => x.getSortKey());\n Sort.sortSet(this._dtsTypeReferenceDirectives);\n Sort.sortSet(this._dtsLibReferenceDirectives);\n this._starExportedExternalModulePaths.sort();\n }\n\n /**\n * For a given ts.Identifier that is part of an AstSymbol that we analyzed, return the CollectorEntity that\n * it refers to. Returns undefined if it doesn't refer to anything interesting.\n * @remarks\n * Throws an Error if the ts.Identifier is not part of node tree that was analyzed.\n */\n public tryGetEntityForNode(identifier: ts.Identifier | ts.ImportTypeNode): CollectorEntity | undefined {\n const astEntity: AstEntity | undefined = this.astSymbolTable.tryGetEntityForNode(identifier);\n if (astEntity) {\n return this._entitiesByAstEntity.get(astEntity);\n }\n return undefined;\n }\n\n /**\n * For a given analyzed ts.Symbol, return the CollectorEntity that it refers to. Returns undefined if it\n * doesn't refer to anything interesting.\n */\n public tryGetEntityForSymbol(symbol: ts.Symbol): CollectorEntity | undefined {\n return this._entitiesBySymbol.get(symbol);\n }\n\n /**\n * Returns the associated `CollectorEntity` for the given `astEntity`, if one was created during analysis.\n */\n public tryGetCollectorEntity(astEntity: AstEntity): CollectorEntity | undefined {\n return this._entitiesByAstEntity.get(astEntity);\n }\n\n public fetchSymbolMetadata(astSymbol: AstSymbol): SymbolMetadata {\n if (astSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol);\n }\n return astSymbol.symbolMetadata as SymbolMetadata;\n }\n\n public fetchDeclarationMetadata(astDeclaration: AstDeclaration): DeclarationMetadata {\n if (astDeclaration.declarationMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the DeclarationMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.declarationMetadata as DeclarationMetadata;\n }\n\n public fetchApiItemMetadata(astDeclaration: AstDeclaration): ApiItemMetadata {\n if (astDeclaration.apiItemMetadata === undefined) {\n // Fetching the SymbolMetadata always constructs the ApiItemMetadata\n this._fetchSymbolMetadata(astDeclaration.astSymbol);\n }\n return astDeclaration.apiItemMetadata as ApiItemMetadata;\n }\n\n public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined {\n if (astEntity instanceof AstSymbol) {\n return this.fetchSymbolMetadata(astEntity);\n }\n if (astEntity instanceof AstImport) {\n if (astEntity.astSymbol) {\n return this.fetchSymbolMetadata(astEntity.astSymbol);\n }\n }\n return undefined;\n }\n\n public isAncillaryDeclaration(astDeclaration: AstDeclaration): boolean {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n return declarationMetadata.isAncillary;\n }\n\n public getNonAncillaryDeclarations(astSymbol: AstSymbol): ReadonlyArray<AstDeclaration> {\n const result: AstDeclaration[] = [];\n for (const astDeclaration of astSymbol.astDeclarations) {\n const declarationMetadata: DeclarationMetadata = this.fetchDeclarationMetadata(astDeclaration);\n if (!declarationMetadata.isAncillary) {\n result.push(astDeclaration);\n }\n }\n return result;\n }\n\n /**\n * Removes the leading underscore, for example: \"_Example\" --> \"example*Example*_\"\n *\n * @remarks\n * This causes internal definitions to sort alphabetically case-insensitive, then case-sensitive, and\n * initially ignoring the underscore prefix, while still deterministically comparing it.\n * The star is used as a delimiter because it is not a legal identifier character.\n */\n public static getSortKeyIgnoringUnderscore(identifier: string | undefined): string {\n if (!identifier) return '';\n\n let parts: string[];\n\n if (identifier[0] === '_') {\n const withoutUnderscore: string = identifier.substr(1);\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\n } else {\n parts = [identifier.toLowerCase(), '*', identifier];\n }\n\n return parts.join('');\n }\n\n /**\n * For function-like signatures, this returns the TSDoc \"overload index\" which can be used to identify\n * a specific overload.\n */\n public getOverloadIndex(astDeclaration: AstDeclaration): number {\n const allDeclarations: ReadonlyArray<AstDeclaration> = astDeclaration.astSymbol.astDeclarations;\n if (allDeclarations.length === 1) {\n return 1; // trivial case\n }\n\n let overloadIndex: number | undefined = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n\n if (overloadIndex === undefined) {\n // TSDoc index selectors are positive integers counting from 1\n let nextIndex: number = 1;\n for (const other of allDeclarations) {\n // Filter out other declarations that are not overloads. For example, an overloaded function can also\n // be a namespace.\n if (other.declaration.kind === astDeclaration.declaration.kind) {\n this._cachedOverloadIndexesByDeclaration.set(other, nextIndex);\n ++nextIndex;\n }\n }\n overloadIndex = this._cachedOverloadIndexesByDeclaration.get(astDeclaration);\n }\n\n if (overloadIndex === undefined) {\n // This should never happen\n throw new InternalError('Error calculating overload index for declaration');\n }\n\n return overloadIndex;\n }\n\n private _createCollectorEntity(\n astEntity: AstEntity,\n exportName?: string,\n parent?: CollectorEntity\n ): CollectorEntity {\n let entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\n\n if (!entity) {\n entity = new CollectorEntity(astEntity);\n\n this._entitiesByAstEntity.set(astEntity, entity);\n if (astEntity instanceof AstSymbol) {\n this._entitiesBySymbol.set(astEntity.followedSymbol, entity);\n } else if (astEntity instanceof AstNamespaceImport) {\n this._entitiesBySymbol.set(astEntity.symbol, entity);\n }\n this._entities.push(entity);\n this._collectReferenceDirectives(astEntity);\n }\n\n if (exportName) {\n if (parent) {\n entity.addLocalExportName(exportName, parent);\n } else {\n entity.addExportName(exportName);\n }\n }\n\n return entity;\n }\n\n private _recursivelyCreateEntities(astEntity: AstEntity, alreadySeenAstEntities: Set<AstEntity>): void {\n if (alreadySeenAstEntities.has(astEntity)) return;\n alreadySeenAstEntities.add(astEntity);\n\n if (astEntity instanceof AstSymbol) {\n astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => {\n for (const referencedAstEntity of astDeclaration.referencedAstEntities) {\n if (referencedAstEntity instanceof AstSymbol) {\n // We only create collector entities for root-level symbols. For example, if a symbol is\n // nested inside a namespace, only the namespace gets a collector entity. Note that this\n // is not true for AstNamespaceImports below.\n if (referencedAstEntity.parentAstSymbol === undefined) {\n this._createCollectorEntity(referencedAstEntity);\n }\n } else {\n this._createCollectorEntity(referencedAstEntity);\n }\n\n this._recursivelyCreateEntities(referencedAstEntity, alreadySeenAstEntities);\n }\n });\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(this);\n const parentEntity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity);\n if (!parentEntity) {\n // This should never happen, as we've already created entities for all AstNamespaceImports.\n throw new InternalError(\n `Failed to get CollectorEntity for AstNamespaceImport with namespace name \"${astEntity.namespaceName}\"`\n );\n }\n\n for (const [localExportName, localAstEntity] of astModuleExportInfo.exportedLocalEntities) {\n // Create a CollectorEntity for each local export within an AstNamespaceImport entity.\n this._createCollectorEntity(localAstEntity, localExportName, parentEntity);\n this._recursivelyCreateEntities(localAstEntity, alreadySeenAstEntities);\n }\n }\n }\n\n /**\n * Ensures a unique name for each item in the package typings file.\n */\n private _makeUniqueNames(): void {\n // The following examples illustrate the nameForEmit heuristics:\n //\n // Example 1:\n // class X { } <--- nameForEmit should be \"A\" to simplify things and reduce possibility of conflicts\n // export { X as A };\n //\n // Example 2:\n // class X { } <--- nameForEmit should be \"X\" because choosing A or B would be nondeterministic\n // export { X as A };\n // export { X as B };\n //\n // Example 3:\n // class X { } <--- nameForEmit should be \"X_1\" because Y has a stronger claim to the name\n // export { X as A };\n // export { X as B };\n // class Y { } <--- nameForEmit should be \"X\"\n // export { Y as X };\n\n // Set of names that should NOT be used when generating a unique nameForEmit\n const usedNames: Set<string> = new Set<string>();\n\n // First collect the names of explicit package exports, and perform a sanity check.\n for (const entity of this._entities) {\n for (const exportName of entity.exportNames) {\n if (usedNames.has(exportName)) {\n // This should be impossible\n throw new InternalError(`A package cannot have two exports with the name \"${exportName}\"`);\n }\n usedNames.add(exportName);\n }\n }\n\n // Ensure that each entity has a unique nameForEmit\n for (const entity of this._entities) {\n // What name would we ideally want to emit it as?\n let idealNameForEmit: string;\n\n // If this entity is exported exactly once, then we prefer the exported name\n if (\n entity.singleExportName !== undefined &&\n entity.singleExportName !== ts.InternalSymbolName.Default\n ) {\n idealNameForEmit = entity.singleExportName;\n } else {\n // otherwise use the local name\n idealNameForEmit = entity.astEntity.localName;\n }\n\n if (idealNameForEmit.includes('.')) {\n // For an ImportType with a namespace chain, only the top namespace is imported.\n idealNameForEmit = idealNameForEmit.split('.')[0];\n }\n\n // If the idealNameForEmit happens to be the same as one of the exports, then we're safe to use that...\n if (entity.exportNames.has(idealNameForEmit)) {\n // ...except that if it conflicts with a global name, then the global name wins\n if (!this.globalVariableAnalyzer.hasGlobalName(idealNameForEmit)) {\n // ...also avoid \"default\" which can interfere with \"export { default } from 'some-module;'\"\n if (idealNameForEmit !== 'default') {\n entity.nameForEmit = idealNameForEmit;\n continue;\n }\n }\n }\n\n // Generate a unique name based on idealNameForEmit\n let suffix: number = 1;\n let nameForEmit: string = idealNameForEmit;\n\n // Choose a name that doesn't conflict with usedNames or a global name\n while (\n nameForEmit === 'default' ||\n usedNames.has(nameForEmit) ||\n this.globalVariableAnalyzer.hasGlobalName(nameForEmit)\n ) {\n nameForEmit = `${idealNameForEmit}_${++suffix}`;\n }\n entity.nameForEmit = nameForEmit;\n usedNames.add(nameForEmit);\n }\n }\n\n private _fetchSymbolMetadata(astSymbol: AstSymbol): void {\n if (astSymbol.symbolMetadata) {\n return;\n }\n\n // When we solve an astSymbol, then we always also solve all of its parents and all of its declarations.\n // The parent is solved first.\n if (astSymbol.parentAstSymbol && astSymbol.parentAstSymbol.symbolMetadata === undefined) {\n this._fetchSymbolMetadata(astSymbol.parentAstSymbol);\n }\n\n // Construct the DeclarationMetadata objects, and detect any ancillary declarations\n this._calculateDeclarationMetadataForDeclarations(astSymbol);\n\n // Calculate the ApiItemMetadata objects\n for (const astDeclaration of astSymbol.astDeclarations) {\n this._calculateApiItemMetadata(astDeclaration);\n }\n\n // The most public effectiveReleaseTag for all declarations\n let maxEffectiveReleaseTag: ReleaseTag = ReleaseTag.None;\n\n for (const astDeclaration of astSymbol.astDeclarations) {\n // We know we solved this above\n const apiItemMetadata: ApiItemMetadata = astDeclaration.apiItemMetadata as ApiItemMetadata;\n\n const effectiveReleaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;\n\n if (effectiveReleaseTag > maxEffectiveReleaseTag) {\n maxEffectiveReleaseTag = effectiveReleaseTag;\n }\n }\n\n // Update this last when we're sure no exceptions were thrown\n astSymbol.symbolMetadata = new SymbolMetadata({\n maxEffectiveReleaseTag\n });\n }\n\n private _calculateDeclarationMetadataForDeclarations(astSymbol: AstSymbol): void {\n // Initialize DeclarationMetadata for each declaration\n for (const astDeclaration of astSymbol.astDeclarations) {\n if (astDeclaration.declarationMetadata) {\n throw new InternalError(\n 'AstDeclaration.declarationMetadata is not expected to have been initialized yet'\n );\n }\n\n const metadata: InternalDeclarationMetadata = new InternalDeclarationMetadata();\n metadata.tsdocParserContext = this._parseTsdocForAstDeclaration(astDeclaration);\n\n astDeclaration.declarationMetadata = metadata;\n }\n\n // Detect ancillary declarations\n for (const astDeclaration of astSymbol.astDeclarations) {\n // For a getter/setter pair, make the setter ancillary to the getter\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n let foundGetter: boolean = false;\n for (const getterAstDeclaration of astDeclaration.astSymbol.astDeclarations) {\n if (getterAstDeclaration.declaration.kind === ts.SyntaxKind.GetAccessor) {\n // Associate it with the getter\n this._addAncillaryDeclaration(getterAstDeclaration, astDeclaration);\n\n foundGetter = true;\n }\n }\n\n if (!foundGetter) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingGetter,\n `The property \"${astDeclaration.astSymbol.localName}\" has a setter but no getter.`,\n astDeclaration\n );\n }\n }\n }\n }\n\n private _addAncillaryDeclaration(\n mainAstDeclaration: AstDeclaration,\n ancillaryAstDeclaration: AstDeclaration\n ): void {\n const mainMetadata: InternalDeclarationMetadata =\n mainAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n const ancillaryMetadata: InternalDeclarationMetadata =\n ancillaryAstDeclaration.declarationMetadata as InternalDeclarationMetadata;\n\n if (mainMetadata.ancillaryDeclarations.indexOf(ancillaryAstDeclaration) >= 0) {\n return; // already added\n }\n\n if (mainAstDeclaration.astSymbol !== ancillaryAstDeclaration.astSymbol) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because declarations do not' +\n ' belong to the same symbol'\n );\n }\n\n if (mainMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the target is ancillary itself'\n );\n }\n\n if (ancillaryMetadata.isAncillary) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because source is already ancillary' +\n ' to another declaration'\n );\n }\n\n if (mainAstDeclaration.apiItemMetadata || ancillaryAstDeclaration.apiItemMetadata) {\n throw new InternalError(\n 'Invalid call to _addAncillaryDeclaration() because the API item metadata' +\n ' has already been constructed'\n );\n }\n\n ancillaryMetadata.isAncillary = true;\n mainMetadata.ancillaryDeclarations.push(ancillaryAstDeclaration);\n }\n\n private _calculateApiItemMetadata(astDeclaration: AstDeclaration): void {\n const declarationMetadata: InternalDeclarationMetadata =\n astDeclaration.declarationMetadata as InternalDeclarationMetadata;\n if (declarationMetadata.isAncillary) {\n if (astDeclaration.declaration.kind === ts.SyntaxKind.SetAccessor) {\n if (declarationMetadata.tsdocParserContext) {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.SetterWithDocs,\n `The doc comment for the property \"${astDeclaration.astSymbol.localName}\"` +\n ` must appear on the getter, not the setter.`,\n astDeclaration\n );\n }\n }\n\n // We never calculate ApiItemMetadata for an ancillary declaration; instead, it is assigned when\n // the main declaration is processed.\n return;\n }\n\n const options: IApiItemMetadataOptions = {\n declaredReleaseTag: ReleaseTag.None,\n effectiveReleaseTag: ReleaseTag.None,\n isEventProperty: false,\n isOverride: false,\n isSealed: false,\n isVirtual: false,\n isPreapproved: false,\n releaseTagSameAsParent: false\n };\n\n const parserContext: tsdoc.ParserContext | undefined = declarationMetadata.tsdocParserContext;\n if (parserContext) {\n const modifierTagSet: tsdoc.StandardModifierTagSet = parserContext.docComment.modifierTagSet;\n\n let declaredReleaseTag: ReleaseTag = ReleaseTag.None;\n let extraReleaseTags: boolean = false;\n\n if (modifierTagSet.isPublic()) {\n declaredReleaseTag = ReleaseTag.Public;\n }\n if (modifierTagSet.isBeta()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Beta;\n }\n }\n if (modifierTagSet.isAlpha()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Alpha;\n }\n }\n if (modifierTagSet.isInternal()) {\n if (declaredReleaseTag !== ReleaseTag.None) {\n extraReleaseTags = true;\n } else {\n declaredReleaseTag = ReleaseTag.Internal;\n }\n }\n\n if (extraReleaseTags) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.ExtraReleaseTag,\n 'The doc comment should not contain more than one release tag',\n astDeclaration\n );\n }\n }\n\n options.declaredReleaseTag = declaredReleaseTag;\n\n options.isEventProperty = modifierTagSet.isEventProperty();\n options.isOverride = modifierTagSet.isOverride();\n options.isSealed = modifierTagSet.isSealed();\n options.isVirtual = modifierTagSet.isVirtual();\n const preapprovedTag: tsdoc.TSDocTagDefinition | void =\n this.extractorConfig.tsdocConfiguration.tryGetTagDefinition('@preapproved');\n\n if (preapprovedTag && modifierTagSet.hasTag(preapprovedTag)) {\n // This feature only makes sense for potentially big declarations.\n switch (astDeclaration.declaration.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n case ts.SyntaxKind.EnumDeclaration:\n case ts.SyntaxKind.InterfaceDeclaration:\n case ts.SyntaxKind.ModuleDeclaration:\n if (declaredReleaseTag === ReleaseTag.Internal) {\n options.isPreapproved = true;\n } else {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedBadReleaseTag,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` without an @internal release tag`,\n astDeclaration\n );\n }\n break;\n default:\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.PreapprovedUnsupportedType,\n `The @preapproved tag cannot be applied to \"${astDeclaration.astSymbol.localName}\"` +\n ` because it is not a supported declaration type`,\n astDeclaration\n );\n break;\n }\n }\n }\n\n // This needs to be set regardless of whether or not a parserContext exists\n if (astDeclaration.parent) {\n const parentApiItemMetadata: ApiItemMetadata = this.fetchApiItemMetadata(astDeclaration.parent);\n options.effectiveReleaseTag =\n options.declaredReleaseTag === ReleaseTag.None\n ? parentApiItemMetadata.effectiveReleaseTag\n : options.declaredReleaseTag;\n\n options.releaseTagSameAsParent =\n parentApiItemMetadata.effectiveReleaseTag === options.effectiveReleaseTag;\n } else {\n options.effectiveReleaseTag = options.declaredReleaseTag;\n }\n\n if (options.effectiveReleaseTag === ReleaseTag.None) {\n if (!astDeclaration.astSymbol.isExternal) {\n // for now, don't report errors for external code\n // Don't report missing release tags for forgotten exports (unless we're including forgotten exports\n // in either the API report or doc model).\n const astSymbol: AstSymbol = astDeclaration.astSymbol;\n const entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astSymbol.rootAstSymbol);\n if (\n entity &&\n (entity.consumable ||\n this.extractorConfig.apiReportIncludeForgottenExports ||\n this.extractorConfig.docModelIncludeForgottenExports)\n ) {\n // We also don't report errors for the default export of an entry point, since its doc comment\n // isn't easy to obtain from the .d.ts file\n if (astSymbol.rootAstSymbol.localName !== '_default') {\n this.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.MissingReleaseTag,\n `\"${entity.astEntity.localName}\" is part of the package's API, but it is missing ` +\n `a release tag (@alpha, @beta, @public, or @internal)`,\n astSymbol\n );\n }\n }\n }\n\n options.effectiveReleaseTag = ReleaseTag.Public;\n }\n\n const apiItemMetadata: ApiItemMetadata = new ApiItemMetadata(options);\n if (parserContext) {\n apiItemMetadata.tsdocComment = parserContext.docComment;\n }\n\n astDeclaration.apiItemMetadata = apiItemMetadata;\n\n // Lastly, share the result with any ancillary declarations\n for (const ancillaryDeclaration of declarationMetadata.ancillaryDeclarations) {\n ancillaryDeclaration.apiItemMetadata = apiItemMetadata;\n }\n }\n\n private _parseTsdocForAstDeclaration(astDeclaration: AstDeclaration): tsdoc.ParserContext | undefined {\n const declaration: ts.Declaration = astDeclaration.declaration;\n let nodeForComment: ts.Node = declaration;\n\n if (ts.isVariableDeclaration(declaration)) {\n // Variable declarations are special because they can be combined into a list. For example:\n //\n // /** A */ export /** B */ const /** C */ x = 1, /** D **/ [ /** E */ y, z] = [3, 4];\n //\n // The compiler will only emit comments A and C in the .d.ts file, so in general there isn't a well-defined\n // way to document these parts. API Extractor requires you to break them into separate exports like this:\n //\n // /** A */ export const x = 1;\n //\n // But _getReleaseTagForDeclaration() still receives a node corresponding to \"x\", so we need to walk upwards\n // and find the containing statement in order for getJSDocCommentRanges() to read the comment that we expect.\n const statement: ts.VariableStatement | undefined = TypeScriptHelpers.findFirstParent(\n declaration,\n ts.SyntaxKind.VariableStatement\n ) as ts.VariableStatement | undefined;\n if (statement !== undefined) {\n // For a compound declaration, fall back to looking for C instead of A\n if (statement.declarationList.declarations.length === 1) {\n nodeForComment = statement;\n }\n }\n }\n\n const sourceFileText: string = declaration.getSourceFile().text;\n const ranges: ts.CommentRange[] =\n TypeScriptInternals.getJSDocCommentRanges(nodeForComment, sourceFileText) || [];\n\n if (ranges.length === 0) {\n return undefined;\n }\n\n // We use the JSDoc comment block that is closest to the definition, i.e.\n // the last one preceding it\n const range: ts.TextRange = ranges[ranges.length - 1];\n\n const tsdocTextRange: tsdoc.TextRange = tsdoc.TextRange.fromStringRange(\n sourceFileText,\n range.pos,\n range.end\n );\n\n const parserContext: tsdoc.ParserContext = this._tsdocParser.parseRange(tsdocTextRange);\n\n this.messageRouter.addTsdocMessages(parserContext, declaration.getSourceFile(), astDeclaration);\n\n // We delete the @privateRemarks block as early as possible, to ensure that it never leaks through\n // into one of the output files.\n parserContext.docComment.privateRemarks = undefined;\n\n return parserContext;\n }\n\n private _collectReferenceDirectives(astEntity: AstEntity): void {\n // Here, we're collecting reference directives from source files that contain extracted\n // definitions (i.e. - files that contain `export class ...`, `export interface ...`, ...).\n // These references may or may not include the `preserve=\"true\" attribute. In TS < 5.5,\n // references that end up in .D.TS files may or may not be explicity written by the developer.\n // In TS >= 5.5, only references that are explicitly authored and are marked with\n // `preserve=\"true\"` are included in the output. See https://github.com/microsoft/TypeScript/pull/57681\n //\n // The calls to `_collectReferenceDirectivesFromSourceFiles` in this function are\n // preserving existing behavior, which is to include all reference directives\n // regardless of whether they are explicitly authored or not, but only in files that\n // contain definitions.\n\n if (astEntity instanceof AstSymbol) {\n const sourceFiles: ts.SourceFile[] = astEntity.astDeclarations.map((astDeclaration) =>\n astDeclaration.declaration.getSourceFile()\n );\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles, false);\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile];\n return this._collectReferenceDirectivesFromSourceFiles(sourceFiles, false);\n }\n }\n\n private _collectReferenceDirectivesFromSourceFiles(\n sourceFiles: Iterable<ts.SourceFile>,\n onlyIncludeExplicitlyPreserved: boolean\n ): void {\n const seenFilenames: Set<string> = new Set<string>();\n\n for (const sourceFile of sourceFiles) {\n if (sourceFile?.fileName) {\n const {\n fileName,\n typeReferenceDirectives,\n libReferenceDirectives,\n text: sourceFileText\n } = sourceFile;\n if (!seenFilenames.has(fileName)) {\n seenFilenames.add(fileName);\n\n for (const typeReferenceDirective of typeReferenceDirectives) {\n const name: string | undefined = this._getReferenceDirectiveFromSourceFile(\n sourceFileText,\n typeReferenceDirective,\n onlyIncludeExplicitlyPreserved\n );\n if (name) {\n this._dtsTypeReferenceDirectives.add(name);\n }\n }\n\n for (const libReferenceDirective of libReferenceDirectives) {\n const reference: string | undefined = this._getReferenceDirectiveFromSourceFile(\n sourceFileText,\n libReferenceDirective,\n onlyIncludeExplicitlyPreserved\n );\n if (reference) {\n this._dtsLibReferenceDirectives.add(reference);\n }\n }\n }\n }\n }\n }\n\n private _getReferenceDirectiveFromSourceFile(\n sourceFileText: string,\n { pos, end, preserve }: ts.FileReference,\n onlyIncludeExplicitlyPreserved: boolean\n ): string | undefined {\n const reference: string = sourceFileText.substring(pos, end);\n if (preserve || !onlyIncludeExplicitlyPreserved) {\n return reference;\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReportGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/ApiReportGenerator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAgBnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAmB;IAEnD;;;;;;OAMG;WACW,4BAA4B,CACxC,iBAAiB,EAAE,MAAM,EACzB,mBAAmB,EAAE,MAAM,GAC1B,OAAO;IAOV;;;;;OAKG;WACW,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,GAAG,MAAM;IA6NtG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"ApiReportGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/ApiReportGenerator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAgBnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAmB;IAEnD;;;;;;OAMG;WACW,4BAA4B,CACxC,iBAAiB,EAAE,MAAM,EACzB,mBAAmB,EAAE,MAAM,GAC1B,OAAO;IAOV;;;;;OAKG;WACW,yBAAyB,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,GAAG,MAAM;IA6NtG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA6L1B,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAgBxC,OAAO,CAAC,MAAM,CAAC,wBAAwB;IA8BvC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IA8CxC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAuFhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAQpC"}
|
|
@@ -242,7 +242,6 @@ class ApiReportGenerator {
|
|
|
242
242
|
*/
|
|
243
243
|
static _modifySpan(collector, span, entity, astDeclaration, insideTypeLiteral, reportVariant) {
|
|
244
244
|
// Should we process this declaration at all?
|
|
245
|
-
// eslint-disable-next-line no-bitwise
|
|
246
245
|
if (!ApiReportGenerator._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) {
|
|
247
246
|
span.modification.skipAll();
|
|
248
247
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReport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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 ts from 'typescript';\nimport { Text, InternalError } from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\n\nimport { Collector } from '../collector/Collector';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { Span } from '../analyzer/Span';\nimport type { CollectorEntity } from '../collector/CollectorEntity';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport type { ApiItemMetadata } from '../collector/ApiItemMetadata';\nimport { AstImport } from '../analyzer/AstImport';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { ExtractorMessage } from '../api/ExtractorMessage';\nimport { IndentedWriter } from './IndentedWriter';\nimport { DtsEmitHelpers } from './DtsEmitHelpers';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport type { AstEntity } from '../analyzer/AstEntity';\nimport type { IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter';\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\nimport type { ApiReportVariant } from '../api/IConfigFile';\nimport type { SymbolMetadata } from '../collector/SymbolMetadata';\n\nexport class ApiReportGenerator {\n private static _trimSpacesRegExp: RegExp = / +$/gm;\n\n /**\n * Compares the contents of two API files that were created using ApiFileGenerator,\n * and returns true if they are equivalent. Note that these files are not normally edited\n * by a human; the \"equivalence\" comparison here is intended to ignore spurious changes that\n * might be introduced by a tool, e.g. Git newline normalization or an editor that strips\n * whitespace when saving.\n */\n public static areEquivalentApiFileContents(\n actualFileContent: string,\n expectedFileContent: string\n ): boolean {\n // NOTE: \"\\s\" also matches \"\\r\" and \"\\n\"\n const normalizedActual: string = actualFileContent.replace(/[\\s]+/g, ' ');\n const normalizedExpected: string = expectedFileContent.replace(/[\\s]+/g, ' ');\n return normalizedActual === normalizedExpected;\n }\n\n /**\n * Generates and returns the API report contents as a string.\n *\n * @param reportVariant - The release level with which the report is associated.\n * Can also be viewed as the minimal release level of items that should be included in the report.\n */\n public static generateReviewFileContent(collector: Collector, reportVariant: ApiReportVariant): string {\n const writer: IndentedWriter = new IndentedWriter();\n writer.trimLeadingSpaces = true;\n\n function capitalizeFirstLetter(input: string): string {\n return input === '' ? '' : `${input[0].toLocaleUpperCase()}${input.slice(1)}`;\n }\n\n // For backwards compatibility, don't emit \"complete\" in report text for untrimmed reports.\n const releaseLevelPrefix: string =\n reportVariant === 'complete' ? '' : `${capitalizeFirstLetter(reportVariant)} `;\n writer.writeLine(\n [\n `## ${releaseLevelPrefix}API Report File for \"${collector.workingPackage.name}\"`,\n ``,\n `> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).`,\n ``\n ].join('\\n')\n );\n\n // Write the opening delimiter for the Markdown code fence\n writer.writeLine('```ts\\n');\n\n // Emit the triple slash directives\n for (const typeDirectiveReference of Array.from(collector.dtsTypeReferenceDirectives).sort()) {\n // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162\n writer.writeLine(`/// <reference types=\"${typeDirectiveReference}\" />`);\n }\n for (const libDirectiveReference of Array.from(collector.dtsLibReferenceDirectives).sort()) {\n writer.writeLine(`/// <reference lib=\"${libDirectiveReference}\" />`);\n }\n writer.ensureSkippedLine();\n\n // Emit the imports\n for (const entity of collector.entities) {\n if (entity.astEntity instanceof AstImport) {\n DtsEmitHelpers.emitImport(writer, entity, entity.astEntity);\n }\n }\n writer.ensureSkippedLine();\n\n // Emit the regular declarations\n for (const entity of collector.entities) {\n const astEntity: AstEntity = entity.astEntity;\n const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity(astEntity);\n const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata?.maxEffectiveReleaseTag ?? ReleaseTag.None;\n\n if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, reportVariant)) {\n continue;\n }\n\n if (entity.consumable || collector.extractorConfig.apiReportIncludeForgottenExports) {\n // First, collect the list of export names for this symbol. When reporting messages with\n // ExtractorMessage.properties.exportName, this will enable us to emit the warning comments alongside\n // the associated export statement.\n interface IExportToEmit {\n readonly exportName: string;\n readonly associatedMessages: ExtractorMessage[];\n }\n const exportsToEmit: Map<string, IExportToEmit> = new Map<string, IExportToEmit>();\n\n for (const exportName of entity.exportNames) {\n if (!entity.shouldInlineExport) {\n exportsToEmit.set(exportName, { exportName, associatedMessages: [] });\n }\n }\n\n if (astEntity instanceof AstSymbol) {\n // Emit all the declarations for this entity\n for (const astDeclaration of astEntity.astDeclarations || []) {\n // Get the messages associated with this declaration\n const fetchedMessages: ExtractorMessage[] =\n collector.messageRouter.fetchAssociatedMessagesForReviewFile(astDeclaration);\n\n // Peel off the messages associated with an export statement and store them\n // in IExportToEmit.associatedMessages (to be processed later). The remaining messages will\n // added to messagesToReport, to be emitted next to the declaration instead of the export statement.\n const messagesToReport: ExtractorMessage[] = [];\n for (const message of fetchedMessages) {\n if (message.properties.exportName) {\n const exportToEmit: IExportToEmit | undefined = exportsToEmit.get(\n message.properties.exportName\n );\n if (exportToEmit) {\n exportToEmit.associatedMessages.push(message);\n continue;\n }\n }\n messagesToReport.push(message);\n }\n\n if (this._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) {\n writer.ensureSkippedLine();\n writer.write(ApiReportGenerator._getAedocSynopsis(collector, astDeclaration, messagesToReport));\n\n const span: Span = new Span(astDeclaration.declaration);\n\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n if (apiItemMetadata.isPreapproved) {\n ApiReportGenerator._modifySpanForPreapproved(span);\n } else {\n ApiReportGenerator._modifySpan(collector, span, entity, astDeclaration, false, reportVariant);\n }\n\n span.writeModifiedText(writer);\n writer.ensureNewLine();\n }\n }\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector);\n\n if (entity.nameForEmit === undefined) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n if (astModuleExportInfo.starExportedExternalModules.size > 0) {\n // We could support this, but we would need to find a way to safely represent it.\n throw new Error(\n `The ${entity.nameForEmit} namespace import includes a star export, which is not supported:\\n` +\n SourceFileLocationFormatter.formatDeclaration(astEntity.declaration)\n );\n }\n\n // Emit a synthetic declaration for the namespace. It will look like this:\n //\n // declare namespace example {\n // export {\n // f1,\n // f2\n // }\n // }\n //\n // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type\n // signatures may reference them directly (without using the namespace qualifier).\n\n writer.ensureSkippedLine();\n writer.writeLine(`declare namespace ${entity.nameForEmit} {`);\n\n // all local exports of local imported module are just references to top-level declarations\n writer.increaseIndent();\n writer.writeLine('export {');\n writer.increaseIndent();\n\n const exportClauses: string[] = [];\n for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) {\n const collectorEntity: CollectorEntity | undefined =\n collector.tryGetCollectorEntity(exportedEntity);\n if (collectorEntity === undefined) {\n // This should never happen\n // top-level exports of local imported module should be added as collector entities before\n throw new InternalError(\n `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`\n );\n }\n\n if (collectorEntity.nameForEmit === exportedName) {\n exportClauses.push(collectorEntity.nameForEmit);\n } else {\n exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`);\n }\n }\n writer.writeLine(exportClauses.join(',\\n'));\n\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"export { ... }\"\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"declare namespace { ... }\"\n }\n\n // Now emit the export statements for this entity.\n for (const exportToEmit of exportsToEmit.values()) {\n // Write any associated messages\n if (exportToEmit.associatedMessages.length > 0) {\n writer.ensureSkippedLine();\n for (const message of exportToEmit.associatedMessages) {\n ApiReportGenerator._writeLineAsComments(\n writer,\n 'Warning: ' + message.formatMessageWithoutLocation()\n );\n }\n }\n\n DtsEmitHelpers.emitNamedExport(writer, exportToEmit.exportName, entity);\n }\n writer.ensureSkippedLine();\n }\n }\n\n DtsEmitHelpers.emitStarExports(writer, collector);\n\n // Write the unassociated warnings at the bottom of the file\n const unassociatedMessages: ExtractorMessage[] =\n collector.messageRouter.fetchUnassociatedMessagesForReviewFile();\n if (unassociatedMessages.length > 0) {\n writer.ensureSkippedLine();\n ApiReportGenerator._writeLineAsComments(writer, 'Warnings were encountered during analysis:');\n ApiReportGenerator._writeLineAsComments(writer, '');\n for (const unassociatedMessage of unassociatedMessages) {\n ApiReportGenerator._writeLineAsComments(\n writer,\n unassociatedMessage.formatMessageWithLocation(collector.workingPackage.packageFolder)\n );\n }\n }\n\n if (collector.workingPackage.tsdocComment === undefined) {\n writer.ensureSkippedLine();\n ApiReportGenerator._writeLineAsComments(writer, '(No @packageDocumentation comment for this package)');\n }\n\n // Write the closing delimiter for the Markdown code fence\n writer.ensureSkippedLine();\n writer.writeLine('```');\n\n // Remove any trailing spaces\n return writer.toString().replace(ApiReportGenerator._trimSpacesRegExp, '');\n }\n\n /**\n * Before writing out a declaration, _modifySpan() applies various fixups to make it nice.\n */\n private static _modifySpan(\n collector: Collector,\n span: Span,\n entity: CollectorEntity,\n astDeclaration: AstDeclaration,\n insideTypeLiteral: boolean,\n reportVariant: ApiReportVariant\n ): void {\n // Should we process this declaration at all?\n // eslint-disable-next-line no-bitwise\n if (!ApiReportGenerator._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) {\n span.modification.skipAll();\n return;\n }\n\n const previousSpan: Span | undefined = span.previousSibling;\n\n let recurseChildren: boolean = true;\n let sortChildren: boolean = false;\n\n switch (span.kind) {\n case ts.SyntaxKind.JSDocComment:\n span.modification.skipAll();\n // For now, we don't transform JSDoc comment nodes at all\n recurseChildren = false;\n break;\n\n case ts.SyntaxKind.ExportKeyword:\n case ts.SyntaxKind.DefaultKeyword:\n case ts.SyntaxKind.DeclareKeyword:\n // Delete any explicit \"export\" or \"declare\" keywords -- we will re-add them below\n span.modification.skipAll();\n break;\n\n case ts.SyntaxKind.InterfaceKeyword:\n case ts.SyntaxKind.ClassKeyword:\n case ts.SyntaxKind.EnumKeyword:\n case ts.SyntaxKind.NamespaceKeyword:\n case ts.SyntaxKind.ModuleKeyword:\n case ts.SyntaxKind.TypeKeyword:\n case ts.SyntaxKind.FunctionKeyword:\n // Replace the stuff we possibly deleted above\n let replacedModifiers: string = '';\n\n if (entity.shouldInlineExport) {\n replacedModifiers = 'export ' + replacedModifiers;\n }\n\n if (previousSpan && previousSpan.kind === ts.SyntaxKind.SyntaxList) {\n // If there is a previous span of type SyntaxList, then apply it before any other modifiers\n // (e.g. \"abstract\") that appear there.\n previousSpan.modification.prefix = replacedModifiers + previousSpan.modification.prefix;\n } else {\n // Otherwise just stick it in front of this span\n span.modification.prefix = replacedModifiers + span.modification.prefix;\n }\n break;\n\n case ts.SyntaxKind.SyntaxList:\n if (span.parent) {\n if (AstDeclaration.isSupportedSyntaxKind(span.parent.kind)) {\n // If the immediate parent is an API declaration, and the immediate children are API declarations,\n // then sort the children alphabetically\n sortChildren = true;\n } else if (span.parent.kind === ts.SyntaxKind.ModuleBlock) {\n // Namespaces are special because their chain goes ModuleDeclaration -> ModuleBlock -> SyntaxList\n sortChildren = true;\n }\n }\n break;\n\n case ts.SyntaxKind.VariableDeclaration:\n if (!span.parent) {\n // The VariableDeclaration node is part of a VariableDeclarationList, however\n // the Entry.followedSymbol points to the VariableDeclaration part because\n // multiple definitions might share the same VariableDeclarationList.\n //\n // Since we are emitting a separate declaration for each one, we need to look upwards\n // in the ts.Node tree and write a copy of the enclosing VariableDeclarationList\n // content (e.g. \"var\" from \"var x=1, y=2\").\n const list: ts.VariableDeclarationList | undefined = TypeScriptHelpers.matchAncestor(span.node, [\n ts.SyntaxKind.VariableDeclarationList,\n ts.SyntaxKind.VariableDeclaration\n ]);\n if (!list) {\n // This should not happen unless the compiler API changes somehow\n throw new InternalError('Unsupported variable declaration');\n }\n const listPrefix: string = list\n .getSourceFile()\n .text.substring(list.getStart(), list.declarations[0].getStart());\n span.modification.prefix = listPrefix + span.modification.prefix;\n span.modification.suffix = ';';\n\n if (entity.shouldInlineExport) {\n span.modification.prefix = 'export ' + span.modification.prefix;\n }\n }\n break;\n\n case ts.SyntaxKind.Identifier:\n const referencedEntity: CollectorEntity | undefined = collector.tryGetEntityForNode(\n span.node as ts.Identifier\n );\n\n if (referencedEntity) {\n if (!referencedEntity.nameForEmit) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n span.modification.prefix = referencedEntity.nameForEmit;\n // For debugging:\n // span.modification.prefix += '/*R=FIX*/';\n } else {\n // For debugging:\n // span.modification.prefix += '/*R=KEEP*/';\n }\n\n break;\n\n case ts.SyntaxKind.TypeLiteral:\n insideTypeLiteral = true;\n break;\n\n case ts.SyntaxKind.ImportType:\n DtsEmitHelpers.modifyImportTypeSpan(\n collector,\n span,\n astDeclaration,\n (childSpan, childAstDeclaration) => {\n ApiReportGenerator._modifySpan(\n collector,\n childSpan,\n entity,\n childAstDeclaration,\n insideTypeLiteral,\n reportVariant\n );\n }\n );\n break;\n }\n\n if (recurseChildren) {\n for (const child of span.children) {\n let childAstDeclaration: AstDeclaration = astDeclaration;\n\n if (AstDeclaration.isSupportedSyntaxKind(child.kind)) {\n childAstDeclaration = collector.astSymbolTable.getChildAstDeclarationByNode(\n child.node,\n astDeclaration\n );\n\n if (ApiReportGenerator._shouldIncludeDeclaration(collector, childAstDeclaration, reportVariant)) {\n if (sortChildren) {\n span.modification.sortChildren = true;\n child.modification.sortKey = Collector.getSortKeyIgnoringUnderscore(\n childAstDeclaration.astSymbol.localName\n );\n }\n\n if (!insideTypeLiteral) {\n const messagesToReport: ExtractorMessage[] =\n collector.messageRouter.fetchAssociatedMessagesForReviewFile(childAstDeclaration);\n\n // NOTE: This generates ae-undocumented messages as a side effect\n const aedocSynopsis: string = ApiReportGenerator._getAedocSynopsis(\n collector,\n childAstDeclaration,\n messagesToReport\n );\n\n child.modification.prefix = aedocSynopsis + child.modification.prefix;\n }\n }\n }\n\n ApiReportGenerator._modifySpan(\n collector,\n child,\n entity,\n childAstDeclaration,\n insideTypeLiteral,\n reportVariant\n );\n }\n }\n }\n\n private static _shouldIncludeDeclaration(\n collector: Collector,\n astDeclaration: AstDeclaration,\n reportVariant: ApiReportVariant\n ): boolean {\n // Private declarations are not included in the API report\n // eslint-disable-next-line no-bitwise\n if ((astDeclaration.modifierFlags & ts.ModifierFlags.Private) !== 0) {\n return false;\n }\n\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n return this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, reportVariant);\n }\n\n private static _shouldIncludeReleaseTag(releaseTag: ReleaseTag, reportVariant: ApiReportVariant): boolean {\n switch (reportVariant) {\n case 'complete':\n return true;\n case 'alpha':\n return (\n releaseTag === ReleaseTag.Alpha ||\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n case 'beta':\n return (\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n case 'public':\n return (\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n default:\n throw new Error(`Unrecognized release level: ${reportVariant}`);\n }\n }\n\n /**\n * For declarations marked as `@preapproved`, this is used instead of _modifySpan().\n */\n private static _modifySpanForPreapproved(span: Span): void {\n // Match something like this:\n //\n // ClassDeclaration:\n // SyntaxList:\n // ExportKeyword: pre=[export] sep=[ ]\n // DeclareKeyword: pre=[declare] sep=[ ]\n // ClassKeyword: pre=[class] sep=[ ]\n // Identifier: pre=[_PreapprovedClass] sep=[ ]\n // FirstPunctuation: pre=[{] sep=[\\n\\n ]\n // SyntaxList:\n // ...\n // CloseBraceToken: pre=[}]\n //\n // or this:\n // ModuleDeclaration:\n // SyntaxList:\n // ExportKeyword: pre=[export] sep=[ ]\n // DeclareKeyword: pre=[declare] sep=[ ]\n // NamespaceKeyword: pre=[namespace] sep=[ ]\n // Identifier: pre=[_PreapprovedNamespace] sep=[ ]\n // ModuleBlock:\n // FirstPunctuation: pre=[{] sep=[\\n\\n ]\n // SyntaxList:\n // ...\n // CloseBraceToken: pre=[}]\n //\n // And reduce it to something like this:\n //\n // // @internal (undocumented)\n // class _PreapprovedClass { /* (preapproved) */ }\n //\n\n let skipRest: boolean = false;\n for (const child of span.children) {\n if (skipRest || child.kind === ts.SyntaxKind.SyntaxList || child.kind === ts.SyntaxKind.JSDocComment) {\n child.modification.skipAll();\n }\n if (child.kind === ts.SyntaxKind.Identifier) {\n skipRest = true;\n child.modification.omitSeparatorAfter = true;\n child.modification.suffix = ' { /* (preapproved) */ }';\n }\n }\n }\n\n /**\n * Writes a synopsis of the AEDoc comments, which indicates the release tag,\n * whether the item has been documented, and any warnings that were detected\n * by the analysis.\n */\n private static _getAedocSynopsis(\n collector: Collector,\n astDeclaration: AstDeclaration,\n messagesToReport: ExtractorMessage[]\n ): string {\n const writer: IndentedWriter = new IndentedWriter();\n\n for (const message of messagesToReport) {\n ApiReportGenerator._writeLineAsComments(writer, 'Warning: ' + message.formatMessageWithoutLocation());\n }\n\n if (!collector.isAncillaryDeclaration(astDeclaration)) {\n const footerParts: string[] = [];\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n // 1. Release tag (if present)\n if (!apiItemMetadata.releaseTagSameAsParent) {\n if (apiItemMetadata.effectiveReleaseTag !== ReleaseTag.None) {\n footerParts.push(ReleaseTag.getTagName(apiItemMetadata.effectiveReleaseTag));\n }\n }\n\n // 2. Enumerate configured tags, reporting standard system tags first and then other configured tags.\n // Note that the ordering we handle the standard tags is important for backwards compatibility.\n // Also note that we had special mechanisms for checking whether or not an item is documented with these tags,\n // so they are checked specially.\n const {\n '@sealed': reportSealedTag,\n '@virtual': reportVirtualTag,\n '@override': reportOverrideTag,\n '@eventProperty': reportEventPropertyTag,\n '@deprecated': reportDeprecatedTag,\n ...otherTagsToReport\n } = collector.extractorConfig.tagsToReport;\n\n // 2.a Check for standard tags and report those that are both configured and present in the metadata.\n if (reportSealedTag && apiItemMetadata.isSealed) {\n footerParts.push('@sealed');\n }\n if (reportVirtualTag && apiItemMetadata.isVirtual) {\n footerParts.push('@virtual');\n }\n if (reportOverrideTag && apiItemMetadata.isOverride) {\n footerParts.push('@override');\n }\n if (reportEventPropertyTag && apiItemMetadata.isEventProperty) {\n footerParts.push('@eventProperty');\n }\n if (reportDeprecatedTag && apiItemMetadata.tsdocComment?.deprecatedBlock) {\n footerParts.push('@deprecated');\n }\n\n // 2.b Check for other configured tags and report those that are present in the tsdoc metadata.\n for (const [tag, reportTag] of Object.entries(otherTagsToReport)) {\n if (reportTag) {\n // If the tag was not handled specially, check if it is present in the metadata.\n if (apiItemMetadata.tsdocComment?.customBlocks.some((block) => block.blockTag.tagName === tag)) {\n footerParts.push(tag);\n } else if (apiItemMetadata.tsdocComment?.modifierTagSet.hasTagName(tag)) {\n footerParts.push(tag);\n }\n }\n }\n\n // 3. If the item is undocumented, append notice at the end of the list\n if (apiItemMetadata.undocumented) {\n footerParts.push('(undocumented)');\n\n collector.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.Undocumented,\n `Missing documentation for \"${astDeclaration.astSymbol.localName}\".`,\n astDeclaration\n );\n }\n\n if (footerParts.length > 0) {\n if (messagesToReport.length > 0) {\n ApiReportGenerator._writeLineAsComments(writer, ''); // skip a line after the warnings\n }\n\n ApiReportGenerator._writeLineAsComments(writer, footerParts.join(' '));\n }\n }\n\n return writer.toString();\n }\n\n private static _writeLineAsComments(writer: IndentedWriter, line: string): void {\n const lines: string[] = Text.convertToLf(line).split('\\n');\n for (const realLine of lines) {\n writer.write('// ');\n writer.write(realLine);\n writer.writeLine();\n }\n }\n}\n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,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\nimport * as ts from 'typescript';\nimport { Text, InternalError } from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\n\nimport { Collector } from '../collector/Collector';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { Span } from '../analyzer/Span';\nimport type { CollectorEntity } from '../collector/CollectorEntity';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport type { ApiItemMetadata } from '../collector/ApiItemMetadata';\nimport { AstImport } from '../analyzer/AstImport';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { ExtractorMessage } from '../api/ExtractorMessage';\nimport { IndentedWriter } from './IndentedWriter';\nimport { DtsEmitHelpers } from './DtsEmitHelpers';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport type { AstEntity } from '../analyzer/AstEntity';\nimport type { IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter';\nimport { ExtractorMessageId } from '../api/ExtractorMessageId';\nimport type { ApiReportVariant } from '../api/IConfigFile';\nimport type { SymbolMetadata } from '../collector/SymbolMetadata';\n\nexport class ApiReportGenerator {\n private static _trimSpacesRegExp: RegExp = / +$/gm;\n\n /**\n * Compares the contents of two API files that were created using ApiFileGenerator,\n * and returns true if they are equivalent. Note that these files are not normally edited\n * by a human; the \"equivalence\" comparison here is intended to ignore spurious changes that\n * might be introduced by a tool, e.g. Git newline normalization or an editor that strips\n * whitespace when saving.\n */\n public static areEquivalentApiFileContents(\n actualFileContent: string,\n expectedFileContent: string\n ): boolean {\n // NOTE: \"\\s\" also matches \"\\r\" and \"\\n\"\n const normalizedActual: string = actualFileContent.replace(/[\\s]+/g, ' ');\n const normalizedExpected: string = expectedFileContent.replace(/[\\s]+/g, ' ');\n return normalizedActual === normalizedExpected;\n }\n\n /**\n * Generates and returns the API report contents as a string.\n *\n * @param reportVariant - The release level with which the report is associated.\n * Can also be viewed as the minimal release level of items that should be included in the report.\n */\n public static generateReviewFileContent(collector: Collector, reportVariant: ApiReportVariant): string {\n const writer: IndentedWriter = new IndentedWriter();\n writer.trimLeadingSpaces = true;\n\n function capitalizeFirstLetter(input: string): string {\n return input === '' ? '' : `${input[0].toLocaleUpperCase()}${input.slice(1)}`;\n }\n\n // For backwards compatibility, don't emit \"complete\" in report text for untrimmed reports.\n const releaseLevelPrefix: string =\n reportVariant === 'complete' ? '' : `${capitalizeFirstLetter(reportVariant)} `;\n writer.writeLine(\n [\n `## ${releaseLevelPrefix}API Report File for \"${collector.workingPackage.name}\"`,\n ``,\n `> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).`,\n ``\n ].join('\\n')\n );\n\n // Write the opening delimiter for the Markdown code fence\n writer.writeLine('```ts\\n');\n\n // Emit the triple slash directives\n for (const typeDirectiveReference of Array.from(collector.dtsTypeReferenceDirectives).sort()) {\n // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162\n writer.writeLine(`/// <reference types=\"${typeDirectiveReference}\" />`);\n }\n for (const libDirectiveReference of Array.from(collector.dtsLibReferenceDirectives).sort()) {\n writer.writeLine(`/// <reference lib=\"${libDirectiveReference}\" />`);\n }\n writer.ensureSkippedLine();\n\n // Emit the imports\n for (const entity of collector.entities) {\n if (entity.astEntity instanceof AstImport) {\n DtsEmitHelpers.emitImport(writer, entity, entity.astEntity);\n }\n }\n writer.ensureSkippedLine();\n\n // Emit the regular declarations\n for (const entity of collector.entities) {\n const astEntity: AstEntity = entity.astEntity;\n const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity(astEntity);\n const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata?.maxEffectiveReleaseTag ?? ReleaseTag.None;\n\n if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, reportVariant)) {\n continue;\n }\n\n if (entity.consumable || collector.extractorConfig.apiReportIncludeForgottenExports) {\n // First, collect the list of export names for this symbol. When reporting messages with\n // ExtractorMessage.properties.exportName, this will enable us to emit the warning comments alongside\n // the associated export statement.\n interface IExportToEmit {\n readonly exportName: string;\n readonly associatedMessages: ExtractorMessage[];\n }\n const exportsToEmit: Map<string, IExportToEmit> = new Map<string, IExportToEmit>();\n\n for (const exportName of entity.exportNames) {\n if (!entity.shouldInlineExport) {\n exportsToEmit.set(exportName, { exportName, associatedMessages: [] });\n }\n }\n\n if (astEntity instanceof AstSymbol) {\n // Emit all the declarations for this entity\n for (const astDeclaration of astEntity.astDeclarations || []) {\n // Get the messages associated with this declaration\n const fetchedMessages: ExtractorMessage[] =\n collector.messageRouter.fetchAssociatedMessagesForReviewFile(astDeclaration);\n\n // Peel off the messages associated with an export statement and store them\n // in IExportToEmit.associatedMessages (to be processed later). The remaining messages will\n // added to messagesToReport, to be emitted next to the declaration instead of the export statement.\n const messagesToReport: ExtractorMessage[] = [];\n for (const message of fetchedMessages) {\n if (message.properties.exportName) {\n const exportToEmit: IExportToEmit | undefined = exportsToEmit.get(\n message.properties.exportName\n );\n if (exportToEmit) {\n exportToEmit.associatedMessages.push(message);\n continue;\n }\n }\n messagesToReport.push(message);\n }\n\n if (this._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) {\n writer.ensureSkippedLine();\n writer.write(ApiReportGenerator._getAedocSynopsis(collector, astDeclaration, messagesToReport));\n\n const span: Span = new Span(astDeclaration.declaration);\n\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n if (apiItemMetadata.isPreapproved) {\n ApiReportGenerator._modifySpanForPreapproved(span);\n } else {\n ApiReportGenerator._modifySpan(collector, span, entity, astDeclaration, false, reportVariant);\n }\n\n span.writeModifiedText(writer);\n writer.ensureNewLine();\n }\n }\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector);\n\n if (entity.nameForEmit === undefined) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n if (astModuleExportInfo.starExportedExternalModules.size > 0) {\n // We could support this, but we would need to find a way to safely represent it.\n throw new Error(\n `The ${entity.nameForEmit} namespace import includes a star export, which is not supported:\\n` +\n SourceFileLocationFormatter.formatDeclaration(astEntity.declaration)\n );\n }\n\n // Emit a synthetic declaration for the namespace. It will look like this:\n //\n // declare namespace example {\n // export {\n // f1,\n // f2\n // }\n // }\n //\n // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type\n // signatures may reference them directly (without using the namespace qualifier).\n\n writer.ensureSkippedLine();\n writer.writeLine(`declare namespace ${entity.nameForEmit} {`);\n\n // all local exports of local imported module are just references to top-level declarations\n writer.increaseIndent();\n writer.writeLine('export {');\n writer.increaseIndent();\n\n const exportClauses: string[] = [];\n for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) {\n const collectorEntity: CollectorEntity | undefined =\n collector.tryGetCollectorEntity(exportedEntity);\n if (collectorEntity === undefined) {\n // This should never happen\n // top-level exports of local imported module should be added as collector entities before\n throw new InternalError(\n `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`\n );\n }\n\n if (collectorEntity.nameForEmit === exportedName) {\n exportClauses.push(collectorEntity.nameForEmit);\n } else {\n exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`);\n }\n }\n writer.writeLine(exportClauses.join(',\\n'));\n\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"export { ... }\"\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"declare namespace { ... }\"\n }\n\n // Now emit the export statements for this entity.\n for (const exportToEmit of exportsToEmit.values()) {\n // Write any associated messages\n if (exportToEmit.associatedMessages.length > 0) {\n writer.ensureSkippedLine();\n for (const message of exportToEmit.associatedMessages) {\n ApiReportGenerator._writeLineAsComments(\n writer,\n 'Warning: ' + message.formatMessageWithoutLocation()\n );\n }\n }\n\n DtsEmitHelpers.emitNamedExport(writer, exportToEmit.exportName, entity);\n }\n writer.ensureSkippedLine();\n }\n }\n\n DtsEmitHelpers.emitStarExports(writer, collector);\n\n // Write the unassociated warnings at the bottom of the file\n const unassociatedMessages: ExtractorMessage[] =\n collector.messageRouter.fetchUnassociatedMessagesForReviewFile();\n if (unassociatedMessages.length > 0) {\n writer.ensureSkippedLine();\n ApiReportGenerator._writeLineAsComments(writer, 'Warnings were encountered during analysis:');\n ApiReportGenerator._writeLineAsComments(writer, '');\n for (const unassociatedMessage of unassociatedMessages) {\n ApiReportGenerator._writeLineAsComments(\n writer,\n unassociatedMessage.formatMessageWithLocation(collector.workingPackage.packageFolder)\n );\n }\n }\n\n if (collector.workingPackage.tsdocComment === undefined) {\n writer.ensureSkippedLine();\n ApiReportGenerator._writeLineAsComments(writer, '(No @packageDocumentation comment for this package)');\n }\n\n // Write the closing delimiter for the Markdown code fence\n writer.ensureSkippedLine();\n writer.writeLine('```');\n\n // Remove any trailing spaces\n return writer.toString().replace(ApiReportGenerator._trimSpacesRegExp, '');\n }\n\n /**\n * Before writing out a declaration, _modifySpan() applies various fixups to make it nice.\n */\n private static _modifySpan(\n collector: Collector,\n span: Span,\n entity: CollectorEntity,\n astDeclaration: AstDeclaration,\n insideTypeLiteral: boolean,\n reportVariant: ApiReportVariant\n ): void {\n // Should we process this declaration at all?\n if (!ApiReportGenerator._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) {\n span.modification.skipAll();\n return;\n }\n\n const previousSpan: Span | undefined = span.previousSibling;\n\n let recurseChildren: boolean = true;\n let sortChildren: boolean = false;\n\n switch (span.kind) {\n case ts.SyntaxKind.JSDocComment:\n span.modification.skipAll();\n // For now, we don't transform JSDoc comment nodes at all\n recurseChildren = false;\n break;\n\n case ts.SyntaxKind.ExportKeyword:\n case ts.SyntaxKind.DefaultKeyword:\n case ts.SyntaxKind.DeclareKeyword:\n // Delete any explicit \"export\" or \"declare\" keywords -- we will re-add them below\n span.modification.skipAll();\n break;\n\n case ts.SyntaxKind.InterfaceKeyword:\n case ts.SyntaxKind.ClassKeyword:\n case ts.SyntaxKind.EnumKeyword:\n case ts.SyntaxKind.NamespaceKeyword:\n case ts.SyntaxKind.ModuleKeyword:\n case ts.SyntaxKind.TypeKeyword:\n case ts.SyntaxKind.FunctionKeyword:\n // Replace the stuff we possibly deleted above\n let replacedModifiers: string = '';\n\n if (entity.shouldInlineExport) {\n replacedModifiers = 'export ' + replacedModifiers;\n }\n\n if (previousSpan && previousSpan.kind === ts.SyntaxKind.SyntaxList) {\n // If there is a previous span of type SyntaxList, then apply it before any other modifiers\n // (e.g. \"abstract\") that appear there.\n previousSpan.modification.prefix = replacedModifiers + previousSpan.modification.prefix;\n } else {\n // Otherwise just stick it in front of this span\n span.modification.prefix = replacedModifiers + span.modification.prefix;\n }\n break;\n\n case ts.SyntaxKind.SyntaxList:\n if (span.parent) {\n if (AstDeclaration.isSupportedSyntaxKind(span.parent.kind)) {\n // If the immediate parent is an API declaration, and the immediate children are API declarations,\n // then sort the children alphabetically\n sortChildren = true;\n } else if (span.parent.kind === ts.SyntaxKind.ModuleBlock) {\n // Namespaces are special because their chain goes ModuleDeclaration -> ModuleBlock -> SyntaxList\n sortChildren = true;\n }\n }\n break;\n\n case ts.SyntaxKind.VariableDeclaration:\n if (!span.parent) {\n // The VariableDeclaration node is part of a VariableDeclarationList, however\n // the Entry.followedSymbol points to the VariableDeclaration part because\n // multiple definitions might share the same VariableDeclarationList.\n //\n // Since we are emitting a separate declaration for each one, we need to look upwards\n // in the ts.Node tree and write a copy of the enclosing VariableDeclarationList\n // content (e.g. \"var\" from \"var x=1, y=2\").\n const list: ts.VariableDeclarationList | undefined = TypeScriptHelpers.matchAncestor(span.node, [\n ts.SyntaxKind.VariableDeclarationList,\n ts.SyntaxKind.VariableDeclaration\n ]);\n if (!list) {\n // This should not happen unless the compiler API changes somehow\n throw new InternalError('Unsupported variable declaration');\n }\n const listPrefix: string = list\n .getSourceFile()\n .text.substring(list.getStart(), list.declarations[0].getStart());\n span.modification.prefix = listPrefix + span.modification.prefix;\n span.modification.suffix = ';';\n\n if (entity.shouldInlineExport) {\n span.modification.prefix = 'export ' + span.modification.prefix;\n }\n }\n break;\n\n case ts.SyntaxKind.Identifier:\n const referencedEntity: CollectorEntity | undefined = collector.tryGetEntityForNode(\n span.node as ts.Identifier\n );\n\n if (referencedEntity) {\n if (!referencedEntity.nameForEmit) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n span.modification.prefix = referencedEntity.nameForEmit;\n // For debugging:\n // span.modification.prefix += '/*R=FIX*/';\n } else {\n // For debugging:\n // span.modification.prefix += '/*R=KEEP*/';\n }\n\n break;\n\n case ts.SyntaxKind.TypeLiteral:\n insideTypeLiteral = true;\n break;\n\n case ts.SyntaxKind.ImportType:\n DtsEmitHelpers.modifyImportTypeSpan(\n collector,\n span,\n astDeclaration,\n (childSpan, childAstDeclaration) => {\n ApiReportGenerator._modifySpan(\n collector,\n childSpan,\n entity,\n childAstDeclaration,\n insideTypeLiteral,\n reportVariant\n );\n }\n );\n break;\n }\n\n if (recurseChildren) {\n for (const child of span.children) {\n let childAstDeclaration: AstDeclaration = astDeclaration;\n\n if (AstDeclaration.isSupportedSyntaxKind(child.kind)) {\n childAstDeclaration = collector.astSymbolTable.getChildAstDeclarationByNode(\n child.node,\n astDeclaration\n );\n\n if (ApiReportGenerator._shouldIncludeDeclaration(collector, childAstDeclaration, reportVariant)) {\n if (sortChildren) {\n span.modification.sortChildren = true;\n child.modification.sortKey = Collector.getSortKeyIgnoringUnderscore(\n childAstDeclaration.astSymbol.localName\n );\n }\n\n if (!insideTypeLiteral) {\n const messagesToReport: ExtractorMessage[] =\n collector.messageRouter.fetchAssociatedMessagesForReviewFile(childAstDeclaration);\n\n // NOTE: This generates ae-undocumented messages as a side effect\n const aedocSynopsis: string = ApiReportGenerator._getAedocSynopsis(\n collector,\n childAstDeclaration,\n messagesToReport\n );\n\n child.modification.prefix = aedocSynopsis + child.modification.prefix;\n }\n }\n }\n\n ApiReportGenerator._modifySpan(\n collector,\n child,\n entity,\n childAstDeclaration,\n insideTypeLiteral,\n reportVariant\n );\n }\n }\n }\n\n private static _shouldIncludeDeclaration(\n collector: Collector,\n astDeclaration: AstDeclaration,\n reportVariant: ApiReportVariant\n ): boolean {\n // Private declarations are not included in the API report\n // eslint-disable-next-line no-bitwise\n if ((astDeclaration.modifierFlags & ts.ModifierFlags.Private) !== 0) {\n return false;\n }\n\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n return this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, reportVariant);\n }\n\n private static _shouldIncludeReleaseTag(releaseTag: ReleaseTag, reportVariant: ApiReportVariant): boolean {\n switch (reportVariant) {\n case 'complete':\n return true;\n case 'alpha':\n return (\n releaseTag === ReleaseTag.Alpha ||\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n case 'beta':\n return (\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n case 'public':\n return (\n releaseTag === ReleaseTag.Public ||\n // NOTE: No specified release tag is implicitly treated as `@public`.\n releaseTag === ReleaseTag.None\n );\n default:\n throw new Error(`Unrecognized release level: ${reportVariant}`);\n }\n }\n\n /**\n * For declarations marked as `@preapproved`, this is used instead of _modifySpan().\n */\n private static _modifySpanForPreapproved(span: Span): void {\n // Match something like this:\n //\n // ClassDeclaration:\n // SyntaxList:\n // ExportKeyword: pre=[export] sep=[ ]\n // DeclareKeyword: pre=[declare] sep=[ ]\n // ClassKeyword: pre=[class] sep=[ ]\n // Identifier: pre=[_PreapprovedClass] sep=[ ]\n // FirstPunctuation: pre=[{] sep=[\\n\\n ]\n // SyntaxList:\n // ...\n // CloseBraceToken: pre=[}]\n //\n // or this:\n // ModuleDeclaration:\n // SyntaxList:\n // ExportKeyword: pre=[export] sep=[ ]\n // DeclareKeyword: pre=[declare] sep=[ ]\n // NamespaceKeyword: pre=[namespace] sep=[ ]\n // Identifier: pre=[_PreapprovedNamespace] sep=[ ]\n // ModuleBlock:\n // FirstPunctuation: pre=[{] sep=[\\n\\n ]\n // SyntaxList:\n // ...\n // CloseBraceToken: pre=[}]\n //\n // And reduce it to something like this:\n //\n // // @internal (undocumented)\n // class _PreapprovedClass { /* (preapproved) */ }\n //\n\n let skipRest: boolean = false;\n for (const child of span.children) {\n if (skipRest || child.kind === ts.SyntaxKind.SyntaxList || child.kind === ts.SyntaxKind.JSDocComment) {\n child.modification.skipAll();\n }\n if (child.kind === ts.SyntaxKind.Identifier) {\n skipRest = true;\n child.modification.omitSeparatorAfter = true;\n child.modification.suffix = ' { /* (preapproved) */ }';\n }\n }\n }\n\n /**\n * Writes a synopsis of the AEDoc comments, which indicates the release tag,\n * whether the item has been documented, and any warnings that were detected\n * by the analysis.\n */\n private static _getAedocSynopsis(\n collector: Collector,\n astDeclaration: AstDeclaration,\n messagesToReport: ExtractorMessage[]\n ): string {\n const writer: IndentedWriter = new IndentedWriter();\n\n for (const message of messagesToReport) {\n ApiReportGenerator._writeLineAsComments(writer, 'Warning: ' + message.formatMessageWithoutLocation());\n }\n\n if (!collector.isAncillaryDeclaration(astDeclaration)) {\n const footerParts: string[] = [];\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n // 1. Release tag (if present)\n if (!apiItemMetadata.releaseTagSameAsParent) {\n if (apiItemMetadata.effectiveReleaseTag !== ReleaseTag.None) {\n footerParts.push(ReleaseTag.getTagName(apiItemMetadata.effectiveReleaseTag));\n }\n }\n\n // 2. Enumerate configured tags, reporting standard system tags first and then other configured tags.\n // Note that the ordering we handle the standard tags is important for backwards compatibility.\n // Also note that we had special mechanisms for checking whether or not an item is documented with these tags,\n // so they are checked specially.\n const {\n '@sealed': reportSealedTag,\n '@virtual': reportVirtualTag,\n '@override': reportOverrideTag,\n '@eventProperty': reportEventPropertyTag,\n '@deprecated': reportDeprecatedTag,\n ...otherTagsToReport\n } = collector.extractorConfig.tagsToReport;\n\n // 2.a Check for standard tags and report those that are both configured and present in the metadata.\n if (reportSealedTag && apiItemMetadata.isSealed) {\n footerParts.push('@sealed');\n }\n if (reportVirtualTag && apiItemMetadata.isVirtual) {\n footerParts.push('@virtual');\n }\n if (reportOverrideTag && apiItemMetadata.isOverride) {\n footerParts.push('@override');\n }\n if (reportEventPropertyTag && apiItemMetadata.isEventProperty) {\n footerParts.push('@eventProperty');\n }\n if (reportDeprecatedTag && apiItemMetadata.tsdocComment?.deprecatedBlock) {\n footerParts.push('@deprecated');\n }\n\n // 2.b Check for other configured tags and report those that are present in the tsdoc metadata.\n for (const [tag, reportTag] of Object.entries(otherTagsToReport)) {\n if (reportTag) {\n // If the tag was not handled specially, check if it is present in the metadata.\n if (apiItemMetadata.tsdocComment?.customBlocks.some((block) => block.blockTag.tagName === tag)) {\n footerParts.push(tag);\n } else if (apiItemMetadata.tsdocComment?.modifierTagSet.hasTagName(tag)) {\n footerParts.push(tag);\n }\n }\n }\n\n // 3. If the item is undocumented, append notice at the end of the list\n if (apiItemMetadata.undocumented) {\n footerParts.push('(undocumented)');\n\n collector.messageRouter.addAnalyzerIssue(\n ExtractorMessageId.Undocumented,\n `Missing documentation for \"${astDeclaration.astSymbol.localName}\".`,\n astDeclaration\n );\n }\n\n if (footerParts.length > 0) {\n if (messagesToReport.length > 0) {\n ApiReportGenerator._writeLineAsComments(writer, ''); // skip a line after the warnings\n }\n\n ApiReportGenerator._writeLineAsComments(writer, footerParts.join(' '));\n }\n }\n\n return writer.toString();\n }\n\n private static _writeLineAsComments(writer: IndentedWriter, line: string): void {\n const lines: string[] = Text.convertToLf(line).split('\\n');\n for (const realLine of lines) {\n writer.write('// ');\n writer.write(realLine);\n writer.writeLine();\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DtsRollupGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/DtsRollupGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DtsRollupGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/DtsRollupGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,WAAW,EAAiB,MAAM,8BAA8B,CAAC;AAG3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAiBxD;;GAEG;AACH,oBAAY,aAAa;IACvB;;;OAGG;IACH,eAAe,IAAA;IAEf;;;;OAIG;IACH,YAAY,IAAA;IAEZ;;;;OAIG;IACH,WAAW,IAAA;IAEX;;;;OAIG;IACH,aAAa,IAAA;CACd;AAED,qBAAa,kBAAkB;IAC7B;;;;OAIG;WACW,gBAAgB,CAC5B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,WAAW,GACvB,IAAI;IAYP,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAsK1C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IA6M1B,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAyBxC"}
|
|
@@ -36,7 +36,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
})();
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.DtsRollupGenerator = exports.DtsRollupKind = void 0;
|
|
39
|
-
/* eslint-disable no-bitwise */
|
|
40
39
|
const ts = __importStar(require("typescript"));
|
|
41
40
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
42
41
|
const api_extractor_model_1 = require("@microsoft/api-extractor-model");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DtsRollupGenerator.js","sourceRoot":"","sources":["../../src/generators/DtsRollupGenerator.ts"],"names":[],"mappings":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ACH,CAAC;wBAED,OAAO,GAAG,IAAI,CAAC;oBACjB,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,kBAAkB,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;gBACzF,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,wBAAwB,CAAC,UAAsB,EAAE,OAAsB;QACpF,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,aAAa,CAAC,eAAe;gBAChC,OAAO,IAAI,CAAC;YACd,KAAK,aAAa,CAAC,YAAY;gBAC7B,OAAO,CACL,UAAU,KAAK,gCAAU,CAAC,KAAK;oBAC/B,UAAU,KAAK,gCAAU,CAAC,IAAI;oBAC9B,UAAU,KAAK,gCAAU,CAAC,MAAM;oBAChC,uFAAuF;oBACvF,UAAU,KAAK,gCAAU,CAAC,IAAI,CAC/B,CAAC;YACJ,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,CACL,UAAU,KAAK,gCAAU,CAAC,IAAI;oBAC9B,UAAU,KAAK,gCAAU,CAAC,MAAM;oBAChC,uFAAuF;oBACvF,UAAU,KAAK,gCAAU,CAAC,IAAI,CAC/B,CAAC;YACJ,KAAK,aAAa,CAAC,aAAa;gBAC9B,OAAO,UAAU,KAAK,gCAAU,CAAC,MAAM,IAAI,UAAU,KAAK,gCAAU,CAAC,IAAI,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAtaD,gDAsaC","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/* eslint-disable no-bitwise */\n\nimport * as ts from 'typescript';\nimport { FileSystem, type NewlineKind, InternalError } from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\n\nimport type { Collector } from '../collector/Collector';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { IndentDocCommentScope, Span, type SpanModification } from '../analyzer/Span';\nimport { AstImport } from '../analyzer/AstImport';\nimport type { CollectorEntity } from '../collector/CollectorEntity';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport type { ApiItemMetadata } from '../collector/ApiItemMetadata';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { SymbolMetadata } from '../collector/SymbolMetadata';\nimport { IndentedWriter } from './IndentedWriter';\nimport { DtsEmitHelpers } from './DtsEmitHelpers';\nimport type { DeclarationMetadata } from '../collector/DeclarationMetadata';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport type { IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter';\nimport type { AstEntity } from '../analyzer/AstEntity';\n\n/**\n * Used with DtsRollupGenerator.writeTypingsFile()\n */\nexport enum DtsRollupKind {\n /**\n * Generate a *.d.ts file for an internal release, or for the trimming=false mode.\n * This output file will contain all definitions that are reachable from the entry point.\n */\n InternalRelease,\n\n /**\n * Generate a *.d.ts file for a preview release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@internal.\n */\n AlphaRelease,\n\n /**\n * Generate a *.d.ts file for a preview release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@alpha or \\@internal.\n */\n BetaRelease,\n\n /**\n * Generate a *.d.ts file for a public release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@beta, \\@alpha, or \\@internal.\n */\n PublicRelease\n}\n\nexport class DtsRollupGenerator {\n /**\n * Generates the typings file and writes it to disk.\n *\n * @param dtsFilename - The *.d.ts output filename\n */\n public static writeTypingsFile(\n collector: Collector,\n dtsFilename: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n const writer: IndentedWriter = new IndentedWriter();\n writer.trimLeadingSpaces = true;\n\n DtsRollupGenerator._generateTypingsFileContent(collector, writer, dtsKind);\n\n FileSystem.writeFile(dtsFilename, writer.toString(), {\n convertLineEndings: newlineKind,\n ensureFolderExists: true\n });\n }\n\n private static _generateTypingsFileContent(\n collector: Collector,\n writer: IndentedWriter,\n dtsKind: DtsRollupKind\n ): void {\n // Emit the @packageDocumentation comment at the top of the file\n if (collector.workingPackage.tsdocParserContext) {\n writer.trimLeadingSpaces = false;\n writer.writeLine(collector.workingPackage.tsdocParserContext.sourceRange.toString());\n writer.trimLeadingSpaces = true;\n writer.ensureSkippedLine();\n }\n\n // Emit the triple slash directives\n for (const typeDirectiveReference of collector.dtsTypeReferenceDirectives) {\n // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162\n writer.writeLine(`/// <reference types=\"${typeDirectiveReference}\" />`);\n }\n for (const libDirectiveReference of collector.dtsLibReferenceDirectives) {\n writer.writeLine(`/// <reference lib=\"${libDirectiveReference}\" />`);\n }\n writer.ensureSkippedLine();\n\n // Emit the imports\n for (const entity of collector.entities) {\n if (entity.astEntity instanceof AstImport) {\n // Note: it isn't valid to trim imports based on their release tags.\n // E.g. class Foo (`@public`) extends interface Bar (`@beta`) from some external library.\n // API-Extractor cannot trim `import { Bar } from \"external-library\"` when generating its public rollup,\n // or the export of `Foo` would include a broken reference to `Bar`.\n const astImport: AstImport = entity.astEntity;\n DtsEmitHelpers.emitImport(writer, entity, astImport);\n }\n }\n writer.ensureSkippedLine();\n\n // Emit the regular declarations\n for (const entity of collector.entities) {\n const astEntity: AstEntity = entity.astEntity;\n const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity(astEntity);\n const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata\n ? symbolMetadata.maxEffectiveReleaseTag\n : ReleaseTag.None;\n\n if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, dtsKind)) {\n if (!collector.extractorConfig.omitTrimmingComments) {\n writer.ensureSkippedLine();\n writer.writeLine(`/* Excluded from this release type: ${entity.nameForEmit} */`);\n }\n continue;\n }\n\n if (astEntity instanceof AstSymbol) {\n // Emit all the declarations for this entry\n for (const astDeclaration of astEntity.astDeclarations || []) {\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n if (!this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, dtsKind)) {\n if (!collector.extractorConfig.omitTrimmingComments) {\n writer.ensureSkippedLine();\n writer.writeLine(`/* Excluded declaration from this release type: ${entity.nameForEmit} */`);\n }\n continue;\n } else {\n const span: Span = new Span(astDeclaration.declaration);\n DtsRollupGenerator._modifySpan(collector, span, entity, astDeclaration, dtsKind);\n writer.ensureSkippedLine();\n span.writeModifiedText(writer);\n writer.ensureNewLine();\n }\n }\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector);\n\n if (entity.nameForEmit === undefined) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n if (astModuleExportInfo.starExportedExternalModules.size > 0) {\n // We could support this, but we would need to find a way to safely represent it.\n throw new Error(\n `The ${entity.nameForEmit} namespace import includes a start export, which is not supported:\\n` +\n SourceFileLocationFormatter.formatDeclaration(astEntity.declaration)\n );\n }\n\n // Emit a synthetic declaration for the namespace. It will look like this:\n //\n // declare namespace example {\n // export {\n // f1,\n // f2\n // }\n // }\n //\n // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type\n // signatures may reference them directly (without using the namespace qualifier).\n\n writer.ensureSkippedLine();\n if (entity.shouldInlineExport) {\n writer.write('export ');\n }\n writer.writeLine(`declare namespace ${entity.nameForEmit} {`);\n\n // all local exports of local imported module are just references to top-level declarations\n writer.increaseIndent();\n writer.writeLine('export {');\n writer.increaseIndent();\n\n const exportClauses: string[] = [];\n for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) {\n const collectorEntity: CollectorEntity | undefined =\n collector.tryGetCollectorEntity(exportedEntity);\n if (collectorEntity === undefined) {\n // This should never happen\n // top-level exports of local imported module should be added as collector entities before\n throw new InternalError(\n `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`\n );\n }\n\n // If the entity's declaration won't be included, then neither should the namespace export it\n // This fixes the issue encountered here: https://github.com/microsoft/rushstack/issues/2791\n const exportedSymbolMetadata: SymbolMetadata | undefined =\n collector.tryFetchMetadataForAstEntity(exportedEntity);\n const exportedMaxEffectiveReleaseTag: ReleaseTag = exportedSymbolMetadata\n ? exportedSymbolMetadata.maxEffectiveReleaseTag\n : ReleaseTag.None;\n if (!this._shouldIncludeReleaseTag(exportedMaxEffectiveReleaseTag, dtsKind)) {\n continue;\n }\n\n if (collectorEntity.nameForEmit === exportedName) {\n exportClauses.push(collectorEntity.nameForEmit);\n } else {\n exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`);\n }\n }\n writer.writeLine(exportClauses.join(',\\n'));\n\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"export { ... }\"\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"declare namespace { ... }\"\n }\n\n if (!entity.shouldInlineExport) {\n for (const exportName of entity.exportNames) {\n DtsEmitHelpers.emitNamedExport(writer, exportName, entity);\n }\n }\n\n writer.ensureSkippedLine();\n }\n\n DtsEmitHelpers.emitStarExports(writer, collector);\n\n // Emit \"export { }\" which is a special directive that prevents consumers from importing declarations\n // that don't have an explicit \"export\" modifier.\n writer.ensureSkippedLine();\n writer.writeLine('export { }');\n }\n\n /**\n * Before writing out a declaration, _modifySpan() applies various fixups to make it nice.\n */\n private static _modifySpan(\n collector: Collector,\n span: Span,\n entity: CollectorEntity,\n astDeclaration: AstDeclaration,\n dtsKind: DtsRollupKind\n ): void {\n const previousSpan: Span | undefined = span.previousSibling;\n\n let recurseChildren: boolean = true;\n switch (span.kind) {\n case ts.SyntaxKind.JSDocComment:\n // If the @packageDocumentation comment seems to be attached to one of the regular API items,\n // omit it. It gets explictly emitted at the top of the file.\n if (span.node.getText().match(/(?:\\s|\\*)@packageDocumentation(?:\\s|\\*)/gi)) {\n span.modification.skipAll();\n }\n\n // For now, we don't transform JSDoc comment nodes at all\n recurseChildren = false;\n break;\n\n case ts.SyntaxKind.ExportKeyword:\n case ts.SyntaxKind.DefaultKeyword:\n case ts.SyntaxKind.DeclareKeyword:\n // Delete any explicit \"export\" or \"declare\" keywords -- we will re-add them below\n span.modification.skipAll();\n break;\n\n case ts.SyntaxKind.InterfaceKeyword:\n case ts.SyntaxKind.ClassKeyword:\n case ts.SyntaxKind.EnumKeyword:\n case ts.SyntaxKind.NamespaceKeyword:\n case ts.SyntaxKind.ModuleKeyword:\n case ts.SyntaxKind.TypeKeyword:\n case ts.SyntaxKind.FunctionKeyword:\n // Replace the stuff we possibly deleted above\n let replacedModifiers: string = '';\n\n // Add a declare statement for root declarations (but not for nested declarations)\n if (!astDeclaration.parent) {\n replacedModifiers += 'declare ';\n }\n\n if (entity.shouldInlineExport) {\n replacedModifiers = 'export ' + replacedModifiers;\n }\n\n if (previousSpan && previousSpan.kind === ts.SyntaxKind.SyntaxList) {\n // If there is a previous span of type SyntaxList, then apply it before any other modifiers\n // (e.g. \"abstract\") that appear there.\n previousSpan.modification.prefix = replacedModifiers + previousSpan.modification.prefix;\n } else {\n // Otherwise just stick it in front of this span\n span.modification.prefix = replacedModifiers + span.modification.prefix;\n }\n break;\n\n case ts.SyntaxKind.VariableDeclaration:\n // Is this a top-level variable declaration?\n // (The logic below does not apply to variable declarations that are part of an explicit \"namespace\" block,\n // since the compiler prefers not to emit \"declare\" or \"export\" keywords for those declarations.)\n if (!span.parent) {\n // The VariableDeclaration node is part of a VariableDeclarationList, however\n // the Entry.followedSymbol points to the VariableDeclaration part because\n // multiple definitions might share the same VariableDeclarationList.\n //\n // Since we are emitting a separate declaration for each one, we need to look upwards\n // in the ts.Node tree and write a copy of the enclosing VariableDeclarationList\n // content (e.g. \"var\" from \"var x=1, y=2\").\n const list: ts.VariableDeclarationList | undefined = TypeScriptHelpers.matchAncestor(span.node, [\n ts.SyntaxKind.VariableDeclarationList,\n ts.SyntaxKind.VariableDeclaration\n ]);\n if (!list) {\n // This should not happen unless the compiler API changes somehow\n throw new InternalError('Unsupported variable declaration');\n }\n const listPrefix: string = list\n .getSourceFile()\n .text.substring(list.getStart(), list.declarations[0].getStart());\n span.modification.prefix = 'declare ' + listPrefix + span.modification.prefix;\n span.modification.suffix = ';';\n\n if (entity.shouldInlineExport) {\n span.modification.prefix = 'export ' + span.modification.prefix;\n }\n\n const declarationMetadata: DeclarationMetadata = collector.fetchDeclarationMetadata(astDeclaration);\n if (declarationMetadata.tsdocParserContext) {\n // Typically the comment for a variable declaration is attached to the outer variable statement\n // (which may possibly contain multiple variable declarations), so it's not part of the Span.\n // Instead we need to manually inject it.\n let originalComment: string = declarationMetadata.tsdocParserContext.sourceRange.toString();\n if (!/\\r?\\n\\s*$/.test(originalComment)) {\n originalComment += '\\n';\n }\n span.modification.indentDocComment = IndentDocCommentScope.PrefixOnly;\n span.modification.prefix = originalComment + span.modification.prefix;\n }\n }\n break;\n\n case ts.SyntaxKind.Identifier:\n {\n const referencedEntity: CollectorEntity | undefined = collector.tryGetEntityForNode(\n span.node as ts.Identifier\n );\n\n if (referencedEntity) {\n if (!referencedEntity.nameForEmit) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n span.modification.prefix = referencedEntity.nameForEmit;\n // For debugging:\n // span.modification.prefix += '/*R=FIX*/';\n } else {\n // For debugging:\n // span.modification.prefix += '/*R=KEEP*/';\n }\n }\n break;\n\n case ts.SyntaxKind.ImportType:\n DtsEmitHelpers.modifyImportTypeSpan(\n collector,\n span,\n astDeclaration,\n (childSpan, childAstDeclaration) => {\n DtsRollupGenerator._modifySpan(collector, childSpan, entity, childAstDeclaration, dtsKind);\n }\n );\n break;\n }\n\n if (recurseChildren) {\n for (const child of span.children) {\n let childAstDeclaration: AstDeclaration = astDeclaration;\n\n // Should we trim this node?\n let trimmed: boolean = false;\n if (AstDeclaration.isSupportedSyntaxKind(child.kind)) {\n childAstDeclaration = collector.astSymbolTable.getChildAstDeclarationByNode(\n child.node,\n astDeclaration\n );\n const releaseTag: ReleaseTag =\n collector.fetchApiItemMetadata(childAstDeclaration).effectiveReleaseTag;\n\n if (!this._shouldIncludeReleaseTag(releaseTag, dtsKind)) {\n let nodeToTrim: Span = child;\n\n // If we are trimming a variable statement, then we need to trim the outer VariableDeclarationList\n // as well.\n if (child.kind === ts.SyntaxKind.VariableDeclaration) {\n const variableStatement: Span | undefined = child.findFirstParent(\n ts.SyntaxKind.VariableStatement\n );\n if (variableStatement !== undefined) {\n nodeToTrim = variableStatement;\n }\n }\n\n const modification: SpanModification = nodeToTrim.modification;\n\n // Yes, trim it and stop here\n const name: string = childAstDeclaration.astSymbol.localName;\n modification.omitChildren = true;\n\n if (!collector.extractorConfig.omitTrimmingComments) {\n modification.prefix = `/* Excluded from this release type: ${name} */`;\n } else {\n modification.prefix = '';\n }\n modification.suffix = '';\n\n if (nodeToTrim.children.length > 0) {\n // If there are grandchildren, then keep the last grandchild's separator,\n // since it often has useful whitespace\n modification.suffix = nodeToTrim.children[nodeToTrim.children.length - 1].separator;\n }\n\n if (nodeToTrim.nextSibling) {\n // If the thing we are trimming is followed by a comma, then trim the comma also.\n // An example would be an enum member.\n if (nodeToTrim.nextSibling.kind === ts.SyntaxKind.CommaToken) {\n // Keep its separator since it often has useful whitespace\n modification.suffix += nodeToTrim.nextSibling.separator;\n nodeToTrim.nextSibling.modification.skipAll();\n }\n }\n\n trimmed = true;\n }\n }\n\n if (!trimmed) {\n DtsRollupGenerator._modifySpan(collector, child, entity, childAstDeclaration, dtsKind);\n }\n }\n }\n }\n\n private static _shouldIncludeReleaseTag(releaseTag: ReleaseTag, dtsKind: DtsRollupKind): boolean {\n switch (dtsKind) {\n case DtsRollupKind.InternalRelease:\n return true;\n case DtsRollupKind.AlphaRelease:\n return (\n releaseTag === ReleaseTag.Alpha ||\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: If the release tag is \"None\", then we don't have enough information to trim it\n releaseTag === ReleaseTag.None\n );\n case DtsRollupKind.BetaRelease:\n return (\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: If the release tag is \"None\", then we don't have enough information to trim it\n releaseTag === ReleaseTag.None\n );\n case DtsRollupKind.PublicRelease:\n return releaseTag === ReleaseTag.Public || releaseTag === ReleaseTag.None;\n default:\n throw new Error(`${DtsRollupKind[dtsKind]} is not implemented`);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DtsRollupGenerator.js","sourceRoot":"","sources":["../../src/generators/DtsRollupGenerator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,oEAA2F;AAC3F,wEAA4D;AAG5D,qEAAkE;AAClE,2CAAsF;AACtF,qDAAkD;AAElD,+DAA4D;AAE5D,qDAAkD;AAElD,qDAAkD;AAClD,qDAAkD;AAElD,uEAAoE;AAEpE,yFAAsF;AAGtF;;GAEG;AACH,IAAY,aA2BX;AA3BD,WAAY,aAAa;IACvB;;;OAGG;IACH,uEAAe,CAAA;IAEf;;;;OAIG;IACH,iEAAY,CAAA;IAEZ;;;;OAIG;IACH,+DAAW,CAAA;IAEX;;;;OAIG;IACH,mEAAa,CAAA;AACf,CAAC,EA3BW,aAAa,6BAAb,aAAa,QA2BxB;AAED,MAAa,kBAAkB;IAC7B;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAC5B,SAAoB,EACpB,WAAmB,EACnB,OAAsB,EACtB,WAAwB;QAExB,MAAM,MAAM,GAAmB,IAAI,+BAAc,EAAE,CAAC;QACpD,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;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AK,gCAAU,CAAC,MAAM;oBAChC,uFAAuF;oBACvF,UAAU,KAAK,gCAAU,CAAC,IAAI,CAC/B,CAAC;YACJ,KAAK,aAAa,CAAC,aAAa;gBAC9B,OAAO,UAAU,KAAK,gCAAU,CAAC,MAAM,IAAI,UAAU,KAAK,gCAAU,CAAC,IAAI,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAtaD,gDAsaC","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 ts from 'typescript';\nimport { FileSystem, type NewlineKind, InternalError } from '@rushstack/node-core-library';\nimport { ReleaseTag } from '@microsoft/api-extractor-model';\n\nimport type { Collector } from '../collector/Collector';\nimport { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers';\nimport { IndentDocCommentScope, Span, type SpanModification } from '../analyzer/Span';\nimport { AstImport } from '../analyzer/AstImport';\nimport type { CollectorEntity } from '../collector/CollectorEntity';\nimport { AstDeclaration } from '../analyzer/AstDeclaration';\nimport type { ApiItemMetadata } from '../collector/ApiItemMetadata';\nimport { AstSymbol } from '../analyzer/AstSymbol';\nimport type { SymbolMetadata } from '../collector/SymbolMetadata';\nimport { IndentedWriter } from './IndentedWriter';\nimport { DtsEmitHelpers } from './DtsEmitHelpers';\nimport type { DeclarationMetadata } from '../collector/DeclarationMetadata';\nimport { AstNamespaceImport } from '../analyzer/AstNamespaceImport';\nimport type { IAstModuleExportInfo } from '../analyzer/AstModule';\nimport { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter';\nimport type { AstEntity } from '../analyzer/AstEntity';\n\n/**\n * Used with DtsRollupGenerator.writeTypingsFile()\n */\nexport enum DtsRollupKind {\n /**\n * Generate a *.d.ts file for an internal release, or for the trimming=false mode.\n * This output file will contain all definitions that are reachable from the entry point.\n */\n InternalRelease,\n\n /**\n * Generate a *.d.ts file for a preview release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@internal.\n */\n AlphaRelease,\n\n /**\n * Generate a *.d.ts file for a preview release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@alpha or \\@internal.\n */\n BetaRelease,\n\n /**\n * Generate a *.d.ts file for a public release.\n * This output file will contain all definitions that are reachable from the entry point,\n * except definitions marked as \\@beta, \\@alpha, or \\@internal.\n */\n PublicRelease\n}\n\nexport class DtsRollupGenerator {\n /**\n * Generates the typings file and writes it to disk.\n *\n * @param dtsFilename - The *.d.ts output filename\n */\n public static writeTypingsFile(\n collector: Collector,\n dtsFilename: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n const writer: IndentedWriter = new IndentedWriter();\n writer.trimLeadingSpaces = true;\n\n DtsRollupGenerator._generateTypingsFileContent(collector, writer, dtsKind);\n\n FileSystem.writeFile(dtsFilename, writer.toString(), {\n convertLineEndings: newlineKind,\n ensureFolderExists: true\n });\n }\n\n private static _generateTypingsFileContent(\n collector: Collector,\n writer: IndentedWriter,\n dtsKind: DtsRollupKind\n ): void {\n // Emit the @packageDocumentation comment at the top of the file\n if (collector.workingPackage.tsdocParserContext) {\n writer.trimLeadingSpaces = false;\n writer.writeLine(collector.workingPackage.tsdocParserContext.sourceRange.toString());\n writer.trimLeadingSpaces = true;\n writer.ensureSkippedLine();\n }\n\n // Emit the triple slash directives\n for (const typeDirectiveReference of collector.dtsTypeReferenceDirectives) {\n // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162\n writer.writeLine(`/// <reference types=\"${typeDirectiveReference}\" />`);\n }\n for (const libDirectiveReference of collector.dtsLibReferenceDirectives) {\n writer.writeLine(`/// <reference lib=\"${libDirectiveReference}\" />`);\n }\n writer.ensureSkippedLine();\n\n // Emit the imports\n for (const entity of collector.entities) {\n if (entity.astEntity instanceof AstImport) {\n // Note: it isn't valid to trim imports based on their release tags.\n // E.g. class Foo (`@public`) extends interface Bar (`@beta`) from some external library.\n // API-Extractor cannot trim `import { Bar } from \"external-library\"` when generating its public rollup,\n // or the export of `Foo` would include a broken reference to `Bar`.\n const astImport: AstImport = entity.astEntity;\n DtsEmitHelpers.emitImport(writer, entity, astImport);\n }\n }\n writer.ensureSkippedLine();\n\n // Emit the regular declarations\n for (const entity of collector.entities) {\n const astEntity: AstEntity = entity.astEntity;\n const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity(astEntity);\n const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata\n ? symbolMetadata.maxEffectiveReleaseTag\n : ReleaseTag.None;\n\n if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, dtsKind)) {\n if (!collector.extractorConfig.omitTrimmingComments) {\n writer.ensureSkippedLine();\n writer.writeLine(`/* Excluded from this release type: ${entity.nameForEmit} */`);\n }\n continue;\n }\n\n if (astEntity instanceof AstSymbol) {\n // Emit all the declarations for this entry\n for (const astDeclaration of astEntity.astDeclarations || []) {\n const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration);\n\n if (!this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, dtsKind)) {\n if (!collector.extractorConfig.omitTrimmingComments) {\n writer.ensureSkippedLine();\n writer.writeLine(`/* Excluded declaration from this release type: ${entity.nameForEmit} */`);\n }\n continue;\n } else {\n const span: Span = new Span(astDeclaration.declaration);\n DtsRollupGenerator._modifySpan(collector, span, entity, astDeclaration, dtsKind);\n writer.ensureSkippedLine();\n span.writeModifiedText(writer);\n writer.ensureNewLine();\n }\n }\n }\n\n if (astEntity instanceof AstNamespaceImport) {\n const astModuleExportInfo: IAstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector);\n\n if (entity.nameForEmit === undefined) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n if (astModuleExportInfo.starExportedExternalModules.size > 0) {\n // We could support this, but we would need to find a way to safely represent it.\n throw new Error(\n `The ${entity.nameForEmit} namespace import includes a start export, which is not supported:\\n` +\n SourceFileLocationFormatter.formatDeclaration(astEntity.declaration)\n );\n }\n\n // Emit a synthetic declaration for the namespace. It will look like this:\n //\n // declare namespace example {\n // export {\n // f1,\n // f2\n // }\n // }\n //\n // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type\n // signatures may reference them directly (without using the namespace qualifier).\n\n writer.ensureSkippedLine();\n if (entity.shouldInlineExport) {\n writer.write('export ');\n }\n writer.writeLine(`declare namespace ${entity.nameForEmit} {`);\n\n // all local exports of local imported module are just references to top-level declarations\n writer.increaseIndent();\n writer.writeLine('export {');\n writer.increaseIndent();\n\n const exportClauses: string[] = [];\n for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) {\n const collectorEntity: CollectorEntity | undefined =\n collector.tryGetCollectorEntity(exportedEntity);\n if (collectorEntity === undefined) {\n // This should never happen\n // top-level exports of local imported module should be added as collector entities before\n throw new InternalError(\n `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`\n );\n }\n\n // If the entity's declaration won't be included, then neither should the namespace export it\n // This fixes the issue encountered here: https://github.com/microsoft/rushstack/issues/2791\n const exportedSymbolMetadata: SymbolMetadata | undefined =\n collector.tryFetchMetadataForAstEntity(exportedEntity);\n const exportedMaxEffectiveReleaseTag: ReleaseTag = exportedSymbolMetadata\n ? exportedSymbolMetadata.maxEffectiveReleaseTag\n : ReleaseTag.None;\n if (!this._shouldIncludeReleaseTag(exportedMaxEffectiveReleaseTag, dtsKind)) {\n continue;\n }\n\n if (collectorEntity.nameForEmit === exportedName) {\n exportClauses.push(collectorEntity.nameForEmit);\n } else {\n exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`);\n }\n }\n writer.writeLine(exportClauses.join(',\\n'));\n\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"export { ... }\"\n writer.decreaseIndent();\n writer.writeLine('}'); // end of \"declare namespace { ... }\"\n }\n\n if (!entity.shouldInlineExport) {\n for (const exportName of entity.exportNames) {\n DtsEmitHelpers.emitNamedExport(writer, exportName, entity);\n }\n }\n\n writer.ensureSkippedLine();\n }\n\n DtsEmitHelpers.emitStarExports(writer, collector);\n\n // Emit \"export { }\" which is a special directive that prevents consumers from importing declarations\n // that don't have an explicit \"export\" modifier.\n writer.ensureSkippedLine();\n writer.writeLine('export { }');\n }\n\n /**\n * Before writing out a declaration, _modifySpan() applies various fixups to make it nice.\n */\n private static _modifySpan(\n collector: Collector,\n span: Span,\n entity: CollectorEntity,\n astDeclaration: AstDeclaration,\n dtsKind: DtsRollupKind\n ): void {\n const previousSpan: Span | undefined = span.previousSibling;\n\n let recurseChildren: boolean = true;\n switch (span.kind) {\n case ts.SyntaxKind.JSDocComment:\n // If the @packageDocumentation comment seems to be attached to one of the regular API items,\n // omit it. It gets explictly emitted at the top of the file.\n if (span.node.getText().match(/(?:\\s|\\*)@packageDocumentation(?:\\s|\\*)/gi)) {\n span.modification.skipAll();\n }\n\n // For now, we don't transform JSDoc comment nodes at all\n recurseChildren = false;\n break;\n\n case ts.SyntaxKind.ExportKeyword:\n case ts.SyntaxKind.DefaultKeyword:\n case ts.SyntaxKind.DeclareKeyword:\n // Delete any explicit \"export\" or \"declare\" keywords -- we will re-add them below\n span.modification.skipAll();\n break;\n\n case ts.SyntaxKind.InterfaceKeyword:\n case ts.SyntaxKind.ClassKeyword:\n case ts.SyntaxKind.EnumKeyword:\n case ts.SyntaxKind.NamespaceKeyword:\n case ts.SyntaxKind.ModuleKeyword:\n case ts.SyntaxKind.TypeKeyword:\n case ts.SyntaxKind.FunctionKeyword:\n // Replace the stuff we possibly deleted above\n let replacedModifiers: string = '';\n\n // Add a declare statement for root declarations (but not for nested declarations)\n if (!astDeclaration.parent) {\n replacedModifiers += 'declare ';\n }\n\n if (entity.shouldInlineExport) {\n replacedModifiers = 'export ' + replacedModifiers;\n }\n\n if (previousSpan && previousSpan.kind === ts.SyntaxKind.SyntaxList) {\n // If there is a previous span of type SyntaxList, then apply it before any other modifiers\n // (e.g. \"abstract\") that appear there.\n previousSpan.modification.prefix = replacedModifiers + previousSpan.modification.prefix;\n } else {\n // Otherwise just stick it in front of this span\n span.modification.prefix = replacedModifiers + span.modification.prefix;\n }\n break;\n\n case ts.SyntaxKind.VariableDeclaration:\n // Is this a top-level variable declaration?\n // (The logic below does not apply to variable declarations that are part of an explicit \"namespace\" block,\n // since the compiler prefers not to emit \"declare\" or \"export\" keywords for those declarations.)\n if (!span.parent) {\n // The VariableDeclaration node is part of a VariableDeclarationList, however\n // the Entry.followedSymbol points to the VariableDeclaration part because\n // multiple definitions might share the same VariableDeclarationList.\n //\n // Since we are emitting a separate declaration for each one, we need to look upwards\n // in the ts.Node tree and write a copy of the enclosing VariableDeclarationList\n // content (e.g. \"var\" from \"var x=1, y=2\").\n const list: ts.VariableDeclarationList | undefined = TypeScriptHelpers.matchAncestor(span.node, [\n ts.SyntaxKind.VariableDeclarationList,\n ts.SyntaxKind.VariableDeclaration\n ]);\n if (!list) {\n // This should not happen unless the compiler API changes somehow\n throw new InternalError('Unsupported variable declaration');\n }\n const listPrefix: string = list\n .getSourceFile()\n .text.substring(list.getStart(), list.declarations[0].getStart());\n span.modification.prefix = 'declare ' + listPrefix + span.modification.prefix;\n span.modification.suffix = ';';\n\n if (entity.shouldInlineExport) {\n span.modification.prefix = 'export ' + span.modification.prefix;\n }\n\n const declarationMetadata: DeclarationMetadata = collector.fetchDeclarationMetadata(astDeclaration);\n if (declarationMetadata.tsdocParserContext) {\n // Typically the comment for a variable declaration is attached to the outer variable statement\n // (which may possibly contain multiple variable declarations), so it's not part of the Span.\n // Instead we need to manually inject it.\n let originalComment: string = declarationMetadata.tsdocParserContext.sourceRange.toString();\n if (!/\\r?\\n\\s*$/.test(originalComment)) {\n originalComment += '\\n';\n }\n span.modification.indentDocComment = IndentDocCommentScope.PrefixOnly;\n span.modification.prefix = originalComment + span.modification.prefix;\n }\n }\n break;\n\n case ts.SyntaxKind.Identifier:\n {\n const referencedEntity: CollectorEntity | undefined = collector.tryGetEntityForNode(\n span.node as ts.Identifier\n );\n\n if (referencedEntity) {\n if (!referencedEntity.nameForEmit) {\n // This should never happen\n throw new InternalError('referencedEntry.nameForEmit is undefined');\n }\n\n span.modification.prefix = referencedEntity.nameForEmit;\n // For debugging:\n // span.modification.prefix += '/*R=FIX*/';\n } else {\n // For debugging:\n // span.modification.prefix += '/*R=KEEP*/';\n }\n }\n break;\n\n case ts.SyntaxKind.ImportType:\n DtsEmitHelpers.modifyImportTypeSpan(\n collector,\n span,\n astDeclaration,\n (childSpan, childAstDeclaration) => {\n DtsRollupGenerator._modifySpan(collector, childSpan, entity, childAstDeclaration, dtsKind);\n }\n );\n break;\n }\n\n if (recurseChildren) {\n for (const child of span.children) {\n let childAstDeclaration: AstDeclaration = astDeclaration;\n\n // Should we trim this node?\n let trimmed: boolean = false;\n if (AstDeclaration.isSupportedSyntaxKind(child.kind)) {\n childAstDeclaration = collector.astSymbolTable.getChildAstDeclarationByNode(\n child.node,\n astDeclaration\n );\n const releaseTag: ReleaseTag =\n collector.fetchApiItemMetadata(childAstDeclaration).effectiveReleaseTag;\n\n if (!this._shouldIncludeReleaseTag(releaseTag, dtsKind)) {\n let nodeToTrim: Span = child;\n\n // If we are trimming a variable statement, then we need to trim the outer VariableDeclarationList\n // as well.\n if (child.kind === ts.SyntaxKind.VariableDeclaration) {\n const variableStatement: Span | undefined = child.findFirstParent(\n ts.SyntaxKind.VariableStatement\n );\n if (variableStatement !== undefined) {\n nodeToTrim = variableStatement;\n }\n }\n\n const modification: SpanModification = nodeToTrim.modification;\n\n // Yes, trim it and stop here\n const name: string = childAstDeclaration.astSymbol.localName;\n modification.omitChildren = true;\n\n if (!collector.extractorConfig.omitTrimmingComments) {\n modification.prefix = `/* Excluded from this release type: ${name} */`;\n } else {\n modification.prefix = '';\n }\n modification.suffix = '';\n\n if (nodeToTrim.children.length > 0) {\n // If there are grandchildren, then keep the last grandchild's separator,\n // since it often has useful whitespace\n modification.suffix = nodeToTrim.children[nodeToTrim.children.length - 1].separator;\n }\n\n if (nodeToTrim.nextSibling) {\n // If the thing we are trimming is followed by a comma, then trim the comma also.\n // An example would be an enum member.\n if (nodeToTrim.nextSibling.kind === ts.SyntaxKind.CommaToken) {\n // Keep its separator since it often has useful whitespace\n modification.suffix += nodeToTrim.nextSibling.separator;\n nodeToTrim.nextSibling.modification.skipAll();\n }\n }\n\n trimmed = true;\n }\n }\n\n if (!trimmed) {\n DtsRollupGenerator._modifySpan(collector, child, entity, childAstDeclaration, dtsKind);\n }\n }\n }\n }\n\n private static _shouldIncludeReleaseTag(releaseTag: ReleaseTag, dtsKind: DtsRollupKind): boolean {\n switch (dtsKind) {\n case DtsRollupKind.InternalRelease:\n return true;\n case DtsRollupKind.AlphaRelease:\n return (\n releaseTag === ReleaseTag.Alpha ||\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: If the release tag is \"None\", then we don't have enough information to trim it\n releaseTag === ReleaseTag.None\n );\n case DtsRollupKind.BetaRelease:\n return (\n releaseTag === ReleaseTag.Beta ||\n releaseTag === ReleaseTag.Public ||\n // NOTE: If the release tag is \"None\", then we don't have enough information to trim it\n releaseTag === ReleaseTag.None\n );\n case DtsRollupKind.PublicRelease:\n return releaseTag === ReleaseTag.Public || releaseTag === ReleaseTag.None;\n default:\n throw new Error(`${DtsRollupKind[dtsKind]} is not implemented`);\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.10",
|
|
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",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"@microsoft/tsdoc-config": "~0.17.1",
|
|
36
36
|
"@microsoft/tsdoc": "~0.15.1",
|
|
37
37
|
"lodash": "~4.17.15",
|
|
38
|
-
"minimatch": "
|
|
38
|
+
"minimatch": "10.0.3",
|
|
39
39
|
"resolve": "~1.22.1",
|
|
40
40
|
"semver": "~7.5.4",
|
|
41
41
|
"source-map": "~0.6.1",
|
|
42
42
|
"typescript": "5.8.2",
|
|
43
|
-
"@microsoft/api-extractor-model": "7.30.
|
|
43
|
+
"@microsoft/api-extractor-model": "7.30.7",
|
|
44
44
|
"@rushstack/rig-package": "0.5.3",
|
|
45
|
-
"@rushstack/node-core-library": "5.
|
|
46
|
-
"@rushstack/
|
|
47
|
-
"@rushstack/
|
|
45
|
+
"@rushstack/node-core-library": "5.14.0",
|
|
46
|
+
"@rushstack/terminal": "0.15.4",
|
|
47
|
+
"@rushstack/ts-command-line": "5.0.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@rushstack/heft": "0.
|
|
50
|
+
"@rushstack/heft": "0.74.1",
|
|
51
51
|
"@types/lodash": "4.14.116",
|
|
52
|
-
"@types/minimatch": "3.0.5",
|
|
53
52
|
"@types/resolve": "1.20.2",
|
|
54
53
|
"@types/semver": "7.5.0",
|
|
54
|
+
"eslint": "~9.25.1",
|
|
55
55
|
"decoupled-local-node-rig": "1.0.0",
|
|
56
56
|
"local-eslint-config": "1.0.0"
|
|
57
57
|
},
|