diff --git a/src/compiler/program.ts b/src/compiler/program.ts index a8a076ea49c..7f7303dd867 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -3962,6 +3962,9 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } (filesWithReferencesProcessed ??= new Set()).add(file.path); } + else { + host.onSourceFileNotCreated?.(sourceFileOptions); + } return file; } diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index 66263c33c1f..1f4a1765c72 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -7,6 +7,7 @@ import { CompilerOptions, createModeAwareCache, createModuleResolutionCache, + CreateSourceFileOptions, createTypeReferenceDirectiveResolutionCache, createTypeReferenceResolutionLoader, Debug, @@ -53,7 +54,6 @@ import { noopFileWatcher, normalizePath, packageIdToString, - PackageJsonInfoCacheEntry, parseNodeModuleFromPath, Path, PathPathComponents, @@ -111,6 +111,7 @@ export interface ResolutionCache extends Required>; resolutionsWithFailedLookups: Set; resolutionsWithOnlyAffectingLocations: Set; + packageJsonRefCount: Map; directoryWatchesOfFailedLookups: Map; fileWatchesOfAffectingLocations: Map; packageDirWatchers: Map; @@ -693,6 +694,8 @@ export function createResolutionCache( let resolutionsResolvedWithGlobalCache = 0; let resolutionsResolvedWithoutGlobalCache = 0; + const packageJsonRefCount = new Map(); + let potentiallyUnwatchedPackageJsons: Set | undefined; const directoryWatchesOfFailedLookups = new Map(); const fileWatchesOfAffectingLocations = new Map(); const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory); @@ -718,6 +721,7 @@ export function createResolutionCache( resolvedFileToResolution, resolutionsWithFailedLookups, resolutionsWithOnlyAffectingLocations, + packageJsonRefCount, directoryWatchesOfFailedLookups, fileWatchesOfAffectingLocations, packageDirWatchers, @@ -734,6 +738,7 @@ export function createResolutionCache( resolveTypeReferenceDirectiveReferences, onReusedModuleResolutions, onReusedTypeReferenceDirectiveResolutions, + onSourceFileNotCreated, resolveLibrary, resolveSingleModuleNameWithoutWatching, removeResolutionsFromProjectReferenceRedirects, @@ -754,9 +759,11 @@ export function createResolutionCache( function clear() { potentiallyUnreferencedResolutions = undefined; potentiallyUnreferencedDirWatchers = undefined; + potentiallyUnwatchedPackageJsons = undefined; newUnresolvedResolutionCachePassResolutions = undefined; clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf); clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf); + packageJsonRefCount.clear(); isSymlinkCache.clear(); packageDirWatchers.clear(); dirPathToSymlinkPackageRefCount.clear(); @@ -890,6 +897,8 @@ export function createResolutionCache( potentiallyUnreferencedResolutions = undefined; } hasChangedAutomaticTypeDirectiveNames = false; + potentiallyUnwatchedPackageJsons?.forEach(releasePotentiallyUnwatchedPackageJson); + potentiallyUnwatchedPackageJsons = undefined; if (!skipCacheCompact) compactCaches(newProgram); moduleResolutionCache.isReadonly = true; typeReferenceDirectiveResolutionCache.isReadonly = true; @@ -954,13 +963,37 @@ export function createResolutionCache( } } + function releasePotentiallyUnwatchedPackageJson(path: Path) { + if (!packageJsonRefCount.has(path)) moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()?.delete(path); + } + + function releasePackageJsonCachePath(path: Path) { + moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()?.delete(path); + packageJsonRefCount.delete(path); + } + + function releasePackageJson(path: Path) { + const existing = packageJsonRefCount.get(path)!; + if (existing !== 1) packageJsonRefCount.set(path, existing - 1); + else releasePackageJsonCachePath(path); + } + + function addRefToPackageJson(path: Path) { + packageJsonRefCount.set(path, (packageJsonRefCount.get(path) ?? 0) + 1); + } + function closeFileWatcherOfAffectingLocation(watcher: FileWatcherOfAffectingLocation, path: string) { if (watcher.files === 0 && watcher.resolutions === 0 && !watcher.symlinks?.size) { fileWatchesOfAffectingLocations.delete(path); + releasePackageJson(resolutionHost.toPath(path)); watcher.watcher.close(); } } + function onSourceFileNotCreated(sourceFileOptions: CreateSourceFileOptions) { + sourceFileOptions.packageJsonLocations?.forEach(addToPotentiallyUnwatchedPackageJsons); + } + function getValidResolution(resolution: T | undefined) { return isInvalidatedResolution(resolution) ? undefined : resolution; } @@ -1301,6 +1334,14 @@ export function createResolutionCache( watchFailedLookupLocationOfResolution(resolution); watchAffectingLocationsOfResolution(resolution); if (!firstTime) return; + if (resolution.globalCacheResolution && !resolution.globalCacheResolution.resolution.resolvedModule) { + // Add to potentially unreferenced resolutions + resolution.globalCacheResolution.resolution.failedLookupLocations?.forEach( + addToPotentiallyUnwatchedPackageJsonsIfPackageJson, + ); + if (resolution.globalCacheResolution.resolution.alternateResult) addToPotentiallyUnwatchedPackageJsonsIfPackageJson(resolution.globalCacheResolution.resolution.alternateResult); + resolution.globalCacheResolution.resolution.affectingLocations?.forEach(addToPotentiallyUnwatchedPackageJsons); + } if (isResolvedWithGlobalCachePass(resolution)) resolutionsResolvedWithGlobalCache++; else if (isResolvedWithoutGlobalCachePass(resolution)) resolutionsResolvedWithoutGlobalCache++; const resolved = getResolutionWithResolvedFileName(resolution); @@ -1312,8 +1353,17 @@ export function createResolutionCache( } } + function addToPotentiallyUnwatchedPackageJsonsIfPackageJson(location: string) { + if (endsWith(location, "/package.json")) addToPotentiallyUnwatchedPackageJsons(location); + } + + function addToPotentiallyUnwatchedPackageJsons(location: string) { + (potentiallyUnwatchedPackageJsons ??= new Set()).add(resolutionHost.toPath(location)); + } + function watchFailedLookupLocation(failedLookupLocation: string) { const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + if (endsWith(failedLookupLocationPath, "/package.json")) addRefToPackageJson(failedLookupLocationPath); const toWatch = getDirectoryToWatchFailedLookupLocation( failedLookupLocation, failedLookupLocationPath, @@ -1398,7 +1448,7 @@ export function createResolutionCache( watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => { cachedDirectoryStructureHost?.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind); - invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()); + invalidateAffectingFileWatcher(locationToWatch); resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); }) : noopFileWatcher, resolutions: isSymlink ? 0 : resolutions, @@ -1406,6 +1456,7 @@ export function createResolutionCache( symlinks: undefined, }; fileWatchesOfAffectingLocations.set(locationToWatch, watcher); + addRefToPackageJson(resolutionHost.toPath(locationToWatch)); if (isSymlink) symlinkWatcher = watcher; } if (isSymlink) { @@ -1417,6 +1468,7 @@ export function createResolutionCache( // Close symlink watcher if no ref if (symlinkWatcher?.symlinks?.delete(affectingLocation) && !symlinkWatcher.symlinks.size && !symlinkWatcher.resolutions && !symlinkWatcher.files) { fileWatchesOfAffectingLocations.delete(locationToWatch); + releasePackageJson(resolutionHost.toPath(locationToWatch)); symlinkWatcher.watcher.close(); } }, @@ -1426,16 +1478,17 @@ export function createResolutionCache( symlinks: undefined, }; fileWatchesOfAffectingLocations.set(affectingLocation, watcher); + addRefToPackageJson(resolutionHost.toPath(affectingLocation)); (symlinkWatcher.symlinks ??= new Set()).add(affectingLocation); } } - function invalidateAffectingFileWatcher(path: string, packageJsonMap: Map | undefined) { + function invalidateAffectingFileWatcher(path: string) { const watcher = fileWatchesOfAffectingLocations.get(path); if (watcher?.resolutions) (affectingPathChecks ??= new Set()).add(path); if (watcher?.files) (affectingPathChecksForFile ??= new Set()).add(path); - watcher?.symlinks?.forEach(path => invalidateAffectingFileWatcher(path, packageJsonMap)); - packageJsonMap?.delete(resolutionHost.toPath(path)); + moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()?.delete(resolutionHost.toPath(path)); + watcher?.symlinks?.forEach(path => invalidateAffectingFileWatcher(path)); } function createDirectoryWatcherForPackageDir( @@ -1523,6 +1576,7 @@ export function createResolutionCache( function stopWatchFailedLookupLocation(failedLookupLocation: string) { const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + if (endsWith(failedLookupLocationPath, "/package.json")) releasePackageJson(failedLookupLocationPath); const toWatch = getDirectoryToWatchFailedLookupLocation( failedLookupLocation, failedLookupLocationPath, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index a62581fe12b..017dc2304c8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -8134,6 +8134,7 @@ export interface CompilerHostSupportingResolutionCache { redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, ): void; + onSourceFileNotCreated?(sourceFileOptions: CreateSourceFileOptions): void; } /** @internal */ export interface CompilerHost extends CompilerHostSupportingResolutionCache { diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 9efca1f8692..6a00fa119c2 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -524,6 +524,7 @@ export function createWatchProgram(host: WatchCompiler getDirectoryPath(getNormalizedAbsolutePath(configFileName, currentDirectory)) : currentDirectory, ); + compilerHost.onSourceFileNotCreated = resolutionCache.onSourceFileNotCreated.bind(resolutionCache); // Resolve module using host module resolution strategy if provided otherwise use resolution cache to resolve module names compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); diff --git a/src/harness/incrementalUtils.ts b/src/harness/incrementalUtils.ts index 3aa0848b871..98f81c0a871 100644 --- a/src/harness/incrementalUtils.ts +++ b/src/harness/incrementalUtils.ts @@ -435,6 +435,7 @@ export function verifyResolutionCache( // Verify that caches are same: forEachModuleOrTypeRefOrLibCache((cache, cacheType) => verifyModuleOrTypeResolutionCache(cache, actual[cacheType], cacheType)); + verifyPackageJsonWatchInfo(); // Stop watching resolutions to verify everything gets closed. expected.startCachingPerDirectoryResolution(); @@ -453,6 +454,11 @@ export function verifyResolutionCache( ts.Debug.assert(expected.countResolutionsResolvedWithGlobalCache() === 0, `${projectName}:: ResolutionsResolvedWithGlobalCache should be cleared`); ts.Debug.assert(expected.countResolutionsResolvedWithoutGlobalCache() === 0, `${projectName}:: ResolutionsResolvedWithoutGlobalCache should be cleared`); forEachModuleOrTypeRefOrLibCache((cache, cacheType) => verifyModuleOrTypeResolutionCacheIsEmpty(cache, cacheType, /*compacted*/ false)); + ts.Debug.assert(expected.packageJsonRefCount.size === 0, `${projectName}:: packageJsonRefCount should be cleared`); + ts.Debug.assert( + expected.moduleResolutionCache.getPackageJsonInfoCache().getInternalMap() === undefined || expected.moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()!.size === 0, + `${projectName}:: Shouldnt have any packageJson entries`, + ); expected.compactCaches(/*newProgram*/ undefined); forEachModuleOrTypeRefOrLibCache((cache, cacheType) => verifyModuleOrTypeResolutionCacheIsEmpty(cache, cacheType, /*compacted*/ true)); @@ -803,6 +809,32 @@ export function verifyResolutionCache( } }); } + + function verifyPackageJsonWatchInfo() { + verifyMap( + expected.packageJsonRefCount, + actual.packageJsonRefCount, + (expectedRefCount, actualRefCount, caption) => + ts.Debug.assert( + expectedRefCount === actualRefCount, + `${projectName}:: ${caption}`, + ), + "packageJsonRefCount", + ); + verifyMap( + actual.packageJsonRefCount, + actual.moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(), + (refCount, packageJsonCacheEntry, caption) => { + // Ok to have refcount on entry not in cache + if (!packageJsonCacheEntry) return; + ts.Debug.assert( + !!refCount, + `${projectName}:: ${caption}:: expected ref count on packageJson as there is entry in the cache`, + ); + }, + "Package Json cache watched", + ); + } } function verifyMap( diff --git a/src/server/project.ts b/src/server/project.ts index 7e35446c478..7e30d4faced 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -24,6 +24,7 @@ import { createCacheableExportInfoMap, createLanguageService, createResolutionCache, + CreateSourceFileOptions, createSymlinkCache, Debug, Diagnostic, @@ -884,6 +885,11 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo return this.resolutionCache.resolveLibrary(libraryName, resolveFrom, options, libFileName); } + /** @internal */ + onSourceFileNotCreated(sourceFileOptions: CreateSourceFileOptions): void { + this.resolutionCache.onSourceFileNotCreated(sourceFileOptions); + } + directoryExists(path: string): boolean { return this.directoryStructureHost.directoryExists!(path); // TODO: GH#18217 } diff --git a/src/services/services.ts b/src/services/services.ts index 529629908dc..98ec9af4d02 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1762,6 +1762,7 @@ export function createLanguageService( onReusedModuleResolutions: maybeBind(host, host.onReusedModuleResolutions), onReusedTypeReferenceDirectiveResolutions: maybeBind(host, host.onReusedTypeReferenceDirectiveResolutions), resolveLibrary: maybeBind(host, host.resolveLibrary), + onSourceFileNotCreated: maybeBind(host, host.onSourceFileNotCreated), useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), getParsedCommandLine, jsDocParsingMode: host.jsDocParsingMode, diff --git a/tests/baselines/reference/tscWatch/libraryResolution/with-config.js b/tests/baselines/reference/tscWatch/libraryResolution/with-config.js index 608e095c31d..d6891f39817 100644 --- a/tests/baselines/reference/tscWatch/libraryResolution/with-config.js +++ b/tests/baselines/reference/tscWatch/libraryResolution/with-config.js @@ -1981,13 +1981,13 @@ File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts' Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/node_modules/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. -File '/home/src/package.json' does not exist according to earlier cached lookups. -File '/home/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts 250 undefined Source file FileWatcher:: Close:: WatchInfo: /home/src/tslibs/TS/Lib/lib.dom.d.ts 250 undefined Source file FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json 2000 undefined File location affecting resolution diff --git a/tests/baselines/reference/tscWatch/libraryResolution/without-config.js b/tests/baselines/reference/tscWatch/libraryResolution/without-config.js index 9979946d8fc..a219cc58052 100644 --- a/tests/baselines/reference/tscWatch/libraryResolution/without-config.js +++ b/tests/baselines/reference/tscWatch/libraryResolution/without-config.js @@ -1108,13 +1108,13 @@ File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index. Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. ======== Module name '@typescript/lib-webworker' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts'. ======== File '/home/src/workspace/projects/node_modules/@typescript/lib-webworker/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/node_modules/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. -File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. -File '/home/src/package.json' does not exist according to earlier cached lookups. -File '/home/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist. +File '/home/src/workspace/projects/node_modules/package.json' does not exist. +File '/home/src/workspace/projects/package.json' does not exist. +File '/home/src/workspace/package.json' does not exist. +File '/home/src/package.json' does not exist. +File '/home/package.json' does not exist. +File '/package.json' does not exist. FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/@typescript/lib-webworker/index.d.ts 250 undefined Source file Reusing resolution of module '@typescript/lib-scripthost' from '/home/src/workspace/projects/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts' of old program, it was not resolved. Reusing resolution of module '@typescript/lib-es5' from '/home/src/workspace/projects/__lib_node_modules_lookup_lib.es5.d.ts__.ts' of old program, it was not resolved. diff --git a/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js b/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js index 7c2b35aa338..892ddf75c79 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js @@ -843,9 +843,9 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/package.json' does not exist. -File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -File '/user/username/package.json' does not exist according to earlier cached lookups. -File '/user/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited.js b/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited.js index 999b8632ccc..20d01c59c57 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/package-json-file-is-edited.js @@ -847,9 +847,9 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/package.json' does not exist. -File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -File '/user/username/package.json' does not exist according to earlier cached lookups. -File '/user/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. File '/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js index 18866d36b1a..ef76add0726 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-with-nodenext.js @@ -951,7 +951,7 @@ File '/user/username/projects/package.json' does not exist according to earlier File '/user/username/package.json' does not exist according to earlier cached lookups. File '/user/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -File '/user/username/projects/transitiveReferences/refs/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/transitiveReferences/refs/package.json' does not exist. File '/user/username/projects/transitiveReferences/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/package.json' does not exist according to earlier cached lookups. File '/user/username/package.json' does not exist according to earlier cached lookups. @@ -1150,7 +1150,7 @@ File '/package.json' does not exist according to earlier cached lookups. Using compiler options of project reference redirect '/user/username/projects/transitiveReferences/tsconfig.b.json'. Module resolution kind is not specified, using 'NodeNext'. ======== Module name '@ref/a' was successfully resolved to '/user/username/projects/transitiveReferences/nrefs/a.d.ts'. ======== -File '/user/username/projects/transitiveReferences/nrefs/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/transitiveReferences/nrefs/package.json' does not exist. File '/user/username/projects/transitiveReferences/package.json' does not exist according to earlier cached lookups. File '/user/username/projects/package.json' does not exist according to earlier cached lookups. File '/user/username/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tscWatch/resolutionCache/project-with-package-json-scope.js b/tests/baselines/reference/tscWatch/resolutionCache/project-with-package-json-scope.js index 14c4ca569b7..92eb4414ec6 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/project-with-package-json-scope.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/project-with-package-json-scope.js @@ -5192,7 +5192,7 @@ File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/src/package.json' does not exist according to earlier cached lookups. File '/home/src/workspaces/project/package.json' does not exist. -File '/home/src/workspaces/package.json' does not exist according to earlier cached lookups. +File '/home/src/workspaces/package.json' does not exist. File '/home/src/package.json' does not exist according to earlier cached lookups. File '/home/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js index cccd33afa40..41cd9db7b60 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Linux.js @@ -1318,13 +1318,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js index 42858df577a..b94325883c1 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-MacOs.js @@ -1241,13 +1241,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Windows.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Windows.js index dc8338bdbe4..0f7013611e3 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Windows.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-Windows.js @@ -1181,13 +1181,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js index 108acd88572..444e0c666f2 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Linux.js @@ -1039,13 +1039,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js index ace8c8c1c9e..3d6a747945a 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-MacOs.js @@ -1025,13 +1025,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Windows.js b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Windows.js index b137a8ed138..92f364acd38 100644 --- a/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Windows.js +++ b/tests/baselines/reference/tscWatch/symlinks/packages-outside-project-folder-built-Windows.js @@ -965,13 +965,15 @@ Module resolution kind is not specified, using 'Node10'. Loading module 'c' from 'node_modules' folder, target file types: TypeScript, Declaration. Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. Directory '/home/src/projects/a/1/a-impl/a/lib/node_modules' does not exist, skipping all lookups in it. -File '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json' exists according to earlier cached lookups. +Found 'package.json' at '/home/src/projects/a/1/a-impl/a/node_modules/c/package.json'. File '/home/src/projects/a/1/a-impl/a/node_modules/c.ts' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.tsx' does not exist. File '/home/src/projects/a/1/a-impl/a/node_modules/c.d.ts' does not exist. +'package.json' does not have a 'typesVersions' field. 'package.json' does not have a 'typings' field. 'package.json' has 'types' field './lib/index.d.ts' that references '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts'. File '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts' exists - use it as a name resolution result. +'package.json' does not have a 'peerDependencies' field. Resolving real path for '/home/src/projects/a/1/a-impl/a/node_modules/c/lib/index.d.ts', result '/home/src/projects/c/3/c-impl/c/lib/index.d.ts'. ======== Module name 'c' was successfully resolved to '/home/src/projects/c/3/c-impl/c/lib/index.d.ts' with Package ID 'c/lib/index.d.ts@1.0.0'. ======== DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/a/1/a-impl/a/lib/node_modules 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tsserver/libraryResolution/with-config.js b/tests/baselines/reference/tsserver/libraryResolution/with-config.js index b5e4387b118..1a5a08f5fd4 100644 --- a/tests/baselines/reference/tsserver/libraryResolution/with-config.js +++ b/tests/baselines/reference/tsserver/libraryResolution/with-config.js @@ -1756,13 +1756,13 @@ Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/@typesc Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts', result '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. Info seq [hh:mm:ss:mss] ======== Module name '@typescript/lib-dom' was successfully resolved to '/home/src/workspace/projects/node_modules/@typescript/lib-dom/index.d.ts'. ======== Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/workspace/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/@typescript/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/node_modules/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspace/projects/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/workspace/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/package.json' does not exist. Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/@typescript/lib-dom/package.json 2000 undefined Project: /home/src/workspace/projects/project1/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/@typescript/package.json 2000 undefined Project: /home/src/workspace/projects/project1/tsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/workspace/projects/node_modules/package.json 2000 undefined Project: /home/src/workspace/projects/project1/tsconfig.json WatchType: File location affecting resolution diff --git a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js index f251d52652a..0b6f9d797a3 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js +++ b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited-when-package-json-with-type-module-exists.js @@ -1206,9 +1206,9 @@ Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to e Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' does not exist. -Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js index 46644fdcd54..072496a95a5 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js +++ b/tests/baselines/reference/tsserver/moduleResolution/package-json-file-is-edited.js @@ -1192,9 +1192,9 @@ Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to e Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' does not exist. -Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/user/username/projects/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/user/username/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/user/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project-built.js b/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project-built.js index 047341cfa31..e556a8e9bcd 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project-built.js +++ b/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project-built.js @@ -1169,12 +1169,13 @@ Info seq [hh:mm:ss:mss] Searching all ancestor node_modules directories for pre Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/package-b/src/node_modules' does not exist, skipping all lookups in it. Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/package-b/node_modules' does not exist, skipping all lookups in it. Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/node_modules' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/package.json' exists according to earlier cached lookups. +Info seq [hh:mm:ss:mss] Found 'package.json' at '/home/src/projects/project/node_modules/package-a/package.json'. Info seq [hh:mm:ss:mss] Using 'exports' subpath '.' with target './build/index.js'. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/package-a/build/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.tsx' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] 'package.json' does not have a 'peerDependencies' field. Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/projects/project/node_modules/package-a/build/index.d.ts', result '/home/src/projects/project/packages/package-a/build/index.d.ts'. Info seq [hh:mm:ss:mss] ======== Module name 'package-a' was successfully resolved to '/home/src/projects/project/packages/package-a/build/index.d.ts' with Package ID 'package-a/build/index.d.ts@1.0.0'. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package-b/package-a 1 undefined Project: /home/src/projects/project/packages/package-b/tsconfig.json WatchType: Failed Lookup Locations @@ -1192,7 +1193,7 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.d.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.js' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.jsx' does not exist. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/index.ts' exists - use it as a name resolution result. Info seq [hh:mm:ss:mss] ======== Module name './subfolder' was successfully resolved to '/home/src/projects/project/packages/package-a/src/subfolder/index.ts'. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package-a 1 undefined Project: /home/src/projects/project/packages/package-b/tsconfig.json WatchType: Failed Lookup Locations diff --git a/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project.js b/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project.js index 11068af057b..4347c027262 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project.js +++ b/tests/baselines/reference/tsserver/moduleResolution/using-referenced-project.js @@ -986,12 +986,13 @@ Info seq [hh:mm:ss:mss] Searching all ancestor node_modules directories for pre Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/package-b/src/node_modules' does not exist, skipping all lookups in it. Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/package-b/node_modules' does not exist, skipping all lookups in it. Info seq [hh:mm:ss:mss] Directory '/home/src/projects/project/packages/node_modules' does not exist, skipping all lookups in it. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/package.json' exists according to earlier cached lookups. +Info seq [hh:mm:ss:mss] Found 'package.json' at '/home/src/projects/project/node_modules/package-a/package.json'. Info seq [hh:mm:ss:mss] Using 'exports' subpath '.' with target './build/index.js'. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/package-a/build/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.tsx' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/package-a/build/index.d.ts' exists - use it as a name resolution result. +Info seq [hh:mm:ss:mss] 'package.json' does not have a 'peerDependencies' field. Info seq [hh:mm:ss:mss] Resolving real path for '/home/src/projects/project/node_modules/package-a/build/index.d.ts', result '/home/src/projects/project/packages/package-a/build/index.d.ts'. Info seq [hh:mm:ss:mss] ======== Module name 'package-a' was successfully resolved to '/home/src/projects/project/packages/package-a/build/index.d.ts' with Package ID 'package-a/build/index.d.ts@1.0.0'. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package-b/package-a 1 undefined Project: /home/src/projects/project/packages/package-b/tsconfig.json WatchType: Failed Lookup Locations @@ -1009,7 +1010,7 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.d.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.js' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder.jsx' does not exist. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/packages/package-a/src/subfolder/index.ts' exists - use it as a name resolution result. Info seq [hh:mm:ss:mss] ======== Module name './subfolder' was successfully resolved to '/home/src/projects/project/packages/package-a/src/subfolder/index.ts'. ======== Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package-a 1 undefined Project: /home/src/projects/project/packages/package-b/tsconfig.json WatchType: Failed Lookup Locations diff --git a/tests/baselines/reference/tsserver/resolutionCache/project-with-package-json-scope.js b/tests/baselines/reference/tsserver/resolutionCache/project-with-package-json-scope.js index ed0cfc99c5e..78242b4244e 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/project-with-package-json-scope.js +++ b/tests/baselines/reference/tsserver/resolutionCache/project-with-package-json-scope.js @@ -2845,7 +2845,7 @@ Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to e Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/src/workspaces/project/package.json' does not exist. -Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/workspaces/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/home/package.json' does not exist according to earlier cached lookups. Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. diff --git a/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-when-typing-installer-installs-typing.js b/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-when-typing-installer-installs-typing.js index 3504db46892..75460ecfb6c 100644 --- a/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-when-typing-installer-installs-typing.js +++ b/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-when-typing-installer-installs-typing.js @@ -913,12 +913,12 @@ Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/node_modules/bar/in Info seq [hh:mm:ss:mss] Resolving real path for '/users/user/projects/project1/node_modules/bar/index.js', result '/users/user/projects/project1/node_modules/bar/index.js'. Info seq [hh:mm:ss:mss] ======== Module name 'bar' was successfully resolved to '/users/user/projects/project1/node_modules/bar/index.js'. ======== Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/node_modules/bar/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/user/projects/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/user/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/users/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/node_modules/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/users/user/projects/project1/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/users/user/projects/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/users/user/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/users/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/package.json' does not exist. Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/user/projects/project1/node_modules/bar/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/user/projects/project1/node_modules/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/user/projects/project1/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution @@ -1152,15 +1152,15 @@ Info seq [hh:mm:ss:mss] Resolving real path for '/users/user/projects/project1/ Info seq [hh:mm:ss:mss] ======== Module name 'bar' was successfully resolved to '/users/user/projects/project1/node_modules/bar/index.js'. ======== Info seq [hh:mm:ss:mss] Auto discovery for typings is enabled in project '/users/user/projects/project1/jsconfig.json'. Running extra resolution pass for module 'bar' using cache location '/home/src/Library/Caches/typescript'. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/bar.d.ts' does not exist. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar.d.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules 1 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules 1 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/package.json' exists according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/package.json' does not exist. +Info seq [hh:mm:ss:mss] Found 'package.json' at '/home/src/Library/Caches/typescript/package.json'. Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/@types/bar/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/@types/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution diff --git a/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-with-already-aquired-typing.js b/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-with-already-aquired-typing.js index b7e8afdb66b..aee9d50d0da 100644 --- a/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-with-already-aquired-typing.js +++ b/tests/baselines/reference/tsserver/typeAquisition/changes-to-typeAquisition-with-already-aquired-typing.js @@ -858,15 +858,15 @@ Info seq [hh:mm:ss:mss] Resolving real path for '/users/user/projects/project1/ Info seq [hh:mm:ss:mss] ======== Module name 'bar' was successfully resolved to '/users/user/projects/project1/node_modules/bar/index.js'. ======== Info seq [hh:mm:ss:mss] Auto discovery for typings is enabled in project '/users/user/projects/project1/jsconfig.json'. Running extra resolution pass for module 'bar' using cache location '/home/src/Library/Caches/typescript'. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/bar.d.ts' does not exist. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar.d.ts' does not exist. Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules 1 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules 1 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: Failed Lookup Locations Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/bar/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/package.json' does not exist according to earlier cached lookups. -Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/package.json' exists according to earlier cached lookups. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/@types/package.json' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/Library/Caches/typescript/node_modules/package.json' does not exist. +Info seq [hh:mm:ss:mss] Found 'package.json' at '/home/src/Library/Caches/typescript/package.json'. Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/@types/bar/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/@types/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /home/src/Library/Caches/typescript/node_modules/package.json 2000 undefined Project: /users/user/projects/project1/jsconfig.json WatchType: File location affecting resolution