@microsoft/api-extractor 7.52.10 → 7.52.12
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 +27 -0
- package/CHANGELOG.md +13 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/api/CompilerState.d.ts.map +1 -1
- package/lib/api/CompilerState.js +8 -0
- package/lib/api/CompilerState.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "7.52.12",
|
|
6
|
+
"tag": "@microsoft/api-extractor_v7.52.12",
|
|
7
|
+
"date": "Thu, 11 Sep 2025 00:22:31 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"dependency": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Updating dependency \"@rushstack/terminal\" to `0.16.0`"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.0.3`"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "7.52.11",
|
|
21
|
+
"tag": "@microsoft/api-extractor_v7.52.11",
|
|
22
|
+
"date": "Tue, 19 Aug 2025 20:45:02 GMT",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "Fix self-package import resolution by removing outDir/declarationDir from compiler options"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
4
31
|
{
|
|
5
32
|
"version": "7.52.10",
|
|
6
33
|
"tag": "@microsoft/api-extractor_v7.52.10",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @microsoft/api-extractor
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 11 Sep 2025 00:22:31 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 7.52.12
|
|
6
|
+
Thu, 11 Sep 2025 00:22:31 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 7.52.11
|
|
11
|
+
Tue, 19 Aug 2025 20:45:02 GMT
|
|
12
|
+
|
|
13
|
+
### Patches
|
|
14
|
+
|
|
15
|
+
- Fix self-package import resolution by removing outDir/declarationDir from compiler options
|
|
4
16
|
|
|
5
17
|
## 7.52.10
|
|
6
18
|
Fri, 01 Aug 2025 00:12:48 GMT
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompilerState.d.ts","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,OAAO;IAIP;;OAEG;WACW,MAAM,CAClB,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,2BAA2B,GACpC,aAAa;
|
|
1
|
+
{"version":3,"file":"CompilerState.d.ts","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,OAAO;IAIP;;OAEG;WACW,MAAM,CAClB,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,2BAA2B,GACpC,aAAa;IAoDhB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;IAuB5C,OAAO,CAAC,MAAM,CAAC,mBAAmB;CAwEnC"}
|
package/lib/api/CompilerState.js
CHANGED
|
@@ -68,6 +68,14 @@ class CompilerState {
|
|
|
68
68
|
console.log(terminal_1.Colorize.cyan('API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +
|
|
69
69
|
'incorrect type analysis.'));
|
|
70
70
|
}
|
|
71
|
+
// Delete outDir and declarationDir to prevent TypeScript from redirecting self-package
|
|
72
|
+
// imports to source files. When these options are set, TypeScript's module resolution
|
|
73
|
+
// tries to map output .d.ts files back to their source .ts files to avoid analyzing
|
|
74
|
+
// build outputs during compilation. However, API Extractor specifically wants to analyze
|
|
75
|
+
// the .d.ts build artifacts, not the source files. Since API Extractor doesn't emit any
|
|
76
|
+
// files, these options are unnecessary and interfere with correct module resolution.
|
|
77
|
+
delete commandLine.options.outDir;
|
|
78
|
+
delete commandLine.options.declarationDir;
|
|
71
79
|
const inputFilePaths = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);
|
|
72
80
|
if (options && options.additionalEntryPoints) {
|
|
73
81
|
inputFilePaths.push(...options.additionalEntryPoints);
|
|
@@ -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,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AC;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;AAxKD,sCAwKC","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 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,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;QAChE,IAAI,cAAc,GAAW,eAAe,CAAC,aAAa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Aa,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor",
|
|
3
|
-
"version": "7.52.
|
|
3
|
+
"version": "7.52.12",
|
|
4
4
|
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"source-map": "~0.6.1",
|
|
42
42
|
"typescript": "5.8.2",
|
|
43
43
|
"@microsoft/api-extractor-model": "7.30.7",
|
|
44
|
-
"@rushstack/rig-package": "0.5.3",
|
|
45
44
|
"@rushstack/node-core-library": "5.14.0",
|
|
46
|
-
"@rushstack/
|
|
47
|
-
"@rushstack/
|
|
45
|
+
"@rushstack/rig-package": "0.5.3",
|
|
46
|
+
"@rushstack/terminal": "0.16.0",
|
|
47
|
+
"@rushstack/ts-command-line": "5.0.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@rushstack/heft": "0.74.
|
|
50
|
+
"@rushstack/heft": "0.74.3",
|
|
51
51
|
"@types/lodash": "4.14.116",
|
|
52
52
|
"@types/resolve": "1.20.2",
|
|
53
53
|
"@types/semver": "7.5.0",
|