diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts
index c4a34d424b2..4f520adb3fa 100644
--- a/src/testRunner/tests.ts
+++ b/src/testRunner/tests.ts
@@ -60,6 +60,7 @@ import "./unittests/services/preProcessFile";
import "./unittests/services/textChanges";
import "./unittests/services/transpile";
import "./unittests/tsbuild/amdModulesWithOut";
+import "./unittests/tsbuild/cacheResolutions";
import "./unittests/tsbuild/clean";
import "./unittests/tsbuild/commandLine";
import "./unittests/tsbuild/configFileErrors";
@@ -85,6 +86,7 @@ import "./unittests/tsbuild/referencesWithRootDirInParent";
import "./unittests/tsbuild/resolveJsonModule";
import "./unittests/tsbuild/sample";
import "./unittests/tsbuild/transitiveReferences";
+import "./unittests/tsbuildWatch/cacheResolutions";
import "./unittests/tsbuildWatch/configFileErrors";
import "./unittests/tsbuildWatch/demo";
import "./unittests/tsbuildWatch/moduleResolution";
@@ -95,6 +97,7 @@ import "./unittests/tsbuildWatch/projectsBuilding";
import "./unittests/tsbuildWatch/publicApi";
import "./unittests/tsbuildWatch/reexport";
import "./unittests/tsbuildWatch/watchEnvironment";
+import "./unittests/tsc/cacheResolutions";
import "./unittests/tsc/cancellationToken";
import "./unittests/tsc/composite";
import "./unittests/tsc/declarationEmit";
@@ -104,6 +107,7 @@ import "./unittests/tsc/listFilesOnly";
import "./unittests/tsc/projectReferences";
import "./unittests/tsc/redirect";
import "./unittests/tsc/runWithoutArgs";
+import "./unittests/tscWatch/cacheResolutions";
import "./unittests/tscWatch/consoleClearing";
import "./unittests/tscWatch/emit";
import "./unittests/tscWatch/nodeNextWatch";
@@ -120,6 +124,7 @@ import "./unittests/tscWatch/watchEnvironment";
import "./unittests/tsserver/applyChangesToOpenFiles";
import "./unittests/tsserver/autoImportProvider";
import "./unittests/tsserver/auxiliaryProject";
+import "./unittests/tsserver/cacheResolutions";
import "./unittests/tsserver/cachingFileSystemInformation";
import "./unittests/tsserver/cancellationToken";
import "./unittests/tsserver/compileOnSave";
diff --git a/src/testRunner/unittests/tsbuild/cacheResolutions.ts b/src/testRunner/unittests/tsbuild/cacheResolutions.ts
new file mode 100644
index 00000000000..8eb90937bab
--- /dev/null
+++ b/src/testRunner/unittests/tsbuild/cacheResolutions.ts
@@ -0,0 +1,70 @@
+import {
+ noChangeRun,
+ prependText,
+ verifyTsc,
+} from "../tsc/helpers";
+import {
+ getFsWithNode16,
+ getFsWithOut,
+ getPkgImportContent,
+ getPkgTypeRefContent,
+} from "./cacheResolutionsHelper";
+
+describe("unittests:: tsbuild:: cacheResolutions::", () => {
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "multi file",
+ fs: getFsWithNode16,
+ commandLineArgs: ["-b", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ noChangeRun,
+ {
+ caption: "write file not resolved by import",
+ edit: fs => fs.writeFileSync("/src/project/node_modules/pkg1/require.d.ts", getPkgImportContent("Require", 1)),
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: fs => fs.writeFileSync("/src/project/node_modules/pkg3/require.d.ts", getPkgTypeRefContent("Require", 3)),
+ },
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };\n`),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: fs => prependText(fs, "/src/project/randomFileForTypeRef.ts", `/// \n`),
+ },
+ ]
+ });
+
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "bundle emit",
+ fs: getFsWithOut,
+ commandLineArgs: ["-b", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ noChangeRun,
+ {
+ caption: "write file not resolved by import",
+ edit: fs => fs.writeFileSync("/src/project/pkg1.d.ts", getPkgImportContent("Require", 1)),
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: fs => {
+ fs.mkdirpSync("/src/project/node_modules/pkg3");
+ fs.writeFileSync("/src/project/node_modules/pkg3/index.d.ts", getPkgTypeRefContent("Require", 3));
+ },
+ },
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: fs => prependText(fs, "/src/project/randomFileForTypeRef.ts", `/// \n`),
+ },
+ ]
+ });
+});
\ No newline at end of file
diff --git a/src/testRunner/unittests/tsbuild/cacheResolutionsHelper.ts b/src/testRunner/unittests/tsbuild/cacheResolutionsHelper.ts
new file mode 100644
index 00000000000..ff533eedd5e
--- /dev/null
+++ b/src/testRunner/unittests/tsbuild/cacheResolutionsHelper.ts
@@ -0,0 +1,160 @@
+import * as Utils from "../../_namespaces/Utils";
+import {
+ createServerHost,
+ createWatchedSystem,
+ libFile,
+ TestServerHost,
+} from "../virtualFileSystemWithWatch";
+import {
+ loadProjectFromFiles,
+} from "../tsc/helpers";
+import {
+ solutionBuildWithBaseline,
+} from "../tscWatch/helpers";
+
+function getRandomFileContent() {
+ return `export const x = 10;`;
+}
+function getPkgPackageJsonContent(pkg: number) {
+ return JSON.stringify({
+ name: `pkg${pkg}`,
+ version: "0.0.1",
+ exports: {
+ import: "./import.js",
+ require: "./require.js"
+ }
+ });
+}
+export function getPkgImportContent(type: "Import" | "Require", pkg: number) {
+ return `export interface ${type}Interface${pkg} {}`;
+}
+export function getPkgTypeRefContent(type: "Import" | "Require", pkg: number) {
+ return Utils.dedent`
+ export {};
+ declare global {
+ interface ${type}Interface${pkg} {}
+ }
+ `;
+}
+export function getFsMapWithNode16(): { [path: string]: string; } {
+ return {
+ "/src/project/tsconfig.json": JSON.stringify({
+ compilerOptions: {
+ moduleResolution: "node16",
+ composite: true,
+ cacheResolutions: true,
+ traceResolution: true,
+ },
+ include: ["*.ts"],
+ exclude: ["*.d.ts"]
+ }),
+ "/src/project/fileWithImports.ts": Utils.dedent`
+ import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };
+ import type { RequireInterface1 } from "pkg1" assert { "resolution-mode": "require" };
+ `,
+ "/src/project/randomFileForImport.ts": getRandomFileContent(),
+ "/src/project/node_modules/pkg0/package.json": getPkgPackageJsonContent(0),
+ "/src/project/node_modules/pkg0/import.d.ts": getPkgImportContent("Import", 0),
+ "/src/project/node_modules/pkg0/require.d.ts": getPkgImportContent("Require", 0),
+ "/src/project/node_modules/pkg1/package.json": getPkgPackageJsonContent(1),
+ "/src/project/node_modules/pkg1/import.d.ts": getPkgImportContent("Import", 1),
+ "/src/project/fileWithTypeRefs.ts": Utils.dedent`
+ ///
+ ///
+ interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+ export {}
+ `,
+ "/src/project/randomFileForTypeRef.ts": getRandomFileContent(),
+ "/src/project/node_modules/pkg2/package.json": getPkgPackageJsonContent(2),
+ "/src/project/node_modules/pkg2/import.d.ts": getPkgTypeRefContent("Import", 2),
+ "/src/project/node_modules/pkg2/require.d.ts": getPkgTypeRefContent("Require", 2),
+ "/src/project/node_modules/pkg3/package.json": getPkgPackageJsonContent(3),
+ "/src/project/node_modules/pkg3/import.d.ts": getPkgTypeRefContent("Import", 3),
+ "/src/project/node_modules/@types/pkg4/index.d.ts": getRandomFileContent(),
+ };
+}
+
+export function getFsWithNode16() {
+ return loadProjectFromFiles(getFsMapWithNode16());
+}
+
+export function getWatchSystemWithNode16() {
+ const system = createWatchedSystem(getFsMapWithNode16(), { currentDirectory: "/src/project" });
+ system.ensureFileOrFolder(libFile);
+ return system;
+}
+
+export function getServerHostWithNode16() {
+ const system = createServerHost(getFsMapWithNode16(), { currentDirectory: "/src/project" });
+ system.writeFile(libFile.path, libFile.content);
+ return system;
+}
+
+export function getWatchSystemWithNode16WithBuild() {
+ return getSystemWithBuild(getWatchSystemWithNode16);
+}
+
+export function getServerHostWithNode16WithBuild() {
+ return getSystemWithBuild(getServerHostWithNode16);
+}
+
+function getSystemWithBuild(createSystem: () => TestServerHost) {
+ const system = createSystem();
+ solutionBuildWithBaseline(system, ["/src/project"]);
+ return system;
+}
+
+export function getFsMapWithOut(): { [path: string]: string; } {
+ return {
+ "/src/project/tsconfig.json": JSON.stringify({
+ compilerOptions: {
+ module: "amd",
+ composite: true,
+ cacheResolutions: true,
+ traceResolution: true,
+ out: "./out.js"
+ },
+ include: ["*.ts"],
+ exclude: ["*.d.ts"]
+ }),
+ "/src/project/fileWithImports.ts": Utils.dedent`
+ import type { ImportInterface0 } from "pkg0";
+ import type { RequireInterface1 } from "pkg1";
+ `,
+ "/src/project/randomFileForImport.ts": getRandomFileContent(),
+ "/src/project/pkg0.d.ts": getPkgImportContent("Import", 0),
+ "/src/project/fileWithTypeRefs.ts": Utils.dedent`
+ ///
+ ///
+ interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+ export {}
+ `,
+ "/src/project/randomFileForTypeRef.ts": getRandomFileContent(),
+ "/src/project/node_modules/pkg2/index.d.ts": getPkgTypeRefContent("Import", 2),
+ "/src/project/node_modules/@types/pkg4/index.d.ts": getRandomFileContent(),
+ };
+}
+
+export function getFsWithOut() {
+ return loadProjectFromFiles(getFsMapWithOut());
+}
+
+export function getWatchSystemWithOut() {
+ const system = createWatchedSystem(getFsMapWithOut(), { currentDirectory: "/src/project" });
+ system.ensureFileOrFolder(libFile);
+ return system;
+}
+
+export function getServerHostWithOut() {
+ const system = createServerHost(getFsMapWithOut(), { currentDirectory: "/src/project" });
+ system.ensureFileOrFolder(libFile);
+ return system;
+}
+
+export function getWatchSystemWithOutWithBuild() {
+ return getSystemWithBuild(getWatchSystemWithOut);
+}
+
+export function getServerHostWithOutWithBuild() {
+ return getSystemWithBuild(getServerHostWithOut);
+}
\ No newline at end of file
diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts
index b98f14f7c8e..6cfa21130ab 100644
--- a/src/testRunner/unittests/tsbuild/sample.ts
+++ b/src/testRunner/unittests/tsbuild/sample.ts
@@ -613,5 +613,28 @@ class someClass2 { }`),
fs.unlinkSync("/src/core/anotherModule.ts");
}
});
+
+ verifyTsc({
+ scenario: "sample1",
+ subScenario: "cacheResolutions",
+ baselinePrograms: true,
+ fs: () => projFs,
+ modifyFs: fs => {
+ cacheResolutions("/src/core/tsconfig.json");
+ cacheResolutions("/src/logic/tsconfig.json");
+ cacheResolutions("/src/tests/tsconfig.json");
+ function cacheResolutions(file: string) {
+ const content = JSON.parse(fs.readFileSync(file, "utf-8"));
+ content.compilerOptions = {
+ ...content.compilerOptions || {},
+ cacheResolutions: true
+ };
+ fs.writeFileSync(file, JSON.stringify(content, /*replacer*/ undefined, 4));
+ }
+ },
+ commandLineArgs: ["--b", "/src/tests"],
+ baselineModulesAndTypeRefs: true,
+ edits: coreChanges,
+ });
});
});
diff --git a/src/testRunner/unittests/tsbuildWatch/cacheResolutions.ts b/src/testRunner/unittests/tsbuildWatch/cacheResolutions.ts
new file mode 100644
index 00000000000..9fb09b65dcf
--- /dev/null
+++ b/src/testRunner/unittests/tsbuildWatch/cacheResolutions.ts
@@ -0,0 +1,113 @@
+import {
+ TestServerHost,
+} from "../virtualFileSystemWithWatch";
+import {
+ getPkgImportContent,
+ getPkgTypeRefContent,
+ getWatchSystemWithNode16,
+ getWatchSystemWithNode16WithBuild,
+ getWatchSystemWithOut,
+ getWatchSystemWithOutWithBuild,
+} from "../tsbuild/cacheResolutionsHelper";
+import {
+ verifyTscWatch,
+} from "../tscWatch/helpers";
+
+describe("unittests:: tsbuildWatch:: watchMode:: cacheResolutions::", () => {
+ describe("multi file project", () => {
+ verifyTscWatchMultiFile("multi file", getWatchSystemWithNode16);
+ verifyTscWatchMultiFile("multi file already built", getWatchSystemWithNode16WithBuild);
+ function verifyTscWatchMultiFile(subScenario: string, sys: () => TestServerHost) {
+ verifyTscWatch({
+ scenario: "cacheResolutions",
+ subScenario,
+ sys,
+ commandLineArgs: ["-b", "-w", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: sys => sys.prependFile("/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };\n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: sys => sys.prependFile("/src/project/randomFileForTypeRef.ts", `/// \n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by import and random edit",
+ edit: sys => {
+ sys.writeFile("/src/project/node_modules/pkg1/require.d.ts", getPkgImportContent("Require", 1));
+ sys.appendFile("/src/project/randomFileForImport.ts", `export const y = 10;`);
+ },
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by typeRef and random edit",
+ edit: sys => {
+ sys.writeFile("/src/project/node_modules/pkg3/require.d.ts", getPkgTypeRefContent("Require", 3));
+ sys.appendFile("/src/project/randomFileForImport.ts", `export const z = 10;`);
+ },
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "Random edit",
+ edit: sys => sys.appendFile("/src/project/randomFileForImport.ts", `export const k = 10;`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ ]
+ });
+ }
+ });
+
+ describe("with bundle emit", () => {
+ verifyTscWatchBundleEmit("bundle emit", getWatchSystemWithOut);
+ verifyTscWatchBundleEmit("bundle emit already built", getWatchSystemWithOutWithBuild);
+ function verifyTscWatchBundleEmit(subScenario: string, sys: () => TestServerHost) {
+ verifyTscWatch({
+ scenario: "cacheResolutions",
+ subScenario,
+ sys,
+ commandLineArgs: ["-b", "-w", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: sys => sys.prependFile("/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: sys => sys.prependFile("/src/project/randomFileForTypeRef.ts", `/// \n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by import and random edit",
+ edit: sys => {
+ sys.writeFile("/src/project/pkg1.d.ts", getPkgImportContent("Require", 1));
+ sys.appendFile("/src/project/randomFileForImport.ts", `export const y = 10;`);
+ },
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by typeRef and random edit",
+ edit: sys => {
+ sys.ensureFileOrFolder({
+ path: "/src/project/node_modules/pkg3/index.d.ts",
+ content: getPkgTypeRefContent("Require", 3)
+ });
+ sys.appendFile("/src/project/randomFileForImport.ts", `export const z = 10;`);
+ },
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "Random edit",
+ edit: sys => sys.appendFile("/src/project/randomFileForImport.ts", `export const k = 10;`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ ]
+ });
+ }
+ });
+});
\ No newline at end of file
diff --git a/src/testRunner/unittests/tsc/cacheResolutions.ts b/src/testRunner/unittests/tsc/cacheResolutions.ts
new file mode 100644
index 00000000000..93c75b875f0
--- /dev/null
+++ b/src/testRunner/unittests/tsc/cacheResolutions.ts
@@ -0,0 +1,226 @@
+import * as Utils from "../../_namespaces/Utils";
+import {
+ createWatchedSystem,
+ libFile,
+} from "../virtualFileSystemWithWatch";
+import {
+ getFsWithNode16,
+ getFsWithOut,
+ getPkgImportContent,
+ getPkgTypeRefContent,
+} from "../tsbuild/cacheResolutionsHelper";
+import {
+ loadProjectFromFiles,
+ noChangeRun,
+ prependText,
+ verifyTsc,
+} from "./helpers";
+import {
+ solutionBuildWithBaseline,
+ verifyTscWatch,
+} from "../tscWatch/helpers";
+
+describe("unittests:: tsc:: cacheResolutions::", () => {
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "multi file",
+ fs: getFsWithNode16,
+ commandLineArgs: ["-p", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ noChangeRun,
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };\n`),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: fs => prependText(fs, "/src/project/randomFileForTypeRef.ts", `/// \n`),
+ },
+ {
+ caption: "write file not resolved by import",
+ edit: fs => fs.writeFileSync("/src/project/node_modules/pkg1/require.d.ts", getPkgImportContent("Require", 1)),
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: fs => fs.writeFileSync("/src/project/node_modules/pkg3/require.d.ts", getPkgTypeRefContent("Require", 3)),
+ },
+ {
+ caption: "delete file with imports",
+ edit: fs => fs.unlinkSync("/src/project/fileWithImports.ts"),
+ },
+ {
+ caption: "delete file with typeRefs",
+ edit: fs => fs.unlinkSync("/src/project/fileWithTypeRefs.ts"),
+ },
+ {
+ caption: "delete resolved import file",
+ edit: fs => fs.unlinkSync("/src/project/node_modules/pkg0/import.d.ts"),
+ },
+ {
+ caption: "delete resolved typeRef file",
+ edit: fs => fs.unlinkSync("/src/project/node_modules/pkg2/import.d.ts"),
+ },
+ ]
+ });
+
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "bundle emit",
+ fs: getFsWithOut,
+ commandLineArgs: ["-p", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ noChangeRun,
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: fs => prependText(fs, "/src/project/randomFileForTypeRef.ts", `/// \n`),
+ },
+ {
+ caption: "write file not resolved by import",
+ edit: fs => fs.writeFileSync("/src/project/pkg1.d.ts", getPkgImportContent("Require", 1)),
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: fs => {
+ fs.mkdirpSync("/src/project/node_modules/pkg3");
+ fs.writeFileSync("/src/project/node_modules/pkg3/index.d.ts", getPkgTypeRefContent("Require", 3));
+ },
+ },
+ {
+ caption: "delete file with imports",
+ edit: fs => fs.unlinkSync("/src/project/fileWithImports.ts"),
+ },
+ {
+ caption: "delete file with typeRefs",
+ edit: fs => fs.unlinkSync("/src/project/fileWithTypeRefs.ts"),
+ },
+ {
+ caption: "delete resolved import file",
+ edit: fs => fs.unlinkSync("/src/project/pkg0.d.ts"),
+ },
+ {
+ caption: "delete resolved typeRef file",
+ edit: fs => fs.unlinkSync("/src/project/node_modules/pkg2/index.d.ts"),
+ },
+ ]
+ });
+
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "pathsBasePath",
+ fs: () => loadProjectFromFiles({
+ "/src/project/tsconfig.json": JSON.stringify({
+ compilerOptions: {
+ paths: {
+ "*": ["./lib/*"]
+ },
+ composite: true,
+ cacheResolutions: true,
+ traceResolution: true,
+ },
+ files: ["main.ts", "randomFileForImport.ts"],
+ }),
+ "/src/project/main.ts": Utils.dedent`
+ import type { ImportInterface0 } from "pkg0";
+ `,
+ "/src/project/randomFileForImport.ts": "export const x = 10;",
+ "/src/project/lib/pkg0/index.d.ts": getPkgImportContent("Import", 0),
+ }),
+ commandLineArgs: ["-p", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`),
+ },
+ ]
+ });
+
+ describe("symlinks", () => {
+ function verifySymLinks(preserveSymlinks: boolean, built: boolean) {
+ verifyTscWatch({
+ scenario: "cacheResolutions",
+ subScenario: `resolutions with symlinks${preserveSymlinks ? " with preserveSymlinks" : ""}${built ? "" : " when not built"}`,
+ sys: () => {
+ const sys = createWatchedSystem({
+ "/src/project/tsconfig.json": JSON.stringify({
+ compilerOptions: {
+ composite: true,
+ cacheResolutions: true,
+ traceResolution: true,
+ preserveSymlinks,
+ },
+ files: ["main.ts", "randomFileForImport.ts"],
+ }),
+ "/src/project/main.ts": Utils.dedent`
+ import type { ImportInterface0 } from "pkg0";
+ `,
+ "/src/project/randomFileForImport.ts": "export const x = 10;",
+ "/src/project/lib/pkg0/index.d.ts": getPkgImportContent("Import", 0),
+ "/src/project/node_modules/pkg0/index.d.ts": { symLink: "/src/project/lib/pkg0/index.d.ts" },
+ });
+ sys.ensureFileOrFolder(libFile);
+ if (built) {
+ solutionBuildWithBaseline(sys, ["/src/project"]);
+ sys.clearOutput();
+ sys.prependFile("/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`);
+ }
+ return sys;
+ },
+ commandLineArgs: ["-p", "/src/project", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ });
+ }
+ verifySymLinks(/*preserveSymlinks*/ true, /*built*/ true);
+ verifySymLinks(/*preserveSymlinks*/ false, /*built*/ true);
+ verifySymLinks(/*preserveSymlinks*/ true, /*built*/ false);
+ verifySymLinks(/*preserveSymlinks*/ false, /*built*/ false);
+ });
+
+ verifyTsc({
+ scenario: "cacheResolutions",
+ subScenario: "diagnostics from cache",
+ fs: () => loadProjectFromFiles({
+ "/src/project/tsconfig.json": JSON.stringify({
+ compilerOptions: {
+ moduleResolution: "nodenext",
+ outDir: "./dist",
+ declaration: true,
+ declarationDir: "./types",
+ cacheResolutions: true,
+ traceResolution: true,
+ },
+ }),
+ "/src/project/package.json": JSON.stringify({
+ name: "@this/package",
+ type: "module",
+ exports: {
+ ".": {
+ default: "./dist/index.js",
+ types: "./types/index.d.ts"
+ }
+ }
+ }),
+ "/src/project/index.ts": Utils.dedent`
+ import * as me from "@this/package";
+ me.thing()
+ export function thing(): void {}
+ `,
+ "/src/project/index2.ts": Utils.dedent`
+ export function thing(): void {}
+ `,
+ "/src/project/randomFileForImport.ts": "export const x = 10;",
+ }),
+ commandLineArgs: ["-p", "/src/project", "--incremental", "--explainFiles"],
+ baselineModulesAndTypeRefs: true,
+ edits: [{
+ caption: "modify randomFileForImport by adding import",
+ edit: fs => prependText(fs, "/src/project/randomFileForImport.ts", `import * as me from "@this/package";\n`),
+ }],
+ });
+});
\ No newline at end of file
diff --git a/src/testRunner/unittests/tscWatch/cacheResolutions.ts b/src/testRunner/unittests/tscWatch/cacheResolutions.ts
new file mode 100644
index 00000000000..cbd3e36734d
--- /dev/null
+++ b/src/testRunner/unittests/tscWatch/cacheResolutions.ts
@@ -0,0 +1,143 @@
+import {
+ getPkgImportContent,
+ getPkgTypeRefContent,
+ getWatchSystemWithNode16,
+ getWatchSystemWithNode16WithBuild,
+ getWatchSystemWithOut,
+ getWatchSystemWithOutWithBuild,
+} from "../tsbuild/cacheResolutionsHelper";
+import {
+ TestServerHost,
+} from "../virtualFileSystemWithWatch";
+import {
+ verifyTscWatch,
+} from "./helpers";
+
+describe("unittests:: tsc-watch:: cacheResolutions::", () => {
+ describe("multi file project", () => {
+ verifyTscWatchMultiFile("multi file", getWatchSystemWithNode16);
+ verifyTscWatchMultiFile("multi file already built", getWatchSystemWithNode16WithBuild);
+ function verifyTscWatchMultiFile(subScenario: string, sys: () => TestServerHost) {
+ verifyTscWatch({
+ scenario: "cacheResolutions",
+ subScenario,
+ sys,
+ commandLineArgs: ["-w", "--explainFiles", "--extendedDiagnostics"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: sys => sys.prependFile("/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };\n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: sys => sys.prependFile("/src/project/randomFileForTypeRef.ts", `/// \n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by import",
+ edit: sys => sys.writeFile("/src/project/node_modules/pkg1/require.d.ts", getPkgImportContent("Require", 1)),
+ timeouts: sys => {
+ sys.runQueuedTimeoutCallbacks(); // failed lookup
+ sys.runQueuedTimeoutCallbacks(); // actual update
+ }
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: sys => sys.writeFile("/src/project/node_modules/pkg3/require.d.ts", getPkgTypeRefContent("Require", 3)),
+ timeouts: sys => {
+ sys.runQueuedTimeoutCallbacks(); // failed lookup
+ sys.runQueuedTimeoutCallbacks(); // actual update
+ }
+ },
+ {
+ caption: "delete file with imports",
+ edit: sys => sys.deleteFile("/src/project/fileWithImports.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete file with typeRefs",
+ edit: sys => sys.deleteFile("/src/project/fileWithTypeRefs.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete resolved import file",
+ edit: sys => sys.deleteFile("/src/project/node_modules/pkg0/import.d.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete resolved typeRef file",
+ edit: sys => sys.deleteFile("/src/project/node_modules/pkg2/import.d.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ ]
+ });
+ }
+ });
+
+ describe("with bundle emit", () => {
+ verifyTscWatchBundleEmit("bundle emit", getWatchSystemWithOut);
+ verifyTscWatchBundleEmit("bundle emit already built", getWatchSystemWithOutWithBuild);
+ function verifyTscWatchBundleEmit(subScenario: string, sys: () => TestServerHost) {
+ verifyTscWatch({
+ scenario: "cacheResolutions",
+ subScenario,
+ sys,
+ commandLineArgs: ["-w", "--explainFiles", "--extendedDiagnostics"],
+ baselineModulesAndTypeRefs: true,
+ edits: [
+ {
+ caption: "modify randomFileForImport by adding import",
+ edit: sys => sys.prependFile("/src/project/randomFileForImport.ts", `import type { ImportInterface0 } from "pkg0";\n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "modify randomFileForTypeRef by adding typeRef",
+ edit: sys => sys.prependFile("/src/project/randomFileForTypeRef.ts", `/// \n`),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "write file not resolved by import",
+ edit: sys => sys.writeFile("/src/project/pkg1.d.ts", getPkgImportContent("Require", 1)),
+ timeouts: sys => {
+ sys.runQueuedTimeoutCallbacks(); // failed lookup
+ sys.runQueuedTimeoutCallbacks(); // actual update
+ }
+ },
+ {
+ caption: "write file not resolved by typeRef",
+ edit: sys => sys.ensureFileOrFolder({
+ path: "/src/project/node_modules/pkg3/index.d.ts",
+ content: getPkgTypeRefContent("Require", 3)
+ }),
+ timeouts: sys => {
+ sys.runQueuedTimeoutCallbacks(); // failed lookup
+ sys.runQueuedTimeoutCallbacks(); // actual update
+ }
+ },
+ {
+ caption: "delete file with imports",
+ edit: sys => sys.deleteFile("/src/project/fileWithImports.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete file with typeRefs",
+ edit: sys => sys.deleteFile("/src/project/fileWithTypeRefs.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete resolved import file",
+ edit: sys => sys.deleteFile("/src/project/pkg0.d.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ {
+ caption: "delete resolved typeRef file",
+ edit: sys => sys.deleteFile("/src/project/node_modules/pkg2/index.d.ts"),
+ timeouts: sys => sys.runQueuedTimeoutCallbacks(),
+ },
+ ]
+ });
+ }
+ });
+});
\ No newline at end of file
diff --git a/src/testRunner/unittests/tsserver/cacheResolutions.ts b/src/testRunner/unittests/tsserver/cacheResolutions.ts
new file mode 100644
index 00000000000..a9baaa25e3a
--- /dev/null
+++ b/src/testRunner/unittests/tsserver/cacheResolutions.ts
@@ -0,0 +1,280 @@
+import * as ts from "../../_namespaces/ts";
+import * as fakes from "../../_namespaces/fakes";
+import * as Utils from "../../_namespaces/Utils";
+import {
+ createServerHost,
+ File,
+ getTsBuildProjectFile,
+ libFile,
+ TestServerHost,
+} from "../virtualFileSystemWithWatch";
+import {
+ solutionBuildWithBaseline,
+} from "../tscWatch/helpers";
+import {
+ baselineTsserverLogs,
+ createLoggerWithInMemoryLogs,
+ createSession,
+ openFilesForSession,
+} from "./helpers";
+import {
+ getPkgImportContent,
+ getServerHostWithNode16,
+ getServerHostWithNode16WithBuild,
+ getServerHostWithOut,
+ getServerHostWithOutWithBuild,
+} from "../tsbuild/cacheResolutionsHelper";
+
+describe("unittests:: tsserver:: cacheResolutions:: tsserverProjectSystem caching module resolutions option", () => {
+ describe("multi file project", () => {
+ verifyTsserverMultiFile("multi file not built", getServerHostWithNode16);
+ verifyTsserverMultiFile("multi file", getServerHostWithNode16WithBuild);
+ function verifyTsserverMultiFile(scenario: string, createHost: () => TestServerHost) {
+ it(scenario, () => {
+ const host = fakes.patchHostForBuildInfoReadWrite(createHost());
+ const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) });
+ openFilesForSession(["/src/project/randomFileForImport.ts", "/src/project/randomFileForTypeRef.ts"], session);
+
+ session.logger.info("modify randomFileForImport by adding import");
+ session.executeCommandSeq({
+ command: ts.server.protocol.CommandTypes.Change,
+ arguments: {
+ file: "/src/project/randomFileForImport.ts",
+ line: 1,
+ offset: 1,
+ endLine: 1,
+ endOffset: 1,
+ insertString: `import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };\n`,
+ }
+ });
+ ts.server.updateProjectIfDirty(session.getProjectService().configuredProjects.get("/src/project/tsconfig.json")!);
+
+ session.logger.info("modify randomFileForTypeRef by adding typeRef");
+ session.executeCommandSeq({
+ command: ts.server.protocol.CommandTypes.Change,
+ arguments: {
+ file: "/src/project/randomFileForTypeRef.ts",
+ line: 1,
+ offset: 1,
+ endLine: 1,
+ endOffset: 1,
+ insertString: `/// \n`,
+ }
+ });
+ ts.server.updateProjectIfDirty(session.getProjectService().configuredProjects.get("/src/project/tsconfig.json")!);
+
+ session.logger.info("write file not resolved by import");
+ host.writeFile("/src/project/node_modules/pkg1/require.d.ts", getPkgImportContent("Require", 1));
+ host.runQueuedTimeoutCallbacks(); // failed lookup
+ host.runQueuedTimeoutCallbacks(); // actual update
+
+ session.logger.info("write file not resolved by typeRef");
+ host.writeFile("/src/project/node_modules/pkg3/require.d.ts", getPkgImportContent("Require", 3));
+ host.runQueuedTimeoutCallbacks(); // failed lookup
+ host.runQueuedTimeoutCallbacks(); // actual update
+
+ session.logger.info("delete file with imports");
+ host.deleteFile("/src/project/fileWithImports.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete file with typeRefs");
+ host.deleteFile("/src/project/fileWithTypeRefs.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete resolved import file");
+ host.deleteFile("/src/project/node_modules/pkg0/import.d.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete resolved typeRef file");
+ host.deleteFile("/src/project/node_modules/pkg2/import.d.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ baselineTsserverLogs("cacheResolutions", scenario, session);
+ });
+ }
+ });
+
+ describe("with bundle emit", () => {
+ verifyTsserverBundleEmit("bundle emit not built", getServerHostWithOut);
+ verifyTsserverBundleEmit("bundle emit", getServerHostWithOutWithBuild);
+ function verifyTsserverBundleEmit(scenario: string, createHost: () => TestServerHost) {
+ it(scenario, () => {
+ const host = fakes.patchHostForBuildInfoReadWrite(createHost());
+ const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) });
+ openFilesForSession(["/src/project/randomFileForImport.ts", "/src/project/randomFileForTypeRef.ts"], session);
+
+ session.logger.info("modify randomFileForImport by adding import");
+ session.executeCommandSeq({
+ command: ts.server.protocol.CommandTypes.Change,
+ arguments: {
+ file: "/src/project/randomFileForImport.ts",
+ line: 1,
+ offset: 1,
+ endLine: 1,
+ endOffset: 1,
+ insertString: `import type { ImportInterface0 } from "pkg0";\n`,
+ }
+ });
+ ts.server.updateProjectIfDirty(session.getProjectService().configuredProjects.get("/src/project/tsconfig.json")!);
+
+ session.logger.info("modify randomFileForTypeRef by adding typeRef");
+ session.executeCommandSeq({
+ command: ts.server.protocol.CommandTypes.Change,
+ arguments: {
+ file: "/src/project/randomFileForTypeRef.ts",
+ line: 1,
+ offset: 1,
+ endLine: 1,
+ endOffset: 1,
+ insertString: `/// \n`,
+ }
+ });
+ ts.server.updateProjectIfDirty(session.getProjectService().configuredProjects.get("/src/project/tsconfig.json")!);
+
+ session.logger.info("write file not resolved by import");
+ host.writeFile("/src/project/pkg1.d.ts", getPkgImportContent("Require", 1));
+ host.runQueuedTimeoutCallbacks(); // failed lookup
+ host.runQueuedTimeoutCallbacks(); // actual update
+
+ session.logger.info("write file not resolved by typeRef");
+ host.ensureFileOrFolder({
+ path: "/src/project/node_modules/pkg3/index.d.ts",
+ content: getPkgImportContent("Require", 3)
+ });
+ host.runQueuedTimeoutCallbacks(); // failed lookup
+ host.runQueuedTimeoutCallbacks(); // actual update
+
+ session.logger.info("delete file with imports");
+ host.deleteFile("/src/project/fileWithImports.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete file with typeRefs");
+ host.deleteFile("/src/project/fileWithTypeRefs.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete resolved import file");
+ host.deleteFile("/src/project/pkg0.d.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ session.logger.info("delete resolved typeRef file");
+ host.deleteFile("/src/project/node_modules/pkg2/index.d.ts");
+ host.runQueuedTimeoutCallbacks();
+
+ baselineTsserverLogs("cacheResolutions", scenario, session);
+ });
+ }
+ });
+
+ describe("different projects", () => {
+ describe("on sample project", () => {
+ function cacheResolutions(file: File) {
+ const content = JSON.parse(file.content);
+ content.compilerOptions = {
+ ...content.compilerOptions || {},
+ cacheResolutions: true,
+ traceResolution: true,
+ };
+ file.content = JSON.stringify(content, /*replacer*/ undefined, 4);
+ return file;
+ }
+ function setupHost() {
+ const coreConfig = cacheResolutions(getTsBuildProjectFile("sample1", "core/tsconfig.json"));
+ const coreIndex = getTsBuildProjectFile("sample1", "core/index.ts");
+ const coreAnotherModule = getTsBuildProjectFile("sample1", "core/anotherModule.ts");
+ const coreSomeDecl = getTsBuildProjectFile("sample1", "core/some_decl.d.ts");
+ const logicConfig = cacheResolutions(getTsBuildProjectFile("sample1", "logic/tsconfig.json"));
+ const logicIndex = getTsBuildProjectFile("sample1", "logic/index.ts");
+ const testsConfig = cacheResolutions(getTsBuildProjectFile("sample1", "tests/tsconfig.json"));
+ const testsIndex = getTsBuildProjectFile("sample1", "tests/index.ts");
+ const host = createServerHost([libFile, coreConfig, coreIndex, coreAnotherModule, coreSomeDecl, logicConfig, logicIndex, testsConfig, testsIndex]);
+ return { host, testsConfig, testsIndex };
+ }
+ verifyOnProject("sample project", setupHost);
+ });
+
+ describe("project where d.ts file contains fewer modules than original file", () => {
+ function setupHost() {
+ const coreConfig: File = {
+ path: `/user/username/projects/sample1/core/tsconfig.json`,
+ content: JSON.stringify({ compilerOptions: { composite: true, cacheResolutions: true, traceResolution: true } })
+ };
+ const coreIndex: File = {
+ path: `/user/username/projects/sample1/core/index.ts`,
+ content: `export function bar() { return 10; }`
+ };
+ const coreMyClass: File = {
+ path: `/user/username/projects/sample1/core/myClass.ts`,
+ content: `export class myClass { }`
+ };
+ const coreAnotherClass: File = {
+ path: `/user/username/projects/sample1/core/anotherClass.ts`,
+ content: `export class anotherClass { }`
+ };
+ const logicConfig: File = {
+ path: `/user/username/projects/sample1/logic/tsconfig.json`,
+ content: JSON.stringify({
+ compilerOptions: { composite: true, cacheResolutions: true, traceResolution: true },
+ references: [{ path: "../core" }]
+ })
+ };
+ const logicIndex: File = {
+ path: `/user/username/projects/sample1/logic/index.ts`,
+ content: Utils.dedent`
+ import { myClass } from "../core/myClass";
+ import { bar } from "../core";
+ import { anotherClass } from "../core/anotherClass";
+ export function returnMyClass() {
+ bar();
+ return new myClass();
+ }
+ export function returnAnotherClass() {
+ return new anotherClass();
+ }
+ `
+ };
+ const testsConfig: File = {
+ path: `/user/username/projects/sample1/tests/tsconfig.json`,
+ content: JSON.stringify({
+ compilerOptions: { composite: true, cacheResolutions: true, traceResolution: true },
+ references: [{ path: "../logic" }]
+ })
+ };
+ const testsIndex: File = {
+ path: `/user/username/projects/sample1/tests/index.ts`,
+ content: Utils.dedent`
+ import { returnMyClass } from "../logic";
+ returnMyClass();
+ `
+ };
+ const host = createServerHost([libFile, coreConfig, coreIndex, coreMyClass, coreAnotherClass, logicConfig, logicIndex, testsConfig, testsIndex]);
+ return { host, testsConfig, testsIndex };
+ }
+
+ verifyOnProject("dts has fewer resolutions than ts", setupHost);
+ });
+
+ function verifyOnProject(
+ scenario: string,
+ setupHost: () => {
+ host: TestServerHost;
+ testsConfig: File;
+ testsIndex: File;
+ }) {
+ it(scenario, () => {
+ const { host, testsConfig, testsIndex } = setupHost();
+ solutionBuildWithBaseline(host, [testsConfig.path]);
+ fakes.patchHostForBuildInfoReadWrite(host);
+ const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) });
+ openFilesForSession([testsIndex], session);
+ baselineTsserverLogs("cacheResolutions", scenario, session);
+ });
+ it(`${scenario} not built`, () => {
+ const { host, testsIndex } = setupHost();
+ fakes.patchHostForBuildInfoReadWrite(host);
+ const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) });
+ openFilesForSession([testsIndex], session);
+ baselineTsserverLogs("cacheResolutions", `${scenario} not built`, session);
+ });
+ }
+ });
+});
\ No newline at end of file
diff --git a/tests/baselines/reference/tsbuild/cacheResolutions/bundle-emit.js b/tests/baselines/reference/tsbuild/cacheResolutions/bundle-emit.js
new file mode 100644
index 00000000000..44962dee732
--- /dev/null
+++ b/tests/baselines/reference/tsbuild/cacheResolutions/bundle-emit.js
@@ -0,0 +1,1410 @@
+Input::
+//// [/lib/lib.d.ts]
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+declare const console: { log(msg: any): void; };
+
+//// [/src/project/fileWithImports.ts]
+import type { ImportInterface0 } from "pkg0";
+import type { RequireInterface1 } from "pkg1";
+
+
+//// [/src/project/fileWithTypeRefs.ts]
+///
+///
+interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+export {}
+
+
+//// [/src/project/node_modules/@types/pkg4/index.d.ts]
+export const x = 10;
+
+//// [/src/project/node_modules/pkg2/index.d.ts]
+export {};
+declare global {
+ interface ImportInterface2 {}
+}
+
+
+//// [/src/project/pkg0.d.ts]
+export interface ImportInterface0 {}
+
+//// [/src/project/randomFileForImport.ts]
+export const x = 10;
+
+//// [/src/project/randomFileForTypeRef.ts]
+export const x = 10;
+
+//// [/src/project/tsconfig.json]
+{"compilerOptions":{"module":"amd","composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js"},"include":["*.ts"],"exclude":["*.d.ts"]}
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96msrc/project/fileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+
+Found 3 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx",
+ "/src/project/pkg1.d.ts",
+ "/src/pkg1.ts",
+ "/src/pkg1.tsx",
+ "/src/pkg1.d.ts",
+ "/pkg1.ts",
+ "/pkg1.tsx",
+ "/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/pkg1.js",
+ "/src/project/pkg1.jsx",
+ "/src/pkg1.js",
+ "/src/pkg1.jsx",
+ "/pkg1.js",
+ "/pkg1.jsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+
+
+Change:: no-change-run
+Input::
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96msrc/project/fileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+
+Found 3 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx",
+ "/src/project/pkg1.d.ts",
+ "/src/pkg1.ts",
+ "/src/pkg1.tsx",
+ "/src/pkg1.d.ts",
+ "/pkg1.ts",
+ "/pkg1.tsx",
+ "/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/pkg1.js",
+ "/src/project/pkg1.jsx",
+ "/src/pkg1.js",
+ "/src/pkg1.jsx",
+ "/pkg1.js",
+ "/pkg1.jsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+
+
+Change:: write file not resolved by import
+Input::
+//// [/src/project/pkg1.d.ts]
+export interface RequireInterface1 {}
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+src/project/pkg1.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+
+Found 2 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+
+
+Change:: write file not resolved by typeRef
+Input::
+//// [/src/project/node_modules/pkg3/index.d.ts]
+export {};
+declare global {
+ interface RequireInterface3 {}
+}
+
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3/package.json' does not exist.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/pkg3/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/index.d.ts', result '/src/project/node_modules/pkg3/index.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+src/project/pkg1.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/node_modules/pkg3/index.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+exitCode:: ExitStatus.Success
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/out.d.ts]
+declare module "fileWithImports" { }
+declare module "fileWithTypeRefs" {
+ export {};
+}
+declare module "randomFileForImport" {
+ export const x = 10;
+}
+declare module "randomFileForTypeRef" {
+ export const x = 10;
+}
+
+
+//// [/out.js]
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///
+ ///
+});
+define("randomFileForImport", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+define("randomFileForTypeRef", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+
+
+//// [/out.tsbuildinfo]
+{"bundle":{"commonSourceDirectory":"./src/project","sourceFiles":["./src/project/fileWithImports.ts","./src/project/fileWithTypeRefs.ts","./src/project/randomFileForImport.ts","./src/project/randomFileForTypeRef.ts"],"js":{"sections":[{"pos":0,"end":864,"kind":"text"}],"hash":"-31220064334-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\n"},"dts":{"sections":[{"pos":0,"end":233,"kind":"text"}],"hash":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"}},"program":{"fileNames":["./lib/lib.d.ts","./src/project/pkg0.d.ts","./src/project/pkg1.d.ts","./src/project/filewithimports.ts","./src/project/node_modules/pkg2/index.d.ts","./src/project/node_modules/pkg3/index.d.ts","./src/project/filewithtyperefs.ts","./src/project/randomfileforimport.ts","./src/project/randomfilefortyperef.ts","./src/project/node_modules/@types/pkg4/index.d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","769951468-export interface ImportInterface0 {}","-3547817137-export interface RequireInterface1 {}","17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n","1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","-10726455937-export const x = 10;","-10726455937-export const x = 10;","-10726455937-export const x = 10;"],"options":{"cacheResolutions":true,"composite":true,"module":2,"out":"./out.js"},"outSignature":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n","latestChangedDtsFile":"./out.d.ts"},"version":"FakeTSVersion"}
+
+//// [/out.tsbuildinfo.baseline.txt]
+======================================================================
+File:: ./out.js
+----------------------------------------------------------------------
+text: (0-864)
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///
+ ///
+});
+define("randomFileForImport", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+define("randomFileForTypeRef", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+
+======================================================================
+======================================================================
+File:: ./out.d.ts
+----------------------------------------------------------------------
+text: (0-233)
+declare module "fileWithImports" { }
+declare module "fileWithTypeRefs" {
+ export {};
+}
+declare module "randomFileForImport" {
+ export const x = 10;
+}
+declare module "randomFileForTypeRef" {
+ export const x = 10;
+}
+
+======================================================================
+
+//// [/out.tsbuildinfo.readable.baseline.txt]
+{
+ "bundle": {
+ "commonSourceDirectory": "./src/project",
+ "sourceFiles": [
+ "./src/project/fileWithImports.ts",
+ "./src/project/fileWithTypeRefs.ts",
+ "./src/project/randomFileForImport.ts",
+ "./src/project/randomFileForTypeRef.ts"
+ ],
+ "js": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 864,
+ "kind": "text"
+ }
+ ],
+ "hash": "-31220064334-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\n"
+ },
+ "dts": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 233,
+ "kind": "text"
+ }
+ ],
+ "hash": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"
+ }
+ },
+ "program": {
+ "fileNames": [
+ "./lib/lib.d.ts",
+ "./src/project/pkg0.d.ts",
+ "./src/project/pkg1.d.ts",
+ "./src/project/filewithimports.ts",
+ "./src/project/node_modules/pkg2/index.d.ts",
+ "./src/project/node_modules/pkg3/index.d.ts",
+ "./src/project/filewithtyperefs.ts",
+ "./src/project/randomfileforimport.ts",
+ "./src/project/randomfilefortyperef.ts",
+ "./src/project/node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileInfos": {
+ "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "./src/project/pkg0.d.ts": "769951468-export interface ImportInterface0 {}",
+ "./src/project/pkg1.d.ts": "-3547817137-export interface RequireInterface1 {}",
+ "./src/project/filewithimports.ts": "17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n",
+ "./src/project/node_modules/pkg2/index.d.ts": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "./src/project/node_modules/pkg3/index.d.ts": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "./src/project/filewithtyperefs.ts": "-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "./src/project/randomfileforimport.ts": "-10726455937-export const x = 10;",
+ "./src/project/randomfilefortyperef.ts": "-10726455937-export const x = 10;",
+ "./src/project/node_modules/@types/pkg4/index.d.ts": "-10726455937-export const x = 10;"
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "module": 2,
+ "out": "./out.js"
+ },
+ "outSignature": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n",
+ "latestChangedDtsFile": "./out.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 3511
+}
+
+
+
+Change:: modify randomFileForImport by adding import
+Input::
+//// [/src/project/randomFileForImport.ts]
+import type { ImportInterface0 } from "pkg0";
+export const x = 10;
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3/package.json' does not exist.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/pkg3/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/index.d.ts', result '/src/project/node_modules/pkg3/index.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/index.d.ts', primary: false. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+ Imported via "pkg0" from file 'src/project/randomFileForImport.ts'
+src/project/pkg1.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/node_modules/pkg3/index.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+exitCode:: ExitStatus.Success
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/out.js] file written with same contents
+//// [/out.tsbuildinfo]
+{"bundle":{"commonSourceDirectory":"./src/project","sourceFiles":["./src/project/fileWithImports.ts","./src/project/fileWithTypeRefs.ts","./src/project/randomFileForImport.ts","./src/project/randomFileForTypeRef.ts"],"js":{"sections":[{"pos":0,"end":864,"kind":"text"}],"hash":"-31220064334-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\n"},"dts":{"sections":[{"pos":0,"end":233,"kind":"text"}],"hash":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"}},"program":{"fileNames":["./lib/lib.d.ts","./src/project/pkg0.d.ts","./src/project/pkg1.d.ts","./src/project/filewithimports.ts","./src/project/node_modules/pkg2/index.d.ts","./src/project/node_modules/pkg3/index.d.ts","./src/project/filewithtyperefs.ts","./src/project/randomfileforimport.ts","./src/project/randomfilefortyperef.ts","./src/project/node_modules/@types/pkg4/index.d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","769951468-export interface ImportInterface0 {}","-3547817137-export interface RequireInterface1 {}","17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n","1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","10580737119-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;","-10726455937-export const x = 10;","-10726455937-export const x = 10;"],"options":{"cacheResolutions":true,"composite":true,"module":2,"out":"./out.js"},"outSignature":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n","latestChangedDtsFile":"./out.d.ts"},"version":"FakeTSVersion"}
+
+//// [/out.tsbuildinfo.baseline.txt] file written with same contents
+//// [/out.tsbuildinfo.readable.baseline.txt]
+{
+ "bundle": {
+ "commonSourceDirectory": "./src/project",
+ "sourceFiles": [
+ "./src/project/fileWithImports.ts",
+ "./src/project/fileWithTypeRefs.ts",
+ "./src/project/randomFileForImport.ts",
+ "./src/project/randomFileForTypeRef.ts"
+ ],
+ "js": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 864,
+ "kind": "text"
+ }
+ ],
+ "hash": "-31220064334-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\n"
+ },
+ "dts": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 233,
+ "kind": "text"
+ }
+ ],
+ "hash": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"
+ }
+ },
+ "program": {
+ "fileNames": [
+ "./lib/lib.d.ts",
+ "./src/project/pkg0.d.ts",
+ "./src/project/pkg1.d.ts",
+ "./src/project/filewithimports.ts",
+ "./src/project/node_modules/pkg2/index.d.ts",
+ "./src/project/node_modules/pkg3/index.d.ts",
+ "./src/project/filewithtyperefs.ts",
+ "./src/project/randomfileforimport.ts",
+ "./src/project/randomfilefortyperef.ts",
+ "./src/project/node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileInfos": {
+ "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "./src/project/pkg0.d.ts": "769951468-export interface ImportInterface0 {}",
+ "./src/project/pkg1.d.ts": "-3547817137-export interface RequireInterface1 {}",
+ "./src/project/filewithimports.ts": "17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n",
+ "./src/project/node_modules/pkg2/index.d.ts": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "./src/project/node_modules/pkg3/index.d.ts": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "./src/project/filewithtyperefs.ts": "-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "./src/project/randomfileforimport.ts": "10580737119-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;",
+ "./src/project/randomfilefortyperef.ts": "-10726455937-export const x = 10;",
+ "./src/project/node_modules/@types/pkg4/index.d.ts": "-10726455937-export const x = 10;"
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "module": 2,
+ "out": "./out.js"
+ },
+ "outSignature": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n",
+ "latestChangedDtsFile": "./out.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 3559
+}
+
+
+
+Change:: modify randomFileForTypeRef by adding typeRef
+Input::
+//// [/src/project/randomFileForTypeRef.ts]
+///
+export const x = 10;
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3/package.json' does not exist.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/pkg3/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/index.d.ts', result '/src/project/node_modules/pkg3/index.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/index.d.ts', primary: false. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/randomFileForTypeRef.ts'. ========
+Resolution for type reference directive 'pkg2' was found in cache from location '/src/project'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/pkg0.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts'
+ Imported via "pkg0" from file 'src/project/randomFileForImport.ts'
+src/project/pkg1.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts'
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts'
+src/project/node_modules/pkg3/index.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts'
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+exitCode:: ExitStatus.Success
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+File: /src/project/randomFileForTypeRef.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/out.js]
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///
+ ///
+});
+define("randomFileForImport", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+define("randomFileForTypeRef", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ ///
+ exports.x = 10;
+});
+
+
+//// [/out.tsbuildinfo]
+{"bundle":{"commonSourceDirectory":"./src/project","sourceFiles":["./src/project/fileWithImports.ts","./src/project/fileWithTypeRefs.ts","./src/project/randomFileForImport.ts","./src/project/randomFileForTypeRef.ts"],"js":{"sections":[{"pos":0,"end":899,"kind":"text"}],"hash":"-30350808392-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n /// \r\n exports.x = 10;\r\n});\r\n"},"dts":{"sections":[{"pos":0,"end":233,"kind":"text"}],"hash":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"}},"program":{"fileNames":["./lib/lib.d.ts","./src/project/pkg0.d.ts","./src/project/pkg1.d.ts","./src/project/filewithimports.ts","./src/project/node_modules/pkg2/index.d.ts","./src/project/node_modules/pkg3/index.d.ts","./src/project/filewithtyperefs.ts","./src/project/randomfileforimport.ts","./src/project/randomfilefortyperef.ts","./src/project/node_modules/@types/pkg4/index.d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","769951468-export interface ImportInterface0 {}","-3547817137-export interface RequireInterface1 {}","17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n","1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","10580737119-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;","-2210321256-/// \nexport const x = 10;","-10726455937-export const x = 10;"],"options":{"cacheResolutions":true,"composite":true,"module":2,"out":"./out.js"},"outSignature":"407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n","latestChangedDtsFile":"./out.d.ts"},"version":"FakeTSVersion"}
+
+//// [/out.tsbuildinfo.baseline.txt]
+======================================================================
+File:: ./out.js
+----------------------------------------------------------------------
+text: (0-899)
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///
+ ///
+});
+define("randomFileForImport", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ exports.x = 10;
+});
+define("randomFileForTypeRef", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ ///
+ exports.x = 10;
+});
+
+======================================================================
+======================================================================
+File:: ./out.d.ts
+----------------------------------------------------------------------
+text: (0-233)
+declare module "fileWithImports" { }
+declare module "fileWithTypeRefs" {
+ export {};
+}
+declare module "randomFileForImport" {
+ export const x = 10;
+}
+declare module "randomFileForTypeRef" {
+ export const x = 10;
+}
+
+======================================================================
+
+//// [/out.tsbuildinfo.readable.baseline.txt]
+{
+ "bundle": {
+ "commonSourceDirectory": "./src/project",
+ "sourceFiles": [
+ "./src/project/fileWithImports.ts",
+ "./src/project/fileWithTypeRefs.ts",
+ "./src/project/randomFileForImport.ts",
+ "./src/project/randomFileForTypeRef.ts"
+ ],
+ "js": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 899,
+ "kind": "text"
+ }
+ ],
+ "hash": "-30350808392-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n});\r\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n /// \r\n /// \r\n});\r\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n exports.x = 10;\r\n});\r\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n exports.x = void 0;\r\n /// \r\n exports.x = 10;\r\n});\r\n"
+ },
+ "dts": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 233,
+ "kind": "text"
+ }
+ ],
+ "hash": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n"
+ }
+ },
+ "program": {
+ "fileNames": [
+ "./lib/lib.d.ts",
+ "./src/project/pkg0.d.ts",
+ "./src/project/pkg1.d.ts",
+ "./src/project/filewithimports.ts",
+ "./src/project/node_modules/pkg2/index.d.ts",
+ "./src/project/node_modules/pkg3/index.d.ts",
+ "./src/project/filewithtyperefs.ts",
+ "./src/project/randomfileforimport.ts",
+ "./src/project/randomfilefortyperef.ts",
+ "./src/project/node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileInfos": {
+ "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "./src/project/pkg0.d.ts": "769951468-export interface ImportInterface0 {}",
+ "./src/project/pkg1.d.ts": "-3547817137-export interface RequireInterface1 {}",
+ "./src/project/filewithimports.ts": "17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n",
+ "./src/project/node_modules/pkg2/index.d.ts": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "./src/project/node_modules/pkg3/index.d.ts": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "./src/project/filewithtyperefs.ts": "-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "./src/project/randomfileforimport.ts": "10580737119-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;",
+ "./src/project/randomfilefortyperef.ts": "-2210321256-/// \nexport const x = 10;",
+ "./src/project/node_modules/@types/pkg4/index.d.ts": "-10726455937-export const x = 10;"
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "module": 2,
+ "out": "./out.js"
+ },
+ "outSignature": "407350366-declare module \"fileWithImports\" { }\r\ndeclare module \"fileWithTypeRefs\" {\r\n export {};\r\n}\r\ndeclare module \"randomFileForImport\" {\r\n export const x = 10;\r\n}\r\ndeclare module \"randomFileForTypeRef\" {\r\n export const x = 10;\r\n}\r\n",
+ "latestChangedDtsFile": "./out.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 3630
+}
+
diff --git a/tests/baselines/reference/tsbuild/cacheResolutions/multi-file.js b/tests/baselines/reference/tsbuild/cacheResolutions/multi-file.js
new file mode 100644
index 00000000000..a7ed4e8552f
--- /dev/null
+++ b/tests/baselines/reference/tsbuild/cacheResolutions/multi-file.js
@@ -0,0 +1,2851 @@
+Input::
+//// [/lib/lib.d.ts]
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+declare const console: { log(msg: any): void; };
+
+//// [/src/project/fileWithImports.ts]
+import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };
+import type { RequireInterface1 } from "pkg1" assert { "resolution-mode": "require" };
+
+
+//// [/src/project/fileWithTypeRefs.ts]
+///
+///
+interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+export {}
+
+
+//// [/src/project/node_modules/@types/pkg4/index.d.ts]
+export const x = 10;
+
+//// [/src/project/node_modules/pkg0/import.d.ts]
+export interface ImportInterface0 {}
+
+//// [/src/project/node_modules/pkg0/package.json]
+{"name":"pkg0","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}}
+
+//// [/src/project/node_modules/pkg0/require.d.ts]
+export interface RequireInterface0 {}
+
+//// [/src/project/node_modules/pkg1/import.d.ts]
+export interface ImportInterface1 {}
+
+//// [/src/project/node_modules/pkg1/package.json]
+{"name":"pkg1","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}}
+
+//// [/src/project/node_modules/pkg2/import.d.ts]
+export {};
+declare global {
+ interface ImportInterface2 {}
+}
+
+
+//// [/src/project/node_modules/pkg2/package.json]
+{"name":"pkg2","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}}
+
+//// [/src/project/node_modules/pkg2/require.d.ts]
+export {};
+declare global {
+ interface RequireInterface2 {}
+}
+
+
+//// [/src/project/node_modules/pkg3/import.d.ts]
+export {};
+declare global {
+ interface ImportInterface3 {}
+}
+
+
+//// [/src/project/node_modules/pkg3/package.json]
+{"name":"pkg3","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}}
+
+//// [/src/project/randomFileForImport.ts]
+export const x = 10;
+
+//// [/src/project/randomFileForTypeRef.ts]
+export const x = 10;
+
+//// [/src/project/tsconfig.json]
+{"compilerOptions":{"moduleResolution":"node16","composite":true,"cacheResolutions":true,"traceResolution":true},"include":["*.ts"],"exclude":["*.d.ts"]}
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.js' does not exist.
+File '/src/project/node_modules/pkg1/require.jsx' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name 'pkg1' was not resolved. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+[96msrc/project/fileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2307: [0mCannot find module 'pkg1' or its corresponding type declarations.
+
+[7m2[0m import type { RequireInterface1 } from "pkg1" assert { "resolution-mode": "require" };
+[7m [0m [91m ~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+
+Found 3 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx",
+ "/src/project/node_modules/pkg1/require.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/pkg1/package.json",
+ "/src/node_modules/pkg1.ts",
+ "/src/node_modules/pkg1.tsx",
+ "/src/node_modules/pkg1.d.ts",
+ "/src/node_modules/pkg1/index.ts",
+ "/src/node_modules/pkg1/index.tsx",
+ "/src/node_modules/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/pkg1/package.json",
+ "/node_modules/pkg1.ts",
+ "/node_modules/pkg1.tsx",
+ "/node_modules/pkg1.d.ts",
+ "/node_modules/pkg1/index.ts",
+ "/node_modules/pkg1/index.tsx",
+ "/node_modules/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/node_modules/pkg1/require.js",
+ "/src/project/node_modules/pkg1/require.jsx",
+ "/src/node_modules/pkg1/package.json",
+ "/src/node_modules/pkg1.js",
+ "/src/node_modules/pkg1.jsx",
+ "/src/node_modules/pkg1/index.js",
+ "/src/node_modules/pkg1/index.jsx",
+ "/node_modules/pkg1/package.json",
+ "/node_modules/pkg1.js",
+ "/node_modules/pkg1.jsx",
+ "/node_modules/pkg1/index.js",
+ "/node_modules/pkg1/index.jsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json",
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/require.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/src/project/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./node_modules/pkg0/import.d.ts","./filewithimports.ts","./node_modules/pkg2/import.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"769951468-export interface ImportInterface0 {}","impliedFormat":1},{"version":"4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n","impliedFormat":1},{"version":"1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1}],"options":{"cacheResolutions":true,"composite":true},"fileIdsList":[[2],[4]],"referencedMap":[[3,1],[5,2]],"exportedModulesMap":[[3,1],[5,2]],"semanticDiagnosticsPerFile":[1,[3,[{"file":"./filewithimports.ts","start":124,"length":6,"messageText":"Cannot find module 'pkg1' or its corresponding type declarations.","category":1,"code":2307}]],[5,[{"file":"./filewithtyperefs.ts","start":162,"length":17,"messageText":"Cannot find name 'RequireInterface3'.","category":1,"code":2304}]],8,2,4,6,7],"affectedFilesPendingEmit":[3,5,6,7],"emitSignatures":[3,5,6,7]},"version":"FakeTSVersion"}
+
+//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileNamesList": [
+ [
+ "./node_modules/pkg0/import.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg0/import.d.ts": {
+ "original": {
+ "version": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": 1
+ },
+ "version": "769951468-export interface ImportInterface0 {}",
+ "signature": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./filewithimports.ts": {
+ "original": {
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "impliedFormat": 1
+ },
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg2/import.d.ts": {
+ "original": {
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "signature": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./filewithtyperefs.ts": {
+ "original": {
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "impliedFormat": 1
+ },
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfileforimport.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfilefortyperef.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/@types/pkg4/index.d.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true
+ },
+ "referencedMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ [
+ "./filewithimports.ts",
+ [
+ {
+ "file": "./filewithimports.ts",
+ "start": 124,
+ "length": 6,
+ "messageText": "Cannot find module 'pkg1' or its corresponding type declarations.",
+ "category": 1,
+ "code": 2307
+ }
+ ]
+ ],
+ [
+ "./filewithtyperefs.ts",
+ [
+ {
+ "file": "./filewithtyperefs.ts",
+ "start": 162,
+ "length": 17,
+ "messageText": "Cannot find name 'RequireInterface3'.",
+ "category": 1,
+ "code": 2304
+ }
+ ]
+ ],
+ "./node_modules/@types/pkg4/index.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ],
+ "affectedFilesPendingEmit": [
+ [
+ "./filewithimports.ts",
+ "Js | Dts"
+ ],
+ [
+ "./filewithtyperefs.ts",
+ "Js | Dts"
+ ],
+ [
+ "./randomfileforimport.ts",
+ "Js | Dts"
+ ],
+ [
+ "./randomfilefortyperef.ts",
+ "Js | Dts"
+ ]
+ ],
+ "emitSignatures": [
+ "./filewithimports.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ]
+ },
+ "version": "FakeTSVersion",
+ "size": 2250
+}
+
+
+
+Change:: no-change-run
+Input::
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.js' does not exist.
+File '/src/project/node_modules/pkg1/require.jsx' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Module name 'pkg1' was not resolved. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+[96msrc/project/fileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2307: [0mCannot find module 'pkg1' or its corresponding type declarations.
+
+[7m2[0m import type { RequireInterface1 } from "pkg1" assert { "resolution-mode": "require" };
+[7m [0m [91m ~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+
+Found 3 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx",
+ "/src/project/node_modules/pkg1/require.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/pkg1/package.json",
+ "/src/node_modules/pkg1.ts",
+ "/src/node_modules/pkg1.tsx",
+ "/src/node_modules/pkg1.d.ts",
+ "/src/node_modules/pkg1/index.ts",
+ "/src/node_modules/pkg1/index.tsx",
+ "/src/node_modules/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/pkg1/package.json",
+ "/node_modules/pkg1.ts",
+ "/node_modules/pkg1.tsx",
+ "/node_modules/pkg1.d.ts",
+ "/node_modules/pkg1/index.ts",
+ "/node_modules/pkg1/index.tsx",
+ "/node_modules/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/node_modules/pkg1/require.js",
+ "/src/project/node_modules/pkg1/require.jsx",
+ "/src/node_modules/pkg1/package.json",
+ "/src/node_modules/pkg1.js",
+ "/src/node_modules/pkg1.jsx",
+ "/src/node_modules/pkg1/index.js",
+ "/src/node_modules/pkg1/index.jsx",
+ "/node_modules/pkg1/package.json",
+ "/node_modules/pkg1.js",
+ "/node_modules/pkg1.jsx",
+ "/node_modules/pkg1/index.js",
+ "/node_modules/pkg1/index.jsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json",
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/require.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+
+
+Change:: write file not resolved by import
+Input::
+//// [/src/project/node_modules/pkg1/require.d.ts]
+export interface RequireInterface1 {}
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg1/require.d.ts', result '/src/project/node_modules/pkg1/require.d.ts'.
+======== Module name 'pkg1' was successfully resolved to '/src/project/node_modules/pkg1/require.d.ts' with Package ID 'pkg1/require.d.ts@0.0.1'. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+[96msrc/project/fileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/node_modules/pkg1/require.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts' with packageId 'pkg1/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg1/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+
+Found 2 errors.
+
+exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg1/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg1",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg1",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg1/require.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg1",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/require.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/src/project/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./node_modules/pkg0/import.d.ts","./node_modules/pkg1/require.d.ts","./filewithimports.ts","./node_modules/pkg2/import.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"769951468-export interface ImportInterface0 {}","impliedFormat":1},{"version":"-3547817137-export interface RequireInterface1 {}","impliedFormat":1},{"version":"4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1}],"options":{"cacheResolutions":true,"composite":true},"fileIdsList":[[2,3],[5]],"referencedMap":[[4,1],[6,2]],"exportedModulesMap":[[6,2]],"semanticDiagnosticsPerFile":[1,4,[6,[{"file":"./filewithtyperefs.ts","start":162,"length":17,"messageText":"Cannot find name 'RequireInterface3'.","category":1,"code":2304}]],9,2,3,5,7,8],"affectedFilesPendingEmit":[4,6,7,8],"emitSignatures":[4,6,7,8]},"version":"FakeTSVersion"}
+
+//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileNamesList": [
+ [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg0/import.d.ts": {
+ "original": {
+ "version": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": 1
+ },
+ "version": "769951468-export interface ImportInterface0 {}",
+ "signature": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg1/require.d.ts": {
+ "original": {
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": 1
+ },
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "signature": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./filewithimports.ts": {
+ "original": {
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg2/import.d.ts": {
+ "original": {
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "signature": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./filewithtyperefs.ts": {
+ "original": {
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "impliedFormat": 1
+ },
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfileforimport.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfilefortyperef.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/@types/pkg4/index.d.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true
+ },
+ "referencedMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./filewithimports.ts",
+ [
+ "./filewithtyperefs.ts",
+ [
+ {
+ "file": "./filewithtyperefs.ts",
+ "start": 162,
+ "length": 17,
+ "messageText": "Cannot find name 'RequireInterface3'.",
+ "category": 1,
+ "code": 2304
+ }
+ ]
+ ],
+ "./node_modules/@types/pkg4/index.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ],
+ "affectedFilesPendingEmit": [
+ [
+ "./filewithimports.ts",
+ "Js | Dts"
+ ],
+ [
+ "./filewithtyperefs.ts",
+ "Js | Dts"
+ ],
+ [
+ "./randomfileforimport.ts",
+ "Js | Dts"
+ ],
+ [
+ "./randomfilefortyperef.ts",
+ "Js | Dts"
+ ]
+ ],
+ "emitSignatures": [
+ "./filewithimports.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ]
+ },
+ "version": "FakeTSVersion",
+ "size": 2240
+}
+
+
+
+Change:: write file not resolved by typeRef
+Input::
+//// [/src/project/node_modules/pkg3/require.d.ts]
+export {};
+declare global {
+ interface RequireInterface3 {}
+}
+
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg1/require.d.ts', result '/src/project/node_modules/pkg1/require.d.ts'.
+======== Module name 'pkg1' was successfully resolved to '/src/project/node_modules/pkg1/require.d.ts' with Package ID 'pkg1/require.d.ts@0.0.1'. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/require.d.ts', result '/src/project/node_modules/pkg3/require.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/require.d.ts' with Package ID 'pkg3/require.d.ts@0.0.1', primary: false. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg3/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/node_modules/pkg1/require.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts' with packageId 'pkg1/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg1/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/node_modules/pkg3/require.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg3/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg3/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+exitCode:: ExitStatus.Success
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg1/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg1",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg1",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg1/require.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg1",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg3/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg3",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg3",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/require.d.ts",
+ "packageId": {
+ "name": "pkg3",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/src/project/fileWithImports.d.ts]
+export {};
+
+
+//// [/src/project/fileWithImports.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+
+
+//// [/src/project/fileWithTypeRefs.d.ts]
+export {};
+
+
+//// [/src/project/fileWithTypeRefs.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+///
+///
+
+
+//// [/src/project/randomFileForImport.d.ts]
+export declare const x = 10;
+
+
+//// [/src/project/randomFileForImport.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.x = void 0;
+exports.x = 10;
+
+
+//// [/src/project/randomFileForTypeRef.d.ts]
+export declare const x = 10;
+
+
+//// [/src/project/randomFileForTypeRef.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.x = void 0;
+exports.x = 10;
+
+
+//// [/src/project/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./node_modules/pkg0/import.d.ts","./node_modules/pkg1/require.d.ts","./filewithimports.ts","./node_modules/pkg2/import.d.ts","./node_modules/pkg3/require.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"769951468-export interface ImportInterface0 {}","impliedFormat":1},{"version":"-3547817137-export interface RequireInterface1 {}","impliedFormat":1},{"version":"4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1}],"options":{"cacheResolutions":true,"composite":true},"fileIdsList":[[2,3],[5,6]],"referencedMap":[[4,1],[7,2]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,7,10,2,3,5,6,8,9],"latestChangedDtsFile":"./randomFileForTypeRef.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileNamesList": [
+ [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg0/import.d.ts": {
+ "original": {
+ "version": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": 1
+ },
+ "version": "769951468-export interface ImportInterface0 {}",
+ "signature": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg1/require.d.ts": {
+ "original": {
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": 1
+ },
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "signature": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./filewithimports.ts": {
+ "original": {
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg2/import.d.ts": {
+ "original": {
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "signature": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg3/require.d.ts": {
+ "original": {
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "signature": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./filewithtyperefs.ts": {
+ "original": {
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfileforimport.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfilefortyperef.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/@types/pkg4/index.d.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true
+ },
+ "referencedMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ]
+ },
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./filewithimports.ts",
+ "./filewithtyperefs.ts",
+ "./node_modules/@types/pkg4/index.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ],
+ "latestChangedDtsFile": "./randomFileForTypeRef.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 2423
+}
+
+
+
+Change:: modify randomFileForImport by adding import
+Input::
+//// [/src/project/randomFileForImport.ts]
+import type { ImportInterface0 } from "pkg0" assert { "resolution-mode": "import" };
+export const x = 10;
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg1/require.d.ts', result '/src/project/node_modules/pkg1/require.d.ts'.
+======== Module name 'pkg1' was successfully resolved to '/src/project/node_modules/pkg1/require.d.ts' with Package ID 'pkg1/require.d.ts@0.0.1'. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/require.d.ts', result '/src/project/node_modules/pkg3/require.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/require.d.ts' with Package ID 'pkg3/require.d.ts@0.0.1', primary: false. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg3/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ Imported via "pkg0" from file 'src/project/randomFileForImport.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/node_modules/pkg1/require.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts' with packageId 'pkg1/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg1/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/node_modules/pkg3/require.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg3/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg3/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+exitCode:: ExitStatus.Success
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg1/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg1",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg1",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg1/require.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg1",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg3/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg3",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg3",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/require.d.ts",
+ "packageId": {
+ "name": "pkg3",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/src/project/randomFileForImport.js] file written with same contents
+//// [/src/project/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./node_modules/pkg0/import.d.ts","./node_modules/pkg1/require.d.ts","./filewithimports.ts","./node_modules/pkg2/import.d.ts","./node_modules/pkg3/require.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"769951468-export interface ImportInterface0 {}","impliedFormat":1},{"version":"-3547817137-export interface RequireInterface1 {}","impliedFormat":1},{"version":"4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1}],"options":{"cacheResolutions":true,"composite":true},"fileIdsList":[[2,3],[5,6],[2]],"referencedMap":[[4,1],[7,2],[8,3]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,7,10,2,3,5,6,8,9],"latestChangedDtsFile":"./randomFileForTypeRef.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileNamesList": [
+ [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg0/import.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg0/import.d.ts": {
+ "original": {
+ "version": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": 1
+ },
+ "version": "769951468-export interface ImportInterface0 {}",
+ "signature": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg1/require.d.ts": {
+ "original": {
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": 1
+ },
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "signature": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./filewithimports.ts": {
+ "original": {
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg2/import.d.ts": {
+ "original": {
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "signature": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg3/require.d.ts": {
+ "original": {
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "signature": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./filewithtyperefs.ts": {
+ "original": {
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfileforimport.ts": {
+ "original": {
+ "version": "-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfilefortyperef.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/@types/pkg4/index.d.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true
+ },
+ "referencedMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ],
+ "./randomfileforimport.ts": [
+ "./node_modules/pkg0/import.d.ts"
+ ]
+ },
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./filewithimports.ts",
+ "./filewithtyperefs.ts",
+ "./node_modules/@types/pkg4/index.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ],
+ "latestChangedDtsFile": "./randomFileForTypeRef.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 2524
+}
+
+
+
+Change:: modify randomFileForTypeRef by adding typeRef
+Input::
+//// [/src/project/randomFileForTypeRef.ts]
+///
+export const x = 10;
+
+
+
+Output::
+/lib/tsc -b /src/project --explainFiles
+File '/src/project/package.json' does not exist.
+File '/src/package.json' does not exist.
+File '/package.json' does not exist.
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in ESM mode with conditions 'node', 'import', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg0/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg0/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg0/import.ts' does not exist.
+File '/src/project/node_modules/pkg0/import.tsx' does not exist.
+File '/src/project/node_modules/pkg0/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg0/import.d.ts', result '/src/project/node_modules/pkg0/import.d.ts'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Explicitly specified module resolution kind: 'Node16'.
+Resolving in CJS mode with conditions 'node', 'require', 'types'.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.
+Found 'package.json' at '/src/project/node_modules/pkg1/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg1/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg1/require.ts' does not exist.
+File '/src/project/node_modules/pkg1/require.tsx' does not exist.
+File '/src/project/node_modules/pkg1/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg1/require.d.ts', result '/src/project/node_modules/pkg1/require.d.ts'.
+======== Module name 'pkg1' was successfully resolved to '/src/project/node_modules/pkg1/require.d.ts' with Package ID 'pkg1/require.d.ts@0.0.1'. ========
+File '/src/project/node_modules/pkg0/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg1/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg2/package.json'.
+Matched 'exports' condition 'import'.
+Using 'exports' subpath '.' with target './import.js'.
+File name '/src/project/node_modules/pkg2/import.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg2/import.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/import.d.ts', result '/src/project/node_modules/pkg2/import.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+Found 'package.json' at '/src/project/node_modules/pkg3/package.json'.
+Saw non-matching condition 'import'.
+Matched 'exports' condition 'require'.
+Using 'exports' subpath '.' with target './require.js'.
+File name '/src/project/node_modules/pkg3/require.js' has a '.js' extension - stripping it.
+File '/src/project/node_modules/pkg3/require.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/require.d.ts', result '/src/project/node_modules/pkg3/require.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/require.d.ts' with Package ID 'pkg3/require.d.ts@0.0.1', primary: false. ========
+File '/src/project/node_modules/pkg2/package.json' exists according to earlier cached lookups.
+File '/src/project/node_modules/pkg3/package.json' exists according to earlier cached lookups.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/import.d.ts' with Package ID 'pkg0/import.d.ts@0.0.1'. ========
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+======== Resolving type reference directive 'pkg2', containing file '/src/project/randomFileForTypeRef.ts'. ========
+Resolution for type reference directive 'pkg2' was found in cache from location '/src/project'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/import.d.ts' with Package ID 'pkg2/import.d.ts@0.0.1', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist according to earlier cached lookups.
+File '/src/project/node_modules/@types/package.json' does not exist.
+File '/src/project/node_modules/package.json' does not exist.
+File '/src/project/package.json' does not exist according to earlier cached lookups.
+File '/src/package.json' does not exist according to earlier cached lookups.
+File '/package.json' does not exist according to earlier cached lookups.
+File '/lib/package.json' does not exist.
+File '/package.json' does not exist according to earlier cached lookups.
+lib/lib.d.ts
+ Default library for target 'es5'
+src/project/node_modules/pkg0/import.d.ts
+ Imported via "pkg0" from file 'src/project/fileWithImports.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ Imported via "pkg0" from file 'src/project/randomFileForImport.ts' with packageId 'pkg0/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg0/package.json' does not have field "type"
+src/project/node_modules/pkg1/require.d.ts
+ Imported via "pkg1" from file 'src/project/fileWithImports.ts' with packageId 'pkg1/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg1/package.json' does not have field "type"
+src/project/fileWithImports.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/pkg2/import.d.ts
+ Type library referenced via 'pkg2' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg2/import.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg2/package.json' does not have field "type"
+src/project/node_modules/pkg3/require.d.ts
+ Type library referenced via 'pkg3' from file 'src/project/fileWithTypeRefs.ts' with packageId 'pkg3/require.d.ts@0.0.1'
+ File is CommonJS module because 'src/project/node_modules/pkg3/package.json' does not have field "type"
+src/project/fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'src/project/tsconfig.json'
+ File is CommonJS module because 'package.json' was not found
+src/project/node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+ File is CommonJS module because 'package.json' was not found
+exitCode:: ExitStatus.Success
+File: /src/project/node_modules/pkg0/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg0",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg0",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg1/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg1",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg1",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+pkg1: commonjs: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg1/require.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg1",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg1/require.ts",
+ "/src/project/node_modules/pkg1/require.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg1/package.json"
+ ]
+}
+
+File: /src/project/node_modules/pkg2/import.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg2",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg2",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/node_modules/pkg3/require.d.ts
+packageJsonScope:: {
+ "packageDirectory": "/src/project/node_modules/pkg3",
+ "contents": {
+ "packageJsonContent": {
+ "name": "pkg3",
+ "version": "0.0.1",
+ "exports": {
+ "import": "./import.js",
+ "require": "./require.js"
+ }
+ }
+ }
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+pkg3: commonjs: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/require.d.ts",
+ "packageId": {
+ "name": "pkg3",
+ "subModuleName": "require.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg3/package.json"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: esnext: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/node_modules/pkg0/import.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": true,
+ "packageId": {
+ "name": "pkg0",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ }
+ },
+ "failedLookupLocations": [
+ "/src/project/package.json",
+ "/src/package.json",
+ "/package.json",
+ "/src/project/node_modules/pkg0/import.ts",
+ "/src/project/node_modules/pkg0/import.tsx"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg0/package.json"
+ ]
+}
+
+File: /src/project/randomFileForTypeRef.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: esnext: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/import.d.ts",
+ "packageId": {
+ "name": "pkg2",
+ "subModuleName": "import.d.ts",
+ "version": "0.0.1"
+ },
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json"
+ ],
+ "affectingLocations": [
+ "/src/project/node_modules/pkg2/package.json"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+
+//// [/src/project/randomFileForTypeRef.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.x = void 0;
+///
+exports.x = 10;
+
+
+//// [/src/project/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./node_modules/pkg0/import.d.ts","./node_modules/pkg1/require.d.ts","./filewithimports.ts","./node_modules/pkg2/import.d.ts","./node_modules/pkg3/require.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedFormat":1},{"version":"769951468-export interface ImportInterface0 {}","impliedFormat":1},{"version":"-3547817137-export interface RequireInterface1 {}","impliedFormat":1},{"version":"4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","affectsGlobalScope":true,"impliedFormat":1},{"version":"-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","signature":"-4882119183-export {};\r\n","impliedFormat":1},{"version":"-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-8191038086-/// \nexport const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n","impliedFormat":1},{"version":"-10726455937-export const x = 10;","impliedFormat":1}],"options":{"cacheResolutions":true,"composite":true},"fileIdsList":[[2,3],[5,6],[2],[5]],"referencedMap":[[4,1],[7,2],[8,3],[9,4]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,7,10,2,3,5,6,8,9],"latestChangedDtsFile":"./randomFileForTypeRef.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileNamesList": [
+ [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ],
+ [
+ "./node_modules/pkg0/import.d.ts"
+ ],
+ [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg0/import.d.ts": {
+ "original": {
+ "version": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": 1
+ },
+ "version": "769951468-export interface ImportInterface0 {}",
+ "signature": "769951468-export interface ImportInterface0 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg1/require.d.ts": {
+ "original": {
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": 1
+ },
+ "version": "-3547817137-export interface RequireInterface1 {}",
+ "signature": "-3547817137-export interface RequireInterface1 {}",
+ "impliedFormat": "commonjs"
+ },
+ "./filewithimports.ts": {
+ "original": {
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "4079531109-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nimport type { RequireInterface1 } from \"pkg1\" assert { \"resolution-mode\": \"require\" };\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg2/import.d.ts": {
+ "original": {
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "signature": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/pkg3/require.d.ts": {
+ "original": {
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": 1
+ },
+ "version": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "signature": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "affectsGlobalScope": true,
+ "impliedFormat": "commonjs"
+ },
+ "./filewithtyperefs.ts": {
+ "original": {
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-20622778057-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "signature": "-4882119183-export {};\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfileforimport.ts": {
+ "original": {
+ "version": "-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-8633945300-import type { ImportInterface0 } from \"pkg0\" assert { \"resolution-mode\": \"import\" };\nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./randomfilefortyperef.ts": {
+ "original": {
+ "version": "-8191038086-/// \nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": 1
+ },
+ "version": "-8191038086-/// \nexport const x = 10;",
+ "signature": "-6057683066-export declare const x = 10;\r\n",
+ "impliedFormat": "commonjs"
+ },
+ "./node_modules/@types/pkg4/index.d.ts": {
+ "original": {
+ "version": "-10726455937-export const x = 10;",
+ "impliedFormat": 1
+ },
+ "version": "-10726455937-export const x = 10;",
+ "signature": "-10726455937-export const x = 10;",
+ "impliedFormat": "commonjs"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true
+ },
+ "referencedMap": {
+ "./filewithimports.ts": [
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts"
+ ],
+ "./filewithtyperefs.ts": [
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts"
+ ],
+ "./randomfileforimport.ts": [
+ "./node_modules/pkg0/import.d.ts"
+ ],
+ "./randomfilefortyperef.ts": [
+ "./node_modules/pkg2/import.d.ts"
+ ]
+ },
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./filewithimports.ts",
+ "./filewithtyperefs.ts",
+ "./node_modules/@types/pkg4/index.d.ts",
+ "./node_modules/pkg0/import.d.ts",
+ "./node_modules/pkg1/require.d.ts",
+ "./node_modules/pkg2/import.d.ts",
+ "./node_modules/pkg3/require.d.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts"
+ ],
+ "latestChangedDtsFile": "./randomFileForTypeRef.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 2593
+}
+
diff --git a/tests/baselines/reference/tsbuild/sample1/cacheResolutions.js b/tests/baselines/reference/tsbuild/sample1/cacheResolutions.js
new file mode 100644
index 00000000000..aa69d064337
--- /dev/null
+++ b/tests/baselines/reference/tsbuild/sample1/cacheResolutions.js
@@ -0,0 +1,976 @@
+Input::
+//// [/lib/lib.d.ts]
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+interface ReadonlyArray {}
+declare const console: { log(msg: any): void; };
+
+//// [/src/core/anotherModule.ts]
+export const World = "hello";
+
+
+//// [/src/core/index.ts]
+export const someString: string = "HELLO WORLD";
+export function leftPad(s: string, n: number) { return s + n; }
+export function multiply(a: number, b: number) { return a * b; }
+
+
+//// [/src/core/some_decl.d.ts]
+declare const dts: any;
+
+
+//// [/src/core/tsconfig.json]
+{
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true,
+ "skipDefaultLibCheck": true,
+ "cacheResolutions": true
+ }
+}
+
+//// [/src/logic/index.ts]
+import * as c from '../core/index';
+export function getSecondsInDay() {
+ return c.multiply(10, 15);
+}
+import * as mod from '../core/anotherModule';
+export const m = mod;
+
+
+//// [/src/logic/tsconfig.json]
+{
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "sourceMap": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipDefaultLibCheck": true,
+ "cacheResolutions": true
+ },
+ "references": [
+ {
+ "path": "../core"
+ }
+ ]
+}
+
+//// [/src/tests/index.ts]
+import * as c from '../core/index';
+import * as logic from '../logic/index';
+
+c.leftPad("", 10);
+logic.getSecondsInDay();
+
+import * as mod from '../core/anotherModule';
+export const m = mod;
+
+
+//// [/src/tests/tsconfig.json]
+{
+ "references": [
+ {
+ "path": "../core"
+ },
+ {
+ "path": "../logic"
+ }
+ ],
+ "files": [
+ "index.ts"
+ ],
+ "compilerOptions": {
+ "composite": true,
+ "declaration": true,
+ "forceConsistentCasingInFileNames": true,
+ "skipDefaultLibCheck": true,
+ "cacheResolutions": true
+ }
+}
+
+//// [/src/ui/index.ts]
+import * as logic from '../logic';
+
+export function run() {
+ console.log(logic.getSecondsInDay());
+}
+
+
+//// [/src/ui/tsconfig.json]
+{
+ "compilerOptions": {
+ "skipDefaultLibCheck": true
+ },
+ "references": [
+ { "path": "../logic/index" }
+ ]
+}
+
+
+
+
+Output::
+/lib/tsc --b /src/tests
+exitCode:: ExitStatus.Success
+Program root files: ["/src/core/anotherModule.ts","/src/core/index.ts","/src/core/some_decl.d.ts"]
+Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/core/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/anotherModule.ts
+/src/core/index.ts
+/src/core/some_decl.d.ts
+
+Semantic diagnostics in builder refreshed for::
+/lib/lib.d.ts
+/src/core/anotherModule.ts
+/src/core/index.ts
+/src/core/some_decl.d.ts
+
+Shape signatures in builder refreshed for::
+/lib/lib.d.ts (used version)
+/src/core/anothermodule.ts (computed .d.ts during emit)
+/src/core/index.ts (computed .d.ts during emit)
+/src/core/some_decl.d.ts (used version)
+
+Program root files: ["/src/logic/index.ts"]
+Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/logic/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.ts
+
+Semantic diagnostics in builder refreshed for::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.ts
+
+Shape signatures in builder refreshed for::
+/lib/lib.d.ts (used version)
+/src/core/index.d.ts (used version)
+/src/core/anothermodule.d.ts (used version)
+/src/logic/index.ts (computed .d.ts during emit)
+
+Program root files: ["/src/tests/index.ts"]
+Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/tests/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.d.ts
+/src/tests/index.ts
+
+Semantic diagnostics in builder refreshed for::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.d.ts
+/src/tests/index.ts
+
+Shape signatures in builder refreshed for::
+/lib/lib.d.ts (used version)
+/src/core/index.d.ts (used version)
+/src/core/anothermodule.d.ts (used version)
+/src/logic/index.d.ts (used version)
+/src/tests/index.ts (computed .d.ts during emit)
+
+
+//// [/src/core/anotherModule.d.ts]
+export declare const World = "hello";
+//# sourceMappingURL=anotherModule.d.ts.map
+
+//// [/src/core/anotherModule.d.ts.map]
+{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"}
+
+//// [/src/core/anotherModule.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.World = void 0;
+exports.World = "hello";
+
+
+//// [/src/core/index.d.ts]
+export declare const someString: string;
+export declare function leftPad(s: string, n: number): string;
+export declare function multiply(a: number, b: number): number;
+//# sourceMappingURL=index.d.ts.map
+
+//// [/src/core/index.d.ts.map]
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"}
+
+//// [/src/core/index.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.multiply = exports.leftPad = exports.someString = void 0;
+exports.someString = "HELLO WORLD";
+function leftPad(s, n) { return s + n; }
+exports.leftPad = leftPad;
+function multiply(a, b) { return a * b; }
+exports.multiply = multiply;
+
+
+//// [/src/core/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "./anothermodule.ts": {
+ "original": {
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",
+ "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"
+ },
+ "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",
+ "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"
+ },
+ "./some_decl.d.ts": {
+ "original": {
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ },
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "signature": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true,
+ "skipDefaultLibCheck": true
+ },
+ "referencedMap": {},
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1493
+}
+
+//// [/src/logic/index.d.ts]
+export declare function getSecondsInDay(): number;
+import * as mod from '../core/anotherModule';
+export declare const m: typeof mod;
+
+
+//// [/src/logic/index.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.m = exports.getSecondsInDay = void 0;
+var c = require("../core/index");
+function getSecondsInDay() {
+ return c.multiply(10, 15);
+}
+exports.getSecondsInDay = getSecondsInDay;
+var mod = require("../core/anotherModule");
+exports.m = mod;
+//# sourceMappingURL=index.js.map
+
+//// [/src/logic/index.js.map]
+{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"}
+
+//// [/src/logic/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n","-8396256275-export declare const World = \"hello\";\r\n",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "./index.ts"
+ ],
+ "fileNamesList": [
+ [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts"
+ ],
+ [
+ "../core/anothermodule.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "../core/index.d.ts": {
+ "version": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n",
+ "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"
+ },
+ "../core/anothermodule.d.ts": {
+ "version": "-8396256275-export declare const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "skipDefaultLibCheck": true,
+ "sourceMap": true
+ },
+ "referencedMap": {
+ "./index.ts": [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "./index.ts": [
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "../core/anothermodule.d.ts",
+ "../core/index.d.ts",
+ "./index.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1538
+}
+
+//// [/src/tests/index.d.ts]
+import * as mod from '../core/anotherModule';
+export declare const m: typeof mod;
+
+
+//// [/src/tests/index.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.m = void 0;
+var c = require("../core/index");
+var logic = require("../logic/index");
+c.leftPad("", 10);
+logic.getSecondsInDay();
+var mod = require("../core/anotherModule");
+exports.m = mod;
+
+
+//// [/src/tests/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n","-8396256275-export declare const World = \"hello\";\r\n","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts",
+ "./index.ts"
+ ],
+ "fileNamesList": [
+ [
+ "../core/anothermodule.d.ts"
+ ],
+ [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "../core/index.d.ts": {
+ "version": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n",
+ "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"
+ },
+ "../core/anothermodule.d.ts": {
+ "version": "-8396256275-export declare const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "../logic/index.d.ts": {
+ "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "skipDefaultLibCheck": true
+ },
+ "referencedMap": {
+ "../logic/index.d.ts": [
+ "../core/anothermodule.d.ts"
+ ],
+ "./index.ts": [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "../logic/index.d.ts": [
+ "../core/anothermodule.d.ts"
+ ],
+ "./index.ts": [
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "../core/anothermodule.d.ts",
+ "../core/index.d.ts",
+ "../logic/index.d.ts",
+ "./index.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1685
+}
+
+
+
+Change:: incremental-declaration-changes
+Input::
+//// [/src/core/index.ts]
+export const someString: string = "HELLO WORLD";
+export function leftPad(s: string, n: number) { return s + n; }
+export function multiply(a: number, b: number) { return a * b; }
+
+export class someClass { }
+
+
+
+Output::
+/lib/tsc --b /src/tests
+exitCode:: ExitStatus.Success
+Program root files: ["/src/core/anotherModule.ts","/src/core/index.ts","/src/core/some_decl.d.ts"]
+Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/core/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/anotherModule.ts
+/src/core/index.ts
+/src/core/some_decl.d.ts
+
+Semantic diagnostics in builder refreshed for::
+/src/core/index.ts
+
+Shape signatures in builder refreshed for::
+/src/core/index.ts (computed .d.ts)
+
+Program root files: ["/src/logic/index.ts"]
+Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/logic/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.ts
+
+Semantic diagnostics in builder refreshed for::
+/src/core/index.d.ts
+/src/logic/index.ts
+
+Shape signatures in builder refreshed for::
+/src/core/index.d.ts (used version)
+/src/logic/index.ts (computed .d.ts)
+
+Program root files: ["/src/tests/index.ts"]
+Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/tests/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/index.d.ts
+/src/core/anotherModule.d.ts
+/src/logic/index.d.ts
+/src/tests/index.ts
+
+Semantic diagnostics in builder refreshed for::
+/src/core/index.d.ts
+/src/tests/index.ts
+
+Shape signatures in builder refreshed for::
+/src/core/index.d.ts (used version)
+/src/tests/index.ts (computed .d.ts)
+
+
+//// [/src/core/index.d.ts]
+export declare const someString: string;
+export declare function leftPad(s: string, n: number): string;
+export declare function multiply(a: number, b: number): number;
+export declare class someClass {
+}
+//# sourceMappingURL=index.d.ts.map
+
+//// [/src/core/index.d.ts.map]
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAEhE,qBAAa,SAAS;CAAI"}
+
+//// [/src/core/index.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0;
+exports.someString = "HELLO WORLD";
+function leftPad(s, n) { return s + n; }
+exports.leftPad = leftPad;
+function multiply(a, b) { return a * b; }
+exports.multiply = multiply;
+var someClass = /** @class */ (function () {
+ function someClass() {
+ }
+ return someClass;
+}());
+exports.someClass = someClass;
+
+
+//// [/src/core/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "./anothermodule.ts": {
+ "original": {
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "./some_decl.d.ts": {
+ "original": {
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ },
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "signature": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true,
+ "skipDefaultLibCheck": true
+ },
+ "referencedMap": {},
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1564
+}
+
+//// [/src/logic/index.js] file written with same contents
+//// [/src/logic/index.js.map] file written with same contents
+//// [/src/logic/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n","-8396256275-export declare const World = \"hello\";\r\n",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "./index.ts"
+ ],
+ "fileNamesList": [
+ [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts"
+ ],
+ [
+ "../core/anothermodule.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "../core/index.d.ts": {
+ "version": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "../core/anothermodule.d.ts": {
+ "version": "-8396256275-export declare const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "skipDefaultLibCheck": true,
+ "sourceMap": true
+ },
+ "referencedMap": {
+ "./index.ts": [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "./index.ts": [
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "../core/anothermodule.d.ts",
+ "../core/index.d.ts",
+ "./index.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1581
+}
+
+//// [/src/tests/index.js] file written with same contents
+//// [/src/tests/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n","-8396256275-export declare const World = \"hello\";\r\n","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts",
+ "./index.ts"
+ ],
+ "fileNamesList": [
+ [
+ "../core/anothermodule.d.ts"
+ ],
+ [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts"
+ ]
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "../core/index.d.ts": {
+ "version": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "../core/anothermodule.d.ts": {
+ "version": "-8396256275-export declare const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "../logic/index.d.ts": {
+ "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",
+ "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ },
+ "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n",
+ "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "skipDefaultLibCheck": true
+ },
+ "referencedMap": {
+ "../logic/index.d.ts": [
+ "../core/anothermodule.d.ts"
+ ],
+ "./index.ts": [
+ "../core/index.d.ts",
+ "../core/anothermodule.d.ts",
+ "../logic/index.d.ts"
+ ]
+ },
+ "exportedModulesMap": {
+ "../logic/index.d.ts": [
+ "../core/anothermodule.d.ts"
+ ],
+ "./index.ts": [
+ "../core/anothermodule.d.ts"
+ ]
+ },
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "../core/anothermodule.d.ts",
+ "../core/index.d.ts",
+ "../logic/index.d.ts",
+ "./index.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1728
+}
+
+
+
+Change:: incremental-declaration-doesnt-change
+Input::
+//// [/src/core/index.ts]
+export const someString: string = "HELLO WORLD";
+export function leftPad(s: string, n: number) { return s + n; }
+export function multiply(a: number, b: number) { return a * b; }
+
+export class someClass { }
+class someClass2 { }
+
+
+
+Output::
+/lib/tsc --b /src/tests
+exitCode:: ExitStatus.Success
+Program root files: ["/src/core/anotherModule.ts","/src/core/index.ts","/src/core/some_decl.d.ts"]
+Program options: {"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"cacheResolutions":true,"configFilePath":"/src/core/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/lib/lib.d.ts
+/src/core/anotherModule.ts
+/src/core/index.ts
+/src/core/some_decl.d.ts
+
+Semantic diagnostics in builder refreshed for::
+/src/core/index.ts
+
+Shape signatures in builder refreshed for::
+/src/core/index.ts (computed .d.ts)
+
+
+//// [/src/core/index.d.ts.map] file written with same contents
+//// [/src/core/index.js]
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.someClass = exports.multiply = exports.leftPad = exports.someString = void 0;
+exports.someString = "HELLO WORLD";
+function leftPad(s, n) { return s + n; }
+exports.leftPad = leftPad;
+function multiply(a, b) { return a * b; }
+exports.multiply = multiply;
+var someClass = /** @class */ (function () {
+ function someClass() {
+ }
+ return someClass;
+}());
+exports.someClass = someClass;
+var someClass2 = /** @class */ (function () {
+ function someClass2() {
+ }
+ return someClass2;
+}());
+
+
+//// [/src/core/tsconfig.tsbuildinfo]
+{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"cacheResolutions":true,"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./index.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt]
+{
+ "program": {
+ "fileNames": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "fileInfos": {
+ "../../lib/lib.d.ts": {
+ "original": {
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };",
+ "affectsGlobalScope": true
+ },
+ "./anothermodule.ts": {
+ "original": {
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "version": "-2676574883-export const World = \"hello\";\r\n",
+ "signature": "-8396256275-export declare const World = \"hello\";\r\n"
+ },
+ "./index.ts": {
+ "original": {
+ "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }",
+ "signature": "-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"
+ },
+ "./some_decl.d.ts": {
+ "original": {
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ },
+ "version": "-9253692965-declare const dts: any;\r\n",
+ "signature": "-9253692965-declare const dts: any;\r\n",
+ "affectsGlobalScope": true
+ }
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "declaration": true,
+ "declarationMap": true,
+ "skipDefaultLibCheck": true
+ },
+ "referencedMap": {},
+ "exportedModulesMap": {},
+ "semanticDiagnosticsPerFile": [
+ "../../lib/lib.d.ts",
+ "./anothermodule.ts",
+ "./index.ts",
+ "./some_decl.d.ts"
+ ],
+ "latestChangedDtsFile": "./index.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 1586
+}
+
+//// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time
+//// [/src/tests/tsconfig.tsbuildinfo] file changed its modified time
+
+
+Change:: no-change-run
+Input::
+
+
+Output::
+/lib/tsc --b /src/tests
+exitCode:: ExitStatus.Success
+
+
diff --git a/tests/baselines/reference/tsbuildWatch/cacheResolutions/bundle-emit-already-built.js b/tests/baselines/reference/tsbuildWatch/cacheResolutions/bundle-emit-already-built.js
new file mode 100644
index 00000000000..792c1b5562e
--- /dev/null
+++ b/tests/baselines/reference/tsbuildWatch/cacheResolutions/bundle-emit-already-built.js
@@ -0,0 +1,1920 @@
+Input::
+//// [/src/project/tsconfig.json]
+{"compilerOptions":{"module":"amd","composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js"},"include":["*.ts"],"exclude":["*.d.ts"]}
+
+//// [/src/project/fileWithImports.ts]
+import type { ImportInterface0 } from "pkg0";
+import type { RequireInterface1 } from "pkg1";
+
+
+//// [/src/project/randomFileForImport.ts]
+export const x = 10;
+
+//// [/src/project/pkg0.d.ts]
+export interface ImportInterface0 {}
+
+//// [/src/project/fileWithTypeRefs.ts]
+///
+///
+interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+export {}
+
+
+//// [/src/project/randomFileForTypeRef.ts]
+export const x = 10;
+
+//// [/src/project/node_modules/pkg2/index.d.ts]
+export {};
+declare global {
+ interface ImportInterface2 {}
+}
+
+
+//// [/src/project/node_modules/@types/pkg4/index.d.ts]
+export const x = 10;
+
+//// [/a/lib/lib.d.ts]
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+
+
+/a/lib/tsc.js -b -w --explainFiles
+Output::
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96mfileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+
+>> Screen clear
+[[90m12:00:37 AM[0m] Starting compilation in watch mode...
+
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96mfileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+../../a/lib/lib.d.ts
+ Default library for target 'es5'
+pkg0.d.ts
+ Imported via "pkg0" from file 'fileWithImports.ts'
+fileWithImports.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'fileWithTypeRefs.ts'
+fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+[[90m12:00:38 AM[0m] Found 3 errors. Watching for file changes.
+
+
+
+Program root files: ["/src/project/fileWithImports.ts","/src/project/fileWithTypeRefs.ts","/src/project/randomFileForImport.ts","/src/project/randomFileForTypeRef.ts"]
+Program options: {"module":2,"composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js","watch":true,"explainFiles":true,"configFilePath":"/src/project/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/a/lib/lib.d.ts
+/src/project/pkg0.d.ts
+/src/project/fileWithImports.ts
+/src/project/node_modules/pkg2/index.d.ts
+/src/project/fileWithTypeRefs.ts
+/src/project/randomFileForImport.ts
+/src/project/randomFileForTypeRef.ts
+/src/project/node_modules/@types/pkg4/index.d.ts
+
+No cached semantic diagnostics in the builder::
+
+No shapes updated in the builder::
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx",
+ "/src/project/pkg1.d.ts",
+ "/src/pkg1.ts",
+ "/src/pkg1.tsx",
+ "/src/pkg1.d.ts",
+ "/pkg1.ts",
+ "/pkg1.tsx",
+ "/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/pkg1.js",
+ "/src/project/pkg1.jsx",
+ "/src/pkg1.js",
+ "/src/pkg1.jsx",
+ "/pkg1.js",
+ "/pkg1.jsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+PolledWatches::
+/src/project/node_modules/@types/pkg1/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg4/package.json:
+ {"pollingInterval":2000}
+
+FsWatches::
+/src/project/tsconfig.json:
+ {}
+/src/project:
+ {}
+/src/project/filewithimports.ts:
+ {}
+/src/project/filewithtyperefs.ts:
+ {}
+/src/project/randomfileforimport.ts:
+ {}
+/src/project/randomfilefortyperef.ts:
+ {}
+
+FsWatchesRecursive::
+
+exitCode:: ExitStatus.undefined
+
+
+Change:: modify randomFileForImport by adding import
+
+Input::
+//// [/src/project/randomFileForImport.ts]
+import type { ImportInterface0 } from "pkg0";
+export const x = 10;
+
+
+Output::
+>> Screen clear
+[[90m12:00:41 AM[0m] File change detected. Starting incremental compilation...
+
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96mfileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+../../a/lib/lib.d.ts
+ Default library for target 'es5'
+pkg0.d.ts
+ Imported via "pkg0" from file 'fileWithImports.ts'
+ Imported via "pkg0" from file 'randomFileForImport.ts'
+fileWithImports.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'fileWithTypeRefs.ts'
+fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+[[90m12:00:42 AM[0m] Found 3 errors. Watching for file changes.
+
+
+
+Program root files: ["/src/project/fileWithImports.ts","/src/project/fileWithTypeRefs.ts","/src/project/randomFileForImport.ts","/src/project/randomFileForTypeRef.ts"]
+Program options: {"module":2,"composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js","watch":true,"explainFiles":true,"configFilePath":"/src/project/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/a/lib/lib.d.ts
+/src/project/pkg0.d.ts
+/src/project/fileWithImports.ts
+/src/project/node_modules/pkg2/index.d.ts
+/src/project/fileWithTypeRefs.ts
+/src/project/randomFileForImport.ts
+/src/project/randomFileForTypeRef.ts
+/src/project/node_modules/@types/pkg4/index.d.ts
+
+No cached semantic diagnostics in the builder::
+
+No shapes updated in the builder::
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx",
+ "/src/project/pkg1.d.ts",
+ "/src/pkg1.ts",
+ "/src/pkg1.tsx",
+ "/src/pkg1.d.ts",
+ "/pkg1.ts",
+ "/pkg1.tsx",
+ "/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/pkg1.js",
+ "/src/project/pkg1.jsx",
+ "/src/pkg1.js",
+ "/src/pkg1.jsx",
+ "/pkg1.js",
+ "/pkg1.jsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+PolledWatches::
+/src/project/node_modules/@types/pkg1/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg4/package.json:
+ {"pollingInterval":2000}
+
+FsWatches::
+/src/project/tsconfig.json:
+ {}
+/src/project:
+ {}
+/src/project/filewithimports.ts:
+ {}
+/src/project/filewithtyperefs.ts:
+ {}
+/src/project/randomfileforimport.ts:
+ {}
+/src/project/randomfilefortyperef.ts:
+ {}
+
+FsWatchesRecursive::
+
+exitCode:: ExitStatus.undefined
+
+
+Change:: modify randomFileForTypeRef by adding typeRef
+
+Input::
+//// [/src/project/randomFileForTypeRef.ts]
+///
+export const x = 10;
+
+
+Output::
+>> Screen clear
+[[90m12:00:45 AM[0m] File change detected. Starting incremental compilation...
+
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' does not exist.
+File '/src/pkg1.ts' does not exist.
+File '/src/pkg1.tsx' does not exist.
+File '/src/pkg1.d.ts' does not exist.
+File '/pkg1.ts' does not exist.
+File '/pkg1.tsx' does not exist.
+File '/pkg1.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg1.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+File '/src/project/pkg1.js' does not exist.
+File '/src/project/pkg1.jsx' does not exist.
+File '/src/pkg1.js' does not exist.
+File '/src/pkg1.jsx' does not exist.
+File '/pkg1.js' does not exist.
+File '/pkg1.jsx' does not exist.
+======== Module name 'pkg1' was not resolved. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/randomFileForTypeRef.ts'. ========
+Resolution for type reference directive 'pkg2' was found in cache from location '/src/project'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96mfileWithImports.ts[0m:[93m2[0m:[93m40[0m - [91merror[0m[90m TS2792: [0mCannot find module 'pkg1'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
+
+[7m2[0m import type { RequireInterface1 } from "pkg1";
+[7m [0m [91m ~~~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+../../a/lib/lib.d.ts
+ Default library for target 'es5'
+pkg0.d.ts
+ Imported via "pkg0" from file 'fileWithImports.ts'
+ Imported via "pkg0" from file 'randomFileForImport.ts'
+fileWithImports.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'fileWithTypeRefs.ts'
+fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+[[90m12:00:46 AM[0m] Found 3 errors. Watching for file changes.
+
+
+
+Program root files: ["/src/project/fileWithImports.ts","/src/project/fileWithTypeRefs.ts","/src/project/randomFileForImport.ts","/src/project/randomFileForTypeRef.ts"]
+Program options: {"module":2,"composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js","watch":true,"explainFiles":true,"configFilePath":"/src/project/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/a/lib/lib.d.ts
+/src/project/pkg0.d.ts
+/src/project/fileWithImports.ts
+/src/project/node_modules/pkg2/index.d.ts
+/src/project/fileWithTypeRefs.ts
+/src/project/randomFileForImport.ts
+/src/project/randomFileForTypeRef.ts
+/src/project/node_modules/@types/pkg4/index.d.ts
+
+No cached semantic diagnostics in the builder::
+
+No shapes updated in the builder::
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx",
+ "/src/project/pkg1.d.ts",
+ "/src/pkg1.ts",
+ "/src/pkg1.tsx",
+ "/src/pkg1.d.ts",
+ "/pkg1.ts",
+ "/pkg1.tsx",
+ "/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/package.json",
+ "/src/project/node_modules/@types/pkg1.d.ts",
+ "/src/project/node_modules/@types/pkg1/index.d.ts",
+ "/src/node_modules/@types/pkg1/package.json",
+ "/src/node_modules/@types/pkg1.d.ts",
+ "/src/node_modules/@types/pkg1/index.d.ts",
+ "/node_modules/@types/pkg1/package.json",
+ "/node_modules/@types/pkg1.d.ts",
+ "/node_modules/@types/pkg1/index.d.ts",
+ "/src/project/pkg1.js",
+ "/src/project/pkg1.jsx",
+ "/src/pkg1.js",
+ "/src/pkg1.jsx",
+ "/pkg1.js",
+ "/pkg1.jsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+File: /src/project/randomFileForTypeRef.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+PolledWatches::
+/src/project/node_modules/@types/pkg1/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg4/package.json:
+ {"pollingInterval":2000}
+
+FsWatches::
+/src/project/tsconfig.json:
+ {}
+/src/project:
+ {}
+/src/project/filewithimports.ts:
+ {}
+/src/project/filewithtyperefs.ts:
+ {}
+/src/project/randomfileforimport.ts:
+ {}
+/src/project/randomfilefortyperef.ts:
+ {}
+
+FsWatchesRecursive::
+
+exitCode:: ExitStatus.undefined
+
+
+Change:: write file not resolved by import and random edit
+
+Input::
+//// [/src/project/randomFileForImport.ts]
+import type { ImportInterface0 } from "pkg0";
+export const x = 10;export const y = 10;
+
+//// [/src/project/pkg1.d.ts]
+export interface RequireInterface1 {}
+
+
+Output::
+>> Screen clear
+[[90m12:00:51 AM[0m] File change detected. Starting incremental compilation...
+
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/@types/pkg3.d.ts' does not exist.
+Directory '/src/node_modules' does not exist, skipping all lookups in it.
+Directory '/node_modules' does not exist, skipping all lookups in it.
+======== Type reference directive 'pkg3' was not resolved. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/randomFileForTypeRef.ts'. ========
+Resolution for type reference directive 'pkg2' was found in cache from location '/src/project'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+[96mfileWithTypeRefs.ts[0m:[93m2[0m:[93m23[0m - [91merror[0m[90m TS2688: [0mCannot find type definition file for 'pkg3'.
+
+[7m2[0m ///
+[7m [0m [91m ~~~~[0m
+
+[96mfileWithTypeRefs.ts[0m:[93m3[0m:[93m52[0m - [91merror[0m[90m TS2304: [0mCannot find name 'RequireInterface3'.
+
+[7m3[0m interface LocalInterface extends ImportInterface2, RequireInterface3 {}
+[7m [0m [91m ~~~~~~~~~~~~~~~~~[0m
+
+../../a/lib/lib.d.ts
+ Default library for target 'es5'
+pkg0.d.ts
+ Imported via "pkg0" from file 'fileWithImports.ts'
+ Imported via "pkg0" from file 'randomFileForImport.ts'
+pkg1.d.ts
+ Imported via "pkg1" from file 'fileWithImports.ts'
+fileWithImports.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'fileWithTypeRefs.ts'
+fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+[[90m12:00:52 AM[0m] Found 2 errors. Watching for file changes.
+
+
+
+Program root files: ["/src/project/fileWithImports.ts","/src/project/fileWithTypeRefs.ts","/src/project/randomFileForImport.ts","/src/project/randomFileForTypeRef.ts"]
+Program options: {"module":2,"composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js","watch":true,"explainFiles":true,"configFilePath":"/src/project/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/a/lib/lib.d.ts
+/src/project/pkg0.d.ts
+/src/project/pkg1.d.ts
+/src/project/fileWithImports.ts
+/src/project/node_modules/pkg2/index.d.ts
+/src/project/fileWithTypeRefs.ts
+/src/project/randomFileForImport.ts
+/src/project/randomFileForTypeRef.ts
+/src/project/node_modules/@types/pkg4/index.d.ts
+
+No cached semantic diagnostics in the builder::
+
+No shapes updated in the builder::
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts",
+ "/src/project/node_modules/pkg3/index.d.ts",
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3.d.ts",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/node_modules/pkg3/package.json",
+ "/src/node_modules/pkg3.d.ts",
+ "/src/node_modules/pkg3/index.d.ts",
+ "/src/node_modules/@types/pkg3/package.json",
+ "/src/node_modules/@types/pkg3.d.ts",
+ "/src/node_modules/@types/pkg3/index.d.ts",
+ "/node_modules/pkg3/package.json",
+ "/node_modules/pkg3.d.ts",
+ "/node_modules/pkg3/index.d.ts",
+ "/node_modules/@types/pkg3/package.json",
+ "/node_modules/@types/pkg3.d.ts",
+ "/node_modules/@types/pkg3/index.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+File: /src/project/randomFileForTypeRef.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+PolledWatches::
+/src/project/node_modules/@types/pkg1/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg4/package.json:
+ {"pollingInterval":2000}
+
+FsWatches::
+/src/project/tsconfig.json:
+ {}
+/src/project:
+ {}
+/src/project/filewithimports.ts:
+ {}
+/src/project/filewithtyperefs.ts:
+ {}
+/src/project/randomfileforimport.ts:
+ {}
+/src/project/randomfilefortyperef.ts:
+ {}
+
+FsWatchesRecursive::
+
+exitCode:: ExitStatus.undefined
+
+
+Change:: write file not resolved by typeRef and random edit
+
+Input::
+//// [/src/project/randomFileForImport.ts]
+import type { ImportInterface0 } from "pkg0";
+export const x = 10;export const y = 10;export const z = 10;
+
+//// [/src/project/node_modules/pkg3/index.d.ts]
+export {};
+declare global {
+ interface RequireInterface3 {}
+}
+
+
+
+Output::
+>> Screen clear
+[[90m12:01:00 AM[0m] File change detected. Starting incremental compilation...
+
+======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg0.ts' does not exist.
+File '/src/project/pkg0.tsx' does not exist.
+File '/src/project/pkg0.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ========
+Module resolution kind is not specified, using 'Classic'.
+File '/src/project/pkg1.ts' does not exist.
+File '/src/project/pkg1.tsx' does not exist.
+File '/src/project/pkg1.d.ts' exist - use it as a name resolution result.
+======== Module name 'pkg1' was successfully resolved to '/src/project/pkg1.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg2/package.json' does not exist.
+File '/src/project/node_modules/pkg2.d.ts' does not exist.
+File '/src/project/node_modules/pkg2/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg2/index.d.ts', result '/src/project/node_modules/pkg2/index.d.ts'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg3', containing file '/src/project/fileWithTypeRefs.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+Looking up in 'node_modules' folder, initial location '/src/project'.
+File '/src/project/node_modules/pkg3/package.json' does not exist.
+File '/src/project/node_modules/pkg3.d.ts' does not exist.
+File '/src/project/node_modules/pkg3/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/pkg3/index.d.ts', result '/src/project/node_modules/pkg3/index.d.ts'.
+======== Type reference directive 'pkg3' was successfully resolved to '/src/project/node_modules/pkg3/index.d.ts', primary: false. ========
+======== Resolving module 'pkg0' from '/src/project/randomFileForImport.ts'. ========
+Resolution for module 'pkg0' was found in cache from location '/src/project'.
+======== Module name 'pkg0' was successfully resolved to '/src/project/pkg0.d.ts'. ========
+======== Resolving type reference directive 'pkg2', containing file '/src/project/randomFileForTypeRef.ts'. ========
+Resolution for type reference directive 'pkg2' was found in cache from location '/src/project'.
+======== Type reference directive 'pkg2' was successfully resolved to '/src/project/node_modules/pkg2/index.d.ts', primary: false. ========
+======== Resolving type reference directive 'pkg4', containing file '/src/project/__inferred type names__.ts', root directory '/src/project/node_modules/@types'. ========
+Resolving with primary search path '/src/project/node_modules/@types'.
+File '/src/project/node_modules/@types/pkg4/package.json' does not exist.
+File '/src/project/node_modules/@types/pkg4/index.d.ts' exist - use it as a name resolution result.
+Resolving real path for '/src/project/node_modules/@types/pkg4/index.d.ts', result '/src/project/node_modules/@types/pkg4/index.d.ts'.
+======== Type reference directive 'pkg4' was successfully resolved to '/src/project/node_modules/@types/pkg4/index.d.ts', primary: true. ========
+../../a/lib/lib.d.ts
+ Default library for target 'es5'
+pkg0.d.ts
+ Imported via "pkg0" from file 'fileWithImports.ts'
+ Imported via "pkg0" from file 'randomFileForImport.ts'
+pkg1.d.ts
+ Imported via "pkg1" from file 'fileWithImports.ts'
+fileWithImports.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/pkg2/index.d.ts
+ Type library referenced via 'pkg2' from file 'fileWithTypeRefs.ts'
+node_modules/pkg3/index.d.ts
+ Type library referenced via 'pkg3' from file 'fileWithTypeRefs.ts'
+fileWithTypeRefs.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForImport.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+randomFileForTypeRef.ts
+ Matched by include pattern '*.ts' in 'tsconfig.json'
+node_modules/@types/pkg4/index.d.ts
+ Entry point for implicit type library 'pkg4'
+[[90m12:01:12 AM[0m] Found 0 errors. Watching for file changes.
+
+
+
+Program root files: ["/src/project/fileWithImports.ts","/src/project/fileWithTypeRefs.ts","/src/project/randomFileForImport.ts","/src/project/randomFileForTypeRef.ts"]
+Program options: {"module":2,"composite":true,"cacheResolutions":true,"traceResolution":true,"out":"./out.js","watch":true,"explainFiles":true,"configFilePath":"/src/project/tsconfig.json"}
+Program structureReused: Not
+Program files::
+/a/lib/lib.d.ts
+/src/project/pkg0.d.ts
+/src/project/pkg1.d.ts
+/src/project/fileWithImports.ts
+/src/project/node_modules/pkg2/index.d.ts
+/src/project/node_modules/pkg3/index.d.ts
+/src/project/fileWithTypeRefs.ts
+/src/project/randomFileForImport.ts
+/src/project/randomFileForTypeRef.ts
+/src/project/node_modules/@types/pkg4/index.d.ts
+
+No cached semantic diagnostics in the builder::
+
+No shapes updated in the builder::
+
+File: /src/project/fileWithImports.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+pkg1: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg1.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg1.ts",
+ "/src/project/pkg1.tsx"
+ ]
+}
+
+File: /src/project/fileWithTypeRefs.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+pkg3: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg3/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg3/package.json",
+ "/src/project/node_modules/@types/pkg3/index.d.ts",
+ "/src/project/node_modules/pkg3/package.json",
+ "/src/project/node_modules/pkg3.d.ts"
+ ]
+}
+
+File: /src/project/randomFileForImport.ts
+resolvedModules:
+pkg0: {
+ "resolvedModule": {
+ "resolvedFileName": "/src/project/pkg0.d.ts",
+ "extension": ".d.ts",
+ "isExternalLibraryImport": false
+ },
+ "failedLookupLocations": [
+ "/src/project/pkg0.ts",
+ "/src/project/pkg0.tsx"
+ ]
+}
+
+File: /src/project/randomFileForTypeRef.ts
+resolvedTypeReferenceDirectiveNames:
+pkg2: {
+ "resolvedTypeReferenceDirective": {
+ "primary": false,
+ "resolvedFileName": "/src/project/node_modules/pkg2/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg2/package.json",
+ "/src/project/node_modules/@types/pkg2/index.d.ts",
+ "/src/project/node_modules/pkg2/package.json",
+ "/src/project/node_modules/pkg2.d.ts"
+ ]
+}
+
+automaticTypeDirectiveResolutions:
+pkg4: {
+ "resolvedTypeReferenceDirective": {
+ "primary": true,
+ "resolvedFileName": "/src/project/node_modules/@types/pkg4/index.d.ts",
+ "isExternalLibraryImport": true
+ },
+ "failedLookupLocations": [
+ "/src/project/node_modules/@types/pkg4/package.json"
+ ]
+}
+
+PolledWatches::
+/src/project/node_modules/@types/pkg1/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg2/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/pkg3/package.json:
+ {"pollingInterval":2000}
+/src/project/node_modules/@types/pkg4/package.json:
+ {"pollingInterval":2000}
+
+FsWatches::
+/src/project/tsconfig.json:
+ {}
+/src/project:
+ {}
+/src/project/filewithimports.ts:
+ {}
+/src/project/filewithtyperefs.ts:
+ {}
+/src/project/randomfileforimport.ts:
+ {}
+/src/project/randomfilefortyperef.ts:
+ {}
+
+FsWatchesRecursive::
+
+exitCode:: ExitStatus.undefined
+
+//// [/src/project/out.js]
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///
+ ///
+});
+define("randomFileForImport", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.z = exports.y = exports.x = void 0;
+ exports.x = 10;
+ exports.y = 10;
+ exports.z = 10;
+});
+define("randomFileForTypeRef", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.x = void 0;
+ ///
+ exports.x = 10;
+});
+
+
+//// [/src/project/out.d.ts]
+declare module "fileWithImports" { }
+declare module "fileWithTypeRefs" {
+ export {};
+}
+declare module "randomFileForImport" {
+ export const x = 10;
+ export const y = 10;
+ export const z = 10;
+}
+declare module "randomFileForTypeRef" {
+ export const x = 10;
+}
+
+
+//// [/src/project/out.tsbuildinfo]
+{"bundle":{"commonSourceDirectory":"./","sourceFiles":["./fileWithImports.ts","./fileWithTypeRefs.ts","./randomFileForImport.ts","./randomFileForTypeRef.ts"],"js":{"sections":[{"pos":0,"end":940,"kind":"text"}],"hash":"21057699039-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n});\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n /// \n /// \n});\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.z = exports.y = exports.x = void 0;\n exports.x = 10;\n exports.y = 10;\n exports.z = 10;\n});\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.x = void 0;\n /// \n exports.x = 10;\n});\n"},"dts":{"sections":[{"pos":0,"end":273,"kind":"text"}],"hash":"-32434225881-declare module \"fileWithImports\" { }\ndeclare module \"fileWithTypeRefs\" {\n export {};\n}\ndeclare module \"randomFileForImport\" {\n export const x = 10;\n export const y = 10;\n export const z = 10;\n}\ndeclare module \"randomFileForTypeRef\" {\n export const x = 10;\n}\n"}},"program":{"fileNames":["../../a/lib/lib.d.ts","./pkg0.d.ts","./pkg1.d.ts","./filewithimports.ts","./node_modules/pkg2/index.d.ts","./node_modules/pkg3/index.d.ts","./filewithtyperefs.ts","./randomfileforimport.ts","./randomfilefortyperef.ts","./node_modules/@types/pkg4/index.d.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","769951468-export interface ImportInterface0 {}","-3547817137-export interface RequireInterface1 {}","17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n","1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n","-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n","-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n","16859148566-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;export const y = 10;export const z = 10;","-2210321256-/// \nexport const x = 10;","-10726455937-export const x = 10;"],"options":{"cacheResolutions":true,"composite":true,"module":2,"out":"./out.js"},"outSignature":"-32434225881-declare module \"fileWithImports\" { }\ndeclare module \"fileWithTypeRefs\" {\n export {};\n}\ndeclare module \"randomFileForImport\" {\n export const x = 10;\n export const y = 10;\n export const z = 10;\n}\ndeclare module \"randomFileForTypeRef\" {\n export const x = 10;\n}\n","latestChangedDtsFile":"./out.d.ts"},"version":"FakeTSVersion"}
+
+//// [/src/project/out.tsbuildinfo.readable.baseline.txt]
+{
+ "bundle": {
+ "commonSourceDirectory": "./",
+ "sourceFiles": [
+ "./fileWithImports.ts",
+ "./fileWithTypeRefs.ts",
+ "./randomFileForImport.ts",
+ "./randomFileForTypeRef.ts"
+ ],
+ "js": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 940,
+ "kind": "text"
+ }
+ ],
+ "hash": "21057699039-define(\"fileWithImports\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n});\ndefine(\"fileWithTypeRefs\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n /// \n /// \n});\ndefine(\"randomFileForImport\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.z = exports.y = exports.x = void 0;\n exports.x = 10;\n exports.y = 10;\n exports.z = 10;\n});\ndefine(\"randomFileForTypeRef\", [\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.x = void 0;\n /// \n exports.x = 10;\n});\n"
+ },
+ "dts": {
+ "sections": [
+ {
+ "pos": 0,
+ "end": 273,
+ "kind": "text"
+ }
+ ],
+ "hash": "-32434225881-declare module \"fileWithImports\" { }\ndeclare module \"fileWithTypeRefs\" {\n export {};\n}\ndeclare module \"randomFileForImport\" {\n export const x = 10;\n export const y = 10;\n export const z = 10;\n}\ndeclare module \"randomFileForTypeRef\" {\n export const x = 10;\n}\n"
+ }
+ },
+ "program": {
+ "fileNames": [
+ "../../a/lib/lib.d.ts",
+ "./pkg0.d.ts",
+ "./pkg1.d.ts",
+ "./filewithimports.ts",
+ "./node_modules/pkg2/index.d.ts",
+ "./node_modules/pkg3/index.d.ts",
+ "./filewithtyperefs.ts",
+ "./randomfileforimport.ts",
+ "./randomfilefortyperef.ts",
+ "./node_modules/@types/pkg4/index.d.ts"
+ ],
+ "fileInfos": {
+ "../../a/lib/lib.d.ts": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }",
+ "./pkg0.d.ts": "769951468-export interface ImportInterface0 {}",
+ "./pkg1.d.ts": "-3547817137-export interface RequireInterface1 {}",
+ "./filewithimports.ts": "17369432329-import type { ImportInterface0 } from \"pkg0\";\nimport type { RequireInterface1 } from \"pkg1\";\n",
+ "./node_modules/pkg2/index.d.ts": "1714206242-export {};\ndeclare global {\n interface ImportInterface2 {}\n}\n",
+ "./node_modules/pkg3/index.d.ts": "-6568745979-export {};\ndeclare global {\n interface RequireInterface3 {}\n}\n",
+ "./filewithtyperefs.ts": "-9965483727-/// \n/// \ninterface LocalInterface extends ImportInterface2, RequireInterface3 {}\nexport {}\n",
+ "./randomfileforimport.ts": "16859148566-import type { ImportInterface0 } from \"pkg0\";\nexport const x = 10;export const y = 10;export const z = 10;",
+ "./randomfilefortyperef.ts": "-2210321256-/// \nexport const x = 10;",
+ "./node_modules/@types/pkg4/index.d.ts": "-10726455937-export const x = 10;"
+ },
+ "options": {
+ "cacheResolutions": true,
+ "composite": true,
+ "module": 2,
+ "out": "./out.js"
+ },
+ "outSignature": "-32434225881-declare module \"fileWithImports\" { }\ndeclare module \"fileWithTypeRefs\" {\n export {};\n}\ndeclare module \"randomFileForImport\" {\n export const x = 10;\n export const y = 10;\n export const z = 10;\n}\ndeclare module \"randomFileForTypeRef\" {\n export const x = 10;\n}\n",
+ "latestChangedDtsFile": "./out.d.ts"
+ },
+ "version": "FakeTSVersion",
+ "size": 3518
+}
+
+//// [/src/project/out.tsbuildinfo.baseline.txt]
+======================================================================
+File:: ./out.js
+----------------------------------------------------------------------
+text: (0-940)
+define("fileWithImports", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
+define("fileWithTypeRefs", ["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ ///