@microsoft/api-extractor 7.50.1 → 7.51.1

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.
Files changed (42) hide show
  1. package/CHANGELOG.json +24 -0
  2. package/CHANGELOG.md +15 -1
  3. package/dist/rollup.d.ts +28 -2
  4. package/lib/analyzer/AstModule.d.ts +3 -2
  5. package/lib/analyzer/AstModule.d.ts.map +1 -1
  6. package/lib/analyzer/AstModule.js +1 -11
  7. package/lib/analyzer/AstModule.js.map +1 -1
  8. package/lib/analyzer/AstNamespaceImport.d.ts +2 -2
  9. package/lib/analyzer/AstNamespaceImport.d.ts.map +1 -1
  10. package/lib/analyzer/AstNamespaceImport.js.map +1 -1
  11. package/lib/analyzer/AstSymbolTable.d.ts +2 -2
  12. package/lib/analyzer/AstSymbolTable.d.ts.map +1 -1
  13. package/lib/analyzer/AstSymbolTable.js.map +1 -1
  14. package/lib/analyzer/ExportAnalyzer.d.ts +2 -2
  15. package/lib/analyzer/ExportAnalyzer.d.ts.map +1 -1
  16. package/lib/analyzer/ExportAnalyzer.js +12 -7
  17. package/lib/analyzer/ExportAnalyzer.js.map +1 -1
  18. package/lib/api/Extractor.js +3 -3
  19. package/lib/api/Extractor.js.map +1 -1
  20. package/lib/api/ExtractorConfig.d.ts +7 -3
  21. package/lib/api/ExtractorConfig.d.ts.map +1 -1
  22. package/lib/api/ExtractorConfig.js +69 -40
  23. package/lib/api/ExtractorConfig.js.map +1 -1
  24. package/lib/api/IConfigFile.d.ts +11 -0
  25. package/lib/api/IConfigFile.d.ts.map +1 -1
  26. package/lib/api/IConfigFile.js.map +1 -1
  27. package/lib/collector/Collector.d.ts +1 -0
  28. package/lib/collector/Collector.d.ts.map +1 -1
  29. package/lib/collector/Collector.js +59 -15
  30. package/lib/collector/Collector.js.map +1 -1
  31. package/lib/enhancers/ValidationEnhancer.js.map +1 -1
  32. package/lib/generators/ApiModelGenerator.d.ts +14 -2
  33. package/lib/generators/ApiModelGenerator.d.ts.map +1 -1
  34. package/lib/generators/ApiModelGenerator.js +12 -3
  35. package/lib/generators/ApiModelGenerator.js.map +1 -1
  36. package/lib/generators/ApiReportGenerator.js.map +1 -1
  37. package/lib/generators/DtsRollupGenerator.js.map +1 -1
  38. package/lib/index.d.ts +2 -1
  39. package/lib/index.d.ts.map +1 -1
  40. package/lib/index.js.map +1 -1
  41. package/lib/schemas/api-extractor.schema.json +8 -0
  42. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ExportAnalyzer.js","sourceRoot":"","sources":["../../src/analyzer/ExportAnalyzer.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,oEAA6D;AAE7D,2DAAwD;AACxD,2CAAwC;AACxC,2CAA+E;AAC/E,2CAA6D;AAC7D,+DAA4D;AAC5D,+EAA4E;AAG5E,6DAA0D;AAC1D,mDAAgD;AAChD,6DAA0D;AAgC1D;;;;;;;;;GASG;AACH,MAAa,cAAc;IAczB,YACE,OAAmB,EACnB,WAA2B,EAC3B,mBAAwC,EACxC,cAA+B;QAZhB,8BAAyB,GAA8B,IAAI,GAAG,EAAwB,CAAC;QAExG,4CAA4C;QAC3B,kCAA6B,GAAuB,IAAI,GAAG,EAAiB,CAAC;QAE7E,qBAAgB,GAA2B,IAAI,GAAG,EAAqB,CAAC;QACxE,gCAA2B,GAAuC,IAAI,GAAG,EAAE,CAAC;QAQ3F,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;QAChD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACI,4BAA4B,CACjC,UAAyB,EACzB,eAAgD,EAChD,UAAmB;QAEnB,MAAM,YAAY,GAAc,IAAI,CAAC,8BAA8B,CAAC,U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ACnC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAE1C,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,cAAc,GAAc,qCAAiB,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;gBAEnG,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;oBACxD,cAAc,EAAE,cAAc;oBAC9B,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,KAAK;oBAC7B,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;aAAM,CAAC;YACN,4EAA4E;YAC5E,oDAAoD;YACpD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBACxB,SAAS,CAAC,oBAAoB,GAAG,KAAK,CAAC;YACzC,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,mBAAmB,CACzB,yBAA0F;QAE1F,uGAAuG;QACvG,MAAM,eAAe,GACnB,qCAAiB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC;QAElE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,iCAAa,CACrB,oCAAoC;gBAClC,yDAA2B,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAC3E,CAAC;QACJ,CAAC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAt7BD,wCAs7BC","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 { InternalError } from '@rushstack/node-core-library';\n\nimport { TypeScriptHelpers } from './TypeScriptHelpers';\nimport { AstSymbol } from './AstSymbol';\nimport { AstImport, type IAstImportOptions, AstImportKind } from './AstImport';\nimport { AstModule, AstModuleExportInfo } from './AstModule';\nimport { TypeScriptInternals } from './TypeScriptInternals';\nimport { SourceFileLocationFormatter } from './SourceFileLocationFormatter';\nimport type { IFetchAstSymbolOptions } from './AstSymbolTable';\nimport type { AstEntity } from './AstEntity';\nimport { AstNamespaceImport } from './AstNamespaceImport';\nimport { SyntaxHelpers } from './SyntaxHelpers';\nimport { AstNamespaceExport } from './AstNamespaceExport';\n\n/**\n * Exposes the minimal APIs from AstSymbolTable that are needed by ExportAnalyzer.\n *\n * In particular, we want ExportAnalyzer to be able to call AstSymbolTable._fetchAstSymbol() even though it\n * is a very private API that should not be exposed to any other components.\n */\nexport interface IAstSymbolTable {\n fetchAstSymbol(options: IFetchAstSymbolOptions): AstSymbol | undefined;\n\n analyze(astEntity: AstEntity): void;\n}\n\n/**\n * Used with ExportAnalyzer.fetchAstModuleBySourceFile() to provide contextual information about how the source file\n * was imported.\n */\ninterface IAstModuleReference {\n /**\n * For example, if we are following a statement like `import { X } from 'some-package'`, this will be the\n * string `\"some-package\"`.\n */\n moduleSpecifier: string;\n\n /**\n * For example, if we are following a statement like `import { X } from 'some-package'`, this will be the\n * symbol for `X`.\n */\n moduleSpecifierSymbol: ts.Symbol;\n}\n\n/**\n * The ExportAnalyzer is an internal part of AstSymbolTable that has been moved out into its own source file\n * because it is a complex and mostly self-contained algorithm.\n *\n * Its job is to build up AstModule objects by crawling import statements to discover where declarations come from.\n * This is conceptually the same as the compiler's own TypeChecker.getExportsOfModule(), except that when\n * ExportAnalyzer encounters a declaration that was imported from an external package, it remembers how it was imported\n * (i.e. the AstImport object). Today the compiler API does not expose this information, which is crucial for\n * generating .d.ts rollups.\n */\nexport class ExportAnalyzer {\n private readonly _program: ts.Program;\n private readonly _typeChecker: ts.TypeChecker;\n private readonly _bundledPackageNames: ReadonlySet<string>;\n private readonly _astSymbolTable: IAstSymbolTable;\n\n private readonly _astModulesByModuleSymbol: Map<ts.Symbol, AstModule> = new Map<ts.Symbol, AstModule>();\n\n // Used with isImportableAmbientSourceFile()\n private readonly _importableAmbientSourceFiles: Set<ts.SourceFile> = new Set<ts.SourceFile>();\n\n private readonly _astImportsByKey: Map<string, AstImport> = new Map<string, AstImport>();\n private readonly _astNamespaceImportByModule: Map<AstModule, AstNamespaceImport> = new Map();\n\n public constructor(\n program: ts.Program,\n typeChecker: ts.TypeChecker,\n bundledPackageNames: ReadonlySet<string>,\n astSymbolTable: IAstSymbolTable\n ) {\n this._program = program;\n this._typeChecker = typeChecker;\n this._bundledPackageNames = bundledPackageNames;\n this._astSymbolTable = astSymbolTable;\n }\n\n /**\n * For a given source file, this analyzes all of its exports and produces an AstModule object.\n *\n * @param moduleReference - contextual information about the import statement that took us to this source file.\n * or `undefined` if this source file is the initial entry point\n * @param isExternal - whether the given `moduleReference` is external.\n */\n public fetchAstModuleFromSourceFile(\n sourceFile: ts.SourceFile,\n moduleReference: IAstModuleReference | undefined,\n isExternal: boolean\n ): AstModule {\n const moduleSymbol: ts.Symbol = this._getModuleSymbolFromSourceFile(sourceFile, moduleReference);\n\n // Don't traverse into a module that we already processed before:\n // The compiler allows m1 to have \"export * from 'm2'\" and \"export * from 'm3'\",\n // even if m2 and m3 both have \"export * from 'm4'\".\n let astModule: AstModule | undefined = this._astModulesByModuleSymbol.get(moduleSymbol);\n if (!astModule) {\n // (If moduleReference === undefined, then this is the entry point of the local project being analyzed.)\n const externalModulePath: string | undefined =\n moduleReference !== undefined && isExternal ? moduleReference.moduleSpecifier : undefined;\n\n astModule = new AstModule({ sourceFile, moduleSymbol, externalModulePath });\n\n this._astModulesByModuleSymbol.set(moduleSymbol, astModule);\n\n if (astModule.isExternal) {\n // It's an external package, so do the special simplified analysis that doesn't crawl into referenced modules\n for (const exportedSymbol of this._typeChecker.getExportsOfModule(moduleSymbol)) {\n if (externalModulePath === undefined) {\n throw new InternalError(\n 'Failed assertion: externalModulePath=undefined but astModule.isExternal=true'\n );\n }\n\n const followedSymbol: ts.Symbol = TypeScriptHelpers.followAliases(\n exportedSymbol,\n this._typeChecker\n );\n\n // Ignore virtual symbols that don't have any declarations\n const arbitraryDeclaration: ts.Declaration | undefined =\n TypeScriptHelpers.tryGetADeclaration(followedSymbol);\n if (arbitraryDeclaration) {\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: astModule.isExternal,\n includeNominalAnalysis: true,\n addIfMissing: true\n });\n\n if (!astSymbol) {\n throw new Error(\n `Unsupported export ${JSON.stringify(exportedSymbol.name)}:\\n` +\n SourceFileLocationFormatter.formatDeclaration(arbitraryDeclaration)\n );\n }\n\n astModule.cachedExportedEntities.set(exportedSymbol.name, astSymbol);\n }\n }\n } else {\n // The module is part of the local project, so do the full analysis\n\n if (moduleSymbol.exports) {\n // The \"export * from 'module-name';\" declarations are all attached to a single virtual symbol\n // whose name is InternalSymbolName.ExportStar\n const exportStarSymbol: ts.Symbol | undefined = moduleSymbol.exports.get(\n ts.InternalSymbolName.ExportStar\n );\n if (exportStarSymbol) {\n for (const exportStarDeclaration of exportStarSymbol.getDeclarations() || []) {\n if (ts.isExportDeclaration(exportStarDeclaration)) {\n const starExportedModule: AstModule | undefined = this._fetchSpecifierAstModule(\n exportStarDeclaration,\n exportStarSymbol\n );\n\n if (starExportedModule !== undefined) {\n astModule.starExportedModules.add(starExportedModule);\n }\n } else {\n // Ignore ExportDeclaration nodes that don't match the expected pattern\n // TODO: Should we report a warning?\n }\n }\n }\n }\n }\n }\n\n return astModule;\n }\n\n /**\n * Retrieves the symbol for the module corresponding to the ts.SourceFile that is being imported/exported.\n *\n * @remarks\n * The `module` keyword can be used to declare multiple TypeScript modules inside a single source file.\n * (This is a deprecated construct and mainly used for typings such as `@types/node`.) In this situation,\n * `moduleReference` helps us to fish out the correct module symbol.\n */\n private _getModuleSymbolFromSourceFile(\n sourceFile: ts.SourceFile,\n moduleReference: IAstModuleReference | undefined\n ): ts.Symbol {\n const moduleSymbol: ts.Symbol | undefined = TypeScriptInternals.tryGetSymbolForDeclaration(\n sourceFile,\n this._typeChecker\n );\n if (moduleSymbol !== undefined) {\n // This is the normal case. The SourceFile acts is a module and has a symbol.\n return moduleSymbol;\n }\n\n if (moduleReference !== undefined) {\n // But there is also an elaborate case where the source file contains one or more \"module\" declarations,\n // and our moduleReference took us to one of those.\n\n // eslint-disable-next-line no-bitwise\n if ((moduleReference.moduleSpecifierSymbol.flags & ts.SymbolFlags.Alias) !== 0) {\n // Follow the import/export declaration to one hop the exported item inside the target module\n let followedSymbol: ts.Symbol | undefined = TypeScriptInternals.getImmediateAliasedSymbol(\n moduleReference.moduleSpecifierSymbol,\n this._typeChecker\n );\n\n if (followedSymbol === undefined) {\n // This is a workaround for a compiler bug where getImmediateAliasedSymbol() sometimes returns undefined\n followedSymbol = this._typeChecker.getAliasedSymbol(moduleReference.moduleSpecifierSymbol);\n }\n\n if (followedSymbol !== undefined && followedSymbol !== moduleReference.moduleSpecifierSymbol) {\n // The parent of the exported symbol will be the module that we're importing from\n const parent: ts.Symbol | undefined = TypeScriptInternals.getSymbolParent(followedSymbol);\n if (parent !== undefined) {\n // Make sure the thing we found is a module\n // eslint-disable-next-line no-bitwise\n if ((parent.flags & ts.SymbolFlags.ValueModule) !== 0) {\n // Record that that this is an ambient module that can also be imported from\n this._importableAmbientSourceFiles.add(sourceFile);\n return parent;\n }\n }\n }\n }\n }\n\n throw new InternalError('Unable to determine module for: ' + sourceFile.fileName);\n }\n\n /**\n * Implementation of {@link AstSymbolTable.fetchAstModuleExportInfo}.\n */\n public fetchAstModuleExportInfo(entryPointAstModule: AstModule): AstModuleExportInfo {\n if (entryPointAstModule.isExternal) {\n throw new Error('fetchAstModuleExportInfo() is not supported for external modules');\n }\n\n if (entryPointAstModule.astModuleExportInfo === undefined) {\n const astModuleExportInfo: AstModuleExportInfo = new AstModuleExportInfo();\n\n this._collectAllExportsRecursive(astModuleExportInfo, entryPointAstModule, new Set<AstModule>());\n\n entryPointAstModule.astModuleExportInfo = astModuleExportInfo;\n }\n return entryPointAstModule.astModuleExportInfo;\n }\n\n /**\n * Returns true if the module specifier refers to an external package. Ignores packages listed in the\n * \"bundledPackages\" setting from the api-extractor.json config file.\n */\n private _isExternalModulePath(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode,\n moduleSpecifier: string\n ): boolean {\n const specifier: ts.TypeNode | ts.Expression | undefined = ts.isImportTypeNode(importOrExportDeclaration)\n ? importOrExportDeclaration.argument\n : importOrExportDeclaration.moduleSpecifier;\n const mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined =\n specifier && ts.isStringLiteralLike(specifier)\n ? TypeScriptInternals.getModeForUsageLocation(\n importOrExportDeclaration.getSourceFile(),\n specifier,\n this._program.getCompilerOptions()\n )\n : undefined;\n\n const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(\n this._program,\n importOrExportDeclaration.getSourceFile(),\n moduleSpecifier,\n mode\n );\n\n if (resolvedModule === undefined) {\n // The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's\n // previous behavior, simply treat all ambient modules as external. This bug is tracked by\n // https://github.com/microsoft/rushstack/issues/3335.\n return true;\n }\n\n // Either something like `jquery` or `@microsoft/api-extractor`.\n const packageName: string | undefined = resolvedModule.packageId?.name;\n if (packageName !== undefined && this._bundledPackageNames.has(packageName)) {\n return false;\n }\n\n if (resolvedModule.isExternalLibraryImport === undefined) {\n // This presumably means the compiler couldn't figure out whether the module was external, but we're not\n // sure how this can happen.\n throw new InternalError(\n `Cannot determine whether the module ${JSON.stringify(moduleSpecifier)} is external\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n return resolvedModule.isExternalLibraryImport;\n }\n\n /**\n * Returns true if when we analyzed sourceFile, we found that it contains an \"export=\" statement that allows\n * it to behave /either/ as an ambient module /or/ as a regular importable module. In this case,\n * `AstSymbolTable._fetchAstSymbol()` will analyze its symbols even though `TypeScriptHelpers.isAmbient()`\n * returns true.\n */\n public isImportableAmbientSourceFile(sourceFile: ts.SourceFile): boolean {\n return this._importableAmbientSourceFiles.has(sourceFile);\n }\n\n private _collectAllExportsRecursive(\n astModuleExportInfo: AstModuleExportInfo,\n astModule: AstModule,\n visitedAstModules: Set<AstModule>\n ): void {\n if (visitedAstModules.has(astModule)) {\n return;\n }\n visitedAstModules.add(astModule);\n\n if (astModule.isExternal) {\n astModuleExportInfo.starExportedExternalModules.add(astModule);\n } else {\n // Fetch each of the explicit exports for this module\n if (astModule.moduleSymbol.exports) {\n astModule.moduleSymbol.exports.forEach((exportSymbol, exportName) => {\n switch (exportName) {\n case ts.InternalSymbolName.ExportStar:\n case ts.InternalSymbolName.ExportEquals:\n break;\n default:\n // Don't collect the \"export default\" symbol unless this is the entry point module\n if (exportName !== ts.InternalSymbolName.Default || visitedAstModules.size === 1) {\n if (!astModuleExportInfo.exportedLocalEntities.has(exportSymbol.name)) {\n const astEntity: AstEntity = this._getExportOfAstModule(exportSymbol.name, astModule);\n\n if (astEntity instanceof AstSymbol && !astEntity.isExternal) {\n this._astSymbolTable.analyze(astEntity);\n }\n\n if (astEntity instanceof AstNamespaceImport && !astEntity.astModule.isExternal) {\n this._astSymbolTable.analyze(astEntity);\n }\n\n astModuleExportInfo.exportedLocalEntities.set(exportSymbol.name, astEntity);\n }\n }\n break;\n }\n });\n }\n\n for (const starExportedModule of astModule.starExportedModules) {\n this._collectAllExportsRecursive(astModuleExportInfo, starExportedModule, visitedAstModules);\n }\n }\n }\n\n /**\n * For a given symbol (which was encountered in the specified sourceFile), this fetches the AstEntity that it\n * refers to. For example, if a particular interface describes the return value of a function, this API can help\n * us determine a TSDoc declaration reference for that symbol (if the symbol is exported).\n */\n public fetchReferencedAstEntity(\n symbol: ts.Symbol,\n referringModuleIsExternal: boolean\n ): AstEntity | undefined {\n // eslint-disable-next-line no-bitwise\n if ((symbol.flags & ts.SymbolFlags.FunctionScopedVariable) !== 0) {\n // If a symbol refers back to part of its own definition, don't follow that rabbit hole\n // Example:\n //\n // function f(x: number): typeof x {\n // return 123;\n // }\n return undefined;\n }\n\n let current: ts.Symbol = symbol;\n\n if (referringModuleIsExternal) {\n current = TypeScriptHelpers.followAliases(symbol, this._typeChecker);\n } else {\n for (;;) {\n // Is this symbol an import/export that we need to follow to find the real declaration?\n for (const declaration of current.declarations || []) {\n let matchedAstEntity: AstEntity | undefined;\n matchedAstEntity = this._tryMatchExportDeclaration(declaration, current);\n if (matchedAstEntity !== undefined) {\n return matchedAstEntity;\n }\n matchedAstEntity = this._tryMatchImportDeclaration(declaration, current);\n if (matchedAstEntity !== undefined) {\n return matchedAstEntity;\n }\n }\n\n // eslint-disable-next-line no-bitwise\n if (!(current.flags & ts.SymbolFlags.Alias)) {\n break;\n }\n\n const currentAlias: ts.Symbol = TypeScriptInternals.getImmediateAliasedSymbol(\n current,\n this._typeChecker\n );\n // Stop if we reach the end of the chain\n if (!currentAlias || currentAlias === current) {\n break;\n }\n\n current = currentAlias;\n }\n }\n\n // Otherwise, assume it is a normal declaration\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: current,\n isExternal: referringModuleIsExternal,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n\n return astSymbol;\n }\n\n public fetchReferencedAstEntityFromImportTypeNode(\n node: ts.ImportTypeNode,\n referringModuleIsExternal: boolean\n ): AstEntity | undefined {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(node);\n\n if (externalModulePath) {\n let exportName: string;\n if (node.qualifier) {\n // Example input:\n // import('api-extractor-lib1-test').Lib1GenericType<number>\n //\n // Extracted qualifier:\n // Lib1GenericType\n exportName = node.qualifier.getText().trim();\n } else {\n // Example input:\n // import('api-extractor-lib1-test')\n //\n // Extracted qualifier:\n // apiExtractorLib1Test\n\n exportName = SyntaxHelpers.makeCamelCaseIdentifier(externalModulePath);\n }\n\n return this._fetchAstImport(undefined, {\n importKind: AstImportKind.ImportType,\n exportName: exportName,\n modulePath: externalModulePath,\n isTypeOnly: false\n });\n }\n\n // Internal reference: AstSymbol\n const rightMostToken: ts.Identifier | ts.ImportTypeNode = node.qualifier\n ? node.qualifier.kind === ts.SyntaxKind.QualifiedName\n ? node.qualifier.right\n : node.qualifier\n : node;\n\n // There is no symbol property in a ImportTypeNode, obtain the associated export symbol\n const exportSymbol: ts.Symbol | undefined = this._typeChecker.getSymbolAtLocation(rightMostToken);\n if (!exportSymbol) {\n throw new InternalError(\n `Symbol not found for identifier: ${node.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(node)\n );\n }\n\n let followedSymbol: ts.Symbol = exportSymbol;\n for (;;) {\n const referencedAstEntity: AstEntity | undefined = this.fetchReferencedAstEntity(\n followedSymbol,\n referringModuleIsExternal\n );\n\n if (referencedAstEntity) {\n return referencedAstEntity;\n }\n\n const followedSymbolNode: ts.Node | ts.ImportTypeNode | undefined =\n followedSymbol.declarations && (followedSymbol.declarations[0] as ts.Node | undefined);\n\n if (followedSymbolNode && followedSymbolNode.kind === ts.SyntaxKind.ImportType) {\n return this.fetchReferencedAstEntityFromImportTypeNode(\n followedSymbolNode as ts.ImportTypeNode,\n referringModuleIsExternal\n );\n }\n\n // eslint-disable-next-line no-bitwise\n if (!(followedSymbol.flags & ts.SymbolFlags.Alias)) {\n break;\n }\n\n const currentAlias: ts.Symbol = this._typeChecker.getAliasedSymbol(followedSymbol);\n if (!currentAlias || currentAlias === followedSymbol) {\n break;\n }\n\n followedSymbol = currentAlias;\n }\n\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: referringModuleIsExternal,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n\n return astSymbol;\n }\n\n private _tryMatchExportDeclaration(\n declaration: ts.Declaration,\n declarationSymbol: ts.Symbol\n ): AstEntity | undefined {\n const exportDeclaration: ts.ExportDeclaration | undefined =\n TypeScriptHelpers.findFirstParent<ts.ExportDeclaration>(declaration, ts.SyntaxKind.ExportDeclaration);\n\n if (exportDeclaration) {\n let exportName: string | undefined = undefined;\n\n if (declaration.kind === ts.SyntaxKind.ExportSpecifier) {\n // EXAMPLE:\n // \"export { A } from './file-a';\"\n //\n // ExportDeclaration:\n // ExportKeyword: pre=[export] sep=[ ]\n // NamedExports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ExportSpecifier: <------------- declaration\n // Identifier: pre=[A] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['./file-a']\n // SemicolonToken: pre=[;]\n\n // Example: \" ExportName as RenamedName\"\n const exportSpecifier: ts.ExportSpecifier = declaration as ts.ExportSpecifier;\n exportName = (exportSpecifier.propertyName || exportSpecifier.name).getText().trim();\n } else if (declaration.kind === ts.SyntaxKind.NamespaceExport) {\n // EXAMPLE:\n // \"export * as theLib from 'the-lib';\"\n //\n // ExportDeclaration:\n // ExportKeyword: pre=[export] sep=[ ]\n // NamespaceExport:\n // AsteriskToken: pre=[*] sep=[ ]\n // AsKeyword: pre=[as] sep=[ ]\n // Identifier: pre=[theLib] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n // Issue tracking this feature: https://github.com/microsoft/rushstack/issues/2780\n\n const astModule: AstModule = this._fetchSpecifierAstModule(exportDeclaration, declarationSymbol);\n return this._getAstNamespaceExport(astModule, declarationSymbol, declaration);\n } else {\n throw new InternalError(\n `Unimplemented export declaration kind: ${declaration.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(declaration)\n );\n }\n\n // Ignore \"export { A }\" without a module specifier\n if (exportDeclaration.moduleSpecifier) {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(exportDeclaration);\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: externalModulePath,\n exportName: exportName,\n isTypeOnly: false\n });\n }\n\n return this._getExportOfSpecifierAstModule(exportName, exportDeclaration, declarationSymbol);\n }\n }\n\n return undefined;\n }\n\n private _getAstNamespaceExport(\n astModule: AstModule,\n declarationSymbol: ts.Symbol,\n declaration: ts.Declaration\n ): AstNamespaceExport {\n const imoprtNamespace: AstNamespaceImport = this._getAstNamespaceImport(\n astModule,\n declarationSymbol,\n declaration\n );\n\n return new AstNamespaceExport({\n namespaceName: imoprtNamespace.localName,\n astModule: astModule,\n declaration,\n symbol: declarationSymbol\n });\n }\n\n private _tryMatchImportDeclaration(\n declaration: ts.Declaration,\n declarationSymbol: ts.Symbol\n ): AstEntity | undefined {\n const importDeclaration: ts.ImportDeclaration | undefined =\n TypeScriptHelpers.findFirstParent<ts.ImportDeclaration>(declaration, ts.SyntaxKind.ImportDeclaration);\n\n if (importDeclaration) {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(importDeclaration);\n\n if (declaration.kind === ts.SyntaxKind.NamespaceImport) {\n // EXAMPLE:\n // \"import * as theLib from 'the-lib';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause:\n // NamespaceImport: <------------- declaration\n // AsteriskToken: pre=[*] sep=[ ]\n // AsKeyword: pre=[as] sep=[ ]\n // Identifier: pre=[theLib] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n if (externalModulePath === undefined) {\n const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol);\n return this._getAstNamespaceImport(astModule, declarationSymbol, declaration);\n }\n\n // Here importSymbol=undefined because {@inheritDoc} and such are not going to work correctly for\n // a package or source file.\n return this._fetchAstImport(undefined, {\n importKind: AstImportKind.StarImport,\n exportName: declarationSymbol.name,\n modulePath: externalModulePath,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n if (declaration.kind === ts.SyntaxKind.ImportSpecifier) {\n // EXAMPLE:\n // \"import { A, B } from 'the-lib';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause:\n // NamedImports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ImportSpecifier: <------------- declaration\n // Identifier: pre=[A]\n // CommaToken: pre=[,] sep=[ ]\n // ImportSpecifier:\n // Identifier: pre=[B] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n // Example: \" ExportName as RenamedName\"\n const importSpecifier: ts.ImportSpecifier = declaration as ts.ImportSpecifier;\n const exportName: string = (importSpecifier.propertyName || importSpecifier.name).getText().trim();\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: externalModulePath,\n exportName: exportName,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n return this._getExportOfSpecifierAstModule(exportName, importDeclaration, declarationSymbol);\n } else if (declaration.kind === ts.SyntaxKind.ImportClause) {\n // EXAMPLE:\n // \"import A, { B } from './A';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause: <------------- declaration (referring to A)\n // Identifier: pre=[A]\n // CommaToken: pre=[,] sep=[ ]\n // NamedImports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ImportSpecifier:\n // Identifier: pre=[B] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['./A']\n // SemicolonToken: pre=[;]\n\n const importClause: ts.ImportClause = declaration as ts.ImportClause;\n const exportName: string = importClause.name\n ? importClause.name.getText().trim()\n : ts.InternalSymbolName.Default;\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.DefaultImport,\n modulePath: externalModulePath,\n exportName,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n return this._getExportOfSpecifierAstModule(\n ts.InternalSymbolName.Default,\n importDeclaration,\n declarationSymbol\n );\n } else {\n throw new InternalError(\n `Unimplemented import declaration kind: ${declaration.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(declaration)\n );\n }\n }\n\n if (ts.isImportEqualsDeclaration(declaration)) {\n // EXAMPLE:\n // import myLib = require('my-lib');\n //\n // ImportEqualsDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // Identifier: pre=[myLib] sep=[ ]\n // FirstAssignment: pre=[=] sep=[ ]\n // ExternalModuleReference:\n // RequireKeyword: pre=[require]\n // OpenParenToken: pre=[(]\n // StringLiteral: pre=['my-lib']\n // CloseParenToken: pre=[)]\n // SemicolonToken: pre=[;]\n if (ts.isExternalModuleReference(declaration.moduleReference)) {\n if (ts.isStringLiteralLike(declaration.moduleReference.expression)) {\n const variableName: string = TypeScriptInternals.getTextOfIdentifierOrLiteral(declaration.name);\n const externalModuleName: string = TypeScriptInternals.getTextOfIdentifierOrLiteral(\n declaration.moduleReference.expression\n );\n\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.EqualsImport,\n modulePath: externalModuleName,\n exportName: variableName,\n isTypeOnly: false\n });\n }\n }\n }\n\n return undefined;\n }\n\n private _getAstNamespaceImport(\n astModule: AstModule,\n declarationSymbol: ts.Symbol,\n declaration: ts.Declaration\n ): AstNamespaceImport {\n let namespaceImport: AstNamespaceImport | undefined = this._astNamespaceImportByModule.get(astModule);\n if (namespaceImport === undefined) {\n namespaceImport = new AstNamespaceImport({\n namespaceName: declarationSymbol.name,\n astModule: astModule,\n declaration: declaration,\n symbol: declarationSymbol\n });\n this._astNamespaceImportByModule.set(astModule, namespaceImport);\n }\n\n return namespaceImport;\n }\n\n private static _getIsTypeOnly(importDeclaration: ts.ImportDeclaration): boolean {\n if (importDeclaration.importClause) {\n return !!importDeclaration.importClause.isTypeOnly;\n }\n return false;\n }\n\n private _getExportOfSpecifierAstModule(\n exportName: string,\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration,\n exportSymbol: ts.Symbol\n ): AstEntity {\n const specifierAstModule: AstModule = this._fetchSpecifierAstModule(\n importOrExportDeclaration,\n exportSymbol\n );\n const astEntity: AstEntity = this._getExportOfAstModule(exportName, specifierAstModule);\n return astEntity;\n }\n\n private _getExportOfAstModule(exportName: string, astModule: AstModule): AstEntity {\n const visitedAstModules: Set<AstModule> = new Set<AstModule>();\n const astEntity: AstEntity | undefined = this._tryGetExportOfAstModule(\n exportName,\n astModule,\n visitedAstModules\n );\n if (astEntity === undefined) {\n throw new InternalError(\n `Unable to analyze the export ${JSON.stringify(exportName)} in\\n` + astModule.sourceFile.fileName\n );\n }\n return astEntity;\n }\n\n /**\n * Implementation of {@link AstSymbolTable.tryGetExportOfAstModule}.\n */\n public tryGetExportOfAstModule(exportName: string, astModule: AstModule): AstEntity | undefined {\n const visitedAstModules: Set<AstModule> = new Set<AstModule>();\n return this._tryGetExportOfAstModule(exportName, astModule, visitedAstModules);\n }\n\n private _tryGetExportOfAstModule(\n exportName: string,\n astModule: AstModule,\n visitedAstModules: Set<AstModule>\n ): AstEntity | undefined {\n if (visitedAstModules.has(astModule)) {\n return undefined;\n }\n visitedAstModules.add(astModule);\n\n let astEntity: AstEntity | undefined = astModule.cachedExportedEntities.get(exportName);\n if (astEntity !== undefined) {\n return astEntity;\n }\n\n // Try the explicit exports\n const escapedExportName: ts.__String = ts.escapeLeadingUnderscores(exportName);\n if (astModule.moduleSymbol.exports) {\n const exportSymbol: ts.Symbol | undefined = astModule.moduleSymbol.exports.get(escapedExportName);\n if (exportSymbol) {\n astEntity = this.fetchReferencedAstEntity(exportSymbol, astModule.isExternal);\n\n if (astEntity !== undefined) {\n astModule.cachedExportedEntities.set(exportName, astEntity); // cache for next time\n return astEntity;\n }\n }\n }\n\n // Try each of the star imports\n for (const starExportedModule of astModule.starExportedModules) {\n astEntity = this._tryGetExportOfAstModule(exportName, starExportedModule, visitedAstModules);\n\n if (astEntity !== undefined) {\n if (starExportedModule.externalModulePath !== undefined) {\n // This entity was obtained from an external module, so return an AstImport instead\n const astSymbol: AstSymbol = astEntity as AstSymbol;\n return this._fetchAstImport(astSymbol.followedSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: starExportedModule.externalModulePath,\n exportName: exportName,\n isTypeOnly: false\n });\n }\n\n return astEntity;\n }\n }\n\n return undefined;\n }\n\n private _tryGetExternalModulePath(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode\n ): string | undefined {\n const moduleSpecifier: string = this._getModuleSpecifier(importOrExportDeclaration);\n if (this._isExternalModulePath(importOrExportDeclaration, moduleSpecifier)) {\n return moduleSpecifier;\n }\n\n return undefined;\n }\n\n /**\n * Given an ImportDeclaration of the form `export { X } from \"___\";`, this interprets the module specifier (`\"___\"`)\n * and fetches the corresponding AstModule object.\n */\n private _fetchSpecifierAstModule(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration,\n exportSymbol: ts.Symbol\n ): AstModule {\n const moduleSpecifier: string = this._getModuleSpecifier(importOrExportDeclaration);\n const mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined =\n importOrExportDeclaration.moduleSpecifier &&\n ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier)\n ? TypeScriptInternals.getModeForUsageLocation(\n importOrExportDeclaration.getSourceFile(),\n importOrExportDeclaration.moduleSpecifier,\n this._program.getCompilerOptions()\n )\n : undefined;\n const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(\n this._program,\n importOrExportDeclaration.getSourceFile(),\n moduleSpecifier,\n mode\n );\n\n if (resolvedModule === undefined) {\n // Encountered in https://github.com/microsoft/rushstack/issues/1914.\n //\n // It's also possible for this to occur with ambient modules. However, in practice this doesn't happen\n // as API Extractor treats all ambient modules as external per the logic in `_isExternalModulePath`, and\n // thus this code path is never reached for ambient modules.\n throw new InternalError(\n `getResolvedModule() could not resolve module name ${JSON.stringify(moduleSpecifier)}\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n // Map the filename back to the corresponding SourceFile. This circuitous approach is needed because\n // we have no way to access the compiler's internal resolveExternalModuleName() function\n const moduleSourceFile: ts.SourceFile | undefined = this._program.getSourceFile(\n resolvedModule.resolvedFileName\n );\n if (!moduleSourceFile) {\n // This should not happen, since getResolvedModule() specifically looks up names that the compiler\n // found in export declarations for this source file\n throw new InternalError(\n `getSourceFile() failed to locate ${JSON.stringify(resolvedModule.resolvedFileName)}\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n const isExternal: boolean = this._isExternalModulePath(importOrExportDeclaration, moduleSpecifier);\n const moduleReference: IAstModuleReference = {\n moduleSpecifier: moduleSpecifier,\n moduleSpecifierSymbol: exportSymbol\n };\n const specifierAstModule: AstModule = this.fetchAstModuleFromSourceFile(\n moduleSourceFile,\n moduleReference,\n isExternal\n );\n\n return specifierAstModule;\n }\n\n private _fetchAstImport(importSymbol: ts.Symbol | undefined, options: IAstImportOptions): AstImport {\n const key: string = AstImport.getKey(options);\n\n let astImport: AstImport | undefined = this._astImportsByKey.get(key);\n\n if (!astImport) {\n astImport = new AstImport(options);\n this._astImportsByKey.set(key, astImport);\n\n if (importSymbol) {\n const followedSymbol: ts.Symbol = TypeScriptHelpers.followAliases(importSymbol, this._typeChecker);\n\n astImport.astSymbol = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: true,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n }\n } else {\n // If we encounter at least one import that does not use the type-only form,\n // then the .d.ts rollup will NOT use \"import type\".\n if (!options.isTypeOnly) {\n astImport.isTypeOnlyEverywhere = false;\n }\n }\n\n return astImport;\n }\n\n private _getModuleSpecifier(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode\n ): string {\n // The name of the module, which could be like \"./SomeLocalFile' or like 'external-package/entry/point'\n const moduleSpecifier: string | undefined =\n TypeScriptHelpers.getModuleSpecifier(importOrExportDeclaration);\n\n if (!moduleSpecifier) {\n throw new InternalError(\n 'Unable to parse module specifier\\n' +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n return moduleSpecifier;\n }\n}\n"]}
1
+ {"version":3,"file":"ExportAnalyzer.js","sourceRoot":"","sources":["../../src/analyzer/ExportAnalyzer.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,+CAAiC;AACjC,oEAA6D;AAE7D,2DAAwD;AACxD,2CAAwC;AACxC,2CAA+E;AAC/E,2CAAmE;AACnE,+DAA4D;AAC5D,+EAA4E;AAG5E,6DAA0D;AAC1D,mDAAgD;AAChD,6DAA0D;AAgC1D;;;;;;;;;GASG;AACH,MAAa,cAAc;IAczB,YACE,OAAmB,EACnB,WAA2B,EAC3B,mBAAwC,EACxC,cAA+B;QAZhB,8BAAyB,GAA8B,IAAI,GAAG,EAAwB,CAAC;QAExG,4CAA4C;QAC3B,kCAA6B,GAAuB,IAAI,GAAG,EAAiB,CAAC;QAE7E,qBAAgB,GAA2B,IAAI,GAAG,EAAqB,CAAC;QACxE,gCAA2B,GAAuC,IAAI,GAAG,EAAE,CAAC;QAQ3F,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;QAChD,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACI,4BAA4B,CACjC,UAAyB,EACzB,eAAgD,EAChD,UAAmB;QAEnB,MAAM,YAAY,GAAc,IAAI,CAAC,8BAA8B,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QAEjG,iEAAiE;QACjE,gFAAgF;QAChF,oDAAoD;QACpD,IAAI,SAAS,GAA0B,IAAI,CAAC,yB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B,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YAE1C,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,cAAc,GAAc,qCAAiB,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;gBAEnG,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;oBACxD,cAAc,EAAE,cAAc;oBAC9B,UAAU,EAAE,IAAI;oBAChB,sBAAsB,EAAE,KAAK;oBAC7B,YAAY,EAAE,IAAI;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;aAAM,CAAC;YACN,4EAA4E;YAC5E,oDAAoD;YACpD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;gBACxB,SAAS,CAAC,oBAAoB,GAAG,KAAK,CAAC;YACzC,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,mBAAmB,CACzB,yBAA0F;QAE1F,uGAAuG;QACvG,MAAM,eAAe,GACnB,qCAAiB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC;QAElE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,iCAAa,CACrB,oCAAoC;gBAClC,yDAA2B,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAC3E,CAAC;QACJ,CAAC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAv7BD,wCAu7BC","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 { InternalError } from '@rushstack/node-core-library';\n\nimport { TypeScriptHelpers } from './TypeScriptHelpers';\nimport { AstSymbol } from './AstSymbol';\nimport { AstImport, type IAstImportOptions, AstImportKind } from './AstImport';\nimport { AstModule, type IAstModuleExportInfo } from './AstModule';\nimport { TypeScriptInternals } from './TypeScriptInternals';\nimport { SourceFileLocationFormatter } from './SourceFileLocationFormatter';\nimport type { IFetchAstSymbolOptions } from './AstSymbolTable';\nimport type { AstEntity } from './AstEntity';\nimport { AstNamespaceImport } from './AstNamespaceImport';\nimport { SyntaxHelpers } from './SyntaxHelpers';\nimport { AstNamespaceExport } from './AstNamespaceExport';\n\n/**\n * Exposes the minimal APIs from AstSymbolTable that are needed by ExportAnalyzer.\n *\n * In particular, we want ExportAnalyzer to be able to call AstSymbolTable._fetchAstSymbol() even though it\n * is a very private API that should not be exposed to any other components.\n */\nexport interface IAstSymbolTable {\n fetchAstSymbol(options: IFetchAstSymbolOptions): AstSymbol | undefined;\n\n analyze(astEntity: AstEntity): void;\n}\n\n/**\n * Used with ExportAnalyzer.fetchAstModuleBySourceFile() to provide contextual information about how the source file\n * was imported.\n */\ninterface IAstModuleReference {\n /**\n * For example, if we are following a statement like `import { X } from 'some-package'`, this will be the\n * string `\"some-package\"`.\n */\n moduleSpecifier: string;\n\n /**\n * For example, if we are following a statement like `import { X } from 'some-package'`, this will be the\n * symbol for `X`.\n */\n moduleSpecifierSymbol: ts.Symbol;\n}\n\n/**\n * The ExportAnalyzer is an internal part of AstSymbolTable that has been moved out into its own source file\n * because it is a complex and mostly self-contained algorithm.\n *\n * Its job is to build up AstModule objects by crawling import statements to discover where declarations come from.\n * This is conceptually the same as the compiler's own TypeChecker.getExportsOfModule(), except that when\n * ExportAnalyzer encounters a declaration that was imported from an external package, it remembers how it was imported\n * (i.e. the AstImport object). Today the compiler API does not expose this information, which is crucial for\n * generating .d.ts rollups.\n */\nexport class ExportAnalyzer {\n private readonly _program: ts.Program;\n private readonly _typeChecker: ts.TypeChecker;\n private readonly _bundledPackageNames: ReadonlySet<string>;\n private readonly _astSymbolTable: IAstSymbolTable;\n\n private readonly _astModulesByModuleSymbol: Map<ts.Symbol, AstModule> = new Map<ts.Symbol, AstModule>();\n\n // Used with isImportableAmbientSourceFile()\n private readonly _importableAmbientSourceFiles: Set<ts.SourceFile> = new Set<ts.SourceFile>();\n\n private readonly _astImportsByKey: Map<string, AstImport> = new Map<string, AstImport>();\n private readonly _astNamespaceImportByModule: Map<AstModule, AstNamespaceImport> = new Map();\n\n public constructor(\n program: ts.Program,\n typeChecker: ts.TypeChecker,\n bundledPackageNames: ReadonlySet<string>,\n astSymbolTable: IAstSymbolTable\n ) {\n this._program = program;\n this._typeChecker = typeChecker;\n this._bundledPackageNames = bundledPackageNames;\n this._astSymbolTable = astSymbolTable;\n }\n\n /**\n * For a given source file, this analyzes all of its exports and produces an AstModule object.\n *\n * @param moduleReference - contextual information about the import statement that took us to this source file.\n * or `undefined` if this source file is the initial entry point\n * @param isExternal - whether the given `moduleReference` is external.\n */\n public fetchAstModuleFromSourceFile(\n sourceFile: ts.SourceFile,\n moduleReference: IAstModuleReference | undefined,\n isExternal: boolean\n ): AstModule {\n const moduleSymbol: ts.Symbol = this._getModuleSymbolFromSourceFile(sourceFile, moduleReference);\n\n // Don't traverse into a module that we already processed before:\n // The compiler allows m1 to have \"export * from 'm2'\" and \"export * from 'm3'\",\n // even if m2 and m3 both have \"export * from 'm4'\".\n let astModule: AstModule | undefined = this._astModulesByModuleSymbol.get(moduleSymbol);\n if (!astModule) {\n // (If moduleReference === undefined, then this is the entry point of the local project being analyzed.)\n const externalModulePath: string | undefined =\n moduleReference !== undefined && isExternal ? moduleReference.moduleSpecifier : undefined;\n\n astModule = new AstModule({ sourceFile, moduleSymbol, externalModulePath });\n\n this._astModulesByModuleSymbol.set(moduleSymbol, astModule);\n\n if (astModule.isExternal) {\n // It's an external package, so do the special simplified analysis that doesn't crawl into referenced modules\n for (const exportedSymbol of this._typeChecker.getExportsOfModule(moduleSymbol)) {\n if (externalModulePath === undefined) {\n throw new InternalError(\n 'Failed assertion: externalModulePath=undefined but astModule.isExternal=true'\n );\n }\n\n const followedSymbol: ts.Symbol = TypeScriptHelpers.followAliases(\n exportedSymbol,\n this._typeChecker\n );\n\n // Ignore virtual symbols that don't have any declarations\n const arbitraryDeclaration: ts.Declaration | undefined =\n TypeScriptHelpers.tryGetADeclaration(followedSymbol);\n if (arbitraryDeclaration) {\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: astModule.isExternal,\n includeNominalAnalysis: true,\n addIfMissing: true\n });\n\n if (!astSymbol) {\n throw new Error(\n `Unsupported export ${JSON.stringify(exportedSymbol.name)}:\\n` +\n SourceFileLocationFormatter.formatDeclaration(arbitraryDeclaration)\n );\n }\n\n astModule.cachedExportedEntities.set(exportedSymbol.name, astSymbol);\n }\n }\n } else {\n // The module is part of the local project, so do the full analysis\n\n if (moduleSymbol.exports) {\n // The \"export * from 'module-name';\" declarations are all attached to a single virtual symbol\n // whose name is InternalSymbolName.ExportStar\n const exportStarSymbol: ts.Symbol | undefined = moduleSymbol.exports.get(\n ts.InternalSymbolName.ExportStar\n );\n if (exportStarSymbol) {\n for (const exportStarDeclaration of exportStarSymbol.getDeclarations() || []) {\n if (ts.isExportDeclaration(exportStarDeclaration)) {\n const starExportedModule: AstModule | undefined = this._fetchSpecifierAstModule(\n exportStarDeclaration,\n exportStarSymbol\n );\n\n if (starExportedModule !== undefined) {\n astModule.starExportedModules.add(starExportedModule);\n }\n } else {\n // Ignore ExportDeclaration nodes that don't match the expected pattern\n // TODO: Should we report a warning?\n }\n }\n }\n }\n }\n }\n\n return astModule;\n }\n\n /**\n * Retrieves the symbol for the module corresponding to the ts.SourceFile that is being imported/exported.\n *\n * @remarks\n * The `module` keyword can be used to declare multiple TypeScript modules inside a single source file.\n * (This is a deprecated construct and mainly used for typings such as `@types/node`.) In this situation,\n * `moduleReference` helps us to fish out the correct module symbol.\n */\n private _getModuleSymbolFromSourceFile(\n sourceFile: ts.SourceFile,\n moduleReference: IAstModuleReference | undefined\n ): ts.Symbol {\n const moduleSymbol: ts.Symbol | undefined = TypeScriptInternals.tryGetSymbolForDeclaration(\n sourceFile,\n this._typeChecker\n );\n if (moduleSymbol !== undefined) {\n // This is the normal case. The SourceFile acts is a module and has a symbol.\n return moduleSymbol;\n }\n\n if (moduleReference !== undefined) {\n // But there is also an elaborate case where the source file contains one or more \"module\" declarations,\n // and our moduleReference took us to one of those.\n\n // eslint-disable-next-line no-bitwise\n if ((moduleReference.moduleSpecifierSymbol.flags & ts.SymbolFlags.Alias) !== 0) {\n // Follow the import/export declaration to one hop the exported item inside the target module\n let followedSymbol: ts.Symbol | undefined = TypeScriptInternals.getImmediateAliasedSymbol(\n moduleReference.moduleSpecifierSymbol,\n this._typeChecker\n );\n\n if (followedSymbol === undefined) {\n // This is a workaround for a compiler bug where getImmediateAliasedSymbol() sometimes returns undefined\n followedSymbol = this._typeChecker.getAliasedSymbol(moduleReference.moduleSpecifierSymbol);\n }\n\n if (followedSymbol !== undefined && followedSymbol !== moduleReference.moduleSpecifierSymbol) {\n // The parent of the exported symbol will be the module that we're importing from\n const parent: ts.Symbol | undefined = TypeScriptInternals.getSymbolParent(followedSymbol);\n if (parent !== undefined) {\n // Make sure the thing we found is a module\n // eslint-disable-next-line no-bitwise\n if ((parent.flags & ts.SymbolFlags.ValueModule) !== 0) {\n // Record that that this is an ambient module that can also be imported from\n this._importableAmbientSourceFiles.add(sourceFile);\n return parent;\n }\n }\n }\n }\n }\n\n throw new InternalError('Unable to determine module for: ' + sourceFile.fileName);\n }\n\n /**\n * Implementation of {@link AstSymbolTable.fetchAstModuleExportInfo}.\n */\n public fetchAstModuleExportInfo(entryPointAstModule: AstModule): IAstModuleExportInfo {\n if (entryPointAstModule.isExternal) {\n throw new Error('fetchAstModuleExportInfo() is not supported for external modules');\n }\n\n if (entryPointAstModule.astModuleExportInfo === undefined) {\n const astModuleExportInfo: IAstModuleExportInfo = {\n visitedAstModules: new Set<AstModule>(),\n exportedLocalEntities: new Map<string, AstEntity>(),\n starExportedExternalModules: new Set<AstModule>()\n };\n\n this._collectAllExportsRecursive(astModuleExportInfo, entryPointAstModule);\n\n entryPointAstModule.astModuleExportInfo = astModuleExportInfo;\n }\n return entryPointAstModule.astModuleExportInfo;\n }\n\n /**\n * Returns true if the module specifier refers to an external package. Ignores packages listed in the\n * \"bundledPackages\" setting from the api-extractor.json config file.\n */\n private _isExternalModulePath(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode,\n moduleSpecifier: string\n ): boolean {\n const specifier: ts.TypeNode | ts.Expression | undefined = ts.isImportTypeNode(importOrExportDeclaration)\n ? importOrExportDeclaration.argument\n : importOrExportDeclaration.moduleSpecifier;\n const mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined =\n specifier && ts.isStringLiteralLike(specifier)\n ? TypeScriptInternals.getModeForUsageLocation(\n importOrExportDeclaration.getSourceFile(),\n specifier,\n this._program.getCompilerOptions()\n )\n : undefined;\n\n const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(\n this._program,\n importOrExportDeclaration.getSourceFile(),\n moduleSpecifier,\n mode\n );\n\n if (resolvedModule === undefined) {\n // The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's\n // previous behavior, simply treat all ambient modules as external. This bug is tracked by\n // https://github.com/microsoft/rushstack/issues/3335.\n return true;\n }\n\n // Either something like `jquery` or `@microsoft/api-extractor`.\n const packageName: string | undefined = resolvedModule.packageId?.name;\n if (packageName !== undefined && this._bundledPackageNames.has(packageName)) {\n return false;\n }\n\n if (resolvedModule.isExternalLibraryImport === undefined) {\n // This presumably means the compiler couldn't figure out whether the module was external, but we're not\n // sure how this can happen.\n throw new InternalError(\n `Cannot determine whether the module ${JSON.stringify(moduleSpecifier)} is external\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n return resolvedModule.isExternalLibraryImport;\n }\n\n /**\n * Returns true if when we analyzed sourceFile, we found that it contains an \"export=\" statement that allows\n * it to behave /either/ as an ambient module /or/ as a regular importable module. In this case,\n * `AstSymbolTable._fetchAstSymbol()` will analyze its symbols even though `TypeScriptHelpers.isAmbient()`\n * returns true.\n */\n public isImportableAmbientSourceFile(sourceFile: ts.SourceFile): boolean {\n return this._importableAmbientSourceFiles.has(sourceFile);\n }\n\n private _collectAllExportsRecursive(astModuleExportInfo: IAstModuleExportInfo, astModule: AstModule): void {\n const { visitedAstModules, starExportedExternalModules, exportedLocalEntities } = astModuleExportInfo;\n if (visitedAstModules.has(astModule)) {\n return;\n }\n visitedAstModules.add(astModule);\n\n if (astModule.isExternal) {\n starExportedExternalModules.add(astModule);\n } else {\n // Fetch each of the explicit exports for this module\n if (astModule.moduleSymbol.exports) {\n astModule.moduleSymbol.exports.forEach((exportSymbol, exportName) => {\n switch (exportName) {\n case ts.InternalSymbolName.ExportStar:\n case ts.InternalSymbolName.ExportEquals:\n break;\n default:\n // Don't collect the \"export default\" symbol unless this is the entry point module\n if (exportName !== ts.InternalSymbolName.Default || visitedAstModules.size === 1) {\n if (!exportedLocalEntities.has(exportSymbol.name)) {\n const astEntity: AstEntity = this._getExportOfAstModule(exportSymbol.name, astModule);\n\n if (astEntity instanceof AstSymbol && !astEntity.isExternal) {\n this._astSymbolTable.analyze(astEntity);\n }\n\n if (astEntity instanceof AstNamespaceImport && !astEntity.astModule.isExternal) {\n this._astSymbolTable.analyze(astEntity);\n }\n\n exportedLocalEntities.set(exportSymbol.name, astEntity);\n }\n }\n break;\n }\n });\n }\n\n for (const starExportedModule of astModule.starExportedModules) {\n this._collectAllExportsRecursive(astModuleExportInfo, starExportedModule);\n }\n }\n }\n\n /**\n * For a given symbol (which was encountered in the specified sourceFile), this fetches the AstEntity that it\n * refers to. For example, if a particular interface describes the return value of a function, this API can help\n * us determine a TSDoc declaration reference for that symbol (if the symbol is exported).\n */\n public fetchReferencedAstEntity(\n symbol: ts.Symbol,\n referringModuleIsExternal: boolean\n ): AstEntity | undefined {\n // eslint-disable-next-line no-bitwise\n if ((symbol.flags & ts.SymbolFlags.FunctionScopedVariable) !== 0) {\n // If a symbol refers back to part of its own definition, don't follow that rabbit hole\n // Example:\n //\n // function f(x: number): typeof x {\n // return 123;\n // }\n return undefined;\n }\n\n let current: ts.Symbol = symbol;\n\n if (referringModuleIsExternal) {\n current = TypeScriptHelpers.followAliases(symbol, this._typeChecker);\n } else {\n for (;;) {\n // Is this symbol an import/export that we need to follow to find the real declaration?\n for (const declaration of current.declarations || []) {\n let matchedAstEntity: AstEntity | undefined;\n matchedAstEntity = this._tryMatchExportDeclaration(declaration, current);\n if (matchedAstEntity !== undefined) {\n return matchedAstEntity;\n }\n matchedAstEntity = this._tryMatchImportDeclaration(declaration, current);\n if (matchedAstEntity !== undefined) {\n return matchedAstEntity;\n }\n }\n\n // eslint-disable-next-line no-bitwise\n if (!(current.flags & ts.SymbolFlags.Alias)) {\n break;\n }\n\n const currentAlias: ts.Symbol = TypeScriptInternals.getImmediateAliasedSymbol(\n current,\n this._typeChecker\n );\n // Stop if we reach the end of the chain\n if (!currentAlias || currentAlias === current) {\n break;\n }\n\n current = currentAlias;\n }\n }\n\n // Otherwise, assume it is a normal declaration\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: current,\n isExternal: referringModuleIsExternal,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n\n return astSymbol;\n }\n\n public fetchReferencedAstEntityFromImportTypeNode(\n node: ts.ImportTypeNode,\n referringModuleIsExternal: boolean\n ): AstEntity | undefined {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(node);\n\n if (externalModulePath) {\n let exportName: string;\n if (node.qualifier) {\n // Example input:\n // import('api-extractor-lib1-test').Lib1GenericType<number>\n //\n // Extracted qualifier:\n // Lib1GenericType\n exportName = node.qualifier.getText().trim();\n } else {\n // Example input:\n // import('api-extractor-lib1-test')\n //\n // Extracted qualifier:\n // apiExtractorLib1Test\n\n exportName = SyntaxHelpers.makeCamelCaseIdentifier(externalModulePath);\n }\n\n return this._fetchAstImport(undefined, {\n importKind: AstImportKind.ImportType,\n exportName: exportName,\n modulePath: externalModulePath,\n isTypeOnly: false\n });\n }\n\n // Internal reference: AstSymbol\n const rightMostToken: ts.Identifier | ts.ImportTypeNode = node.qualifier\n ? node.qualifier.kind === ts.SyntaxKind.QualifiedName\n ? node.qualifier.right\n : node.qualifier\n : node;\n\n // There is no symbol property in a ImportTypeNode, obtain the associated export symbol\n const exportSymbol: ts.Symbol | undefined = this._typeChecker.getSymbolAtLocation(rightMostToken);\n if (!exportSymbol) {\n throw new InternalError(\n `Symbol not found for identifier: ${node.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(node)\n );\n }\n\n let followedSymbol: ts.Symbol = exportSymbol;\n for (;;) {\n const referencedAstEntity: AstEntity | undefined = this.fetchReferencedAstEntity(\n followedSymbol,\n referringModuleIsExternal\n );\n\n if (referencedAstEntity) {\n return referencedAstEntity;\n }\n\n const followedSymbolNode: ts.Node | ts.ImportTypeNode | undefined =\n followedSymbol.declarations && (followedSymbol.declarations[0] as ts.Node | undefined);\n\n if (followedSymbolNode && followedSymbolNode.kind === ts.SyntaxKind.ImportType) {\n return this.fetchReferencedAstEntityFromImportTypeNode(\n followedSymbolNode as ts.ImportTypeNode,\n referringModuleIsExternal\n );\n }\n\n // eslint-disable-next-line no-bitwise\n if (!(followedSymbol.flags & ts.SymbolFlags.Alias)) {\n break;\n }\n\n const currentAlias: ts.Symbol = this._typeChecker.getAliasedSymbol(followedSymbol);\n if (!currentAlias || currentAlias === followedSymbol) {\n break;\n }\n\n followedSymbol = currentAlias;\n }\n\n const astSymbol: AstSymbol | undefined = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: referringModuleIsExternal,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n\n return astSymbol;\n }\n\n private _tryMatchExportDeclaration(\n declaration: ts.Declaration,\n declarationSymbol: ts.Symbol\n ): AstEntity | undefined {\n const exportDeclaration: ts.ExportDeclaration | undefined =\n TypeScriptHelpers.findFirstParent<ts.ExportDeclaration>(declaration, ts.SyntaxKind.ExportDeclaration);\n\n if (exportDeclaration) {\n let exportName: string | undefined = undefined;\n\n if (declaration.kind === ts.SyntaxKind.ExportSpecifier) {\n // EXAMPLE:\n // \"export { A } from './file-a';\"\n //\n // ExportDeclaration:\n // ExportKeyword: pre=[export] sep=[ ]\n // NamedExports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ExportSpecifier: <------------- declaration\n // Identifier: pre=[A] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['./file-a']\n // SemicolonToken: pre=[;]\n\n // Example: \" ExportName as RenamedName\"\n const exportSpecifier: ts.ExportSpecifier = declaration as ts.ExportSpecifier;\n exportName = (exportSpecifier.propertyName || exportSpecifier.name).getText().trim();\n } else if (declaration.kind === ts.SyntaxKind.NamespaceExport) {\n // EXAMPLE:\n // \"export * as theLib from 'the-lib';\"\n //\n // ExportDeclaration:\n // ExportKeyword: pre=[export] sep=[ ]\n // NamespaceExport:\n // AsteriskToken: pre=[*] sep=[ ]\n // AsKeyword: pre=[as] sep=[ ]\n // Identifier: pre=[theLib] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n // Issue tracking this feature: https://github.com/microsoft/rushstack/issues/2780\n\n const astModule: AstModule = this._fetchSpecifierAstModule(exportDeclaration, declarationSymbol);\n return this._getAstNamespaceExport(astModule, declarationSymbol, declaration);\n } else {\n throw new InternalError(\n `Unimplemented export declaration kind: ${declaration.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(declaration)\n );\n }\n\n // Ignore \"export { A }\" without a module specifier\n if (exportDeclaration.moduleSpecifier) {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(exportDeclaration);\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: externalModulePath,\n exportName: exportName,\n isTypeOnly: false\n });\n }\n\n return this._getExportOfSpecifierAstModule(exportName, exportDeclaration, declarationSymbol);\n }\n }\n\n return undefined;\n }\n\n private _getAstNamespaceExport(\n astModule: AstModule,\n declarationSymbol: ts.Symbol,\n declaration: ts.Declaration\n ): AstNamespaceExport {\n const imoprtNamespace: AstNamespaceImport = this._getAstNamespaceImport(\n astModule,\n declarationSymbol,\n declaration\n );\n\n return new AstNamespaceExport({\n namespaceName: imoprtNamespace.localName,\n astModule: astModule,\n declaration,\n symbol: declarationSymbol\n });\n }\n\n private _tryMatchImportDeclaration(\n declaration: ts.Declaration,\n declarationSymbol: ts.Symbol\n ): AstEntity | undefined {\n const importDeclaration: ts.ImportDeclaration | undefined =\n TypeScriptHelpers.findFirstParent<ts.ImportDeclaration>(declaration, ts.SyntaxKind.ImportDeclaration);\n\n if (importDeclaration) {\n const externalModulePath: string | undefined = this._tryGetExternalModulePath(importDeclaration);\n\n if (declaration.kind === ts.SyntaxKind.NamespaceImport) {\n // EXAMPLE:\n // \"import * as theLib from 'the-lib';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause:\n // NamespaceImport: <------------- declaration\n // AsteriskToken: pre=[*] sep=[ ]\n // AsKeyword: pre=[as] sep=[ ]\n // Identifier: pre=[theLib] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n if (externalModulePath === undefined) {\n const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol);\n return this._getAstNamespaceImport(astModule, declarationSymbol, declaration);\n }\n\n // Here importSymbol=undefined because {@inheritDoc} and such are not going to work correctly for\n // a package or source file.\n return this._fetchAstImport(undefined, {\n importKind: AstImportKind.StarImport,\n exportName: declarationSymbol.name,\n modulePath: externalModulePath,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n if (declaration.kind === ts.SyntaxKind.ImportSpecifier) {\n // EXAMPLE:\n // \"import { A, B } from 'the-lib';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause:\n // NamedImports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ImportSpecifier: <------------- declaration\n // Identifier: pre=[A]\n // CommaToken: pre=[,] sep=[ ]\n // ImportSpecifier:\n // Identifier: pre=[B] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['the-lib']\n // SemicolonToken: pre=[;]\n\n // Example: \" ExportName as RenamedName\"\n const importSpecifier: ts.ImportSpecifier = declaration as ts.ImportSpecifier;\n const exportName: string = (importSpecifier.propertyName || importSpecifier.name).getText().trim();\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: externalModulePath,\n exportName: exportName,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n return this._getExportOfSpecifierAstModule(exportName, importDeclaration, declarationSymbol);\n } else if (declaration.kind === ts.SyntaxKind.ImportClause) {\n // EXAMPLE:\n // \"import A, { B } from './A';\"\n //\n // ImportDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // ImportClause: <------------- declaration (referring to A)\n // Identifier: pre=[A]\n // CommaToken: pre=[,] sep=[ ]\n // NamedImports:\n // FirstPunctuation: pre=[{] sep=[ ]\n // SyntaxList:\n // ImportSpecifier:\n // Identifier: pre=[B] sep=[ ]\n // CloseBraceToken: pre=[}] sep=[ ]\n // FromKeyword: pre=[from] sep=[ ]\n // StringLiteral: pre=['./A']\n // SemicolonToken: pre=[;]\n\n const importClause: ts.ImportClause = declaration as ts.ImportClause;\n const exportName: string = importClause.name\n ? importClause.name.getText().trim()\n : ts.InternalSymbolName.Default;\n\n if (externalModulePath !== undefined) {\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.DefaultImport,\n modulePath: externalModulePath,\n exportName,\n isTypeOnly: ExportAnalyzer._getIsTypeOnly(importDeclaration)\n });\n }\n\n return this._getExportOfSpecifierAstModule(\n ts.InternalSymbolName.Default,\n importDeclaration,\n declarationSymbol\n );\n } else {\n throw new InternalError(\n `Unimplemented import declaration kind: ${declaration.getText()}\\n` +\n SourceFileLocationFormatter.formatDeclaration(declaration)\n );\n }\n }\n\n if (ts.isImportEqualsDeclaration(declaration)) {\n // EXAMPLE:\n // import myLib = require('my-lib');\n //\n // ImportEqualsDeclaration:\n // ImportKeyword: pre=[import] sep=[ ]\n // Identifier: pre=[myLib] sep=[ ]\n // FirstAssignment: pre=[=] sep=[ ]\n // ExternalModuleReference:\n // RequireKeyword: pre=[require]\n // OpenParenToken: pre=[(]\n // StringLiteral: pre=['my-lib']\n // CloseParenToken: pre=[)]\n // SemicolonToken: pre=[;]\n if (ts.isExternalModuleReference(declaration.moduleReference)) {\n if (ts.isStringLiteralLike(declaration.moduleReference.expression)) {\n const variableName: string = TypeScriptInternals.getTextOfIdentifierOrLiteral(declaration.name);\n const externalModuleName: string = TypeScriptInternals.getTextOfIdentifierOrLiteral(\n declaration.moduleReference.expression\n );\n\n return this._fetchAstImport(declarationSymbol, {\n importKind: AstImportKind.EqualsImport,\n modulePath: externalModuleName,\n exportName: variableName,\n isTypeOnly: false\n });\n }\n }\n }\n\n return undefined;\n }\n\n private _getAstNamespaceImport(\n astModule: AstModule,\n declarationSymbol: ts.Symbol,\n declaration: ts.Declaration\n ): AstNamespaceImport {\n let namespaceImport: AstNamespaceImport | undefined = this._astNamespaceImportByModule.get(astModule);\n if (namespaceImport === undefined) {\n namespaceImport = new AstNamespaceImport({\n namespaceName: declarationSymbol.name,\n astModule: astModule,\n declaration: declaration,\n symbol: declarationSymbol\n });\n this._astNamespaceImportByModule.set(astModule, namespaceImport);\n }\n\n return namespaceImport;\n }\n\n private static _getIsTypeOnly(importDeclaration: ts.ImportDeclaration): boolean {\n if (importDeclaration.importClause) {\n return !!importDeclaration.importClause.isTypeOnly;\n }\n return false;\n }\n\n private _getExportOfSpecifierAstModule(\n exportName: string,\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration,\n exportSymbol: ts.Symbol\n ): AstEntity {\n const specifierAstModule: AstModule = this._fetchSpecifierAstModule(\n importOrExportDeclaration,\n exportSymbol\n );\n const astEntity: AstEntity = this._getExportOfAstModule(exportName, specifierAstModule);\n return astEntity;\n }\n\n private _getExportOfAstModule(exportName: string, astModule: AstModule): AstEntity {\n const visitedAstModules: Set<AstModule> = new Set<AstModule>();\n const astEntity: AstEntity | undefined = this._tryGetExportOfAstModule(\n exportName,\n astModule,\n visitedAstModules\n );\n if (astEntity === undefined) {\n throw new InternalError(\n `Unable to analyze the export ${JSON.stringify(exportName)} in\\n` + astModule.sourceFile.fileName\n );\n }\n return astEntity;\n }\n\n /**\n * Implementation of {@link AstSymbolTable.tryGetExportOfAstModule}.\n */\n public tryGetExportOfAstModule(exportName: string, astModule: AstModule): AstEntity | undefined {\n const visitedAstModules: Set<AstModule> = new Set<AstModule>();\n return this._tryGetExportOfAstModule(exportName, astModule, visitedAstModules);\n }\n\n private _tryGetExportOfAstModule(\n exportName: string,\n astModule: AstModule,\n visitedAstModules: Set<AstModule>\n ): AstEntity | undefined {\n if (visitedAstModules.has(astModule)) {\n return undefined;\n }\n visitedAstModules.add(astModule);\n\n let astEntity: AstEntity | undefined = astModule.cachedExportedEntities.get(exportName);\n if (astEntity !== undefined) {\n return astEntity;\n }\n\n // Try the explicit exports\n const escapedExportName: ts.__String = ts.escapeLeadingUnderscores(exportName);\n if (astModule.moduleSymbol.exports) {\n const exportSymbol: ts.Symbol | undefined = astModule.moduleSymbol.exports.get(escapedExportName);\n if (exportSymbol) {\n astEntity = this.fetchReferencedAstEntity(exportSymbol, astModule.isExternal);\n\n if (astEntity !== undefined) {\n astModule.cachedExportedEntities.set(exportName, astEntity); // cache for next time\n return astEntity;\n }\n }\n }\n\n // Try each of the star imports\n for (const starExportedModule of astModule.starExportedModules) {\n astEntity = this._tryGetExportOfAstModule(exportName, starExportedModule, visitedAstModules);\n\n if (astEntity !== undefined) {\n if (starExportedModule.externalModulePath !== undefined) {\n // This entity was obtained from an external module, so return an AstImport instead\n const astSymbol: AstSymbol = astEntity as AstSymbol;\n return this._fetchAstImport(astSymbol.followedSymbol, {\n importKind: AstImportKind.NamedImport,\n modulePath: starExportedModule.externalModulePath,\n exportName: exportName,\n isTypeOnly: false\n });\n }\n\n return astEntity;\n }\n }\n\n return undefined;\n }\n\n private _tryGetExternalModulePath(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode\n ): string | undefined {\n const moduleSpecifier: string = this._getModuleSpecifier(importOrExportDeclaration);\n if (this._isExternalModulePath(importOrExportDeclaration, moduleSpecifier)) {\n return moduleSpecifier;\n }\n\n return undefined;\n }\n\n /**\n * Given an ImportDeclaration of the form `export { X } from \"___\";`, this interprets the module specifier (`\"___\"`)\n * and fetches the corresponding AstModule object.\n */\n private _fetchSpecifierAstModule(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration,\n exportSymbol: ts.Symbol\n ): AstModule {\n const moduleSpecifier: string = this._getModuleSpecifier(importOrExportDeclaration);\n const mode: ts.ModuleKind.CommonJS | ts.ModuleKind.ESNext | undefined =\n importOrExportDeclaration.moduleSpecifier &&\n ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier)\n ? TypeScriptInternals.getModeForUsageLocation(\n importOrExportDeclaration.getSourceFile(),\n importOrExportDeclaration.moduleSpecifier,\n this._program.getCompilerOptions()\n )\n : undefined;\n const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(\n this._program,\n importOrExportDeclaration.getSourceFile(),\n moduleSpecifier,\n mode\n );\n\n if (resolvedModule === undefined) {\n // Encountered in https://github.com/microsoft/rushstack/issues/1914.\n //\n // It's also possible for this to occur with ambient modules. However, in practice this doesn't happen\n // as API Extractor treats all ambient modules as external per the logic in `_isExternalModulePath`, and\n // thus this code path is never reached for ambient modules.\n throw new InternalError(\n `getResolvedModule() could not resolve module name ${JSON.stringify(moduleSpecifier)}\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n // Map the filename back to the corresponding SourceFile. This circuitous approach is needed because\n // we have no way to access the compiler's internal resolveExternalModuleName() function\n const moduleSourceFile: ts.SourceFile | undefined = this._program.getSourceFile(\n resolvedModule.resolvedFileName\n );\n if (!moduleSourceFile) {\n // This should not happen, since getResolvedModule() specifically looks up names that the compiler\n // found in export declarations for this source file\n throw new InternalError(\n `getSourceFile() failed to locate ${JSON.stringify(resolvedModule.resolvedFileName)}\\n` +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n const isExternal: boolean = this._isExternalModulePath(importOrExportDeclaration, moduleSpecifier);\n const moduleReference: IAstModuleReference = {\n moduleSpecifier: moduleSpecifier,\n moduleSpecifierSymbol: exportSymbol\n };\n const specifierAstModule: AstModule = this.fetchAstModuleFromSourceFile(\n moduleSourceFile,\n moduleReference,\n isExternal\n );\n\n return specifierAstModule;\n }\n\n private _fetchAstImport(importSymbol: ts.Symbol | undefined, options: IAstImportOptions): AstImport {\n const key: string = AstImport.getKey(options);\n\n let astImport: AstImport | undefined = this._astImportsByKey.get(key);\n\n if (!astImport) {\n astImport = new AstImport(options);\n this._astImportsByKey.set(key, astImport);\n\n if (importSymbol) {\n const followedSymbol: ts.Symbol = TypeScriptHelpers.followAliases(importSymbol, this._typeChecker);\n\n astImport.astSymbol = this._astSymbolTable.fetchAstSymbol({\n followedSymbol: followedSymbol,\n isExternal: true,\n includeNominalAnalysis: false,\n addIfMissing: true\n });\n }\n } else {\n // If we encounter at least one import that does not use the type-only form,\n // then the .d.ts rollup will NOT use \"import type\".\n if (!options.isTypeOnly) {\n astImport.isTypeOnlyEverywhere = false;\n }\n }\n\n return astImport;\n }\n\n private _getModuleSpecifier(\n importOrExportDeclaration: ts.ImportDeclaration | ts.ExportDeclaration | ts.ImportTypeNode\n ): string {\n // The name of the module, which could be like \"./SomeLocalFile' or like 'external-package/entry/point'\n const moduleSpecifier: string | undefined =\n TypeScriptHelpers.getModuleSpecifier(importOrExportDeclaration);\n\n if (!moduleSpecifier) {\n throw new InternalError(\n 'Unable to parse module specifier\\n' +\n SourceFileLocationFormatter.formatDeclaration(importOrExportDeclaration)\n );\n }\n\n return moduleSpecifier;\n }\n}\n"]}
@@ -138,18 +138,18 @@ class Extractor {
138
138
  const collector = new Collector_1.Collector({
139
139
  program: compilerState.program,
140
140
  messageRouter,
141
- extractorConfig: extractorConfig,
141
+ extractorConfig,
142
142
  sourceMapper
143
143
  });
144
144
  collector.analyze();
145
145
  DocCommentEnhancer_1.DocCommentEnhancer.analyze(collector);
146
146
  ValidationEnhancer_1.ValidationEnhancer.analyze(collector);
147
- const modelBuilder = new ApiModelGenerator_1.ApiModelGenerator(collector);
147
+ const modelBuilder = new ApiModelGenerator_1.ApiModelGenerator(collector, extractorConfig);
148
148
  const apiPackage = modelBuilder.buildApiPackage();
149
149
  if (messageRouter.showDiagnostics) {
150
150
  messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages
151
151
  }
152
- if (extractorConfig.docModelEnabled) {
152
+ if (modelBuilder.docModelEnabled) {
153
153
  messageRouter.logVerbose(ConsoleMessageId_1.ConsoleMessageId.WritingDocModelFile, 'Writing: ' + extractorConfig.apiJsonFilePath);
154
154
  apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {
155
155
  toolPackage: Extractor.packageName,
@@ -1 +1 @@
1
- {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AACnC,oEAOsC;AAEtC,uDAAoF;AACpF,sDAAmD;AACnD,yEAAqF;AACrF,uEAAoE;AAEpE,yEAAsE;AACtE,+EAA4E;AAC5E,wEAAqE;AACrE,wEAAqE;AACrE,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OAAsB,EACtB,WAAwB;QAExB,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,SAAS,CAAC,aAAa,CAAC,UAAU,CAChC,mCAAgB,CAAC,gBAAgB,EACjC,4BAA4B,UAAU,EAAE,CACzC,CAAC;YACF,uCAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AA5XD,8BA4XC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\nimport {\n FileSystem,\n type NewlineKind,\n PackageJsonLookup,\n type IPackageJson,\n type INodePackageJson,\n Path\n} from '@rushstack/node-core-library';\n\nimport { ExtractorConfig, type IExtractorConfigApiReport } from './ExtractorConfig';\nimport { Collector } from '../collector/Collector';\nimport { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';\nimport { ApiModelGenerator } from '../generators/ApiModelGenerator';\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { ApiReportGenerator } from '../generators/ApiReportGenerator';\nimport { PackageMetadataManager } from '../analyzer/PackageMetadataManager';\nimport { ValidationEnhancer } from '../enhancers/ValidationEnhancer';\nimport { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';\nimport { CompilerState } from './CompilerState';\nimport type { ExtractorMessage } from './ExtractorMessage';\nimport { MessageRouter } from '../collector/MessageRouter';\nimport { ConsoleMessageId } from './ConsoleMessageId';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\nimport { SourceMapper } from '../collector/SourceMapper';\n\n/**\n * Runtime options for Extractor.\n *\n * @public\n */\nexport interface IExtractorInvokeOptions {\n /**\n * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor\n * can reuse the same TypeScript compiler analysis.\n */\n compilerState?: CompilerState;\n\n /**\n * Indicates that API Extractor is running as part of a local build, e.g. on developer's\n * machine.\n *\n * @remarks\n * This disables certain validation that would normally be performed for a ship/production build. For example,\n * the *.api.md report file is automatically updated in a local build.\n *\n * The default value is false.\n */\n localBuild?: boolean;\n\n /**\n * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.\n */\n showVerboseMessages?: boolean;\n\n /**\n * If true, API Extractor will print diagnostic information used for troubleshooting problems.\n * These messages will be included as {@link ExtractorLogLevel.Verbose} output.\n *\n * @remarks\n * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.\n */\n showDiagnostics?: boolean;\n\n /**\n * Specifies an alternate folder path to be used when loading the TypeScript system typings.\n *\n * @remarks\n * API Extractor uses its own TypeScript compiler engine to analyze your project. If your project\n * is built with a significantly different TypeScript version, sometimes API Extractor may report compilation\n * errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the \"--typescriptCompilerFolder\"\n * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will\n * use those system typings instead.\n */\n typescriptCompilerFolder?: string;\n\n /**\n * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by\n * API Extractor. The callback can customize the message, handle it, or discard it.\n *\n * @remarks\n * If a `messageCallback` is not provided, then by default API Extractor will print the messages to\n * the STDERR/STDOUT console.\n */\n messageCallback?: (message: ExtractorMessage) => void;\n}\n\n/**\n * This object represents the outcome of an invocation of API Extractor.\n *\n * @public\n */\nexport class ExtractorResult {\n /**\n * The TypeScript compiler state that was used.\n */\n public readonly compilerState: CompilerState;\n\n /**\n * The API Extractor configuration that was used.\n */\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task\n * would normally return a nonzero process exit code, indicating that the operation failed.\n *\n * @remarks\n *\n * Normally the operation \"succeeds\" if `errorCount` and `warningCount` are both zero. However if\n * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation \"succeeds\" if `errorCount` is zero\n * (i.e. warnings are ignored).\n */\n public readonly succeeded: boolean;\n\n /**\n * Returns true if the API report was found to have changed.\n */\n public readonly apiReportChanged: boolean;\n\n /**\n * Reports the number of errors encountered during analysis.\n *\n * @remarks\n * This does not count exceptions, where unexpected issues prematurely abort the operation.\n */\n public readonly errorCount: number;\n\n /**\n * Reports the number of warnings encountered during analysis.\n *\n * @remarks\n * This does not count warnings that are emitted in the API report file.\n */\n public readonly warningCount: number;\n\n /** @internal */\n public constructor(properties: ExtractorResult) {\n this.compilerState = properties.compilerState;\n this.extractorConfig = properties.extractorConfig;\n this.succeeded = properties.succeeded;\n this.apiReportChanged = properties.apiReportChanged;\n this.errorCount = properties.errorCount;\n this.warningCount = properties.warningCount;\n }\n}\n\n/**\n * The starting point for invoking the API Extractor tool.\n * @public\n */\nexport class Extractor {\n /**\n * Returns the version number of the API Extractor NPM package.\n */\n public static get version(): string {\n return Extractor._getPackageJson().version;\n }\n\n /**\n * Returns the package name of the API Extractor NPM package.\n */\n public static get packageName(): string {\n return Extractor._getPackageJson().name;\n }\n\n private static _getPackageJson(): IPackageJson {\n return PackageJsonLookup.loadOwnPackageJson(__dirname);\n }\n\n /**\n * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.\n */\n public static loadConfigAndInvoke(\n configFilePath: string,\n options?: IExtractorInvokeOptions\n ): ExtractorResult {\n const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);\n\n return Extractor.invoke(extractorConfig, options);\n }\n\n /**\n * Invoke API Extractor using an already prepared `ExtractorConfig` object.\n */\n public static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult {\n if (!options) {\n options = {};\n }\n\n const localBuild: boolean = options.localBuild || false;\n\n let compilerState: CompilerState | undefined;\n if (options.compilerState) {\n compilerState = options.compilerState;\n } else {\n compilerState = CompilerState.create(extractorConfig, options);\n }\n\n const sourceMapper: SourceMapper = new SourceMapper();\n\n const messageRouter: MessageRouter = new MessageRouter({\n workingPackageFolder: extractorConfig.packageFolder,\n messageCallback: options.messageCallback,\n messagesConfig: extractorConfig.messages || {},\n showVerboseMessages: !!options.showVerboseMessages,\n showDiagnostics: !!options.showDiagnostics,\n tsdocConfiguration: extractorConfig.tsdocConfiguration,\n sourceMapper\n });\n\n if (extractorConfig.tsdocConfigFile.filePath && !extractorConfig.tsdocConfigFile.fileNotFound) {\n if (!Path.isEqual(extractorConfig.tsdocConfigFile.filePath, ExtractorConfig._tsdocBaseFilePath)) {\n messageRouter.logVerbose(\n ConsoleMessageId.UsingCustomTSDocConfig,\n 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath\n );\n }\n }\n\n this._checkCompilerCompatibility(extractorConfig, messageRouter);\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic('');\n messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');\n messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('Compiler options');\n const serializedCompilerOptions: object = MessageRouter.buildJsonDumpObject(\n (compilerState.program as ts.Program).getCompilerOptions()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('TSDoc configuration');\n // Convert the TSDocConfiguration into a tsdoc.json representation\n const combinedConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(\n extractorConfig.tsdocConfiguration\n );\n const serializedTSDocConfig: object = MessageRouter.buildJsonDumpObject(\n combinedConfigFile.saveToObject()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));\n messageRouter.logDiagnosticFooter();\n }\n\n const collector: Collector = new Collector({\n program: compilerState.program as ts.Program,\n messageRouter,\n extractorConfig: extractorConfig,\n sourceMapper\n });\n\n collector.analyze();\n\n DocCommentEnhancer.analyze(collector);\n ValidationEnhancer.analyze(collector);\n\n const modelBuilder: ApiModelGenerator = new ApiModelGenerator(collector);\n const apiPackage: ApiPackage = modelBuilder.buildApiPackage();\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages\n }\n\n if (extractorConfig.docModelEnabled) {\n messageRouter.logVerbose(\n ConsoleMessageId.WritingDocModelFile,\n 'Writing: ' + extractorConfig.apiJsonFilePath\n );\n apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {\n toolPackage: Extractor.packageName,\n toolVersion: Extractor.version,\n\n newlineConversion: extractorConfig.newlineKind,\n ensureFolderExists: true,\n testMode: extractorConfig.testMode\n });\n }\n\n function writeApiReport(reportConfig: IExtractorConfigApiReport): boolean {\n return Extractor._writeApiReport(\n collector,\n extractorConfig,\n messageRouter,\n extractorConfig.reportTempFolder,\n extractorConfig.reportFolder,\n reportConfig,\n localBuild\n );\n }\n\n let anyReportChanged: boolean = false;\n if (extractorConfig.apiReportEnabled) {\n for (const reportConfig of extractorConfig.reportConfigs) {\n anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;\n }\n }\n\n if (extractorConfig.rollupEnabled) {\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.publicTrimmedFilePath,\n DtsRollupKind.PublicRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.alphaTrimmedFilePath,\n DtsRollupKind.AlphaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.betaTrimmedFilePath,\n DtsRollupKind.BetaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.untrimmedFilePath,\n DtsRollupKind.InternalRelease,\n extractorConfig.newlineKind\n );\n }\n\n if (extractorConfig.tsdocMetadataEnabled) {\n // Write the tsdoc-metadata.json file for this project\n PackageMetadataManager.writeTsdocMetadataFile(\n extractorConfig.tsdocMetadataFilePath,\n extractorConfig.newlineKind\n );\n }\n\n // Show all the messages that we collected during analysis\n messageRouter.handleRemainingNonConsoleMessages();\n\n // Determine success\n let succeeded: boolean;\n if (localBuild) {\n // For a local build, fail if there were errors (but ignore warnings)\n succeeded = messageRouter.errorCount === 0;\n } else {\n // For a production build, fail if there were any errors or warnings\n succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;\n }\n\n return new ExtractorResult({\n compilerState,\n extractorConfig,\n succeeded,\n apiReportChanged: anyReportChanged,\n errorCount: messageRouter.errorCount,\n warningCount: messageRouter.warningCount\n });\n }\n\n /**\n * Generates the API report at the specified release level, writes it to the specified file path, and compares\n * the output to the existing report (if one exists).\n *\n * @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior\n * to comparison with an existing report.\n * @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to\n * which the new report will be written post-comparison.\n * @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.\n *\n * @returns Whether or not the newly generated report differs from the existing report (if one exists).\n */\n private static _writeApiReport(\n collector: Collector,\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter,\n reportTempDirectoryPath: string,\n reportDirectoryPath: string,\n reportConfig: IExtractorConfigApiReport,\n localBuild: boolean\n ): boolean {\n let apiReportChanged: boolean = false;\n\n const actualApiReportPath: string = path.resolve(reportTempDirectoryPath, reportConfig.fileName);\n const actualApiReportShortPath: string = extractorConfig._getShortFilePath(actualApiReportPath);\n\n const expectedApiReportPath: string = path.resolve(reportDirectoryPath, reportConfig.fileName);\n const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(expectedApiReportPath);\n\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingApiReport,\n `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`\n );\n\n const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(\n collector,\n reportConfig.variant\n );\n\n // Write the actual file\n FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n\n // Compare it against the expected file\n if (FileSystem.exists(expectedApiReportPath)) {\n const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);\n\n if (\n !ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)\n ) {\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'You have changed the API signature for this project.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n // For a local build, just copy the file automatically.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCopied,\n `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`\n );\n\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n }\n } else {\n messageRouter.logVerbose(\n ConsoleMessageId.ApiReportUnchanged,\n `The API report is up to date: ${actualApiReportShortPath}`\n );\n }\n } else {\n // The target file does not exist, so we are setting up the API review file for the first time.\n //\n // NOTE: People sometimes make a mistake where they move a project and forget to update the \"reportFolder\"\n // setting, which causes a new file to silently get written to the wrong place. This can be confusing.\n // Thus we treat the initial creation of the file specially.\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'The API report file is missing.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);\n if (!FileSystem.exists(expectedApiReportFolder)) {\n messageRouter.logError(\n ConsoleMessageId.ApiReportFolderMissing,\n 'Unable to create the API report file. Please make sure the target folder exists:\\n' +\n expectedApiReportFolder\n );\n } else {\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n convertLineEndings: extractorConfig.newlineKind\n });\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCreated,\n 'The API report file was missing, so a new file was created. Please add this file to Git:\\n' +\n expectedApiReportPath\n );\n }\n }\n }\n return apiReportChanged;\n }\n\n private static _checkCompilerCompatibility(\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter\n ): void {\n messageRouter.logInfo(\n ConsoleMessageId.Preamble,\n `Analysis will use the bundled TypeScript version ${ts.version}`\n );\n\n try {\n const typescriptPath: string = resolve.sync('typescript', {\n basedir: extractorConfig.projectFolder,\n preserveSymlinks: false\n });\n const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();\n const packageJson: INodePackageJson | undefined =\n packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);\n if (packageJson && packageJson.version && semver.valid(packageJson.version)) {\n // Consider a newer MINOR release to be incompatible\n const ourMajor: number = semver.major(ts.version);\n const ourMinor: number = semver.minor(ts.version);\n\n const theirMajor: number = semver.major(packageJson.version);\n const theirMinor: number = semver.minor(packageJson.version);\n\n if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {\n messageRouter.logInfo(\n ConsoleMessageId.CompilerVersionNotice,\n `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +\n ` bundled compiler engine; consider upgrading API Extractor.`\n );\n }\n }\n } catch (e) {\n // The compiler detection heuristic is not expected to work in many configurations\n }\n }\n\n private static _generateRollupDtsFile(\n collector: Collector,\n outputPath: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n if (outputPath !== '') {\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingDtsRollup,\n `Writing package typings: ${outputPath}`\n );\n DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B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C/F,6DAA6D,CAChE,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,kFAAkF;QACpF,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,sBAAsB,CACnC,SAAoB,EACpB,UAAkB,EAClB,OAAsB,EACtB,WAAwB;QAExB,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,SAAS,CAAC,aAAa,CAAC,UAAU,CAChC,mCAAgB,CAAC,gBAAgB,EACjC,4BAA4B,UAAU,EAAE,CACzC,CAAC;YACF,uCAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AA5XD,8BA4XC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'path';\nimport * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\nimport {\n FileSystem,\n type NewlineKind,\n PackageJsonLookup,\n type IPackageJson,\n type INodePackageJson,\n Path\n} from '@rushstack/node-core-library';\n\nimport { ExtractorConfig, type IExtractorConfigApiReport } from './ExtractorConfig';\nimport { Collector } from '../collector/Collector';\nimport { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';\nimport { ApiModelGenerator } from '../generators/ApiModelGenerator';\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { ApiReportGenerator } from '../generators/ApiReportGenerator';\nimport { PackageMetadataManager } from '../analyzer/PackageMetadataManager';\nimport { ValidationEnhancer } from '../enhancers/ValidationEnhancer';\nimport { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';\nimport { CompilerState } from './CompilerState';\nimport type { ExtractorMessage } from './ExtractorMessage';\nimport { MessageRouter } from '../collector/MessageRouter';\nimport { ConsoleMessageId } from './ConsoleMessageId';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\nimport { SourceMapper } from '../collector/SourceMapper';\n\n/**\n * Runtime options for Extractor.\n *\n * @public\n */\nexport interface IExtractorInvokeOptions {\n /**\n * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor\n * can reuse the same TypeScript compiler analysis.\n */\n compilerState?: CompilerState;\n\n /**\n * Indicates that API Extractor is running as part of a local build, e.g. on developer's\n * machine.\n *\n * @remarks\n * This disables certain validation that would normally be performed for a ship/production build. For example,\n * the *.api.md report file is automatically updated in a local build.\n *\n * The default value is false.\n */\n localBuild?: boolean;\n\n /**\n * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.\n */\n showVerboseMessages?: boolean;\n\n /**\n * If true, API Extractor will print diagnostic information used for troubleshooting problems.\n * These messages will be included as {@link ExtractorLogLevel.Verbose} output.\n *\n * @remarks\n * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.\n */\n showDiagnostics?: boolean;\n\n /**\n * Specifies an alternate folder path to be used when loading the TypeScript system typings.\n *\n * @remarks\n * API Extractor uses its own TypeScript compiler engine to analyze your project. If your project\n * is built with a significantly different TypeScript version, sometimes API Extractor may report compilation\n * errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the \"--typescriptCompilerFolder\"\n * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will\n * use those system typings instead.\n */\n typescriptCompilerFolder?: string;\n\n /**\n * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by\n * API Extractor. The callback can customize the message, handle it, or discard it.\n *\n * @remarks\n * If a `messageCallback` is not provided, then by default API Extractor will print the messages to\n * the STDERR/STDOUT console.\n */\n messageCallback?: (message: ExtractorMessage) => void;\n}\n\n/**\n * This object represents the outcome of an invocation of API Extractor.\n *\n * @public\n */\nexport class ExtractorResult {\n /**\n * The TypeScript compiler state that was used.\n */\n public readonly compilerState: CompilerState;\n\n /**\n * The API Extractor configuration that was used.\n */\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task\n * would normally return a nonzero process exit code, indicating that the operation failed.\n *\n * @remarks\n *\n * Normally the operation \"succeeds\" if `errorCount` and `warningCount` are both zero. However if\n * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation \"succeeds\" if `errorCount` is zero\n * (i.e. warnings are ignored).\n */\n public readonly succeeded: boolean;\n\n /**\n * Returns true if the API report was found to have changed.\n */\n public readonly apiReportChanged: boolean;\n\n /**\n * Reports the number of errors encountered during analysis.\n *\n * @remarks\n * This does not count exceptions, where unexpected issues prematurely abort the operation.\n */\n public readonly errorCount: number;\n\n /**\n * Reports the number of warnings encountered during analysis.\n *\n * @remarks\n * This does not count warnings that are emitted in the API report file.\n */\n public readonly warningCount: number;\n\n /** @internal */\n public constructor(properties: ExtractorResult) {\n this.compilerState = properties.compilerState;\n this.extractorConfig = properties.extractorConfig;\n this.succeeded = properties.succeeded;\n this.apiReportChanged = properties.apiReportChanged;\n this.errorCount = properties.errorCount;\n this.warningCount = properties.warningCount;\n }\n}\n\n/**\n * The starting point for invoking the API Extractor tool.\n * @public\n */\nexport class Extractor {\n /**\n * Returns the version number of the API Extractor NPM package.\n */\n public static get version(): string {\n return Extractor._getPackageJson().version;\n }\n\n /**\n * Returns the package name of the API Extractor NPM package.\n */\n public static get packageName(): string {\n return Extractor._getPackageJson().name;\n }\n\n private static _getPackageJson(): IPackageJson {\n return PackageJsonLookup.loadOwnPackageJson(__dirname);\n }\n\n /**\n * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.\n */\n public static loadConfigAndInvoke(\n configFilePath: string,\n options?: IExtractorInvokeOptions\n ): ExtractorResult {\n const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);\n\n return Extractor.invoke(extractorConfig, options);\n }\n\n /**\n * Invoke API Extractor using an already prepared `ExtractorConfig` object.\n */\n public static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult {\n if (!options) {\n options = {};\n }\n\n const localBuild: boolean = options.localBuild || false;\n\n let compilerState: CompilerState | undefined;\n if (options.compilerState) {\n compilerState = options.compilerState;\n } else {\n compilerState = CompilerState.create(extractorConfig, options);\n }\n\n const sourceMapper: SourceMapper = new SourceMapper();\n\n const messageRouter: MessageRouter = new MessageRouter({\n workingPackageFolder: extractorConfig.packageFolder,\n messageCallback: options.messageCallback,\n messagesConfig: extractorConfig.messages || {},\n showVerboseMessages: !!options.showVerboseMessages,\n showDiagnostics: !!options.showDiagnostics,\n tsdocConfiguration: extractorConfig.tsdocConfiguration,\n sourceMapper\n });\n\n if (extractorConfig.tsdocConfigFile.filePath && !extractorConfig.tsdocConfigFile.fileNotFound) {\n if (!Path.isEqual(extractorConfig.tsdocConfigFile.filePath, ExtractorConfig._tsdocBaseFilePath)) {\n messageRouter.logVerbose(\n ConsoleMessageId.UsingCustomTSDocConfig,\n 'Using custom TSDoc config from ' + extractorConfig.tsdocConfigFile.filePath\n );\n }\n }\n\n this._checkCompilerCompatibility(extractorConfig, messageRouter);\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic('');\n messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');\n messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('Compiler options');\n const serializedCompilerOptions: object = MessageRouter.buildJsonDumpObject(\n (compilerState.program as ts.Program).getCompilerOptions()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('TSDoc configuration');\n // Convert the TSDocConfiguration into a tsdoc.json representation\n const combinedConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(\n extractorConfig.tsdocConfiguration\n );\n const serializedTSDocConfig: object = MessageRouter.buildJsonDumpObject(\n combinedConfigFile.saveToObject()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));\n messageRouter.logDiagnosticFooter();\n }\n\n const collector: Collector = new Collector({\n program: compilerState.program as ts.Program,\n messageRouter,\n extractorConfig,\n sourceMapper\n });\n\n collector.analyze();\n\n DocCommentEnhancer.analyze(collector);\n ValidationEnhancer.analyze(collector);\n\n const modelBuilder: ApiModelGenerator = new ApiModelGenerator(collector, extractorConfig);\n const apiPackage: ApiPackage = modelBuilder.buildApiPackage();\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages\n }\n\n if (modelBuilder.docModelEnabled) {\n messageRouter.logVerbose(\n ConsoleMessageId.WritingDocModelFile,\n 'Writing: ' + extractorConfig.apiJsonFilePath\n );\n apiPackage.saveToJsonFile(extractorConfig.apiJsonFilePath, {\n toolPackage: Extractor.packageName,\n toolVersion: Extractor.version,\n\n newlineConversion: extractorConfig.newlineKind,\n ensureFolderExists: true,\n testMode: extractorConfig.testMode\n });\n }\n\n function writeApiReport(reportConfig: IExtractorConfigApiReport): boolean {\n return Extractor._writeApiReport(\n collector,\n extractorConfig,\n messageRouter,\n extractorConfig.reportTempFolder,\n extractorConfig.reportFolder,\n reportConfig,\n localBuild\n );\n }\n\n let anyReportChanged: boolean = false;\n if (extractorConfig.apiReportEnabled) {\n for (const reportConfig of extractorConfig.reportConfigs) {\n anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;\n }\n }\n\n if (extractorConfig.rollupEnabled) {\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.publicTrimmedFilePath,\n DtsRollupKind.PublicRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.alphaTrimmedFilePath,\n DtsRollupKind.AlphaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.betaTrimmedFilePath,\n DtsRollupKind.BetaRelease,\n extractorConfig.newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n extractorConfig.untrimmedFilePath,\n DtsRollupKind.InternalRelease,\n extractorConfig.newlineKind\n );\n }\n\n if (extractorConfig.tsdocMetadataEnabled) {\n // Write the tsdoc-metadata.json file for this project\n PackageMetadataManager.writeTsdocMetadataFile(\n extractorConfig.tsdocMetadataFilePath,\n extractorConfig.newlineKind\n );\n }\n\n // Show all the messages that we collected during analysis\n messageRouter.handleRemainingNonConsoleMessages();\n\n // Determine success\n let succeeded: boolean;\n if (localBuild) {\n // For a local build, fail if there were errors (but ignore warnings)\n succeeded = messageRouter.errorCount === 0;\n } else {\n // For a production build, fail if there were any errors or warnings\n succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;\n }\n\n return new ExtractorResult({\n compilerState,\n extractorConfig,\n succeeded,\n apiReportChanged: anyReportChanged,\n errorCount: messageRouter.errorCount,\n warningCount: messageRouter.warningCount\n });\n }\n\n /**\n * Generates the API report at the specified release level, writes it to the specified file path, and compares\n * the output to the existing report (if one exists).\n *\n * @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior\n * to comparison with an existing report.\n * @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to\n * which the new report will be written post-comparison.\n * @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.\n *\n * @returns Whether or not the newly generated report differs from the existing report (if one exists).\n */\n private static _writeApiReport(\n collector: Collector,\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter,\n reportTempDirectoryPath: string,\n reportDirectoryPath: string,\n reportConfig: IExtractorConfigApiReport,\n localBuild: boolean\n ): boolean {\n let apiReportChanged: boolean = false;\n\n const actualApiReportPath: string = path.resolve(reportTempDirectoryPath, reportConfig.fileName);\n const actualApiReportShortPath: string = extractorConfig._getShortFilePath(actualApiReportPath);\n\n const expectedApiReportPath: string = path.resolve(reportDirectoryPath, reportConfig.fileName);\n const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(expectedApiReportPath);\n\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingApiReport,\n `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`\n );\n\n const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(\n collector,\n reportConfig.variant\n );\n\n // Write the actual file\n FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n\n // Compare it against the expected file\n if (FileSystem.exists(expectedApiReportPath)) {\n const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath);\n\n if (\n !ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)\n ) {\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'You have changed the API signature for this project.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n // For a local build, just copy the file automatically.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCopied,\n `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`\n );\n\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n }\n } else {\n messageRouter.logVerbose(\n ConsoleMessageId.ApiReportUnchanged,\n `The API report is up to date: ${actualApiReportShortPath}`\n );\n }\n } else {\n // The target file does not exist, so we are setting up the API review file for the first time.\n //\n // NOTE: People sometimes make a mistake where they move a project and forget to update the \"reportFolder\"\n // setting, which causes a new file to silently get written to the wrong place. This can be confusing.\n // Thus we treat the initial creation of the file specially.\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'The API report file is missing.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);\n if (!FileSystem.exists(expectedApiReportFolder)) {\n messageRouter.logError(\n ConsoleMessageId.ApiReportFolderMissing,\n 'Unable to create the API report file. Please make sure the target folder exists:\\n' +\n expectedApiReportFolder\n );\n } else {\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n convertLineEndings: extractorConfig.newlineKind\n });\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCreated,\n 'The API report file was missing, so a new file was created. Please add this file to Git:\\n' +\n expectedApiReportPath\n );\n }\n }\n }\n return apiReportChanged;\n }\n\n private static _checkCompilerCompatibility(\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter\n ): void {\n messageRouter.logInfo(\n ConsoleMessageId.Preamble,\n `Analysis will use the bundled TypeScript version ${ts.version}`\n );\n\n try {\n const typescriptPath: string = resolve.sync('typescript', {\n basedir: extractorConfig.projectFolder,\n preserveSymlinks: false\n });\n const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();\n const packageJson: INodePackageJson | undefined =\n packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);\n if (packageJson && packageJson.version && semver.valid(packageJson.version)) {\n // Consider a newer MINOR release to be incompatible\n const ourMajor: number = semver.major(ts.version);\n const ourMinor: number = semver.minor(ts.version);\n\n const theirMajor: number = semver.major(packageJson.version);\n const theirMinor: number = semver.minor(packageJson.version);\n\n if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {\n messageRouter.logInfo(\n ConsoleMessageId.CompilerVersionNotice,\n `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +\n ` bundled compiler engine; consider upgrading API Extractor.`\n );\n }\n }\n } catch (e) {\n // The compiler detection heuristic is not expected to work in many configurations\n }\n }\n\n private static _generateRollupDtsFile(\n collector: Collector,\n outputPath: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n if (outputPath !== '') {\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingDtsRollup,\n `Writing package typings: ${outputPath}`\n );\n DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);\n }\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { JsonSchema, PackageJsonLookup, type INodePackageJson, NewlineKind } from '@rushstack/node-core-library';
2
2
  import { type IRigConfig } from '@rushstack/rig-package';
3
- import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
4
3
  import { EnumMemberOrder } from '@microsoft/api-extractor-model';
5
4
  import { TSDocConfiguration } from '@microsoft/tsdoc';
6
5
  import { TSDocConfigFile } from '@microsoft/tsdoc-config';
6
+ import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
7
+ import type { IApiModelGenerationOptions } from '../generators/ApiModelGenerator';
7
8
  /**
8
9
  * Options for {@link ExtractorConfig.tryLoadForFolder}.
9
10
  *
@@ -176,8 +177,11 @@ export declare class ExtractorConfig {
176
177
  get reportTempFilePath(): string;
177
178
  /** {@inheritDoc IConfigApiReport.includeForgottenExports} */
178
179
  readonly apiReportIncludeForgottenExports: boolean;
179
- /** {@inheritDoc IConfigDocModel.enabled} */
180
- readonly docModelEnabled: boolean;
180
+ /**
181
+ * If specified, the doc model is enabled and the specified options will be used.
182
+ * @beta
183
+ */
184
+ readonly docModelGenerationOptions: IApiModelGenerationOptions | undefined;
181
185
  /** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
182
186
  readonly apiJsonFilePath: string;
183
187
  /** {@inheritDoc IConfigDocModel.includeForgottenExports} */
@@ -1 +1 @@
1
- {"version":3,"file":"ExtractorConfig.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorConfig.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,UAAU,EAEV,iBAAiB,EACjB,KAAK,gBAAgB,EAKrB,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,UAAU,EAAa,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,wBAAwB,EACzB,MAAM,eAAe,CAAC;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