From c117c266e09c80e8a06b24a6e94b9d018f5fae6b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 23 Feb 2021 11:27:16 -0800 Subject: [PATCH] Refactor to simplify project references tsc-watch and tsserver tests (#42926) --- src/testRunner/tsconfig.json | 2 + src/testRunner/unittests/tsbuild/watchMode.ts | 594 --------- src/testRunner/unittests/tsc/helpers.ts | 5 +- src/testRunner/unittests/tscWatch/helpers.ts | 58 +- .../tscWatch/projectsWithReferences.ts | 299 +++++ src/testRunner/unittests/tsserver/helpers.ts | 7 + .../tsserver/projectsWithReferences.ts | 287 +++++ .../on-sample-project.js | 1006 +++++++++++++++ ...nsitive-references-in-different-folders.js | 1083 +++++++++++++++++ .../on-transitive-references.js | 1046 ++++++++++++++++ ...roject-uses-different-module-resolution.js | 240 ++++ 11 files changed, 4022 insertions(+), 605 deletions(-) create mode 100644 src/testRunner/unittests/tscWatch/projectsWithReferences.ts create mode 100644 src/testRunner/unittests/tsserver/projectsWithReferences.ts create mode 100644 tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js create mode 100644 tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js create mode 100644 tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js create mode 100644 tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 91691b6d4b5..185d3074081 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -147,6 +147,7 @@ "unittests/tscWatch/forceConsistentCasingInFileNames.ts", "unittests/tscWatch/incremental.ts", "unittests/tscWatch/programUpdates.ts", + "unittests/tscWatch/projectsWithReferences.ts", "unittests/tscWatch/resolutionCache.ts", "unittests/tscWatch/sourceOfProjectReferenceRedirect.ts", "unittests/tscWatch/watchApi.ts", @@ -192,6 +193,7 @@ "unittests/tsserver/projectReferences.ts", "unittests/tsserver/projectReferencesSourcemap.ts", "unittests/tsserver/projects.ts", + "unittests/tsserver/projectsWithReferences.ts", "unittests/tsserver/refactors.ts", "unittests/tsserver/reload.ts", "unittests/tsserver/reloadProjects.ts", diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index 56eef651a86..5e0d0932f50 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -10,18 +10,6 @@ namespace ts.tscWatch { ); } - export function createSolutionBuilder(system: WatchedSystem, rootNames: readonly string[], defaultOptions?: BuildOptions) { - const host = createSolutionBuilderHost(system); - return ts.createSolutionBuilder(host, rootNames, defaultOptions || {}); - } - - export function ensureErrorFreeBuild(host: WatchedSystem, rootNames: readonly string[]) { - // ts build should succeed - const solutionBuilder = createSolutionBuilder(host, rootNames, {}); - solutionBuilder.build(); - assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); - } - type OutputFileStamp = [string, Date | undefined, boolean]; function transformOutputToOutputFileStamp(f: string, host: TsBuildWatchSystem): OutputFileStamp { return [f, host.getModifiedTime(f), host.writtenFiles.has(host.toFullPath(f))] as OutputFileStamp; @@ -39,10 +27,6 @@ namespace ts.tscWatch { type ReadonlyFile = Readonly; /** [tsconfig, index] | [tsconfig, index, anotherModule, someDecl] */ type SubProjectFiles = [ReadonlyFile, ReadonlyFile] | [ReadonlyFile, ReadonlyFile, ReadonlyFile, ReadonlyFile]; - function getProjectPath(project: string) { - return `${projectsLocation}/${project}`; - } - function projectPath(subProject: SubProject) { return getFilePathInProject(project, subProject); } @@ -51,10 +35,6 @@ namespace ts.tscWatch { return `${projectPath(subProject)}/${baseFileName.toLowerCase()}`; } - function projectFileName(subProject: SubProject, baseFileName: string) { - return `${projectPath(subProject)}/${baseFileName}`; - } - function projectFile(subProject: SubProject, baseFileName: string): File { return getFileFromProject(project, `${subProject}/${baseFileName}`); } @@ -551,580 +531,6 @@ let x: string = 10;`), }); }); - describe("tsc-watch and tsserver works with project references", () => { - describe("invoking when references are already built", () => { - function verifyWatchesOfProject(host: TsBuildWatchSystem, expectedWatchedFiles: readonly string[], expectedWatchedDirectoriesRecursive: readonly string[], expectedWatchedDirectories?: readonly string[]) { - checkWatchedFilesDetailed(host, expectedWatchedFiles, 1); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories || emptyArray, 1, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectoriesRecursive, 1, /*recursive*/ true); - } - - function createSolutionOfProject(allFiles: readonly File[], - currentDirectory: string, - solutionBuilderconfig: string, - getOutputFileStamps: (host: TsBuildWatchSystem) => readonly OutputFileStamp[]) { - // Build the composite project - const host = createTsBuildWatchSystem(allFiles, { currentDirectory }); - const solutionBuilder = createSolutionBuilder(host, [solutionBuilderconfig], {}); - solutionBuilder.build(); - const outputFileStamps = getOutputFileStamps(host); - for (const stamp of outputFileStamps) { - assert.isDefined(stamp[1], `${stamp[0]} expected to be present`); - } - return { host, solutionBuilder }; - } - - function createSolutionAndWatchModeOfProject( - allFiles: readonly File[], - currentDirectory: string, - solutionBuilderconfig: string, - watchConfig: string, - getOutputFileStamps: (host: TsBuildWatchSystem) => readonly OutputFileStamp[]) { - // Build the composite project - const { host, solutionBuilder } = createSolutionOfProject(allFiles, currentDirectory, solutionBuilderconfig, getOutputFileStamps); - - // Build in watch mode - const watch = createWatchOfConfigFile(watchConfig, host); - checkOutputErrorsInitial(host, emptyArray); - - return { host, solutionBuilder, watch }; - } - - function createSolutionAndServiceOfProject(allFiles: readonly File[], - currentDirectory: string, - solutionBuilderconfig: string, - openFileName: string, - getOutputFileStamps: (host: TsBuildWatchSystem) => readonly OutputFileStamp[]) { - // Build the composite project - const { host, solutionBuilder } = createSolutionOfProject(allFiles, currentDirectory, solutionBuilderconfig, getOutputFileStamps); - - // service - const service = projectSystem.createProjectService(host); - service.openClientFile(openFileName); - - return { host, solutionBuilder, service }; - } - - function checkProjectActualFiles(service: projectSystem.TestProjectService, configFile: string, expectedFiles: readonly string[]) { - projectSystem.checkNumberOfProjects(service, { configuredProjects: 1 }); - projectSystem.checkProjectActualFiles(service.configuredProjects.get(configFile.toLowerCase())!, expectedFiles); - } - - function verifyDependencies(watch: Watch, filePath: string, expected: readonly string[]) { - checkArray(`${filePath} dependencies`, watch.getCurrentProgram().getAllDependencies(watch.getCurrentProgram().getSourceFile(filePath)!), expected); - } - - describe("on sample project", () => { - const coreIndexDts = projectFileName(SubProject.core, "index.d.ts"); - const coreAnotherModuleDts = projectFileName(SubProject.core, "anotherModule.d.ts"); - const logicIndexDts = projectFileName(SubProject.logic, "index.d.ts"); - const expectedWatchedDirectoriesRecursive = projectSystem.getTypeRootsFromLocation(projectPath(SubProject.tests)); - const expectedProjectFiles = () => [libFile, ...tests, ...logic.slice(1), ...core.slice(1, core.length - 1)].map(f => f.path); - const expectedProgramFiles = () => [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, logicIndexDts]; - - function createSolutionAndWatchMode() { - return createSolutionAndWatchModeOfProject(allFiles, projectsLocation, `${project}/${SubProject.tests}`, tests[0].path, getOutputFileStamps); - } - - function createSolutionAndService() { - return createSolutionAndServiceOfProject(allFiles, projectsLocation, `${project}/${SubProject.tests}`, tests[1].path, getOutputFileStamps); - } - - function verifyWatches(host: TsBuildWatchSystem, withTsserver?: boolean) { - verifyWatchesOfProject( - host, - withTsserver ? - [...core.slice(0, core.length - 1), ...logic, tests[0], libFile].map(f => f.path.toLowerCase()) : - [core[0], logic[0], ...tests, libFile].map(f => f.path).concat([coreIndexDts, coreAnotherModuleDts, logicIndexDts].map(f => f.toLowerCase())), - expectedWatchedDirectoriesRecursive - ); - } - - function verifyScenario( - edit: (host: TsBuildWatchSystem, solutionBuilder: SolutionBuilder) => void, - expectedProgramFilesAfterEdit: () => readonly string[], - expectedProjectFilesAfterEdit: () => readonly string[] - ) { - it("with tsc-watch", () => { - const { host, solutionBuilder, watch } = createSolutionAndWatchMode(); - - edit(host, solutionBuilder); - - host.checkTimeoutQueueLengthAndRun(1); - checkOutputErrorsIncremental(host, emptyArray); - checkProgramActualFiles(watch.getCurrentProgram().getProgram(), expectedProgramFilesAfterEdit()); - - }); - - it("with tsserver", () => { - const { host, solutionBuilder, service } = createSolutionAndService(); - - edit(host, solutionBuilder); - - host.checkTimeoutQueueLengthAndRun(2); - checkProjectActualFiles(service, tests[0].path, expectedProjectFilesAfterEdit()); - }); - } - - describe("verifies dependencies and watches", () => { - it("with tsc-watch", () => { - const { host, watch } = createSolutionAndWatchMode(); - verifyWatches(host); - verifyDependencies(watch, coreIndexDts, [coreIndexDts]); - verifyDependencies(watch, coreAnotherModuleDts, [coreAnotherModuleDts]); - verifyDependencies(watch, logicIndexDts, [logicIndexDts, coreAnotherModuleDts]); - verifyDependencies(watch, tests[1].path, expectedProgramFiles().filter(f => f !== libFile.path)); - }); - - it("with tsserver", () => { - const { host } = createSolutionAndService(); - verifyWatches(host, /*withTsserver*/ true); - }); - }); - - describe("local edit in ts file, result in watch compilation because logic.d.ts is written", () => { - verifyScenario((host, solutionBuilder) => { - host.writeFile(logic[1].path, `${logic[1].content} -function foo() { -}`); - solutionBuilder.invalidateProject(logic[0].path.toLowerCase() as ResolvedConfigFilePath); - solutionBuilder.buildNextInvalidatedProject(); - - // not ideal, but currently because of d.ts but no new file is written - // There will be timeout queued even though file contents are same - }, expectedProgramFiles, expectedProjectFiles); - }); - - describe("non local edit in ts file, rebuilds in watch compilation", () => { - verifyScenario((host, solutionBuilder) => { - host.writeFile(logic[1].path, `${logic[1].content} -export function gfoo() { -}`); - solutionBuilder.invalidateProject(logic[0].path.toLowerCase() as ResolvedConfigFilePath); - solutionBuilder.buildNextInvalidatedProject(); - }, expectedProgramFiles, expectedProjectFiles); - }); - - describe("change in project reference config file builds correctly", () => { - verifyScenario((host, solutionBuilder) => { - host.writeFile(logic[0].path, JSON.stringify({ - compilerOptions: { composite: true, declaration: true, declarationDir: "decls" }, - references: [{ path: "../core" }] - })); - solutionBuilder.invalidateProject(logic[0].path.toLowerCase() as ResolvedConfigFilePath, ConfigFileProgramReloadLevel.Full); - solutionBuilder.buildNextInvalidatedProject(); - }, () => [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, projectFilePath(SubProject.logic, "decls/index.d.ts")], expectedProjectFiles); - }); - }); - - describe("on transitive references", () => { - const project = "transitiveReferences"; - const aTsFile = getFileFromProject(project, "a.ts"); - const bTsFile = getFileFromProject(project, "b.ts"); - const cTsFile = getFileFromProject(project, "c.ts"); - const aTsconfigFile = getFileFromProject(project, "tsconfig.a.json"); - const bTsconfigFile = getFileFromProject(project, "tsconfig.b.json"); - const cTsconfigFile = getFileFromProject(project, "tsconfig.c.json"); - const refs = getFileFromProject(project, "refs/a.d.ts"); - - function getRootFile(multiFolder: boolean, fileFromDisk: File, multiFolderPath: string): File { - return multiFolder ? { - path: getFilePathInProject(project, multiFolderPath), - content: fileFromDisk.content - // Replace the relative imports - .replace("./", "../") - } : fileFromDisk; - } - - function dtsFile(extensionLessFile: string) { - return getFilePathInProject(project, `${extensionLessFile}.d.ts`); - } - - function jsFile(extensionLessFile: string) { - return getFilePathInProject(project, `${extensionLessFile}.js`); - } - - function verifyWatchState( - host: TsBuildWatchSystem, - watch: Watch, - expectedProgramFiles: readonly string[], - expectedWatchedFiles: readonly string[], - expectedWatchedDirectoriesRecursive: readonly string[], - dependencies: readonly [string, readonly string[]][], - expectedWatchedDirectories?: readonly string[]) { - checkProgramActualFiles(watch.getCurrentProgram().getProgram(), expectedProgramFiles); - verifyWatchesOfProject(host, expectedWatchedFiles, expectedWatchedDirectoriesRecursive, expectedWatchedDirectories); - for (const [file, deps] of dependencies) { - verifyDependencies(watch, file, deps); - } - } - - function getTsConfigFile(multiFolder: boolean, fileFromDisk: File, folder: string): File { - if (!multiFolder) return fileFromDisk; - - return { - path: getFilePathInProject(project, `${folder}/tsconfig.json`), - content: fileFromDisk.content - // Replace files array - .replace(`${folder}.ts`, "index.ts") - // Replace path mappings - .replace("./*", "../*") - .replace("./refs", "../refs") - // Replace references - .replace("tsconfig.a.json", "../a") - .replace("tsconfig.b.json", "../b") - }; - } - - // function writeFile(file: File) { - // Harness.IO.writeFile(file.path.replace(projectsLocation, "c:/temp"), file.content); - // } - - function verifyTransitiveReferences(multiFolder: boolean) { - const aTs = getRootFile(multiFolder, aTsFile, "a/index.ts"); - const bTs = getRootFile(multiFolder, bTsFile, "b/index.ts"); - const cTs = getRootFile(multiFolder, cTsFile, "c/index.ts"); - - const configToBuild = multiFolder ? "c/tsconfig.json" : "tsconfig.c.json"; - const aTsconfig = getTsConfigFile(multiFolder, aTsconfigFile, "a"); - const bTsconfig = getTsConfigFile(multiFolder, bTsconfigFile, "b"); - const cTsconfig = getTsConfigFile(multiFolder, cTsconfigFile, "c"); - - // if (multiFolder) { - // writeFile(aTs); - // writeFile(bTs); - // writeFile(cTs); - // writeFile(aTsconfig); - // writeFile(bTsconfig); - // writeFile(cTsconfig); - // } - - const allFiles = [libFile, aTs, bTs, cTs, aTsconfig, bTsconfig, cTsconfig, refs]; - const aDts = dtsFile(multiFolder ? "a/index" : "a"), bDts = dtsFile(multiFolder ? "b/index" : "b"); - const expectedFiles = [jsFile(multiFolder ? "a/index" : "a"), aDts, jsFile(multiFolder ? "b/index" : "b"), bDts, jsFile(multiFolder ? "c/index" : "c")]; - const expectedProgramFiles = [cTs.path, libFile.path, aDts, refs.path, bDts]; - const expectedProjectFiles = [cTs.path, libFile.path, aTs.path, refs.path, bTs.path]; - const expectedWatchedFiles = expectedProgramFiles.concat(cTsconfig.path, bTsconfig.path, aTsconfig.path).map(s => s.toLowerCase()); - const expectedProjectWatchedFiles = expectedProjectFiles.concat(cTsconfig.path, bTsconfig.path, aTsconfig.path).map(s => s.toLowerCase()); - const expectedWatchedDirectories = multiFolder ? [ - getProjectPath(project).toLowerCase() // watches for directories created for resolution of b - ] : emptyArray; - const nrefsPath = multiFolder ? ["../nrefs/*"] : ["./nrefs/*"]; - const expectedWatchedDirectoriesRecursive = [ - ...(multiFolder ? [ - getFilePathInProject(project, "a"), // Failed to package json - getFilePathInProject(project, "b"), // Failed to package json - ] : []), - getFilePathInProject(project, "refs"), // Failed lookup since refs/a.ts does not exist - ...projectSystem.getTypeRootsFromLocation(multiFolder ? getFilePathInProject(project, "c") : getProjectPath(project)) - ].map(s => s.toLowerCase()); - - const defaultDependencies: readonly [string, readonly string[]][] = [ - [aDts, [aDts]], - [bDts, [bDts, aDts]], - [refs.path, [refs.path]], - [cTs.path, [cTs.path, refs.path, bDts, aDts]] - ]; - - function createSolutionAndWatchMode() { - return createSolutionAndWatchModeOfProject(allFiles, getProjectPath(project), configToBuild, configToBuild, getOutputFileStamps); - } - - function createSolutionAndService() { - return createSolutionAndServiceOfProject(allFiles, getProjectPath(project), configToBuild, cTs.path, getOutputFileStamps); - } - - function getOutputFileStamps(host: TsBuildWatchSystem) { - return expectedFiles.map(file => transformOutputToOutputFileStamp(file, host)); - } - - function verifyProgram(host: TsBuildWatchSystem, watch: Watch) { - verifyWatchState(host, watch, expectedProgramFiles, expectedWatchedFiles, expectedWatchedDirectoriesRecursive, defaultDependencies, expectedWatchedDirectories); - } - - function verifyProject(host: TsBuildWatchSystem, service: projectSystem.TestProjectService, orphanInfos?: readonly string[]) { - verifyServerState({ host, service, expectedProjectFiles, expectedProjectWatchedFiles, expectedWatchedDirectoriesRecursive, orphanInfos }); - } - - interface VerifyServerState { - host: TsBuildWatchSystem; - service: projectSystem.TestProjectService; - expectedProjectFiles: readonly string[]; - expectedProjectWatchedFiles: readonly string[]; - expectedWatchedDirectoriesRecursive: readonly string[]; - orphanInfos?: readonly string[]; - } - function verifyServerState({ host, service, expectedProjectFiles, expectedProjectWatchedFiles, expectedWatchedDirectoriesRecursive, orphanInfos }: VerifyServerState) { - checkProjectActualFiles(service, cTsconfig.path, expectedProjectFiles.concat(cTsconfig.path)); - const watchedFiles = expectedProjectWatchedFiles.filter(f => f !== cTs.path.toLowerCase()); - const actualOrphan = arrayFrom(mapDefinedIterator( - service.filenameToScriptInfo.values(), - v => v.containingProjects.length === 0 ? v.fileName : undefined - )); - assert.equal(actualOrphan.length, orphanInfos ? orphanInfos.length : 0, `Orphans found: ${JSON.stringify(actualOrphan, /*replacer*/ undefined, " ")}`); - if (orphanInfos && orphanInfos.length) { - for (const orphan of orphanInfos) { - const info = service.getScriptInfoForPath(orphan as Path); - assert.isDefined(info, `${orphan} expected to be present. Actual: ${JSON.stringify(actualOrphan, /*replacer*/ undefined, " ")}`); - assert.equal(info!.containingProjects.length, 0); - watchedFiles.push(orphan); - } - } - verifyWatchesOfProject(host, watchedFiles, expectedWatchedDirectoriesRecursive, expectedWatchedDirectories); - } - - interface VerifyScenario { - edit: (host: TsBuildWatchSystem, solutionBuilder: SolutionBuilder) => void; - schedulesFailedWatchUpdate?: boolean; - expectedEditErrors: readonly string[]; - expectedProgramFiles: readonly string[]; - expectedProjectFiles: readonly string[]; - expectedWatchedFiles: readonly string[]; - expectedProjectWatchedFiles: readonly string[]; - expectedWatchedDirectoriesRecursive: readonly string[]; - dependencies: readonly [string, readonly string[]][]; - revert?: (host: TsBuildWatchSystem) => void; - orphanInfosAfterEdit?: readonly string[]; - orphanInfosAfterRevert?: readonly string[]; - } - function verifyScenario({ edit, schedulesFailedWatchUpdate, expectedEditErrors, expectedProgramFiles, expectedProjectFiles, expectedWatchedFiles, expectedProjectWatchedFiles, expectedWatchedDirectoriesRecursive, dependencies, revert, orphanInfosAfterEdit, orphanInfosAfterRevert }: VerifyScenario) { - it("with tsc-watch", () => { - const { host, solutionBuilder, watch } = createSolutionAndWatchMode(); - - edit(host, solutionBuilder); - - host.checkTimeoutQueueLengthAndRun(schedulesFailedWatchUpdate ? 2 : 1); - checkOutputErrorsIncremental(host, expectedEditErrors); - verifyWatchState(host, watch, expectedProgramFiles, expectedWatchedFiles, expectedWatchedDirectoriesRecursive, dependencies, expectedWatchedDirectories); - - if (revert) { - revert(host); - - host.checkTimeoutQueueLengthAndRun(schedulesFailedWatchUpdate ? 2 : 1); - checkOutputErrorsIncremental(host, emptyArray); - verifyProgram(host, watch); - } - }); - - if (!multiFolder) return; // With side by side file open is in inferred project without any settings - - it("with tsserver", () => { - const { host, solutionBuilder, service } = createSolutionAndService(); - - edit(host, solutionBuilder); - - host.checkTimeoutQueueLengthAndRun(schedulesFailedWatchUpdate ? 3 : 2); - verifyServerState({ host, service, expectedProjectFiles, expectedProjectWatchedFiles, expectedWatchedDirectoriesRecursive, orphanInfos: orphanInfosAfterEdit }); - - if (revert) { - revert(host); - - host.checkTimeoutQueueLengthAndRun(schedulesFailedWatchUpdate ? 3 : 2); - verifyProject(host, service, orphanInfosAfterRevert); - } - }); - } - - describe("verifies dependencies and watches", () => { - // Initial build - it("with tsc-watch", () => { - const { host, watch } = createSolutionAndWatchMode(); - verifyProgram(host, watch); - }); - if (!multiFolder) return; - it("with tsserver", () => { - const { host, service } = createSolutionAndService(); - verifyProject(host, service); - }); - }); - - describe("non local edit updates the program and watch correctly", () => { - verifyScenario({ - edit: (host, solutionBuilder) => { - // edit - host.writeFile(bTs.path, `${bTs.content}\nexport function gfoo() {\n}`); - solutionBuilder.invalidateProject((bTsconfig.path.toLowerCase() as ResolvedConfigFilePath)); - solutionBuilder.buildNextInvalidatedProject(); - }, - expectedEditErrors: emptyArray, - expectedProgramFiles, - expectedProjectFiles, - expectedWatchedFiles, - expectedProjectWatchedFiles, - expectedWatchedDirectoriesRecursive, - dependencies: defaultDependencies - }); - }); - - describe("edit on config file", () => { - const nrefReplacer = (f: string) => f.replace("refs", "nrefs"); - const nrefs: File = { - path: getFilePathInProject(project, "nrefs/a.d.ts"), - content: refs.content - }; - verifyScenario({ - edit: host => { - const cTsConfigJson = JSON.parse(cTsconfig.content); - host.ensureFileOrFolder(nrefs); - cTsConfigJson.compilerOptions.paths = { "@ref/*": nrefsPath }; - host.writeFile(cTsconfig.path, JSON.stringify(cTsConfigJson)); - }, - expectedEditErrors: emptyArray, - expectedProgramFiles: expectedProgramFiles.map(nrefReplacer), - expectedProjectFiles: expectedProjectFiles.map(nrefReplacer), - expectedWatchedFiles: expectedWatchedFiles.map(nrefReplacer), - expectedProjectWatchedFiles: expectedProjectWatchedFiles.map(nrefReplacer), - expectedWatchedDirectoriesRecursive: expectedWatchedDirectoriesRecursive.map(nrefReplacer), - dependencies: [ - [aDts, [aDts]], - [bDts, [bDts, aDts]], - [nrefs.path, [nrefs.path]], - [cTs.path, [cTs.path, nrefs.path, bDts, aDts]] - ], - // revert the update - revert: host => host.writeFile(cTsconfig.path, cTsconfig.content), - // AfterEdit:: Extra watched files on server since the script infos arent deleted till next file open - orphanInfosAfterEdit: [refs.path.toLowerCase()], - // AfterRevert:: Extra watched files on server since the script infos arent deleted till next file open - orphanInfosAfterRevert: [nrefs.path.toLowerCase()] - }); - }); - - describe("edit in referenced config file", () => { - const nrefs: File = { - path: getFilePathInProject(project, "nrefs/a.d.ts"), - content: "export declare class A {}" - }; - const expectedProgramFiles = [cTs.path, bDts, nrefs.path, refs.path, libFile.path]; - const expectedProjectFiles = [cTs.path, bTs.path, nrefs.path, refs.path, libFile.path]; - const [, ...expectedWatchedDirectoriesRecursiveWithoutA] = expectedWatchedDirectoriesRecursive; // Not looking in a folder for resolution in multi folder scenario - verifyScenario({ - edit: host => { - const bTsConfigJson = JSON.parse(bTsconfig.content); - host.ensureFileOrFolder(nrefs); - bTsConfigJson.compilerOptions.paths = { "@ref/*": nrefsPath }; - host.writeFile(bTsconfig.path, JSON.stringify(bTsConfigJson)); - }, - expectedEditErrors: emptyArray, - expectedProgramFiles, - expectedProjectFiles, - expectedWatchedFiles: expectedProgramFiles.concat(cTsconfig.path, bTsconfig.path, aTsconfig.path).map(s => s.toLowerCase()), - expectedProjectWatchedFiles: expectedProjectFiles.concat(cTsconfig.path, bTsconfig.path, aTsconfig.path).map(s => s.toLowerCase()), - expectedWatchedDirectoriesRecursive: (multiFolder ? expectedWatchedDirectoriesRecursiveWithoutA : expectedWatchedDirectoriesRecursive).concat(getFilePathInProject(project, "nrefs").toLowerCase()), - dependencies: [ - [nrefs.path, [nrefs.path]], - [bDts, [bDts, nrefs.path]], - [refs.path, [refs.path]], - [cTs.path, [cTs.path, refs.path, bDts, nrefs.path]], - ], - // revert the update - revert: host => host.writeFile(bTsconfig.path, bTsconfig.content), - // AfterEdit:: Extra watched files on server since the script infos arent deleted till next file open - orphanInfosAfterEdit: [aTs.path.toLowerCase()], - // AfterRevert:: Extra watched files on server since the script infos arent deleted till next file open - orphanInfosAfterRevert: [nrefs.path.toLowerCase()] - }); - }); - - describe("deleting referenced config file", () => { - const expectedProgramFiles = [cTs.path, bTs.path, refs.path, libFile.path]; - const expectedWatchedFiles = expectedProgramFiles.concat(cTsconfig.path, bTsconfig.path).map(s => s.toLowerCase()); - const [, ...expectedWatchedDirectoriesRecursiveWithoutA] = expectedWatchedDirectoriesRecursive; // Not looking in a folder for resolution in multi folder scenario - // Resolutions should change now - // Should map to b.ts instead with options from our own config - verifyScenario({ - edit: host => host.deleteFile(bTsconfig.path), - schedulesFailedWatchUpdate: multiFolder, - expectedEditErrors: [ - `${multiFolder ? "c/tsconfig.json" : "tsconfig.c.json"}(9,21): error TS6053: File '/user/username/projects/transitiveReferences/${multiFolder ? "b" : "tsconfig.b.json"}' not found.\n` - ], - expectedProgramFiles, - expectedProjectFiles: expectedProgramFiles, - expectedWatchedFiles, - expectedProjectWatchedFiles: expectedWatchedFiles, - expectedWatchedDirectoriesRecursive: multiFolder ? expectedWatchedDirectoriesRecursiveWithoutA : expectedWatchedDirectoriesRecursive, - dependencies: [ - [bTs.path, [bTs.path, refs.path]], - [refs.path, [refs.path]], - [cTs.path, [cTs.path, refs.path, bTs.path]], - ], - // revert the update - revert: host => host.writeFile(bTsconfig.path, bTsconfig.content), - // AfterEdit:: Extra watched files on server since the script infos arent deleted till next file open - orphanInfosAfterEdit: [aTs.path.toLowerCase(), aTsconfig.path.toLowerCase()], - }); - }); - - describe("deleting transitively referenced config file", () => { - verifyScenario({ - edit: host => host.deleteFile(aTsconfig.path), - schedulesFailedWatchUpdate: multiFolder, - expectedEditErrors: [ - `${multiFolder ? "b/tsconfig.json" : "tsconfig.b.json"}(10,21): error TS6053: File '/user/username/projects/transitiveReferences/${multiFolder ? "a" : "tsconfig.a.json"}' not found.\n` - ], - expectedProgramFiles: expectedProgramFiles.map(s => s.replace(aDts, aTs.path)), - expectedProjectFiles, - expectedWatchedFiles: expectedWatchedFiles.map(s => s.replace(aDts.toLowerCase(), aTs.path.toLocaleLowerCase())), - expectedProjectWatchedFiles, - expectedWatchedDirectoriesRecursive, - dependencies: [ - [aTs.path, [aTs.path]], - [bDts, [bDts, aTs.path]], - [refs.path, [refs.path]], - [cTs.path, [cTs.path, refs.path, bDts, aTs.path]], - ], - // revert the update - revert: host => host.writeFile(aTsconfig.path, aTsconfig.content), - }); - }); - } - - describe("when config files are side by side", () => { - verifyTransitiveReferences(/*multiFolder*/ false); - - it("when referenced project uses different module resolution", () => { - const bTs: File = { - path: bTsFile.path, - content: `import {A} from "a";export const b = new A();` - }; - const bTsconfig: File = { - path: bTsconfigFile.path, - content: JSON.stringify({ - compilerOptions: { composite: true, moduleResolution: "classic" }, - files: ["b.ts"], - references: [{ path: "tsconfig.a.json" }] - }) - }; - const allFiles = [libFile, aTsFile, bTs, cTsFile, aTsconfigFile, bTsconfig, cTsconfigFile, refs]; - const aDts = dtsFile("a"), bDts = dtsFile("b"); - const expectedFiles = [jsFile("a"), aDts, jsFile("b"), bDts, jsFile("c")]; - const expectedProgramFiles = [cTsFile.path, libFile.path, aDts, refs.path, bDts]; - const expectedWatchedFiles = expectedProgramFiles.concat(cTsconfigFile.path, bTsconfigFile.path, aTsconfigFile.path).map(s => s.toLowerCase()); - const expectedWatchedDirectoriesRecursive = [ - getFilePathInProject(project, "refs"), // Failed lookup since refs/a.ts does not exist - ...projectSystem.getTypeRootsFromLocation(getProjectPath(project)) - ].map(s => s.toLowerCase()); - - const defaultDependencies: readonly [string, readonly string[]][] = [ - [aDts, [aDts]], - [bDts, [bDts, aDts]], - [refs.path, [refs.path]], - [cTsFile.path, [cTsFile.path, refs.path, bDts, aDts]] - ]; - function getOutputFileStamps(host: TsBuildWatchSystem) { - return expectedFiles.map(file => transformOutputToOutputFileStamp(file, host)); - } - const { host, watch } = createSolutionAndWatchModeOfProject(allFiles, getProjectPath(project), "tsconfig.c.json", "tsconfig.c.json", getOutputFileStamps); - verifyWatchState(host, watch, expectedProgramFiles, expectedWatchedFiles, expectedWatchedDirectoriesRecursive, defaultDependencies); - }); - }); - describe("when config files are in side by side folders", () => { - verifyTransitiveReferences(/*multiFolder*/ true); - }); - }); - }); - }); - verifyTscWatch({ scenario, subScenario: "incremental updates in verbose mode", diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index 53d0748b09d..e5b27e97023 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -29,6 +29,7 @@ namespace ts { baselineSourceMap?: boolean; baselineReadFileCalls?: boolean; baselinePrograms?: boolean; + baselineDependencies?: boolean; } export type CommandLineProgram = [Program, EmitAndSemanticDiagnosticsBuilderProgram?]; @@ -73,7 +74,7 @@ namespace ts { const { scenario, subScenario, buildKind, commandLineArgs, modifyFs, - baselineSourceMap, baselineReadFileCalls, baselinePrograms + baselineSourceMap, baselineReadFileCalls, baselinePrograms, baselineDependencies } = input; if (modifyFs) modifyFs(inputFs); inputFs.makeReadonly(); @@ -110,7 +111,7 @@ namespace ts { sys.write(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}\n`); if (baselinePrograms) { const baseline: string[] = []; - tscWatch.baselinePrograms(baseline, getPrograms); + tscWatch.baselinePrograms(baseline, getPrograms, baselineDependencies); sys.write(baseline.join("\n")); } if (baselineReadFileCalls) { diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 982475010a2..9b67cb758c3 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -299,6 +299,7 @@ namespace ts.tscWatch { } export interface TscWatchCheckOptions { baselineSourceMap?: boolean; + baselineDependencies?: boolean; } export interface TscWatchCompileBase extends TscWatchCheckOptions { scenario: string; @@ -323,7 +324,7 @@ namespace ts.tscWatch { const { scenario, subScenario, commandLineArgs, changes, - baselineSourceMap + baselineSourceMap, baselineDependencies } = input; if (!isWatch(commandLineArgs)) sys.exit = exitCode => sys.exitCode = exitCode; @@ -342,6 +343,7 @@ namespace ts.tscWatch { oldSnap, getPrograms, baselineSourceMap, + baselineDependencies, changes, watchOrSolution }); @@ -381,7 +383,7 @@ namespace ts.tscWatch { export function runWatchBaseline({ scenario, subScenario, commandLineArgs, getPrograms, sys, baseline, oldSnap, - baselineSourceMap, + baselineSourceMap, baselineDependencies, changes, watchOrSolution }: RunWatchBaseline) { baseline.push(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}`); @@ -390,7 +392,8 @@ namespace ts.tscWatch { getPrograms, sys, oldSnap, - baselineSourceMap + baselineSourceMap, + baselineDependencies, }); for (const { caption, change, timeouts } of changes) { @@ -401,7 +404,8 @@ namespace ts.tscWatch { getPrograms, sys, oldSnap, - baselineSourceMap + baselineSourceMap, + baselineDependencies, }); } Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? @@ -420,10 +424,10 @@ namespace ts.tscWatch { export interface WatchBaseline extends Baseline, TscWatchCheckOptions { getPrograms: () => readonly CommandLineProgram[]; } - export function watchBaseline({ baseline, getPrograms, sys, oldSnap, baselineSourceMap }: WatchBaseline) { + export function watchBaseline({ baseline, getPrograms, sys, oldSnap, baselineSourceMap, baselineDependencies }: WatchBaseline) { if (baselineSourceMap) generateSourceMapBaselineFiles(sys); sys.serializeOutput(baseline); - const programs = baselinePrograms(baseline, getPrograms); + const programs = baselinePrograms(baseline, getPrograms, baselineDependencies); sys.serializeWatches(baseline); baseline.push(`exitCode:: ExitStatus.${ExitStatus[sys.exitCode as ExitStatus]}`, ""); sys.diff(baseline, oldSnap); @@ -434,15 +438,15 @@ namespace ts.tscWatch { return programs; } - export function baselinePrograms(baseline: string[], getPrograms: () => readonly CommandLineProgram[]) { + export function baselinePrograms(baseline: string[], getPrograms: () => readonly CommandLineProgram[], baselineDependencies: boolean | undefined) { const programs = getPrograms(); for (const program of programs) { - baselineProgram(baseline, program); + baselineProgram(baseline, program, baselineDependencies); } return programs; } - function baselineProgram(baseline: string[], [program, builderProgram]: CommandLineProgram) { + function baselineProgram(baseline: string[], [program, builderProgram]: CommandLineProgram, baselineDependencies: boolean | undefined) { const options = program.getCompilerOptions(); baseline.push(`Program root files: ${JSON.stringify(program.getRootFileNames())}`); baseline.push(`Program options: ${JSON.stringify(options)}`); @@ -466,6 +470,15 @@ namespace ts.tscWatch { baseline.push("No cached semantic diagnostics in the builder::"); } baseline.push(""); + if (!baselineDependencies) return; + baseline.push("Dependencies for::"); + for (const file of builderProgram.getSourceFiles()) { + baseline.push(`${file.fileName}:`); + for (const depenedency of builderProgram.getAllDependencies(file)) { + baseline.push(` ${depenedency}`); + } + } + baseline.push(""); } export interface VerifyTscWatch extends TscWatchCompile { @@ -492,4 +505,31 @@ namespace ts.tscWatch { const content = Debug.checkDefined(sys.readFile(file)); sys.writeFile(file, content.replace(searchValue, replaceValue)); } + + export function createSolutionBuilder(system: WatchedSystem, rootNames: readonly string[], defaultOptions?: BuildOptions) { + const host = createSolutionBuilderHost(system); + return ts.createSolutionBuilder(host, rootNames, defaultOptions || {}); + } + + export function ensureErrorFreeBuild(host: WatchedSystem, rootNames: readonly string[]) { + // ts build should succeed + const solutionBuilder = createSolutionBuilder(host, rootNames, {}); + solutionBuilder.build(); + assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); + } + + export function createSystemWithSolutionBuild(solutionRoots: readonly string[], files: readonly TestFSWithWatch.FileOrFolderOrSymLink[], params?: TestFSWithWatch.TestServerHostCreationParameters) { + const sys = createWatchedSystem(files, params); + const originalReadFile = sys.readFile; + const originalWrite = sys.write; + const originalWriteFile = sys.writeFile; + const solutionBuilder = createSolutionBuilder(TestFSWithWatch.changeToHostTrackingWrittenFiles( + fakes.patchHostForBuildInfoReadWrite(sys) + ), solutionRoots, {}); + solutionBuilder.build(); + sys.readFile = originalReadFile; + sys.write = originalWrite; + sys.writeFile = originalWriteFile; + return sys; + } } diff --git a/src/testRunner/unittests/tscWatch/projectsWithReferences.ts b/src/testRunner/unittests/tscWatch/projectsWithReferences.ts new file mode 100644 index 00000000000..9a2167bd048 --- /dev/null +++ b/src/testRunner/unittests/tscWatch/projectsWithReferences.ts @@ -0,0 +1,299 @@ +namespace ts.tscWatch { + describe("unittests:: tsc-watch:: projects with references: invoking when references are already built", () => { + verifyTscWatch({ + scenario: "projectsWithReferences", + subScenario: "on sample project", + sys: () => createSystemWithSolutionBuild( + ["tests"], + [ + libFile, + TestFSWithWatch.getTsBuildProjectFile("sample1", "core/tsconfig.json"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "core/index.ts"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "core/anotherModule.ts"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "core/some_decl.d.ts"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "logic/tsconfig.json"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "logic/index.ts"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "tests/tsconfig.json"), + TestFSWithWatch.getTsBuildProjectFile("sample1", "tests/index.ts"), + ], + { currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/sample1` } + ), + commandLineArgs: ["-w", "-p", "tests"], + changes: [ + { + caption: "local edit in logic ts, and build logic", + change: sys => { + sys.appendFile(TestFSWithWatch.getTsBuildProjectFilePath("sample1", "logic/index.ts"), `function foo() { }`); + const solutionBuilder = createSolutionBuilder(sys, ["logic"]); + solutionBuilder.build(); + }, + // not ideal, but currently because of d.ts but no new file is written + // There will be timeout queued even though file contents are same + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "non local edit in logic ts, and build logic", + change: sys => { + sys.appendFile(TestFSWithWatch.getTsBuildProjectFilePath("sample1", "logic/index.ts"), `export function gfoo() { }`); + const solutionBuilder = createSolutionBuilder(sys, ["logic"]); + solutionBuilder.build(); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "change in project reference config file builds correctly", + change: sys => { + sys.writeFile(TestFSWithWatch.getTsBuildProjectFilePath("sample1", "logic/tsconfig.json"), JSON.stringify({ + compilerOptions: { composite: true, declaration: true, declarationDir: "decls" }, + references: [{ path: "../core" }] + })); + const solutionBuilder = createSolutionBuilder(sys, ["logic"]); + solutionBuilder.build(); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + ], + baselineDependencies: true + }); + + function changeCompilerOpitonsPaths(sys: WatchedSystem, config: string, newPaths: object) { + const configJson = JSON.parse(sys.readFile(config)!); + configJson.compilerOptions.paths = newPaths; + sys.writeFile(config, JSON.stringify(configJson)); + } + + verifyTscWatch({ + scenario: "projectsWithReferences", + subScenario: "on transitive references", + sys: () => createSystemWithSolutionBuild( + ["tsconfig.c.json"], + [ + libFile, + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.a.json"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.b.json"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.c.json"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "a.ts"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "b.ts"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "c.ts"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "refs/a.d.ts"), + ], + { currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/transitiveReferences` } + ), + commandLineArgs: ["-w", "-p", "tsconfig.c.json"], + changes: [ + { + caption: "non local edit b ts, and build b", + change: sys => { + sys.appendFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b.ts"), `export function gfoo() { }`); + const solutionBuilder = createSolutionBuilder(sys, ["tsconfig.b.json"]); + solutionBuilder.build(); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "edit on config file", + change: sys => { + sys.ensureFileOrFolder({ + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "nrefs/a.d.ts"), + content: sys.readFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "refs/a.d.ts"))! + }); + changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.c.json"), { "@ref/*": ["./nrefs/*"] }); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert config file edit", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.c.json"), { "@ref/*": ["./refs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "edit in referenced config file", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.b.json"), { "@ref/*": ["./nrefs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert referenced config file edit", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.b.json"), { "@ref/*": ["./refs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "deleting referenced config file", + change: sys => sys.deleteFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.b.json")), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert deleting referenced config file", + change: sys => sys.ensureFileOrFolder(TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.b.json")), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "deleting transitively referenced config file", + change: sys => sys.deleteFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.a.json")), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert deleting transitively referenced config file", + change: sys => sys.ensureFileOrFolder(TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.a.json")), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + ], + baselineDependencies: true, + }); + + verifyTscWatch({ + scenario: "projectsWithReferences", + subScenario: "when referenced project uses different module resolution", + sys: () => createSystemWithSolutionBuild( + ["tsconfig.c.json"], + [ + libFile, + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.a.json"), + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "tsconfig.b.json"), + content: JSON.stringify({ + compilerOptions: { composite: true, moduleResolution: "classic" }, + files: ["b.ts"], + references: [{ path: "tsconfig.a.json" }] + }) + }, + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "tsconfig.c.json"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "a.ts"), + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b.ts"), + content: `import {A} from "a";export const b = new A();` + }, + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "c.ts"), + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "refs/a.d.ts"), + ], + { currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/transitiveReferences` } + ), + commandLineArgs: ["-w", "-p", "tsconfig.c.json"], + changes: emptyArray, + baselineDependencies: true, + }); + + verifyTscWatch({ + scenario: "projectsWithReferences", + subScenario: "on transitive references in different folders", + sys: () => createSystemWithSolutionBuild( + ["c"], + [ + libFile, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "a/tsconfig.json"), + content: JSON.stringify({ + compilerOptions: { composite: true }, + files: ["index.ts"] + }), + }, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/tsconfig.json"), + content: JSON.stringify({ + compilerOptions: { composite: true, baseUrl: "./", paths: { "@ref/*": ["../*"] } }, + files: ["index.ts"], + references: [{ path: `../a` }] + }), + }, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "c/tsconfig.json"), + content: JSON.stringify({ + compilerOptions: { baseUrl: "./", paths: { "@ref/*": ["../refs/*"] } }, + files: ["index.ts"], + references: [{ path: `../b` }] + }), + }, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "a/index.ts"), + content: `export class A {}`, + }, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/index.ts"), + content: `import {A} from '@ref/a'; +export const b = new A();`, + }, + { + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "c/index.ts"), + content: `import {b} from '../b'; +import {X} from "@ref/a"; +b; +X;`, + }, + TestFSWithWatch.getTsBuildProjectFile("transitiveReferences", "refs/a.d.ts"), + ], + { currentDirectory: `${TestFSWithWatch.tsbuildProjectsLocation}/transitiveReferences` } + ), + commandLineArgs: ["-w", "-p", "c"], + changes: [ + { + caption: "non local edit b ts, and build b", + change: sys => { + sys.appendFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/index.ts"), `export function gfoo() { }`); + const solutionBuilder = createSolutionBuilder(sys, ["b"]); + solutionBuilder.build(); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "edit on config file", + change: sys => { + sys.ensureFileOrFolder({ + path: TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "nrefs/a.d.ts"), + content: sys.readFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "refs/a.d.ts"))! + }); + changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "c/tsconfig.json"), { "@ref/*": ["../nrefs/*"] }); + }, + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert config file edit", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "c/tsconfig.json"), { "@ref/*": ["../refs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "edit in referenced config file", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/tsconfig.json"), { "@ref/*": ["../nrefs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "Revert referenced config file edit", + change: sys => changeCompilerOpitonsPaths(sys, TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/tsconfig.json"), { "@ref/*": ["../refs/*"] }), + timeouts: checkSingleTimeoutQueueLengthAndRun + }, + { + caption: "deleting referenced config file", + change: sys => sys.deleteFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/tsconfig.json")), + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(2) + }, + { + caption: "Revert deleting referenced config file", + change: sys => sys.writeFile( + TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "b/tsconfig.json"), + JSON.stringify({ + compilerOptions: { composite: true, baseUrl: "./", paths: { "@ref/*": ["../*"] } }, + files: ["index.ts"], + references: [{ path: `../a` }] + }) + ), + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(2) + }, + { + caption: "deleting transitively referenced config file", + change: sys => sys.deleteFile(TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "a/tsconfig.json")), + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(2) + }, + { + caption: "Revert deleting transitively referenced config file", + change: sys => sys.writeFile( + TestFSWithWatch.getTsBuildProjectFilePath("transitiveReferences", "a/tsconfig.json"), + JSON.stringify({ + compilerOptions: { composite: true }, + files: ["index.ts"] + }), + ), + timeouts: sys => sys.checkTimeoutQueueLengthAndRun(2) + }, + ], + baselineDependencies: true, + }); + }); +} \ No newline at end of file diff --git a/src/testRunner/unittests/tsserver/helpers.ts b/src/testRunner/unittests/tsserver/helpers.ts index f20efe386c0..1215aaa8798 100644 --- a/src/testRunner/unittests/tsserver/helpers.ts +++ b/src/testRunner/unittests/tsserver/helpers.ts @@ -440,6 +440,13 @@ namespace ts.projectSystem { return iterResult.value; } + export function checkOrphanScriptInfos(service: server.ProjectService, expectedFiles: readonly string[]) { + checkArray("Orphan ScriptInfos:", arrayFrom(mapDefinedIterator( + service.filenameToScriptInfo.values(), + v => v.containingProjects.length === 0 ? v.fileName : undefined + )), expectedFiles); + } + export function checkProjectActualFiles(project: server.Project, expectedFiles: readonly string[]) { checkArray(`${server.ProjectKind[project.projectKind]} project: ${project.getProjectName()}:: actual files`, project.getFileNames(), expectedFiles); } diff --git a/src/testRunner/unittests/tsserver/projectsWithReferences.ts b/src/testRunner/unittests/tsserver/projectsWithReferences.ts new file mode 100644 index 00000000000..e03d53b0493 --- /dev/null +++ b/src/testRunner/unittests/tsserver/projectsWithReferences.ts @@ -0,0 +1,287 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: projects with references: invoking when references are already built", () => { + it("on sample project", () => { + const coreConfig = TestFSWithWatch.getTsBuildProjectFile("sample1", "core/tsconfig.json"); + const coreIndex = TestFSWithWatch.getTsBuildProjectFile("sample1", "core/index.ts"); + const coreAnotherModule = TestFSWithWatch.getTsBuildProjectFile("sample1", "core/anotherModule.ts"); + const coreSomeDecl = TestFSWithWatch.getTsBuildProjectFile("sample1", "core/some_decl.d.ts"); + const logicConfig = TestFSWithWatch.getTsBuildProjectFile("sample1", "logic/tsconfig.json"); + const logicIndex = TestFSWithWatch.getTsBuildProjectFile("sample1", "logic/index.ts"); + const testsConfig = TestFSWithWatch.getTsBuildProjectFile("sample1", "tests/tsconfig.json"); + const testsIndex = TestFSWithWatch.getTsBuildProjectFile("sample1", "tests/index.ts"); + const host = createServerHost([libFile, coreConfig, coreIndex, coreAnotherModule, coreSomeDecl, logicConfig, logicIndex, testsConfig, testsIndex]); + const service = createProjectService(host); + service.openClientFile(testsIndex.path); + + checkWatchedFilesDetailed(host, [coreConfig, coreIndex, coreAnotherModule, logicConfig, logicIndex, testsConfig, libFile].map(f => f.path.toLowerCase()), 1); + checkWatchedDirectoriesDetailed(host, emptyArray, 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, getTypeRootsFromLocation(TestFSWithWatch.getTsBuildProjectFilePath("sample1", "tests")), 1, /*recursive*/ true); + + // local edit in ts file + host.appendFile(logicIndex.path, `function foo() {}`); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(testsConfig.path)!, [libFile.path, coreIndex.path, coreAnotherModule.path, logicIndex.path, testsIndex.path, testsConfig.path]); + + // non local edit in ts file + host.appendFile(logicIndex.path, `export function gfoo() {}`); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(testsConfig.path)!, [libFile.path, coreIndex.path, coreAnotherModule.path, logicIndex.path, testsIndex.path, testsConfig.path]); + + // change in project reference config file + host.writeFile(logicConfig.path, JSON.stringify({ + compilerOptions: { composite: true, declaration: true, declarationDir: "decls" }, + references: [{ path: "../core" }] + })); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(testsConfig.path)!, [libFile.path, coreIndex.path, coreAnotherModule.path, logicIndex.path, testsIndex.path, testsConfig.path]); + }); + + describe("on transitive references in different folders", () => { + function createService() { + const aConfig: File = { + path: `${tscWatch.projectRoot}/a/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { composite: true }, + files: ["index.ts"] + }), + }; + const bConfig: File = { + path: `${tscWatch.projectRoot}/b/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { composite: true, baseUrl: "./", paths: { "@ref/*": ["../*"] } }, + files: ["index.ts"], + references: [{ path: `../a` }] + }), + }; + const cConfig: File = { + path: `${tscWatch.projectRoot}/c/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { baseUrl: "./", paths: { "@ref/*": ["../refs/*"] } }, + files: ["index.ts"], + references: [{ path: `../b` }] + }), + }; + const aTs: File = { + path: `${tscWatch.projectRoot}/a/index.ts`, + content: `export class A {}`, + }; + const bTs: File = { + path: `${tscWatch.projectRoot}/b/index.ts`, + content: `import {A} from '@ref/a'; +export const b = new A();`, + }; + const cTs: File = { + path: `${tscWatch.projectRoot}/c/index.ts`, + content: `import {b} from '../b'; +import {X} from "@ref/a"; +b; +X;`, + }; + const refsTs: File = { + path: `${tscWatch.projectRoot}/refs/a.d.ts`, + content: `export class X {} +export class A {}` + }; + const host = createServerHost([libFile, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs]); + const service = createProjectService(host); + service.openClientFile(cTs.path); + return { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs }; + } + + it("non local edit", () => { + const { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs } = createService(); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + checkOrphanScriptInfos(service, emptyArray); + + // non local edit + host.appendFile(bTs.path, `export function gFoo() { }`); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + checkOrphanScriptInfos(service, emptyArray); + }); + + it("edit on config file", () => { + const { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs } = createService(); + const nRefsTs: File = { + path: `${tscWatch.projectRoot}/nrefs/a.d.ts`, + content: refsTs.content + }; + const cTsConfigJson = JSON.parse(cConfig.content); + host.ensureFileOrFolder(nRefsTs); + cTsConfigJson.compilerOptions.paths = { "@ref/*": ["../nrefs/*"] }; + host.writeFile(cConfig.path, JSON.stringify(cTsConfigJson)); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, nRefsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path, nRefsTs.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/nrefs`, // Failed lookup since nrefs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + // Script infos arent deleted till next file open + checkOrphanScriptInfos(service, [refsTs.path]); + + // revert the edit on config file + host.writeFile(cConfig.path, cConfig.content); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path, nRefsTs.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + // Script infos arent deleted till next file open + checkOrphanScriptInfos(service, [nRefsTs.path]); + }); + + it("edit in referenced config file", () => { + const { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs } = createService(); + const nRefsTs: File = { + path: `${tscWatch.projectRoot}/nrefs/a.d.ts`, + content: refsTs.content + }; + const bTsConfigJson = JSON.parse(bConfig.content); + host.ensureFileOrFolder(nRefsTs); + bTsConfigJson.compilerOptions.paths = { "@ref/*": ["../nrefs/*"] }; + host.writeFile(bConfig.path, JSON.stringify(bTsConfigJson)); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, refsTs.path, nRefsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path, nRefsTs.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + `${tscWatch.projectRoot}/nrefs`, // Failed lookup since nrefs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + // Script infos arent deleted till next file open + checkOrphanScriptInfos(service, [aTs.path]); + + // revert the edit on config file + host.writeFile(bConfig.path, bConfig.content); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path, nRefsTs.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + // Script infos arent deleted till next file open + checkOrphanScriptInfos(service, [nRefsTs.path]); + }); + + it("deleting referenced config file", () => { + const { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs } = createService(); + host.deleteFile(bConfig.path); + host.checkTimeoutQueueLengthAndRun(3); // Schedules failed lookup invalidation + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + // Script infos arent deleted till next file open + checkOrphanScriptInfos(service, [aTs.path, aConfig.path]); + + // revert + host.writeFile(bConfig.path, bConfig.content); + host.checkTimeoutQueueLengthAndRun(3); // Schedules failed lookup invalidation + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + checkOrphanScriptInfos(service, emptyArray); + }); + + it("deleting transitively referenced config file", () => { + const { host, service, aConfig, bConfig, cConfig, aTs, bTs, cTs, refsTs } = createService(); + host.deleteFile(aConfig.path); + host.checkTimeoutQueueLengthAndRun(3); // Schedules failed lookup invalidation + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + checkOrphanScriptInfos(service, emptyArray); + + // revert + host.writeFile(aConfig.path, aConfig.content); + host.checkTimeoutQueueLengthAndRun(3); // Schedules failed lookup invalidation + checkProjectActualFiles(service.configuredProjects.get(cConfig.path)!, [libFile.path, cTs.path, cConfig.path, bTs.path, aTs.path, refsTs.path]); + checkWatchedFilesDetailed(host, [libFile.path, aTs.path, bTs.path, refsTs.path, aConfig.path, bConfig.path, cConfig.path], 1); + checkWatchedDirectoriesDetailed(host, [ + tscWatch.projectRoot // watches for directories created for resolution of b + ], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [ + `${tscWatch.projectRoot}/a`, // Failed to package json + `${tscWatch.projectRoot}/b`, // Failed to package json + `${tscWatch.projectRoot}/refs`, // Failed lookup since refs/a.ts does not exist + ...getTypeRootsFromLocation(`${tscWatch.projectRoot}/c`) + ], 1, /*recursive*/ true); + checkOrphanScriptInfos(service, emptyArray); + }); + }); + }); +} \ No newline at end of file diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js new file mode 100644 index 00000000000..2979f415271 --- /dev/null +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js @@ -0,0 +1,1006 @@ +Input:: +//// [/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; } + +//// [/user/username/projects/sample1/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/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; } + + +//// [/user/username/projects/sample1/core/anotherModule.ts] +export const World = "hello"; + + +//// [/user/username/projects/sample1/core/some_decl.d.ts] +declare const dts: any; + + +//// [/user/username/projects/sample1/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/user/username/projects/sample1/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; + + +//// [/user/username/projects/sample1/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/user/username/projects/sample1/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; + + +//// [/user/username/projects/sample1/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; + + +//// [/user/username/projects/sample1/core/anotherModule.d.ts.map] +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} + +//// [/user/username/projects/sample1/core/anotherModule.d.ts] +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map + +//// [/user/username/projects/sample1/core/index.js] +"use strict"; +exports.__esModule = 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; + + +//// [/user/username/projects/sample1/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"} + +//// [/user/username/projects/sample1/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 + +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "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": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/sample1/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"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +exports.__esModule = 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 + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "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": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/sample1/tests/index.js] +"use strict"; +exports.__esModule = 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; + + +//// [/user/username/projects/sample1/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "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": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + +/a/lib/tsc.js -w -p tests +Output:: +>> Screen clear +[12:01:07 AM] Starting compilation in watch mode... + +[12:01:08 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"project":"/user/username/projects/sample1/tests","configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/sample1/core/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.d.ts: + /user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts: + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts: + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/tests/index.ts: + /user/username/projects/sample1/tests/index.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/index.d.ts + +WatchedFiles:: +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.d.ts: + {"fileName":"/user/username/projects/sample1/core/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/logic/index.d.ts: + {"fileName":"/user/username/projects/sample1/logic/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.d.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/tests/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/tests/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: local edit in logic ts, and build logic + +Input:: +//// [/user/username/projects/sample1/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; +function foo() { } + +//// [/user/username/projects/sample1/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;AACrB,SAAS,GAAG,KAAK,CAAC"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +exports.__esModule = 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; +function foo() { } +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.d.ts] file written with same contents +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-4111660551-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\nfunction foo() { }", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:23 AM] File change detected. Starting incremental compilation... + +[12:01:24 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"project":"/user/username/projects/sample1/tests","configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/sample1/core/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.d.ts: + /user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts: + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts: + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/tests/index.ts: + /user/username/projects/sample1/tests/index.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/index.d.ts + +WatchedFiles:: +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.d.ts: + {"fileName":"/user/username/projects/sample1/core/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/logic/index.d.ts: + {"fileName":"/user/username/projects/sample1/logic/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.d.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/tests/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/tests/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: non local edit in logic ts, and build logic + +Input:: +//// [/user/username/projects/sample1/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; +function foo() { }export function gfoo() { } + +//// [/user/username/projects/sample1/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;AACrB,SAAS,GAAG,KAAK,CAAC;AAAA,SAAgB,IAAI,KAAK,CAAC;AAA1B,oBAA0B"} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +exports.__esModule = true; +exports.gfoo = 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; +function foo() { } +function gfoo() { } +exports.gfoo = gfoo; +//# sourceMappingURL=index.js.map + +//// [/user/username/projects/sample1/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; +export declare function gfoo(): void; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-380817803-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\nfunction foo() { }export function gfoo() { }", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:39 AM] File change detected. Starting incremental compilation... + +[12:01:49 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"project":"/user/username/projects/sample1/tests","configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/sample1/core/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.d.ts: + /user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts: + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/index.d.ts: + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/tests/index.ts: + /user/username/projects/sample1/tests/index.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/index.d.ts + /user/username/projects/sample1/core/index.d.ts + +WatchedFiles:: +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.d.ts: + {"fileName":"/user/username/projects/sample1/core/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/logic/index.d.ts: + {"fileName":"/user/username/projects/sample1/logic/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.d.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/tests/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/tests/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file written with same contents +//// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/index.d.ts": { + "version": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "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": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Change:: change in project reference config file builds correctly + +Input:: +//// [/user/username/projects/sample1/logic/tsconfig.json] +{"compilerOptions":{"composite":true,"declaration":true,"declarationDir":"decls"},"references":[{"path":"../core"}]} + +//// [/user/username/projects/sample1/logic/index.js] +"use strict"; +exports.__esModule = true; +exports.gfoo = 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; +function foo() { } +function gfoo() { } +exports.gfoo = gfoo; + + +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-380817803-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\nfunction foo() { }export function gfoo() { }", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./decls", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/sample1/logic/decls/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; +export declare function gfoo(): void; + + + +Output:: +>> Screen clear +[12:02:04 AM] File change detected. Starting incremental compilation... + +[12:02:14 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/sample1/tests/index.ts"] +Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"project":"/user/username/projects/sample1/tests","configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/decls/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/sample1/logic/decls/index.d.ts +/user/username/projects/sample1/tests/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/sample1/core/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/decls/index.d.ts + /user/username/projects/sample1/tests/index.ts +/user/username/projects/sample1/core/index.d.ts: + /user/username/projects/sample1/core/index.d.ts +/user/username/projects/sample1/core/anotherModule.d.ts: + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/logic/decls/index.d.ts: + /user/username/projects/sample1/logic/decls/index.d.ts + /user/username/projects/sample1/core/anotherModule.d.ts +/user/username/projects/sample1/tests/index.ts: + /user/username/projects/sample1/tests/index.ts + /user/username/projects/sample1/core/anotherModule.d.ts + /user/username/projects/sample1/logic/decls/index.d.ts + /user/username/projects/sample1/core/index.d.ts + +WatchedFiles:: +/user/username/projects/sample1/tests/tsconfig.json: + {"fileName":"/user/username/projects/sample1/tests/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/core/tsconfig.json: + {"fileName":"/user/username/projects/sample1/core/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/logic/tsconfig.json: + {"fileName":"/user/username/projects/sample1/logic/tsconfig.json","pollingInterval":250} +/user/username/projects/sample1/tests/index.ts: + {"fileName":"/user/username/projects/sample1/tests/index.ts","pollingInterval":250} +/user/username/projects/sample1/core/index.d.ts: + {"fileName":"/user/username/projects/sample1/core/index.d.ts","pollingInterval":250} +/user/username/projects/sample1/core/anothermodule.d.ts: + {"fileName":"/user/username/projects/sample1/core/anotherModule.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/sample1/logic/decls/index.d.ts: + {"fileName":"/user/username/projects/sample1/logic/decls/index.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/sample1/tests/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/tests/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/sample1/node_modules/@types: + {"directoryName":"/user/username/projects/sample1/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/sample1/tests/index.js] file written with same contents +//// [/user/username/projects/sample1/tests/index.d.ts] file written with same contents +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "affectsGlobalScope": false + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "affectsGlobalScope": false + }, + "../logic/decls/index.d.ts": { + "version": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "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": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true, + "watch": true, + "project": "./", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/decls/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/decls/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js new file mode 100644 index 00000000000..ec10651a272 --- /dev/null +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js @@ -0,0 +1,1083 @@ +Input:: +//// [/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; } + +//// [/user/username/projects/transitiveReferences/a/tsconfig.json] +{"compilerOptions":{"composite":true},"files":["index.ts"]} + +//// [/user/username/projects/transitiveReferences/b/tsconfig.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../*"]}},"files":["index.ts"],"references":[{"path":"../a"}]} + +//// [/user/username/projects/transitiveReferences/c/tsconfig.json] +{"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"files":["index.ts"],"references":[{"path":"../b"}]} + +//// [/user/username/projects/transitiveReferences/a/index.ts] +export class A {} + +//// [/user/username/projects/transitiveReferences/b/index.ts] +import {A} from '@ref/a'; +export const b = new A(); + +//// [/user/username/projects/transitiveReferences/c/index.ts] +import {b} from '../b'; +import {X} from "@ref/a"; +b; +X; + +//// [/user/username/projects/transitiveReferences/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/user/username/projects/transitiveReferences/a/index.js] +"use strict"; +exports.__esModule = true; +exports.A = void 0; +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +exports.A = A; + + +//// [/user/username/projects/transitiveReferences/a/index.d.ts] +export declare class A { +} + + +//// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "-7264743946-export class A {}", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "configFilePath": "./tsconfig.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/b/index.js] +"use strict"; +exports.__esModule = true; +exports.b = void 0; +var a_1 = require("@ref/a"); +exports.b = new a_1.A(); + + +//// [/user/username/projects/transitiveReferences/b/index.d.ts] +import { A } from '@ref/a'; +export declare const b: A; + + +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "-2591036212-import {A} from '@ref/a';\nexport const b = new A();", + "signature": "-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ + "../*" + ] + }, + "pathsBasePath": "/user/username/projects/transitiveReferences/b", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/c/index.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("../b"); +var a_1 = require("@ref/a"); +b_1.b; +a_1.X; + + + +/a/lib/tsc.js -w -p c +Output:: +>> Screen clear +[12:00:53 AM] Starting compilation in watch mode... + +[12:00:57 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: non local edit b ts, and build b + +Input:: +//// [/user/username/projects/transitiveReferences/b/index.ts] +import {A} from '@ref/a'; +export const b = new A();export function gfoo() { } + +//// [/user/username/projects/transitiveReferences/b/index.js] +"use strict"; +exports.__esModule = true; +exports.gfoo = exports.b = void 0; +var a_1 = require("@ref/a"); +exports.b = new a_1.A(); +function gfoo() { } +exports.gfoo = gfoo; + + +//// [/user/username/projects/transitiveReferences/b/index.d.ts] +import { A } from '@ref/a'; +export declare const b: A; +export declare function gfoo(): void; + + +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + }, + "./index.ts": { + "version": "1841609480-import {A} from '@ref/a';\nexport const b = new A();export function gfoo() { }", + "signature": "4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ + "../*" + ] + }, + "pathsBasePath": "/user/username/projects/transitiveReferences/b", + "configFilePath": "./tsconfig.json" + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:09 AM] File change detected. Starting incremental compilation... + +[12:01:13 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: edit on config file + +Input:: +//// [/user/username/projects/transitiveReferences/c/tsconfig.json] +{"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../nrefs/*"]}},"files":["index.ts"],"references":[{"path":"../b"}]} + +//// [/user/username/projects/transitiveReferences/nrefs/a.d.ts] +export class X {} +export class A {} + + + +Output:: +>> Screen clear +[12:01:21 AM] File change detected. Starting incremental compilation... + +[12:01:25 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../nrefs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts: + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/nrefs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/nrefs/a.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/nrefs: + {"directoryName":"/user/username/projects/transitiveReferences/nrefs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: Revert config file edit + +Input:: +//// [/user/username/projects/transitiveReferences/c/tsconfig.json] +{"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"files":["index.ts"],"references":[{"path":"../b"}]} + + +Output:: +>> Screen clear +[12:01:29 AM] File change detected. Starting incremental compilation... + +[12:01:33 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: edit in referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/b/tsconfig.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../nrefs/*"]}},"files":["index.ts"],"references":[{"path":"../a"}]} + + +Output:: +>> Screen clear +[12:01:37 AM] File change detected. Starting incremental compilation... + +[12:01:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts: + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/nrefs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/nrefs/a.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/nrefs: + {"directoryName":"/user/username/projects/transitiveReferences/nrefs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Revert referenced config file edit + +Input:: +//// [/user/username/projects/transitiveReferences/b/tsconfig.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"files":["index.ts"],"references":[{"path":"../a"}]} + + +Output:: +>> Screen clear +[12:01:42 AM] File change detected. Starting incremental compilation... + +[12:01:43 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b/index.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: deleting referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/b/tsconfig.json] deleted + +Output:: +>> Screen clear +[12:01:45 AM] File change detected. Starting incremental compilation... + +c/tsconfig.json:1:105 - error TS6053: File '/user/username/projects/transitiveReferences/b' not found. + +1 {"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"files":["index.ts"],"references":[{"path":"../b"}]} +   ~~~~~~~~~~~~~~~ + +[12:01:52 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b/index.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b/index.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b/index.ts: + /user/username/projects/transitiveReferences/b/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitivereferences/b/tsconfig.json","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/b/index.js] file written with same contents +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: Revert deleting referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/b/tsconfig.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../*"]}},"files":["index.ts"],"references":[{"path":"../a"}]} + + +Output:: +>> Screen clear +[12:01:55 AM] File change detected. Starting incremental compilation... + +[12:01:59 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c/index.js] file written with same contents + +Change:: deleting transitively referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/a/tsconfig.json] deleted + +Output:: +>> Screen clear +[12:02:01 AM] File change detected. Starting incremental compilation... + +b/tsconfig.json:1:117 - error TS6053: File '/user/username/projects/transitiveReferences/a' not found. + +1 {"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../*"]}},"files":["index.ts"],"references":[{"path":"../a"}]} +   ~~~~~~~~~~~~~~~ + +[12:02:05 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a/index.ts +/user/username/projects/transitiveReferences/b/index.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.ts: + /user/username/projects/transitiveReferences/a/index.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitivereferences/a/tsconfig.json","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/a/index.js] file written with same contents + +Change:: Revert deleting transitively referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/a/tsconfig.json] +{"compilerOptions":{"composite":true},"files":["index.ts"]} + + +Output:: +>> Screen clear +[12:02:08 AM] File change detected. Starting incremental compilation... + +[12:02:09 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c/index.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences/c","paths":{"@ref/*":["../refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences/c","watch":true,"project":"/user/username/projects/transitiveReferences/c","configFilePath":"/user/username/projects/transitiveReferences/c/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts +/user/username/projects/transitiveReferences/c/index.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c/index.ts +/user/username/projects/transitiveReferences/a/index.d.ts: + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/b/index.d.ts: + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c/index.ts: + /user/username/projects/transitiveReferences/c/index.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b/index.d.ts + /user/username/projects/transitiveReferences/a/index.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/c/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/c/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/c/index.ts: + {"fileName":"/user/username/projects/transitiveReferences/c/index.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/b/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/b/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b/index.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a/tsconfig.json: + {"fileName":"/user/username/projects/transitiveReferences/a/tsconfig.json","pollingInterval":250} +/user/username/projects/transitivereferences/a/index.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a/index.d.ts","pollingInterval":250} + +FsWatches:: +/user/username/projects/transitivereferences: + {"directoryName":"/user/username/projects/transitiveReferences","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/b: + {"directoryName":"/user/username/projects/transitiveReferences/b","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/c/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/c/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/a: + {"directoryName":"/user/username/projects/transitiveReferences/a","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js new file mode 100644 index 00000000000..255332a5695 --- /dev/null +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js @@ -0,0 +1,1046 @@ +Input:: +//// [/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; } + +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] +{ + "compilerOptions": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ "./*" ] + } + }, + "files": [ "b.ts" ], + "references": [ { "path": "tsconfig.a.json" } ] +} + + +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + +//// [/user/username/projects/transitiveReferences/a.ts] +export class A {} + + +//// [/user/username/projects/transitiveReferences/b.ts] +import {A} from '@ref/a'; +export const b = new A(); + + +//// [/user/username/projects/transitiveReferences/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/user/username/projects/transitiveReferences/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/user/username/projects/transitiveReferences/a.js] +"use strict"; +exports.__esModule = true; +exports.A = void 0; +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +exports.A = A; + + +//// [/user/username/projects/transitiveReferences/a.d.ts] +export declare class A { +} + + +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-8566332115-export class A {}\r\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "configFilePath": "./tsconfig.a.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/b.js] +"use strict"; +exports.__esModule = true; +exports.b = void 0; +var a_1 = require("@ref/a"); +exports.b = new a_1.A(); + + +//// [/user/username/projects/transitiveReferences/b.d.ts] +import { A } from '@ref/a'; +export declare const b: A; + + +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + }, + "./b.ts": { + "version": "-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n", + "signature": "-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ + "./*" + ] + }, + "pathsBasePath": "/user/username/projects/transitiveReferences", + "configFilePath": "./tsconfig.b.json" + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/c.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var a_1 = require("@ref/a"); +b_1.b; +a_1.X; + + + +/a/lib/tsc.js -w -p tsconfig.c.json +Output:: +>> Screen clear +[12:00:47 AM] Starting compilation in watch mode... + +[12:00:51 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: non local edit b ts, and build b + +Input:: +//// [/user/username/projects/transitiveReferences/b.ts] +import {A} from '@ref/a'; +export const b = new A(); +export function gfoo() { } + +//// [/user/username/projects/transitiveReferences/b.js] +"use strict"; +exports.__esModule = true; +exports.gfoo = exports.b = void 0; +var a_1 = require("@ref/a"); +exports.b = new a_1.A(); +function gfoo() { } +exports.gfoo = gfoo; + + +//// [/user/username/projects/transitiveReferences/b.d.ts] +import { A } from '@ref/a'; +export declare const b: A; +export declare function gfoo(): void; + + +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + }, + "./b.ts": { + "version": "-23418138964-import {A} from '@ref/a';\r\nexport const b = new A();\r\nexport function gfoo() { }", + "signature": "4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ + "./*" + ] + }, + "pathsBasePath": "/user/username/projects/transitiveReferences", + "configFilePath": "./tsconfig.b.json" + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion" +} + + +Output:: +>> Screen clear +[12:01:03 AM] File change detected. Starting incremental compilation... + +[12:01:07 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: edit on config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] +{"files":["c.ts"],"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["./nrefs/*"]}},"references":[{"path":"tsconfig.b.json"}]} + +//// [/user/username/projects/transitiveReferences/nrefs/a.d.ts] +export class X {} +export class A {} + + + +Output:: +>> Screen clear +[12:01:15 AM] File change detected. Starting incremental compilation... + +[12:01:19 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./nrefs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts: + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/nrefs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/nrefs/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/nrefs: + {"directoryName":"/user/username/projects/transitiveReferences/nrefs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: Revert config file edit + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] +{"files":["c.ts"],"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["./refs/*"]}},"references":[{"path":"tsconfig.b.json"}]} + + +Output:: +>> Screen clear +[12:01:23 AM] File change detected. Starting incremental compilation... + +[12:01:27 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: edit in referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["./nrefs/*"]}},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + + +Output:: +>> Screen clear +[12:01:31 AM] File change detected. Starting incremental compilation... + +[12:01:32 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/nrefs/a.d.ts: + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/nrefs/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/nrefs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/nrefs/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/nrefs: + {"directoryName":"/user/username/projects/transitiveReferences/nrefs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: Revert referenced config file edit + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] +{"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["./refs/*"]}},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + + +Output:: +>> Screen clear +[12:01:36 AM] File change detected. Starting incremental compilation... + +[12:01:37 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + + +Change:: deleting referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] deleted + +Output:: +>> Screen clear +[12:01:39 AM] File change detected. Starting incremental compilation... + +tsconfig.c.json:1:100 - error TS6053: File '/user/username/projects/transitiveReferences/tsconfig.b.json' not found. + +1 {"files":["c.ts"],"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["./refs/*"]}},"references":[{"path":"tsconfig.b.json"}]} +   ~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[12:01:46 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/b.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/b.ts: + /user/username/projects/transitiveReferences/b.ts + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitivereferences/tsconfig.b.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/b.js] file written with same contents +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: Revert deleting referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] +{ + "compilerOptions": { + "composite": true, + "baseUrl": "./", + "paths": { + "@ref/*": [ "./*" ] + } + }, + "files": [ "b.ts" ], + "references": [ { "path": "tsconfig.a.json" } ] +} + + + +Output:: +>> Screen clear +[12:01:49 AM] File change detected. Starting incremental compilation... + +[12:01:53 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents + +Change:: deleting transitively referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] deleted + +Output:: +>> Screen clear +[12:01:55 AM] File change detected. Starting incremental compilation... + +tsconfig.b.json:10:21 - error TS6053: File '/user/username/projects/transitiveReferences/tsconfig.a.json' not found. + +10 "references": [ { "path": "tsconfig.a.json" } ] +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[12:01:59 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a.ts +/user/username/projects/transitiveReferences/b.d.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.ts: + /user/username/projects/transitiveReferences/a.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitivereferences/tsconfig.a.json","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/a.js] file written with same contents + +Change:: Revert deleting transitively referenced config file + +Input:: +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + + +Output:: +>> Screen clear +[12:02:02 AM] File change detected. Starting incremental compilation... + +[12:02:03 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js new file mode 100644 index 00000000000..a7a14a05251 --- /dev/null +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js @@ -0,0 +1,240 @@ +Input:: +//// [/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; } + +//// [/user/username/projects/transitiveReferences/tsconfig.a.json] +{"compilerOptions": {"composite": true}, "files": ["a.ts"]} + + +//// [/user/username/projects/transitiveReferences/tsconfig.b.json] +{"compilerOptions":{"composite":true,"moduleResolution":"classic"},"files":["b.ts"],"references":[{"path":"tsconfig.a.json"}]} + +//// [/user/username/projects/transitiveReferences/tsconfig.c.json] +{ + "files": [ "c.ts" ], + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@ref/*": [ "./refs/*" ] + } + }, + "references": [ { "path": "tsconfig.b.json" } ] +} + + +//// [/user/username/projects/transitiveReferences/a.ts] +export class A {} + + +//// [/user/username/projects/transitiveReferences/b.ts] +import {A} from "a";export const b = new A(); + +//// [/user/username/projects/transitiveReferences/c.ts] +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; + +//// [/user/username/projects/transitiveReferences/refs/a.d.ts] +export class X {} +export class A {} + + +//// [/user/username/projects/transitiveReferences/a.js] +"use strict"; +exports.__esModule = true; +exports.A = void 0; +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +exports.A = A; + + +//// [/user/username/projects/transitiveReferences/a.d.ts] +export declare class A { +} + + +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-8566332115-export class A {}\r\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "configFilePath": "./tsconfig.a.json" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/b.js] +"use strict"; +exports.__esModule = true; +exports.b = void 0; +var a_1 = require("a"); +exports.b = new a_1.A(); + + +//// [/user/username/projects/transitiveReferences/b.d.ts] +import { A } from "a"; +export declare const b: A; + + +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] +{ + "program": { + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-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; }", + "signature": "-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; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n", + "affectsGlobalScope": false + }, + "./b.ts": { + "version": "-19869990292-import {A} from \"a\";export const b = new A();", + "signature": "1870369234-import { A } from \"a\";\nexport declare const b: A;\n", + "affectsGlobalScope": false + } + }, + "options": { + "composite": true, + "moduleResolution": 1, + "configFilePath": "./tsconfig.b.json" + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion" +} + +//// [/user/username/projects/transitiveReferences/c.js] +"use strict"; +exports.__esModule = true; +var b_1 = require("./b"); +var a_1 = require("@ref/a"); +b_1.b; +a_1.X; + + + +/a/lib/tsc.js -w -p tsconfig.c.json +Output:: +>> Screen clear +[12:00:47 AM] Starting compilation in watch mode... + +[12:00:51 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/transitiveReferences/c.ts"] +Program options: {"baseUrl":"/user/username/projects/transitiveReferences","paths":{"@ref/*":["./refs/*"]},"pathsBasePath":"/user/username/projects/transitiveReferences","watch":true,"project":"/user/username/projects/transitiveReferences/tsconfig.c.json","configFilePath":"/user/username/projects/transitiveReferences/tsconfig.c.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts + +Dependencies for:: +/a/lib/lib.d.ts: + /a/lib/lib.d.ts + /user/username/projects/transitiveReferences/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/c.ts +/user/username/projects/transitiveReferences/a.d.ts: + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/b.d.ts: + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts +/user/username/projects/transitiveReferences/refs/a.d.ts: + /user/username/projects/transitiveReferences/refs/a.d.ts +/user/username/projects/transitiveReferences/c.ts: + /user/username/projects/transitiveReferences/c.ts + /user/username/projects/transitiveReferences/refs/a.d.ts + /user/username/projects/transitiveReferences/b.d.ts + /user/username/projects/transitiveReferences/a.d.ts + +WatchedFiles:: +/user/username/projects/transitivereferences/tsconfig.c.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.c.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.b.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.b.json","pollingInterval":250} +/user/username/projects/transitivereferences/tsconfig.a.json: + {"fileName":"/user/username/projects/transitiveReferences/tsconfig.a.json","pollingInterval":250} +/user/username/projects/transitivereferences/c.ts: + {"fileName":"/user/username/projects/transitiveReferences/c.ts","pollingInterval":250} +/user/username/projects/transitivereferences/b.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/b.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/a.d.ts","pollingInterval":250} +/user/username/projects/transitivereferences/refs/a.d.ts: + {"fileName":"/user/username/projects/transitiveReferences/refs/a.d.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/transitivereferences/refs: + {"directoryName":"/user/username/projects/transitiveReferences/refs","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/transitivereferences/node_modules/@types: + {"directoryName":"/user/username/projects/transitiveReferences/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/transitiveReferences/c.js] file written with same contents