@microsoft/api-extractor 7.52.14 → 7.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +50 -0
- package/CHANGELOG.md +13 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/aedoc/PackageDocComment.d.ts.map +1 -1
- package/lib/aedoc/PackageDocComment.js.map +1 -1
- package/lib/analyzer/AstDeclaration.d.ts.map +1 -1
- package/lib/analyzer/AstDeclaration.js +1 -1
- package/lib/analyzer/AstDeclaration.js.map +1 -1
- package/lib/analyzer/AstImport.d.ts.map +1 -1
- package/lib/analyzer/AstImport.js.map +1 -1
- package/lib/analyzer/AstReferenceResolver.d.ts.map +1 -1
- package/lib/analyzer/AstReferenceResolver.js.map +1 -1
- package/lib/analyzer/AstSymbol.d.ts.map +1 -1
- package/lib/analyzer/AstSymbol.js.map +1 -1
- package/lib/analyzer/AstSymbolTable.d.ts.map +1 -1
- package/lib/analyzer/AstSymbolTable.js.map +1 -1
- package/lib/analyzer/ExportAnalyzer.d.ts.map +1 -1
- package/lib/analyzer/ExportAnalyzer.js.map +1 -1
- package/lib/analyzer/PackageMetadataManager.d.ts.map +1 -1
- package/lib/analyzer/PackageMetadataManager.js +11 -11
- package/lib/analyzer/PackageMetadataManager.js.map +1 -1
- package/lib/analyzer/SourceFileLocationFormatter.d.ts.map +1 -1
- package/lib/analyzer/SourceFileLocationFormatter.js +1 -1
- package/lib/analyzer/SourceFileLocationFormatter.js.map +1 -1
- package/lib/analyzer/Span.d.ts.map +1 -1
- package/lib/analyzer/Span.js.map +1 -1
- package/lib/analyzer/TypeScriptHelpers.d.ts.map +1 -1
- package/lib/analyzer/TypeScriptHelpers.js +1 -1
- package/lib/analyzer/TypeScriptHelpers.js.map +1 -1
- package/lib/analyzer/TypeScriptInternals.d.ts.map +1 -1
- package/lib/analyzer/TypeScriptInternals.js.map +1 -1
- package/lib/api/CompilerState.d.ts.map +1 -1
- package/lib/api/CompilerState.js +2 -2
- package/lib/api/CompilerState.js.map +1 -1
- package/lib/api/Extractor.d.ts.map +1 -1
- package/lib/api/Extractor.js +2 -2
- package/lib/api/Extractor.js.map +1 -1
- package/lib/api/ExtractorConfig.d.ts +2 -2
- package/lib/api/ExtractorConfig.d.ts.map +1 -1
- package/lib/api/ExtractorConfig.js +3 -3
- package/lib/api/ExtractorConfig.js.map +1 -1
- package/lib/api/ExtractorMessage.d.ts.map +1 -1
- package/lib/api/ExtractorMessage.js.map +1 -1
- package/lib/api/IConfigFile.d.ts.map +1 -1
- package/lib/api/IConfigFile.js.map +1 -1
- package/lib/cli/ApiExtractorCommandLine.js +1 -1
- package/lib/cli/ApiExtractorCommandLine.js.map +1 -1
- package/lib/cli/InitAction.d.ts.map +1 -1
- package/lib/cli/InitAction.js +1 -1
- package/lib/cli/InitAction.js.map +1 -1
- package/lib/cli/RunAction.d.ts.map +1 -1
- package/lib/cli/RunAction.js +2 -2
- package/lib/cli/RunAction.js.map +1 -1
- package/lib/collector/ApiItemMetadata.d.ts.map +1 -1
- package/lib/collector/ApiItemMetadata.js.map +1 -1
- package/lib/collector/Collector.d.ts.map +1 -1
- package/lib/collector/Collector.js +2 -2
- package/lib/collector/Collector.js.map +1 -1
- package/lib/collector/CollectorEntity.d.ts.map +1 -1
- package/lib/collector/CollectorEntity.js +1 -1
- package/lib/collector/CollectorEntity.js.map +1 -1
- package/lib/collector/DeclarationMetadata.d.ts.map +1 -1
- package/lib/collector/DeclarationMetadata.js.map +1 -1
- package/lib/collector/MessageRouter.d.ts.map +1 -1
- package/lib/collector/MessageRouter.js.map +1 -1
- package/lib/collector/SourceMapper.d.ts.map +1 -1
- package/lib/collector/SourceMapper.js +1 -1
- package/lib/collector/SourceMapper.js.map +1 -1
- package/lib/collector/WorkingPackage.d.ts.map +1 -1
- package/lib/collector/WorkingPackage.js.map +1 -1
- package/lib/enhancers/DocCommentEnhancer.d.ts.map +1 -1
- package/lib/enhancers/DocCommentEnhancer.js +1 -1
- package/lib/enhancers/DocCommentEnhancer.js.map +1 -1
- package/lib/enhancers/ValidationEnhancer.d.ts.map +1 -1
- package/lib/enhancers/ValidationEnhancer.js +2 -2
- package/lib/enhancers/ValidationEnhancer.js.map +1 -1
- package/lib/generators/ApiModelGenerator.d.ts.map +1 -1
- package/lib/generators/ApiModelGenerator.js +1 -1
- package/lib/generators/ApiModelGenerator.js.map +1 -1
- package/lib/generators/ApiReportGenerator.d.ts.map +1 -1
- package/lib/generators/ApiReportGenerator.js +1 -1
- package/lib/generators/ApiReportGenerator.js.map +1 -1
- package/lib/generators/DeclarationReferenceGenerator.d.ts.map +1 -1
- package/lib/generators/DeclarationReferenceGenerator.js.map +1 -1
- package/lib/generators/DtsEmitHelpers.d.ts.map +1 -1
- package/lib/generators/DtsEmitHelpers.js.map +1 -1
- package/lib/generators/DtsRollupGenerator.d.ts.map +1 -1
- package/lib/generators/DtsRollupGenerator.js +1 -1
- package/lib/generators/DtsRollupGenerator.js.map +1 -1
- package/lib/generators/ExcerptBuilder.d.ts.map +1 -1
- package/lib/generators/ExcerptBuilder.js.map +1 -1
- package/lib/start.js +1 -1
- package/lib/start.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompilerState.js","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,2CAA6B;AAC7B,+CAAiC;AAEjC,oEAAwD;AAExD,uDAAoD;AAEpD,kDAA+C;AAgB/C;;;;;GAKG;AACH,MAAa,aAAa;IAMxB,YAAoB,UAAyB;QAC3C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAClB,eAAgC,EAChC,OAAqC;QAErC,IAAI,QAAQ,GAAmB,eAAe,CAAC,gBAAgB,CAAC;QA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,oBAAoB,OAAO,CAAC;4BAE3D,IAAI,aAAa,GAAwB,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;4BACzE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gCAChC,aAAa,GAAG,mBAAmB,CAAC,UAAW,CAAC,WAAW,CAAC,CAAC;gCAC7D,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;4BACjD,CAAC;4BAED,IAAI,aAAa,EAAE,CAAC;gCAClB,6EAA6E;gCAC7E,6FAA6F;gCAC7F,OAAO,KAAK,CAAC;4BACf,CAAC;4BACD,MAAM;oBACV,CAAC;gBACH,CAAC;YACH,CAAC;YAED,6CAA6C;YAC7C,OAAO,mBAAmB,CAAC,UAAW,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAjLD,sCAiLC","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 ts from 'typescript';\n\nimport { JsonFile } from '@rushstack/node-core-library';\n\nimport { ExtractorConfig } from './ExtractorConfig';\nimport type { IExtractorInvokeOptions } from './Extractor';\nimport { Colorize } from '@rushstack/terminal';\n\n/**\n * Options for {@link CompilerState.create}\n * @public\n */\nexport interface ICompilerStateCreateOptions {\n /** {@inheritDoc IExtractorInvokeOptions.typescriptCompilerFolder} */\n typescriptCompilerFolder?: string;\n\n /**\n * Additional .d.ts files to include in the analysis.\n */\n additionalEntryPoints?: string[];\n}\n\n/**\n * This class represents the TypeScript compiler state. This allows an optimization where multiple invocations\n * of API Extractor can reuse the same TypeScript compiler analysis.\n *\n * @public\n */\nexport class CompilerState {\n /**\n * The TypeScript compiler's `Program` object, which represents a complete scope of analysis.\n */\n public readonly program: unknown;\n\n private constructor(properties: CompilerState) {\n this.program = properties.program;\n }\n\n /**\n * Create a compiler state for use with the specified `IExtractorInvokeOptions`.\n */\n public static create(\n extractorConfig: ExtractorConfig,\n options?: ICompilerStateCreateOptions\n ): CompilerState {\n let tsconfig: {} | undefined = extractorConfig.overrideTsconfig;\n let configBasePath: string = extractorConfig.projectFolder;\n if (!tsconfig) {\n // If it wasn't overridden, then load it from disk\n tsconfig = JsonFile.load(extractorConfig.tsconfigFilePath);\n configBasePath = path.resolve(path.dirname(extractorConfig.tsconfigFilePath));\n }\n\n const commandLine: ts.ParsedCommandLine = ts.parseJsonConfigFileContent(tsconfig, ts.sys, configBasePath);\n\n if (!commandLine.options.skipLibCheck && extractorConfig.skipLibCheck) {\n commandLine.options.skipLibCheck = true;\n console.log(\n Colorize.cyan(\n 'API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +\n 'incorrect type analysis.'\n )\n );\n }\n\n // Delete outDir and declarationDir to prevent TypeScript from redirecting self-package\n // imports to source files. When these options are set, TypeScript's module resolution\n // tries to map output .d.ts files back to their source .ts files to avoid analyzing\n // build outputs during compilation. However, API Extractor specifically wants to analyze\n // the .d.ts build artifacts, not the source files. Since API Extractor doesn't emit any\n // files, these options are unnecessary and interfere with correct module resolution.\n delete commandLine.options.outDir;\n delete commandLine.options.declarationDir;\n\n const inputFilePaths: string[] = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);\n if (options && options.additionalEntryPoints) {\n inputFilePaths.push(...options.additionalEntryPoints);\n }\n\n // Append the entry points and remove any non-declaration files from the list\n const analysisFilePaths: string[] = CompilerState._generateFilePathsForAnalysis(inputFilePaths);\n\n const compilerHost: ts.CompilerHost = CompilerState._createCompilerHost(commandLine, options);\n\n const program: ts.Program = ts.createProgram(analysisFilePaths, commandLine.options, compilerHost);\n\n if (commandLine.errors.length > 0) {\n const errorText: string = ts.flattenDiagnosticMessageText(commandLine.errors[0].messageText, '\\n');\n throw new Error(`Error parsing tsconfig.json content: ${errorText}`);\n }\n\n return new CompilerState({\n program\n });\n }\n\n /**\n * Given a list of absolute file paths, return a list containing only the declaration\n * files. Duplicates are also eliminated.\n *\n * @remarks\n * The tsconfig.json settings specify the compiler's input (a set of *.ts source files,\n * plus some *.d.ts declaration files used for legacy typings). However API Extractor\n * analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy\n * typings). This requires API Extractor to generate a special file list when it invokes\n * the compiler.\n *\n * Duplicates are removed so that entry points can be appended without worrying whether they\n * may already appear in the tsconfig.json file list.\n */\n private static _generateFilePathsForAnalysis(inputFilePaths: string[]): string[] {\n const analysisFilePaths: string[] = [];\n\n const seenFiles: Set<string> = new Set<string>();\n\n for (const inputFilePath of inputFilePaths) {\n const inputFileToUpper: string = inputFilePath.toUpperCase();\n if (!seenFiles.has(inputFileToUpper)) {\n seenFiles.add(inputFileToUpper);\n\n if (!path.isAbsolute(inputFilePath)) {\n throw new Error('Input file is not an absolute path: ' + inputFilePath);\n }\n\n if (ExtractorConfig.hasDtsFileExtension(inputFilePath)) {\n analysisFilePaths.push(inputFilePath);\n }\n }\n }\n\n return analysisFilePaths;\n }\n\n private static _createCompilerHost(\n commandLine: ts.ParsedCommandLine,\n options: IExtractorInvokeOptions | undefined\n ): ts.CompilerHost {\n // Create a default CompilerHost that we will override\n const compilerHost: ts.CompilerHost = ts.createCompilerHost(commandLine.options);\n\n // Save a copy of the original members. Note that \"compilerHost\" cannot be the copy, because\n // createCompilerHost() captures that instance in a closure that is used by the members.\n const defaultCompilerHost: ts.CompilerHost = { ...compilerHost };\n\n if (options && options.typescriptCompilerFolder) {\n // Prevent a closure parameter\n const typescriptCompilerLibFolder: string = path.join(options.typescriptCompilerFolder, 'lib');\n compilerHost.getDefaultLibLocation = () => typescriptCompilerLibFolder;\n }\n\n // Used by compilerHost.fileExists()\n // .d.ts file path --> whether the file exists\n const dtsExistsCache: Map<string, boolean> = new Map<string, boolean>();\n\n // Used by compilerHost.fileExists()\n // Example: \"c:/folder/file.part.ts\"\n const fileExtensionRegExp: RegExp = /^(.+)(\\.[a-z0-9_]+)$/i;\n\n compilerHost.fileExists = (fileName: string): boolean => {\n // In certain deprecated setups, the compiler may write its output files (.js and .d.ts)\n // in the same folder as the corresponding input file (.ts or .tsx). When following imports,\n // API Extractor wants to analyze the .d.ts file; however recent versions of the compiler engine\n // will instead choose the .ts file. To work around this, we hook fileExists() to hide the\n // existence of those files.\n\n // Is \"fileName\" a .d.ts file? The double extension \".d.ts\" needs to be matched specially.\n if (!ExtractorConfig.hasDtsFileExtension(fileName)) {\n // It's not a .d.ts file. Is the file extension a potential source file?\n const match: RegExpExecArray | null = fileExtensionRegExp.exec(fileName);\n if (match) {\n // Example: \"c:/folder/file.part\"\n const pathWithoutExtension: string = match[1];\n // Example: \".ts\"\n const fileExtension: string = match[2];\n\n switch (fileExtension.toLocaleLowerCase()) {\n case '.ts':\n case '.tsx':\n case '.js':\n case '.jsx':\n // Yes, this is a possible source file. Is there a corresponding .d.ts file in the same folder?\n const dtsFileName: string = `${pathWithoutExtension}.d.ts`;\n\n let dtsFileExists: boolean | undefined = dtsExistsCache.get(dtsFileName);\n if (dtsFileExists === undefined) {\n dtsFileExists = defaultCompilerHost.fileExists!(dtsFileName);\n dtsExistsCache.set(dtsFileName, dtsFileExists);\n }\n\n if (dtsFileExists) {\n // fileName is a potential source file and a corresponding .d.ts file exists.\n // Thus, API Extractor should ignore this file (so the .d.ts file will get analyzed instead).\n return false;\n }\n break;\n }\n }\n }\n\n // Fall through to the default implementation\n return defaultCompilerHost.fileExists!(fileName);\n };\n\n return compilerHost;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CompilerState.js","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,gDAAkC;AAElC,+CAAiC;AAEjC,oEAAwD;AACxD,kDAA+C;AAE/C,uDAAoD;AAiBpD;;;;;GAKG;AACH,MAAa,aAAa;IAMxB,YAAoB,UAAyB;QAC3C,IAAI,CAAC,OAAO,GAAG,UAAU,CA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CAAC;wBAC1C,KAAK,KAAK,CAAC;wBACX,KAAK,MAAM,CAAC;wBACZ,KAAK,KAAK,CAAC;wBACX,KAAK,MAAM;4BACT,gGAAgG;4BAChG,MAAM,WAAW,GAAW,GAAG,oBAAoB,OAAO,CAAC;4BAE3D,IAAI,aAAa,GAAwB,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;4BACzE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gCAChC,aAAa,GAAG,mBAAmB,CAAC,UAAW,CAAC,WAAW,CAAC,CAAC;gCAC7D,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;4BACjD,CAAC;4BAED,IAAI,aAAa,EAAE,CAAC;gCAClB,6EAA6E;gCAC7E,6FAA6F;gCAC7F,OAAO,KAAK,CAAC;4BACf,CAAC;4BACD,MAAM;oBACV,CAAC;gBACH,CAAC;YACH,CAAC;YAED,6CAA6C;YAC7C,OAAO,mBAAmB,CAAC,UAAW,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAjLD,sCAiLC","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 'node:path';\n\nimport * as ts from 'typescript';\n\nimport { JsonFile } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\n\nimport { ExtractorConfig } from './ExtractorConfig';\nimport type { IExtractorInvokeOptions } from './Extractor';\n\n/**\n * Options for {@link CompilerState.create}\n * @public\n */\nexport interface ICompilerStateCreateOptions {\n /** {@inheritDoc IExtractorInvokeOptions.typescriptCompilerFolder} */\n typescriptCompilerFolder?: string;\n\n /**\n * Additional .d.ts files to include in the analysis.\n */\n additionalEntryPoints?: string[];\n}\n\n/**\n * This class represents the TypeScript compiler state. This allows an optimization where multiple invocations\n * of API Extractor can reuse the same TypeScript compiler analysis.\n *\n * @public\n */\nexport class CompilerState {\n /**\n * The TypeScript compiler's `Program` object, which represents a complete scope of analysis.\n */\n public readonly program: unknown;\n\n private constructor(properties: CompilerState) {\n this.program = properties.program;\n }\n\n /**\n * Create a compiler state for use with the specified `IExtractorInvokeOptions`.\n */\n public static create(\n extractorConfig: ExtractorConfig,\n options?: ICompilerStateCreateOptions\n ): CompilerState {\n let tsconfig: {} | undefined = extractorConfig.overrideTsconfig;\n let configBasePath: string = extractorConfig.projectFolder;\n if (!tsconfig) {\n // If it wasn't overridden, then load it from disk\n tsconfig = JsonFile.load(extractorConfig.tsconfigFilePath);\n configBasePath = path.resolve(path.dirname(extractorConfig.tsconfigFilePath));\n }\n\n const commandLine: ts.ParsedCommandLine = ts.parseJsonConfigFileContent(tsconfig, ts.sys, configBasePath);\n\n if (!commandLine.options.skipLibCheck && extractorConfig.skipLibCheck) {\n commandLine.options.skipLibCheck = true;\n console.log(\n Colorize.cyan(\n 'API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +\n 'incorrect type analysis.'\n )\n );\n }\n\n // Delete outDir and declarationDir to prevent TypeScript from redirecting self-package\n // imports to source files. When these options are set, TypeScript's module resolution\n // tries to map output .d.ts files back to their source .ts files to avoid analyzing\n // build outputs during compilation. However, API Extractor specifically wants to analyze\n // the .d.ts build artifacts, not the source files. Since API Extractor doesn't emit any\n // files, these options are unnecessary and interfere with correct module resolution.\n delete commandLine.options.outDir;\n delete commandLine.options.declarationDir;\n\n const inputFilePaths: string[] = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);\n if (options && options.additionalEntryPoints) {\n inputFilePaths.push(...options.additionalEntryPoints);\n }\n\n // Append the entry points and remove any non-declaration files from the list\n const analysisFilePaths: string[] = CompilerState._generateFilePathsForAnalysis(inputFilePaths);\n\n const compilerHost: ts.CompilerHost = CompilerState._createCompilerHost(commandLine, options);\n\n const program: ts.Program = ts.createProgram(analysisFilePaths, commandLine.options, compilerHost);\n\n if (commandLine.errors.length > 0) {\n const errorText: string = ts.flattenDiagnosticMessageText(commandLine.errors[0].messageText, '\\n');\n throw new Error(`Error parsing tsconfig.json content: ${errorText}`);\n }\n\n return new CompilerState({\n program\n });\n }\n\n /**\n * Given a list of absolute file paths, return a list containing only the declaration\n * files. Duplicates are also eliminated.\n *\n * @remarks\n * The tsconfig.json settings specify the compiler's input (a set of *.ts source files,\n * plus some *.d.ts declaration files used for legacy typings). However API Extractor\n * analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy\n * typings). This requires API Extractor to generate a special file list when it invokes\n * the compiler.\n *\n * Duplicates are removed so that entry points can be appended without worrying whether they\n * may already appear in the tsconfig.json file list.\n */\n private static _generateFilePathsForAnalysis(inputFilePaths: string[]): string[] {\n const analysisFilePaths: string[] = [];\n\n const seenFiles: Set<string> = new Set<string>();\n\n for (const inputFilePath of inputFilePaths) {\n const inputFileToUpper: string = inputFilePath.toUpperCase();\n if (!seenFiles.has(inputFileToUpper)) {\n seenFiles.add(inputFileToUpper);\n\n if (!path.isAbsolute(inputFilePath)) {\n throw new Error('Input file is not an absolute path: ' + inputFilePath);\n }\n\n if (ExtractorConfig.hasDtsFileExtension(inputFilePath)) {\n analysisFilePaths.push(inputFilePath);\n }\n }\n }\n\n return analysisFilePaths;\n }\n\n private static _createCompilerHost(\n commandLine: ts.ParsedCommandLine,\n options: IExtractorInvokeOptions | undefined\n ): ts.CompilerHost {\n // Create a default CompilerHost that we will override\n const compilerHost: ts.CompilerHost = ts.createCompilerHost(commandLine.options);\n\n // Save a copy of the original members. Note that \"compilerHost\" cannot be the copy, because\n // createCompilerHost() captures that instance in a closure that is used by the members.\n const defaultCompilerHost: ts.CompilerHost = { ...compilerHost };\n\n if (options && options.typescriptCompilerFolder) {\n // Prevent a closure parameter\n const typescriptCompilerLibFolder: string = path.join(options.typescriptCompilerFolder, 'lib');\n compilerHost.getDefaultLibLocation = () => typescriptCompilerLibFolder;\n }\n\n // Used by compilerHost.fileExists()\n // .d.ts file path --> whether the file exists\n const dtsExistsCache: Map<string, boolean> = new Map<string, boolean>();\n\n // Used by compilerHost.fileExists()\n // Example: \"c:/folder/file.part.ts\"\n const fileExtensionRegExp: RegExp = /^(.+)(\\.[a-z0-9_]+)$/i;\n\n compilerHost.fileExists = (fileName: string): boolean => {\n // In certain deprecated setups, the compiler may write its output files (.js and .d.ts)\n // in the same folder as the corresponding input file (.ts or .tsx). When following imports,\n // API Extractor wants to analyze the .d.ts file; however recent versions of the compiler engine\n // will instead choose the .ts file. To work around this, we hook fileExists() to hide the\n // existence of those files.\n\n // Is \"fileName\" a .d.ts file? The double extension \".d.ts\" needs to be matched specially.\n if (!ExtractorConfig.hasDtsFileExtension(fileName)) {\n // It's not a .d.ts file. Is the file extension a potential source file?\n const match: RegExpExecArray | null = fileExtensionRegExp.exec(fileName);\n if (match) {\n // Example: \"c:/folder/file.part\"\n const pathWithoutExtension: string = match[1];\n // Example: \".ts\"\n const fileExtension: string = match[2];\n\n switch (fileExtension.toLocaleLowerCase()) {\n case '.ts':\n case '.tsx':\n case '.js':\n case '.jsx':\n // Yes, this is a possible source file. Is there a corresponding .d.ts file in the same folder?\n const dtsFileName: string = `${pathWithoutExtension}.d.ts`;\n\n let dtsFileExists: boolean | undefined = dtsExistsCache.get(dtsFileName);\n if (dtsFileExists === undefined) {\n dtsFileExists = defaultCompilerHost.fileExists!(dtsFileName);\n dtsExistsCache.set(dtsFileName, dtsFileExists);\n }\n\n if (dtsFileExists) {\n // fileName is a potential source file and a corresponding .d.ts file exists.\n // Thus, API Extractor should ignore this file (so the .d.ts file will get analyzed instead).\n return false;\n }\n break;\n }\n }\n }\n\n // Fall through to the default implementation\n return defaultCompilerHost.fileExists!(fileName);\n };\n\n return compilerHost;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extractor.d.ts","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Extractor.d.ts","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names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C,eAAe;IAMlB;;OAEG;WACW,MAAM,CAAC,eAAe,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,eAAe;IA6K1G;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IA6G9B,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAsC1C,OAAO,CAAC,MAAM,CAAC,sBAAsB;CActC"}
|
package/lib/api/Extractor.js
CHANGED
|
@@ -36,10 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
})();
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.Extractor = exports.ExtractorResult = void 0;
|
|
39
|
-
const path = __importStar(require("path"));
|
|
39
|
+
const path = __importStar(require("node:path"));
|
|
40
40
|
const semver = __importStar(require("semver"));
|
|
41
41
|
const ts = __importStar(require("typescript"));
|
|
42
42
|
const resolve = __importStar(require("resolve"));
|
|
43
|
+
const tsdoc_config_1 = require("@microsoft/tsdoc-config");
|
|
43
44
|
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
44
45
|
const ExtractorConfig_1 = require("./ExtractorConfig");
|
|
45
46
|
const Collector_1 = require("../collector/Collector");
|
|
@@ -52,7 +53,6 @@ const DocCommentEnhancer_1 = require("../enhancers/DocCommentEnhancer");
|
|
|
52
53
|
const CompilerState_1 = require("./CompilerState");
|
|
53
54
|
const MessageRouter_1 = require("../collector/MessageRouter");
|
|
54
55
|
const ConsoleMessageId_1 = require("./ConsoleMessageId");
|
|
55
|
-
const tsdoc_config_1 = require("@microsoft/tsdoc-config");
|
|
56
56
|
const SourceMapper_1 = require("../collector/SourceMapper");
|
|
57
57
|
/**
|
|
58
58
|
* This object represents the outcome of an invocation of API Extractor.
|
package/lib/api/Extractor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AA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B,mCAAgB,CAAC,qBAAqB,EACtC,oDAAoD,WAAW,CAAC,OAAO,0BAA0B;wBAC/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
|
+
{"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,gDAAkC;AAElC,+CAAiC;AACjC,+CAAiC;AACjC,iDAAmC;AAGnC,0DAA0D;AAC1D,oEAOsC;AAEtC,uDAAoF;AACpF,sDAAmD;AACnD,yEAAqF;AACrF,uEAAoE;AACpE,yEAAsE;AACtE,+EAA4E;AAC5E,wEAAqE;AACrE,wEAAqE;AACrE,mDAAgD;AAEhD,8DAA2D;AAC3D,yDAAsD;AACtD,4DAAyD;AA+DzD;;;;GAIG;AACH,MAAa,eAAe;IA4C1B,gBAAgB;IAChB,YAAmB,UAA2B;QAC5C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAC9C,CAAC;CACF;AArDD,0CAqDC;AAED;;;GAGG;AACH,MAAa,SAAS;IACpB;;OAEG;IACI,MAAM,KAAK,OAAO;QACvB,OAAO,SAAS,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,WAAW;QAC3B,OAAO,SAAS,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC;IAC1C,CAAC;IAEO,MAAM,CAAC,eAAe;QAC5B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UAAU,GAAW,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAE7D,IAAI,UAAU,GAAG,QAAQ,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;oBAChF,aAAa,CAAC,OAAO,CACnB,mCAAgB,CAAC,qBAAqB,EACtC,oDAAoD,WAAW,CAAC,OAAO,0BAA0B;wBAC/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 'node:path';\n\nimport * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\n\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\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 { 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 { 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,8 +1,8 @@
|
|
|
1
|
-
import { JsonSchema, PackageJsonLookup, type INodePackageJson, NewlineKind } from '@rushstack/node-core-library';
|
|
2
|
-
import { type IRigConfig } from '@rushstack/rig-package';
|
|
3
1
|
import { EnumMemberOrder } from '@microsoft/api-extractor-model';
|
|
4
2
|
import { TSDocConfiguration } from '@microsoft/tsdoc';
|
|
5
3
|
import { TSDocConfigFile } from '@microsoft/tsdoc-config';
|
|
4
|
+
import { type IRigConfig } from '@rushstack/rig-package';
|
|
5
|
+
import { JsonSchema, PackageJsonLookup, type INodePackageJson, NewlineKind } from '@rushstack/node-core-library';
|
|
6
6
|
import type { ApiReportVariant, IConfigFile, IExtractorMessagesConfig } from './IConfigFile';
|
|
7
7
|
import type { IApiModelGenerationOptions } from '../generators/ApiModelGenerator';
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractorConfig.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtractorConfig.d.ts","sourceRoot":"","sources":["../../src/api/ExtractorConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAc,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,KAAK,U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W,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAoFzD,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAmG9C,OAAO,CAAC,MAAM,CAAC,8BAA8B;IAgB7C;;;;OAIG;WACW,OAAO,CAAC,OAAO,EAAE,8BAA8B,GAAG,eAAe;IAsc/E;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAYrC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAgCtC;;OAEG;WACW,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAatC"}
|
|
@@ -39,14 +39,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.ExtractorConfig = void 0;
|
|
42
|
-
const path = __importStar(require("path"));
|
|
42
|
+
const path = __importStar(require("node:path"));
|
|
43
43
|
const resolve = __importStar(require("resolve"));
|
|
44
44
|
const lodash = require("lodash");
|
|
45
|
-
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
46
|
-
const rig_package_1 = require("@rushstack/rig-package");
|
|
47
45
|
const api_extractor_model_1 = require("@microsoft/api-extractor-model");
|
|
48
46
|
const tsdoc_1 = require("@microsoft/tsdoc");
|
|
49
47
|
const tsdoc_config_1 = require("@microsoft/tsdoc-config");
|
|
48
|
+
const rig_package_1 = require("@rushstack/rig-package");
|
|
49
|
+
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
50
50
|
const PackageMetadataManager_1 = require("../analyzer/PackageMetadataManager");
|
|
51
51
|
const MessageRouter_1 = require("../collector/MessageRouter");
|
|
52
52
|
const api_extractor_schema_json_1 = __importDefault(require("../schemas/api-extractor.schema.json"));
|