diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c0395bdfea0a4..e146cce88c8cb 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4547,7 +4547,7 @@ "category": "Message", "code": 6094 }, - "Loading module as file / folder, candidate module location '{0}', target file type '{1}'.": { + "Loading module as file / folder, candidate module location '{0}', target file types: {1}.": { "category": "Message", "code": 6095 }, @@ -4559,7 +4559,7 @@ "category": "Message", "code": 6097 }, - "Loading module '{0}' from 'node_modules' folder, target file type '{1}'.": { + "Loading module '{0}' from 'node_modules' folder, target file types: {1}.": { "category": "Message", "code": 6098 }, diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 59605a7ddb423..191997ecde4bb 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -8,7 +8,7 @@ import { getEmitModuleResolutionKind, getModeForUsageLocation, getNormalizedAbsolutePath, getOwnKeys, getPathComponents, getPathFromPathComponents, getPathsBasePath, getPossibleOriginalInputExtensionForExtension, getRelativePathFromDirectory, getRootLength, hasJSFileExtension, hasProperty, hasTrailingDirectorySeparator, - hasTSFileExtension, hostGetCanonicalFileName, isArray, isExternalModuleNameRelative, isRootedDiskPath, isString, + hostGetCanonicalFileName, isArray, isExternalModuleNameRelative, isRootedDiskPath, isString, isStringLiteralLike, lastOrUndefined, length, MapLike, matchedText, MatchingKeys, matchPatternOrExact, ModuleKind, ModuleResolutionHost, ModuleResolutionKind, noop, noopPush, normalizePath, normalizeSlashes, optionsHaveModuleResolutionChanges, PackageId, packageIdToString, ParsedCommandLine, Path, pathIsRelative, Pattern, @@ -16,8 +16,8 @@ import { ResolutionMode, ResolvedModuleWithFailedLookupLocations, ResolvedProjectReference, ResolvedTypeReferenceDirective, ResolvedTypeReferenceDirectiveWithFailedLookupLocations, some, sort, SourceFile, startsWith, stringContains, - StringLiteralLike, supportedTSExtensionsFlat, toFileNameLowerCase, toPath, tryExtractTSExtension, tryGetExtensionFromPath, - tryParsePatterns, tryRemoveExtension, version, Version, versionMajorMinor, VersionRange, + StringLiteralLike, supportedDeclarationExtensions, supportedTSImplementationExtensions, toFileNameLowerCase, toPath, tryExtractTSExtension, tryGetExtensionFromPath, + tryParsePatterns, version, Version, versionMajorMinor, VersionRange, } from "./_namespaces/ts"; /** @internal */ @@ -83,15 +83,23 @@ interface PathAndExtension { /** * Kinds of file that we are currently looking for. - * Typically there is one pass with Extensions.TypeScript, then a second pass with Extensions.JavaScript. */ -enum Extensions { - TypeScript, /** '.ts', '.tsx', or '.d.ts' */ - JavaScript, /** '.js' or '.jsx' */ - Json, /** '.json' */ - TSConfig, /** '.json' with `tsconfig` used instead of `index` */ - DtsOnly, /** Only '.d.ts' */ - TsOnly, /** '.[cm]tsx?' but not .d.ts variants */ +const enum Extensions { + TypeScript = 1 << 0, // '.ts', '.tsx', '.mts', '.cts' + JavaScript = 1 << 1, // '.js', '.jsx', '.mjs', '.cjs' + Declaration = 1 << 2, // '.d.ts', etc. + Json = 1 << 3, // '.json' + + ImplementationFiles = TypeScript | JavaScript, +} + +function formatExtensions(extensions: Extensions) { + const result: string[] = []; + if (extensions & Extensions.TypeScript) result.push("TypeScript"); + if (extensions & Extensions.JavaScript) result.push("JavaScript"); + if (extensions & Extensions.Declaration) result.push("Declaration"); + if (extensions & Extensions.Json) result.push("JSON"); + return result.join(", "); } interface PathAndPackageId { @@ -141,6 +149,7 @@ export interface ModuleResolutionState { conditions: readonly string[]; requestContainingDirectory: string | undefined; reportDiagnostic: DiagnosticReporter; + isConfigLookup: boolean; } /** Just the fields that we use for module resolution. @@ -403,6 +412,7 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string conditions, requestContainingDirectory: containingDirectory, reportDiagnostic: diag => void diagnostics.push(diag), + isConfigLookup: false, }; let resolved = primaryLookup(); let primary = true; @@ -456,7 +466,7 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); } return resolvedTypeScriptOnly( - loadNodeModuleFromDirectory(Extensions.DtsOnly, candidate, + loadNodeModuleFromDirectory(Extensions.Declaration, candidate, !directoryExists, moduleResolutionState)); }); } @@ -477,12 +487,12 @@ export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string } let result: Resolved | undefined; if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { - const searchResult = loadModuleFromNearestNodeModulesDirectory(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, /*cache*/ undefined, /*redirectedReference*/ undefined); + const searchResult = loadModuleFromNearestNodeModulesDirectory(Extensions.Declaration, typeReferenceDirectiveName, initialLocationForSecondaryLookup, moduleResolutionState, /*cache*/ undefined, /*redirectedReference*/ undefined); result = searchResult && searchResult.value; } else { const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName); - result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true); + result = nodeLoadModuleByRelativeName(Extensions.Declaration, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true); } return resolvedTypeScriptOnly(result); } @@ -1341,45 +1351,51 @@ function nodeNextModuleNameResolver(moduleName: string, containingFile: string, ); } -const jsOnlyExtensions = [Extensions.JavaScript]; -const tsExtensions = [Extensions.TypeScript, Extensions.JavaScript]; -const tsPlusJsonExtensions = [...tsExtensions, Extensions.Json]; -const tsconfigExtensions = [Extensions.TSConfig]; function nodeNextModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations { const containingDirectory = getDirectoryPath(containingFile); // es module file or cjs-like input file, use a variant of the legacy cjs resolver that supports the selected modern features const esmMode = resolutionMode === ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0; - let extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions; + let extensions = compilerOptions.noDtsResolution ? Extensions.ImplementationFiles : Extensions.TypeScript | Extensions.JavaScript | Extensions.Declaration; if (compilerOptions.resolveJsonModule) { - extensions = [...extensions, Extensions.Json]; + extensions |= Extensions.Json; } - return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference); + return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, /*isConfigLookup*/ false, redirectedReference); } function tryResolveJSModuleWorker(moduleName: string, initialDir: string, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { - return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined); + return nodeModuleNameResolverWorker( + NodeResolutionFeatures.None, + moduleName, + initialDir, + { moduleResolution: ModuleResolutionKind.NodeJs, allowJs: true }, + host, + /*cache*/ undefined, + Extensions.JavaScript, + /*isConfigLookup*/ false, + /*redirectedReferences*/ undefined); } export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; /** @internal */ export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, lookupConfig?: boolean): ResolvedModuleWithFailedLookupLocations; // eslint-disable-line @typescript-eslint/unified-signatures -export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, lookupConfig?: boolean): ResolvedModuleWithFailedLookupLocations { +export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, isConfigLookup?: boolean): ResolvedModuleWithFailedLookupLocations { let extensions; - if (lookupConfig) { - extensions = tsconfigExtensions; + if (isConfigLookup) { + extensions = Extensions.Json; } else if (compilerOptions.noDtsResolution) { - extensions = [Extensions.TsOnly]; - if (compilerOptions.allowJs) extensions.push(Extensions.JavaScript); - if (compilerOptions.resolveJsonModule) extensions.push(Extensions.Json); + extensions = Extensions.ImplementationFiles; + if (compilerOptions.resolveJsonModule) extensions |= Extensions.Json; } else { - extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions; + extensions = compilerOptions.resolveJsonModule + ? Extensions.TypeScript | Extensions.JavaScript | Extensions.Declaration | Extensions.Json + : Extensions.TypeScript | Extensions.JavaScript | Extensions.Declaration; } - return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference); + return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference); } -function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions[], redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations { +function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleName: string, containingDirectory: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache: ModuleResolutionCache | undefined, extensions: Extensions, isConfigLookup: boolean, redirectedReference: ResolvedProjectReference | undefined): ResolvedModuleWithFailedLookupLocations { const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations: string[] = []; @@ -1403,13 +1419,26 @@ function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleNa conditions, requestContainingDirectory: containingDirectory, reportDiagnostic: diag => void diagnostics.push(diag), + isConfigLookup, }; if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) <= ModuleResolutionKind.NodeNext) { trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & NodeResolutionFeatures.EsmMode ? "ESM" : "CJS", conditions.map(c => `'${c}'`).join(", ")); } - const result = forEach(extensions, ext => tryResolve(ext)); + let result; + if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs) { + const priorityExtensions = extensions & (Extensions.TypeScript | Extensions.Declaration); + const secondaryExtensions = extensions & ~(Extensions.TypeScript | Extensions.Declaration); + result = + priorityExtensions && tryResolve(priorityExtensions) || + secondaryExtensions && tryResolve(secondaryExtensions) || + undefined; + } + else { + result = tryResolve(extensions); + } + return createResolvedModuleWithFailedLookupLocations( result?.value?.resolved, result?.value?.isExternalLibraryImport, @@ -1436,7 +1465,7 @@ function nodeModuleNameResolverWorker(features: NodeResolutionFeatures, moduleNa } if (!resolved) { if (traceEnabled) { - trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName, Extensions[extensions]); + trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions)); } resolved = loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, containingDirectory, state, cache, redirectedReference); } @@ -1491,7 +1520,7 @@ function realPath(path: string, host: ModuleResolutionHost, traceEnabled: boolea function nodeLoadModuleByRelativeName(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState, considerPackageJson: boolean): Resolved | undefined { if (state.traceEnabled) { - trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); + trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions)); } if (!hasTrailingDirectorySeparator(candidate)) { if (!onlyRecordFailures) { @@ -1576,13 +1605,13 @@ function loadModuleFromFileNoPackageId(extensions: Extensions, candidate: string * in cases when we know upfront that all load attempts will fail (because containing folder does not exists) however we still need to record all failed lookup locations. */ function loadModuleFromFile(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { - if (extensions === Extensions.Json || extensions === Extensions.TSConfig) { - const extensionLess = tryRemoveExtension(candidate, Extension.Json); - const extension = extensionLess ? candidate.substring(extensionLess.length) : ""; - return (extensionLess === undefined && extensions === Extensions.Json) ? undefined : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state); + // ./foo.js -> ./foo.ts + const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); + if (resolvedByReplacingExtension) { + return resolvedByReplacingExtension; } - // esm mode resolutions don't include automatic extension lookup (without additional flags, at least) + // ./foo -> ./foo.ts if (!(state.features & NodeResolutionFeatures.EsmMode)) { // First, try adding an extension. An import of "foo" could be matched by a file "foo.ts", or "foo.js" by "foo.js.ts" const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state); @@ -1590,14 +1619,12 @@ function loadModuleFromFile(extensions: Extensions, candidate: string, onlyRecor return resolvedByAddingExtension; } } - - return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); } function loadModuleFromFileNoImplicitExtensions(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { // If that didn't work, try stripping a ".js" or ".jsx" extension and replacing it with a TypeScript one; // e.g. "./foo.js" can be matched by "./foo.ts" or "./foo.d.ts" - if (hasJSFileExtension(candidate) || (fileExtensionIs(candidate, Extension.Json) && state.compilerOptions.resolveJsonModule)) { + if (hasJSFileExtension(candidate) || extensions & Extensions.Json && fileExtensionIs(candidate, Extension.Json)) { const extensionless = removeFileExtension(candidate); const extension = candidate.substring(extensionless.length); if (state.traceEnabled) { @@ -1608,7 +1635,9 @@ function loadModuleFromFileNoImplicitExtensions(extensions: Extensions, candidat } function loadJSOrExactTSFileName(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { - if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) { + if (extensions & Extensions.TypeScript && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || + extensions & Extensions.Declaration && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions) + ) { const result = tryFile(candidate, onlyRecordFailures, state); return result !== undefined ? { path: candidate, ext: tryExtractTSExtension(candidate) as Extension } : undefined; } @@ -1626,58 +1655,41 @@ function tryAddingExtensions(candidate: string, extensions: Extensions, original } } - switch (extensions) { - case Extensions.DtsOnly: - switch (originalExtension) { - case Extension.Mjs: - case Extension.Mts: - case Extension.Dmts: - return tryExtension(Extension.Dmts); - case Extension.Cjs: - case Extension.Cts: - case Extension.Dcts: - return tryExtension(Extension.Dcts); - case Extension.Json: - candidate += Extension.Json; - return tryExtension(Extension.Dts); - default: return tryExtension(Extension.Dts); + switch (originalExtension) { + case Extension.Mjs: + case Extension.Mts: + case Extension.Dmts: + return extensions & Extensions.TypeScript && tryExtension(Extension.Mts) + || extensions & Extensions.Declaration && tryExtension(Extension.Dmts) + || extensions & Extensions.JavaScript && tryExtension(Extension.Mjs) + || undefined; + case Extension.Cjs: + case Extension.Cts: + case Extension.Dcts: + return extensions & Extensions.TypeScript && tryExtension(Extension.Cts) + || extensions & Extensions.Declaration && tryExtension(Extension.Dcts) + || extensions & Extensions.JavaScript && tryExtension(Extension.Cjs) + || undefined; + case Extension.Json: + const originalCandidate = candidate; + if (extensions & Extensions.Declaration) { + candidate += Extension.Json; + const result = tryExtension(Extension.Dts); + if (result) return result; } - case Extensions.TypeScript: - case Extensions.TsOnly: - const useDts = extensions === Extensions.TypeScript; - switch (originalExtension) { - case Extension.Mjs: - case Extension.Mts: - case Extension.Dmts: - return tryExtension(Extension.Mts) || (useDts ? tryExtension(Extension.Dmts) : undefined); - case Extension.Cjs: - case Extension.Cts: - case Extension.Dcts: - return tryExtension(Extension.Cts) || (useDts ? tryExtension(Extension.Dcts) : undefined); - case Extension.Json: - candidate += Extension.Json; - return useDts ? tryExtension(Extension.Dts) : undefined; - default: - return tryExtension(Extension.Ts) || tryExtension(Extension.Tsx) || (useDts ? tryExtension(Extension.Dts) : undefined); + if (extensions & Extensions.Json) { + candidate = originalCandidate; + const result = tryExtension(Extension.Json); + if (result) return result; } - case Extensions.JavaScript: - switch (originalExtension) { - case Extension.Mjs: - case Extension.Mts: - case Extension.Dmts: - return tryExtension(Extension.Mjs); - case Extension.Cjs: - case Extension.Cts: - case Extension.Dcts: - return tryExtension(Extension.Cjs); - case Extension.Json: - return tryExtension(Extension.Json); - default: - return tryExtension(Extension.Js) || tryExtension(Extension.Jsx); - } - case Extensions.TSConfig: - case Extensions.Json: - return tryExtension(Extension.Json); + return undefined; + default: + return extensions & Extensions.TypeScript && (tryExtension(Extension.Ts) || tryExtension(Extension.Tsx)) + || extensions & Extensions.Declaration && tryExtension(Extension.Dts) + || extensions & Extensions.JavaScript && (tryExtension(Extension.Js) || tryExtension(Extension.Jsx)) + || state.isConfigLookup && tryExtension(Extension.Json) + || undefined; + } function tryExtension(ext: Extension): PathAndExtension | undefined { @@ -1737,7 +1749,7 @@ export function getEntrypointsFromPackageJsonInfo( } let entrypoints: string[] | undefined; - const extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript; + const extensions = Extensions.TypeScript | Extensions.Declaration | (resolveJs ? Extensions.JavaScript : 0); const features = getDefaultNodeResolutionFeatures(options); const requireState = getTemporaryModuleResolutionState(cache?.getPackageJsonInfoCache(), host, options); requireState.conditions = ["node", "require", "types"]; @@ -1839,7 +1851,8 @@ export function getTemporaryModuleResolutionState(packageJsonInfoCache: PackageJ features: NodeResolutionFeatures.None, conditions: emptyArray, requestContainingDirectory: undefined, - reportDiagnostic: noop + reportDiagnostic: noop, + isConfigLookup: false, }; } @@ -1923,24 +1936,14 @@ export function getPackageJsonInfo(packageDirectory: string, onlyRecordFailures: function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState, jsonContent: PackageJsonPathFields | undefined, versionPaths: VersionPaths | undefined): PathAndExtension | undefined { let packageFile: string | undefined; if (jsonContent) { - switch (extensions) { - case Extensions.JavaScript: - case Extensions.Json: - case Extensions.TsOnly: - packageFile = readPackageJsonMainField(jsonContent, candidate, state); - break; - case Extensions.TypeScript: - // When resolving typescript modules, try resolving using main field as well - packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state); - break; - case Extensions.DtsOnly: - packageFile = readPackageJsonTypesFields(jsonContent, candidate, state); - break; - case Extensions.TSConfig: - packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); - break; - default: - return Debug.assertNever(extensions); + if (state.isConfigLookup) { + packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); + } + else { + packageFile = + extensions & Extensions.Declaration && readPackageJsonTypesFields(jsonContent, candidate, state) || + extensions & (Extensions.ImplementationFiles | Extensions.Declaration) && readPackageJsonMainField(jsonContent, candidate, state) || + undefined; } } @@ -1957,7 +1960,7 @@ function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: st } // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" - const nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions; + const expandedExtensions = extensions === Extensions.Declaration ? Extensions.TypeScript | Extensions.Declaration : extensions; // Don't do package.json lookup recursively, because Node.js' package lookup doesn't. // Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions) @@ -1967,14 +1970,14 @@ function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: st if (jsonContent?.type !== "module") { state.features &= ~NodeResolutionFeatures.EsmMode; } - const result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false); + const result = nodeLoadModuleByRelativeName(expandedExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false); state.features = features; return result; }; const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : undefined; const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host); - const indexPath = combinePaths(candidate, extensions === Extensions.TSConfig ? "tsconfig" : "index"); + const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index"); if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) { const moduleName = getRelativePathFromDirectory(candidate, packageFile || indexPath, /*ignoreCase*/ false); @@ -2005,19 +2008,11 @@ function resolvedIfExtensionMatches(extensions: Extensions, path: string): PathA /** True if `extension` is one of the supported `extensions`. */ function extensionIsOk(extensions: Extensions, extension: Extension): boolean { - switch (extensions) { - case Extensions.JavaScript: - return extension === Extension.Js || extension === Extension.Jsx || extension === Extension.Mjs || extension === Extension.Cjs; - case Extensions.TSConfig: - case Extensions.Json: - return extension === Extension.Json; - case Extensions.TypeScript: - return extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Mts || extension === Extension.Cts || extension === Extension.Dts || extension === Extension.Dmts || extension === Extension.Dcts; - case Extensions.TsOnly: - return extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Mts || extension === Extension.Cts; - case Extensions.DtsOnly: - return extension === Extension.Dts || extension === Extension.Dmts || extension === Extension.Dcts; - } + return extensions & Extensions.JavaScript && (extension === Extension.Js || extension === Extension.Jsx || extension === Extension.Mjs || extension === Extension.Cjs) + || extensions & Extensions.TypeScript && (extension === Extension.Ts || extension === Extension.Tsx || extension === Extension.Mts || extension === Extension.Cts) + || extensions & Extensions.Declaration && (extension === Extension.Dts || extension === Extension.Dmts || extension === Extension.Dcts) + || extensions & Extensions.Json && extension === Extension.Json + || false; } /** @internal */ @@ -2198,7 +2193,7 @@ function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: Mo const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath; traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup); traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/"); - const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference); + const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, /*isConfigLookup*/ false, redirectedReference); return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : undefined); } if (state.traceEnabled) { @@ -2303,7 +2298,7 @@ function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: Mo // we reproduce into the output directory is based on the set of input files, which we're still in the process of traversing and resolving! // _Given that_, we have to guess what the base of the output directory is (obviously the user wrote the export map, so has some idea what it is!). // We are going to probe _so many_ possible paths. We limit where we'll do this to try to reduce the possibilities of false positive lookups. - if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json) + if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true) @@ -2376,11 +2371,8 @@ function getLoadModuleFromTargetImportOrExport(extensions: Extensions, state: Mo if (fileExtensionIs(possibleInputBase, ext)) { const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase); for (const possibleExt of inputExts) { + if (!extensionIsOk(extensions, possibleExt)) continue; const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames()); - if ((extensions === Extensions.TypeScript && hasJSFileExtension(possibleInputWithInputExtension)) || - (extensions === Extensions.JavaScript && hasTSFileExtension(possibleInputWithInputExtension))) { - continue; - } if (state.host.fileExists(possibleInputWithInputExtension)) { return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, /*onlyRecordFailures*/ false, state))); } @@ -2425,20 +2417,40 @@ function loadModuleFromNearestNodeModulesDirectory(extensions: Extensions, modul function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName: string, directory: string, state: ModuleResolutionState): SearchResult { // Extensions parameter here doesn't actually matter, because typesOnly ensures we're just doing @types lookup, which is always DtsOnly. - return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.DtsOnly, moduleName, directory, state, /*typesScopeOnly*/ true, /*cache*/ undefined, /*redirectedReference*/ undefined); + return loadModuleFromNearestNodeModulesDirectoryWorker(Extensions.Declaration, moduleName, directory, state, /*typesScopeOnly*/ true, /*cache*/ undefined, /*redirectedReference*/ undefined); } function loadModuleFromNearestNodeModulesDirectoryWorker(extensions: Extensions, moduleName: string, directory: string, state: ModuleResolutionState, typesScopeOnly: boolean, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined): SearchResult { const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? undefined : state.features & NodeResolutionFeatures.EsmMode ? ModuleKind.ESNext : ModuleKind.CommonJS, redirectedReference); - return forEachAncestorDirectory(normalizeSlashes(directory), ancestorDirectory => { - if (getBaseFileName(ancestorDirectory) !== "node_modules") { - const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state); - if (resolutionFromCache) { - return resolutionFromCache; + // Do (up to) two passes through node_modules: + // 1. For each ancestor node_modules directory, try to find: + // i. TS/DTS files in the implementation package + // ii. DTS files in the @types package + // 2. For each ancestor node_modules directory, try to find: + // i. JS files in the implementation package + const priorityExtensions = extensions & (Extensions.TypeScript | Extensions.Declaration); + const secondaryExtensions = extensions & ~(Extensions.TypeScript | Extensions.Declaration); + // (1) + if (priorityExtensions) { + const result = lookup(priorityExtensions); + if (result) return result; + } + // (2) + if (secondaryExtensions && !typesScopeOnly) { + return lookup(secondaryExtensions); + } + + function lookup(extensions: Extensions) { + return forEachAncestorDirectory(normalizeSlashes(directory), ancestorDirectory => { + if (getBaseFileName(ancestorDirectory) !== "node_modules") { + const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); } - return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); - } - }); + }); + } } function loadModuleFromImmediateNodeModulesDirectory(extensions: Extensions, moduleName: string, directory: string, state: ModuleResolutionState, typesScopeOnly: boolean, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined): Resolved | undefined { @@ -2448,11 +2460,14 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions: Extensions, mod trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); } - const packageResult = typesScopeOnly ? undefined : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); - if (packageResult) { - return packageResult; + if (!typesScopeOnly) { + const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); + if (packageResult) { + return packageResult; + } } - if (extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) { + + if (extensions & Extensions.Declaration) { const nodeModulesAtTypes = combinePaths(nodeModulesFolder, "@types"); let nodeModulesAtTypesExists = nodeModulesFolderExists; if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes, state.host)) { @@ -2461,7 +2476,7 @@ function loadModuleFromImmediateNodeModulesDirectory(extensions: Extensions, mod } nodeModulesAtTypesExists = false; } - return loadModuleFromSpecificNodeModulesDirectory(Extensions.DtsOnly, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes, nodeModulesAtTypesExists, state, cache, redirectedReference); + return loadModuleFromSpecificNodeModulesDirectory(Extensions.Declaration, mangleScopedPackageNameWithTrace(moduleName, state), nodeModulesAtTypes, nodeModulesAtTypesExists, state, cache, redirectedReference); } } @@ -2639,9 +2654,12 @@ export function classicNameResolver(moduleName: string, containingFile: string, conditions: [], requestContainingDirectory: containingDirectory, reportDiagnostic: diag => void diagnostics.push(diag), + isConfigLookup: false, }; - const resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); + const resolved = + tryResolve(Extensions.TypeScript | Extensions.Declaration) || + tryResolve(Extensions.JavaScript | (compilerOptions.resolveJsonModule ? Extensions.Json : 0)); // No originalPath because classic resolution doesn't resolve realPath return createResolvedModuleWithFailedLookupLocations( resolved && resolved.value, @@ -2672,7 +2690,7 @@ export function classicNameResolver(moduleName: string, containingFile: string, if (resolved) { return resolved; } - if (extensions === Extensions.TypeScript) { + if (extensions & (Extensions.TypeScript | Extensions.Declaration)) { // If we didn't find the file normally, look it up in @types. return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state); } @@ -2709,8 +2727,9 @@ export function loadModuleFromGlobalCache(moduleName: string, projectName: strin conditions: [], requestContainingDirectory: undefined, reportDiagnostic: diag => void diagnostics.push(diag), + isConfigLookup: false, }; - const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined); + const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.Declaration, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined); return createResolvedModuleWithFailedLookupLocations( resolved, /*isExternalLibraryImport*/ true, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ade3c25fad373..a6eaefed1ef7c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7776,6 +7776,8 @@ const allSupportedExtensions: readonly Extension[][] = [[Extension.Ts, Extension const allSupportedExtensionsWithJson: readonly Extension[][] = [...allSupportedExtensions, [Extension.Json]]; /** @internal */ export const supportedDeclarationExtensions: readonly Extension[] = [Extension.Dts, Extension.Dcts, Extension.Dmts]; +/** @internal */ +export const supportedTSImplementationExtensions: readonly Extension[] = [Extension.Ts, Extension.Cts, Extension.Mts, Extension.Tsx]; /** @internal */ export function getSupportedExtensions(options?: CompilerOptions): readonly Extension[][]; diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index e909c536d8069..6394394560114 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -274,7 +274,7 @@ describe("unittests:: Reuse program structure:: General", () => { [ "======== Resolving module 'a' from 'file1.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'node_modules/a/package.json' does not exist.", "File 'node_modules/a.ts' does not exist.", "File 'node_modules/a.tsx' does not exist.", @@ -285,7 +285,7 @@ describe("unittests:: Reuse program structure:: General", () => { "File 'node_modules/@types/a/package.json' does not exist.", "File 'node_modules/@types/a.d.ts' does not exist.", "File 'node_modules/@types/a/index.d.ts' does not exist.", - "Loading module 'a' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'a' from 'node_modules' folder, target file types: JavaScript.", "File 'node_modules/a/package.json' does not exist according to earlier cached lookups.", "File 'node_modules/a.js' does not exist.", "File 'node_modules/a.jsx' does not exist.", @@ -307,7 +307,7 @@ describe("unittests:: Reuse program structure:: General", () => { [ "======== Resolving module 'a' from 'file1.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'node_modules/a/package.json' does not exist.", "File 'node_modules/a.ts' does not exist.", "File 'node_modules/a.tsx' does not exist.", diff --git a/tests/baselines/reference/cachedModuleResolution1.trace.json b/tests/baselines/reference/cachedModuleResolution1.trace.json index 7f8ce2b403cdf..0789483f0751a 100644 --- a/tests/baselines/reference/cachedModuleResolution1.trace.json +++ b/tests/baselines/reference/cachedModuleResolution1.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", @@ -12,7 +12,7 @@ "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========", "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution2.trace.json b/tests/baselines/reference/cachedModuleResolution2.trace.json index 3f9a7c532eaa1..46adab8045fdb 100644 --- a/tests/baselines/reference/cachedModuleResolution2.trace.json +++ b/tests/baselines/reference/cachedModuleResolution2.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", "File '/a/b/node_modules/foo.ts' does not exist.", "File '/a/b/node_modules/foo.tsx' does not exist.", @@ -10,7 +10,7 @@ "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========", "======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Resolution for module 'foo' was found in cache from location '/a/b/c'.", diff --git a/tests/baselines/reference/cachedModuleResolution5.trace.json b/tests/baselines/reference/cachedModuleResolution5.trace.json index adadb48efaf35..8574fefadfe2a 100644 --- a/tests/baselines/reference/cachedModuleResolution5.trace.json +++ b/tests/baselines/reference/cachedModuleResolution5.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", @@ -12,7 +12,7 @@ "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========", "======== Resolving module 'foo' from '/a/b/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Resolution for module 'foo' was found in cache from location '/a/b'.", "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution6.trace.json b/tests/baselines/reference/cachedModuleResolution6.trace.json index 5d43bb94dd278..43c33cb0d0794 100644 --- a/tests/baselines/reference/cachedModuleResolution6.trace.json +++ b/tests/baselines/reference/cachedModuleResolution6.trace.json @@ -1,14 +1,14 @@ [ "======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", @@ -18,7 +18,7 @@ "======== Module name 'foo' was not resolved. ========", "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution7.trace.json b/tests/baselines/reference/cachedModuleResolution7.trace.json index 49fc1e75b0c7e..f1f5f22311aad 100644 --- a/tests/baselines/reference/cachedModuleResolution7.trace.json +++ b/tests/baselines/reference/cachedModuleResolution7.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "Directory '/a/b/c/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/node_modules' does not exist, skipping all lookups in it.", @@ -14,7 +14,7 @@ "======== Module name 'foo' was not resolved. ========", "======== Resolving module 'foo' from '/a/b/c/d/e/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", "Resolution for module 'foo' was found in cache from location '/a/b/c'.", diff --git a/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage.trace.json b/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage.trace.json index e78a2c0c0e3d1..438dd50a5ff5a 100644 --- a/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage.trace.json +++ b/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo/use' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo/use' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo/use' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo/use.ts' does not exist.", @@ -11,7 +11,7 @@ "======== Module name 'foo/use' was successfully resolved to '/node_modules/foo/use.d.ts' with Package ID 'foo/use.d.ts@1.2.3'. ========", "======== Resolving module 'a' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/a/package.json' does not exist.", "File '/node_modules/a.ts' does not exist.", "File '/node_modules/a.tsx' does not exist.", @@ -23,7 +23,7 @@ "======== Module name 'a' was successfully resolved to '/node_modules/a/index.d.ts'. ========", "======== Resolving module './index' from '/node_modules/foo/use.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/index', target file types: TypeScript, Declaration.", "File '/node_modules/foo/index.ts' does not exist.", "File '/node_modules/foo/index.tsx' does not exist.", "File '/node_modules/foo/index.d.ts' exist - use it as a name resolution result.", @@ -31,7 +31,7 @@ "======== Module name './index' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.2.3'. ========", "======== Resolving module 'foo' from '/node_modules/a/index.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/a/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/a/node_modules/foo.ts' does not exist.", diff --git a/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage_scoped.trace.json b/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage_scoped.trace.json index 3bdf64db17097..5a9d602d03571 100644 --- a/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage_scoped.trace.json +++ b/tests/baselines/reference/duplicatePackage_relativeImportWithinPackage_scoped.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module '@foo/bar/use' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@foo/bar/use' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@foo/bar/use' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/@foo/bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/@foo/bar/use.ts' does not exist.", @@ -11,7 +11,7 @@ "======== Module name '@foo/bar/use' was successfully resolved to '/node_modules/@foo/bar/use.d.ts' with Package ID '@foo/bar/use.d.ts@1.2.3'. ========", "======== Resolving module 'a' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/a/package.json' does not exist.", "File '/node_modules/a.ts' does not exist.", "File '/node_modules/a.tsx' does not exist.", @@ -23,7 +23,7 @@ "======== Module name 'a' was successfully resolved to '/node_modules/a/index.d.ts'. ========", "======== Resolving module './index' from '/node_modules/@foo/bar/use.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/node_modules/@foo/bar/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@foo/bar/index', target file types: TypeScript, Declaration.", "File '/node_modules/@foo/bar/index.ts' does not exist.", "File '/node_modules/@foo/bar/index.tsx' does not exist.", "File '/node_modules/@foo/bar/index.d.ts' exist - use it as a name resolution result.", @@ -31,7 +31,7 @@ "======== Module name './index' was successfully resolved to '/node_modules/@foo/bar/index.d.ts' with Package ID '@foo/bar/index.d.ts@1.2.3'. ========", "======== Resolving module '@foo/bar' from '/node_modules/a/index.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@foo/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@foo/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/a/node_modules/@foo/bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/a/node_modules/@foo/bar.ts' does not exist.", diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).symbols b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).symbols new file mode 100644 index 0000000000000..19522bf41394c --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).symbols @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + +import dir from "./dir"; +>dir : Symbol(dir, Decl(b.ts, 1, 6)) + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).types b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).types new file mode 100644 index 0000000000000..b398b344d7017 --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=classic).types @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : "a.js" + +import dir from "./dir"; +>dir : "dir.js" + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).symbols b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).symbols new file mode 100644 index 0000000000000..19522bf41394c --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).symbols @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + +import dir from "./dir"; +>dir : Symbol(dir, Decl(b.ts, 1, 6)) + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).types b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).types new file mode 100644 index 0000000000000..e556505b9f838 --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node).types @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : "a.js" + +import dir from "./dir"; +>dir : "dir/index.ts" + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).symbols b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).symbols new file mode 100644 index 0000000000000..19522bf41394c --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).symbols @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + +import dir from "./dir"; +>dir : Symbol(dir, Decl(b.ts, 1, 6)) + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).types b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).types new file mode 100644 index 0000000000000..b398b344d7017 --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=node16).types @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : "a.js" + +import dir from "./dir"; +>dir : "dir.js" + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).symbols b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).symbols new file mode 100644 index 0000000000000..19522bf41394c --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).symbols @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : Symbol(a, Decl(b.ts, 0, 6)) + +import dir from "./dir"; +>dir : Symbol(dir, Decl(b.ts, 1, 6)) + diff --git a/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).types b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).types new file mode 100644 index 0000000000000..b398b344d7017 --- /dev/null +++ b/tests/baselines/reference/extensionLoadingPriority(moduleresolution=nodenext).types @@ -0,0 +1,23 @@ +=== /project/a.js === + +export default "a.js"; + +=== /project/a.js.js === + +export default "a.js.js"; + +=== /project/dir/index.ts === + +export default "dir/index.ts"; + +=== /project/dir.js === + +export default "dir.js"; + +=== /project/b.ts === +import a from "./a.js"; +>a : "a.js" + +import dir from "./dir"; +>dir : "dir.js" + diff --git a/tests/baselines/reference/importWithTrailingSlash.trace.json b/tests/baselines/reference/importWithTrailingSlash.trace.json index b60d3bc6aab90..60a4ebf202d55 100644 --- a/tests/baselines/reference/importWithTrailingSlash.trace.json +++ b/tests/baselines/reference/importWithTrailingSlash.trace.json @@ -1,25 +1,25 @@ [ "======== Resolving module '.' from '/a/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, Declaration.", "File '/a/package.json' does not exist.", "File '/a/index.ts' exist - use it as a name resolution result.", "======== Module name '.' was successfully resolved to '/a/index.ts'. ========", "======== Resolving module './' from '/a/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, Declaration.", "File '/a/package.json' does not exist according to earlier cached lookups.", "File '/a/index.ts' exist - use it as a name resolution result.", "======== Module name './' was successfully resolved to '/a/index.ts'. ========", "======== Resolving module '..' from '/a/b/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, Declaration.", "File '/a/package.json' does not exist according to earlier cached lookups.", "File '/a/index.ts' exist - use it as a name resolution result.", "======== Module name '..' was successfully resolved to '/a/index.ts'. ========", "======== Resolving module '../' from '/a/b/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/', target file types: TypeScript, Declaration.", "File '/a/package.json' does not exist according to earlier cached lookups.", "File '/a/index.ts' exist - use it as a name resolution result.", "======== Module name '../' was successfully resolved to '/a/index.ts'. ========" diff --git a/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json b/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json index 1ee467c378905..ca14c471e45a7 100644 --- a/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json +++ b/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json @@ -1,9 +1,9 @@ [ "======== Resolving module './foo/' from '/a.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo/', target file types: TypeScript, Declaration.", "Directory '/foo/' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/foo/', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/foo/', target file types: JavaScript.", "Directory '/foo/' does not exist, skipping all lookups in it.", "======== Module name './foo/' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/maxNodeModuleJsDepthDefaultsToZero.trace.json b/tests/baselines/reference/maxNodeModuleJsDepthDefaultsToZero.trace.json index dd946d6fd425b..4b9d883482488 100644 --- a/tests/baselines/reference/maxNodeModuleJsDepthDefaultsToZero.trace.json +++ b/tests/baselines/reference/maxNodeModuleJsDepthDefaultsToZero.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'shortid' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'shortid' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'shortid' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/shortid/package.json' does not exist.", "File '/node_modules/shortid.ts' does not exist.", "File '/node_modules/shortid.tsx' does not exist.", @@ -10,7 +10,7 @@ "File '/node_modules/shortid/index.tsx' does not exist.", "File '/node_modules/shortid/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'shortid' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'shortid' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/shortid/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/shortid.js' does not exist.", "File '/node_modules/shortid.jsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json b/tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json index 4592160e8de3a..4352a51b61d53 100644 --- a/tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json +++ b/tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.trace.json @@ -5,12 +5,12 @@ "'paths' option is specified, looking for a pattern to match module name 'anotherLib'.", "'baseUrl' option is set to '/project', using this value to resolve non-relative module name 'anotherLib'.", "Resolving module name 'anotherLib' relative to base url '/project' - '/project/anotherLib'.", - "Loading module as file / folder, candidate module location '/project/anotherLib', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/project/anotherLib', target file types: TypeScript, Declaration.", "File '/project/anotherLib.ts' does not exist.", "File '/project/anotherLib.tsx' does not exist.", "File '/project/anotherLib.d.ts' does not exist.", "Directory '/project/anotherLib' does not exist, skipping all lookups in it.", - "Loading module 'anotherLib' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'anotherLib' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/project/src/node_modules' does not exist, skipping all lookups in it.", "File '/project/node_modules/anotherLib/package.json' does not exist.", "File '/project/node_modules/anotherLib.ts' does not exist.", @@ -27,7 +27,7 @@ "'paths' option is specified, looking for a pattern to match module name '@shared/lib/app'.", "Module name '@shared/lib/app', matched pattern '@shared/*'.", "Trying substitution '../shared/*', candidate module location: '../shared/lib/app'.", - "Loading module as file / folder, candidate module location '/shared/lib/app', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/shared/lib/app', target file types: TypeScript, Declaration.", "File '/shared/lib/app.ts' does not exist.", "File '/shared/lib/app.tsx' does not exist.", "File '/shared/lib/app.d.ts' exist - use it as a name resolution result.", @@ -38,8 +38,8 @@ "'paths' option is specified, looking for a pattern to match module name 'troublesome-lib/lib/Compactable'.", "'baseUrl' option is set to '/project', using this value to resolve non-relative module name 'troublesome-lib/lib/Compactable'.", "Resolving module name 'troublesome-lib/lib/Compactable' relative to base url '/project' - '/project/troublesome-lib/lib/Compactable'.", - "Loading module as file / folder, candidate module location '/project/troublesome-lib/lib/Compactable', target file type 'TypeScript'.", - "Loading module 'troublesome-lib/lib/Compactable' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/project/troublesome-lib/lib/Compactable', target file types: TypeScript, Declaration.", + "Loading module 'troublesome-lib/lib/Compactable' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/project/node_modules/anotherLib/node_modules' does not exist, skipping all lookups in it.", "Found 'package.json' at '/project/node_modules/troublesome-lib/package.json'.", "'package.json' does not have a 'typesVersions' field.", @@ -50,7 +50,7 @@ "======== Module name 'troublesome-lib/lib/Compactable' was successfully resolved to '/project/node_modules/troublesome-lib/lib/Compactable.d.ts' with Package ID 'troublesome-lib/lib/Compactable.d.ts@1.17.1'. ========", "======== Resolving module './Option' from '/project/node_modules/troublesome-lib/lib/Compactable.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/project/node_modules/troublesome-lib/lib/Option', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/project/node_modules/troublesome-lib/lib/Option', target file types: TypeScript, Declaration.", "File '/project/node_modules/troublesome-lib/lib/Option.ts' does not exist.", "File '/project/node_modules/troublesome-lib/lib/Option.tsx' does not exist.", "File '/project/node_modules/troublesome-lib/lib/Option.d.ts' exist - use it as a name resolution result.", @@ -62,8 +62,8 @@ "'paths' option is specified, looking for a pattern to match module name 'troublesome-lib/lib/Option'.", "'baseUrl' option is set to '/project', using this value to resolve non-relative module name 'troublesome-lib/lib/Option'.", "Resolving module name 'troublesome-lib/lib/Option' relative to base url '/project' - '/project/troublesome-lib/lib/Option'.", - "Loading module as file / folder, candidate module location '/project/troublesome-lib/lib/Option', target file type 'TypeScript'.", - "Loading module 'troublesome-lib/lib/Option' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/project/troublesome-lib/lib/Option', target file types: TypeScript, Declaration.", + "Loading module 'troublesome-lib/lib/Option' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/shared/lib/node_modules' does not exist, skipping all lookups in it.", "Found 'package.json' at '/shared/node_modules/troublesome-lib/package.json'.", "'package.json' does not have a 'typesVersions' field.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions.trace.json index 104853f8aa3f5..95c1de6bcc32f 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions.trace.json @@ -1,24 +1,18 @@ [ "======== Resolving module './a' from '/src/b.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/a', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/a', target file types: TypeScript, Declaration.", "File '/src/a.ts' exist - use it as a name resolution result.", "======== Module name './a' was successfully resolved to '/src/a.ts'. ========", "======== Resolving module './a.js' from '/src/d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/a.js', target file type 'TypeScript'.", - "File '/src/a.js.ts' does not exist.", - "File '/src/a.js.tsx' does not exist.", - "File '/src/a.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/src/a.js', target file types: TypeScript, Declaration.", "File name '/src/a.js' has a '.js' extension - stripping it.", "File '/src/a.ts' exist - use it as a name resolution result.", "======== Module name './a.js' was successfully resolved to '/src/a.ts'. ========", "======== Resolving module './jquery.js' from '/src/jquery_user_1.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/jquery.js', target file type 'TypeScript'.", - "File '/src/jquery.js.ts' does not exist.", - "File '/src/jquery.js.tsx' does not exist.", - "File '/src/jquery.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/src/jquery.js', target file types: TypeScript, Declaration.", "File name '/src/jquery.js' has a '.js' extension - stripping it.", "File '/src/jquery.ts' does not exist.", "File '/src/jquery.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported.trace.json index b57862c09e31f..2217a5eaacc4c 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported.trace.json @@ -1,29 +1,29 @@ [ "======== Resolving module './tsx' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/tsx', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/tsx', target file types: TypeScript, Declaration.", "File '/tsx.ts' does not exist.", "File '/tsx.tsx' exist - use it as a name resolution result.", "======== Module name './tsx' was successfully resolved to '/tsx.tsx'. ========", "======== Resolving module './jsx' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, Declaration.", "File '/jsx.ts' does not exist.", "File '/jsx.tsx' does not exist.", "File '/jsx.d.ts' does not exist.", "Directory '/jsx' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: JavaScript.", "File '/jsx.js' does not exist.", "File '/jsx.jsx' exist - use it as a name resolution result.", "======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ========", "======== Resolving module './js' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/js', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/js', target file types: TypeScript, Declaration.", "File '/js.ts' does not exist.", "File '/js.tsx' does not exist.", "File '/js.d.ts' does not exist.", "Directory '/js' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/js', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/js', target file types: JavaScript.", "File '/js.js' exist - use it as a name resolution result.", "======== Module name './js' was successfully resolved to '/js.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported2.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported2.trace.json index 7474cccdb355c..ed7694272fffd 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported2.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported2.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './jsx' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, Declaration.", "File '/jsx.ts' does not exist.", "File '/jsx.tsx' does not exist.", "File '/jsx.d.ts' does not exist.", "Directory '/jsx' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: JavaScript.", "File '/jsx.js' does not exist.", "File '/jsx.jsx' exist - use it as a name resolution result.", "======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ========" diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported3.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported3.trace.json index 7474cccdb355c..ed7694272fffd 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_notSupported3.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_notSupported3.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './jsx' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: TypeScript, Declaration.", "File '/jsx.ts' does not exist.", "File '/jsx.tsx' does not exist.", "File '/jsx.d.ts' does not exist.", "Directory '/jsx' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/jsx', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/jsx', target file types: JavaScript.", "File '/jsx.js' does not exist.", "File '/jsx.jsx' exist - use it as a name resolution result.", "======== Module name './jsx' was successfully resolved to '/jsx.jsx'. ========" diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.js b/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.js deleted file mode 100644 index b02d23302ae76..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithExtensions_preferTs.ts] //// - -//// [b.js] - -//// [index.ts] -export default 0; - -//// [a.ts] -import b from "./b"; - - -//// [index.js] -"use strict"; -exports.__esModule = true; -exports["default"] = 0; -//// [a.js] -"use strict"; -exports.__esModule = true; diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.symbols b/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.symbols deleted file mode 100644 index d6b4d68e4a5ff..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.symbols +++ /dev/null @@ -1,8 +0,0 @@ -=== /a.ts === -import b from "./b"; ->b : Symbol(b, Decl(a.ts, 0, 6)) - -=== /b/index.ts === - -export default 0; - diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.trace.json deleted file mode 100644 index 0c56366809e7d..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.trace.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - "======== Resolving module './b' from '/a.ts'. ========", - "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/b', target file type 'TypeScript'.", - "File '/b.ts' does not exist.", - "File '/b.tsx' does not exist.", - "File '/b.d.ts' does not exist.", - "File '/b/package.json' does not exist.", - "File '/b/index.ts' exist - use it as a name resolution result.", - "======== Module name './b' was successfully resolved to '/b/index.ts'. ========" -] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.types b/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.types deleted file mode 100644 index 8c5c92df59c03..0000000000000 --- a/tests/baselines/reference/moduleResolutionWithExtensions_preferTs.types +++ /dev/null @@ -1,8 +0,0 @@ -=== /a.ts === -import b from "./b"; ->b : 0 - -=== /b/index.ts === - -export default 0; - diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json index 17dbc8b753044..7ca41cdf2787e 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'normalize.css' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'normalize.css' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'normalize.css' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/normalize.css/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/normalize.css.ts' does not exist.", @@ -12,7 +12,7 @@ "'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.", "File '/node_modules/normalize.css/normalize.css' exist - use it as a name resolution result.", "File '/node_modules/normalize.css/normalize.css' has an unsupported extension, so skipping it.", - "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: TypeScript, Declaration.", "File '/node_modules/normalize.css/normalize.css.ts' does not exist.", "File '/node_modules/normalize.css/normalize.css.tsx' does not exist.", "File '/node_modules/normalize.css/normalize.css.d.ts' does not exist.", @@ -21,14 +21,14 @@ "File '/node_modules/normalize.css/index.tsx' does not exist.", "File '/node_modules/normalize.css/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'normalize.css' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'normalize.css' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/normalize.css/package.json' exists according to earlier cached lookups.", "File '/node_modules/normalize.css.js' does not exist.", "File '/node_modules/normalize.css.jsx' does not exist.", "'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.", "File '/node_modules/normalize.css/normalize.css' exist - use it as a name resolution result.", "File '/node_modules/normalize.css/normalize.css' has an unsupported extension, so skipping it.", - "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: JavaScript.", "File '/node_modules/normalize.css/normalize.css.js' does not exist.", "File '/node_modules/normalize.css/normalize.css.jsx' does not exist.", "Directory '/node_modules/normalize.css/normalize.css' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json index 7c988b2ceec64..f3c8d73336e38 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo.ts' does not exist.", @@ -11,20 +11,20 @@ "'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'.", "File '/node_modules/foo/foo.js' exist - use it as a name resolution result.", "File '/node_modules/foo/foo.js' has an unsupported extension, so skipping it.", - "Loading module as file / folder, candidate module location '/node_modules/foo/foo.js', target file type 'TypeScript'.", - "File '/node_modules/foo/foo.js.ts' does not exist.", - "File '/node_modules/foo/foo.js.tsx' does not exist.", - "File '/node_modules/foo/foo.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/foo.js', target file types: TypeScript, Declaration.", "File name '/node_modules/foo/foo.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/foo.ts' does not exist.", "File '/node_modules/foo/foo.tsx' does not exist.", "File '/node_modules/foo/foo.d.ts' does not exist.", + "File '/node_modules/foo/foo.js.ts' does not exist.", + "File '/node_modules/foo/foo.js.tsx' does not exist.", + "File '/node_modules/foo/foo.js.d.ts' does not exist.", "Directory '/node_modules/foo/foo.js' does not exist, skipping all lookups in it.", "File '/node_modules/foo/index.ts' does not exist.", "File '/node_modules/foo/index.tsx' does not exist.", "File '/node_modules/foo/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo.js' does not exist.", "File '/node_modules/foo.jsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_withAmbientPresent.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_withAmbientPresent.trace.json index 0d92fd01ac81d..e038cbfbf18b8 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_withAmbientPresent.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_withAmbientPresent.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'js' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'js' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'js' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/js/package.json' does not exist.", "File '/node_modules/js.ts' does not exist.", "File '/node_modules/js.tsx' does not exist.", @@ -10,7 +10,7 @@ "File '/node_modules/js/index.tsx' does not exist.", "File '/node_modules/js/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'js' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'js' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/js/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/js.js' does not exist.", "File '/node_modules/js.jsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.trace.json index 85fa415976b99..6163a55512404 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_withPaths.trace.json @@ -5,10 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/test.js'.", "Module name 'foo/test.js', matched pattern 'foo/*'.", "Trying substitution 'node_modules/foo/lib/*', candidate module location: 'node_modules/foo/lib/test.js'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/lib/test.js', target file type 'TypeScript'.", - "File '/node_modules/foo/lib/test.js.ts' does not exist.", - "File '/node_modules/foo/lib/test.js.tsx' does not exist.", - "File '/node_modules/foo/lib/test.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/lib/test.js', target file types: TypeScript, Declaration.", "File name '/node_modules/foo/lib/test.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/lib/test.ts' does not exist.", "File '/node_modules/foo/lib/test.tsx' does not exist.", @@ -21,7 +18,7 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/test'.", "Module name 'foo/test', matched pattern 'foo/*'.", "Trying substitution 'node_modules/foo/lib/*', candidate module location: 'node_modules/foo/lib/test'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/lib/test', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/lib/test', target file types: TypeScript, Declaration.", "File '/node_modules/foo/lib/test.ts' does not exist.", "File '/node_modules/foo/lib/test.tsx' does not exist.", "File '/node_modules/foo/lib/test.d.ts' exist - use it as a name resolution result.", @@ -29,10 +26,7 @@ "======== Module name 'foo/test' was successfully resolved to '/node_modules/foo/lib/test.d.ts'. ========", "======== Resolving module './relative.js' from '/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/relative.js', target file type 'TypeScript'.", - "File '/relative.js.ts' does not exist.", - "File '/relative.js.tsx' does not exist.", - "File '/relative.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/relative.js', target file types: TypeScript, Declaration.", "File name '/relative.js' has a '.js' extension - stripping it.", "File '/relative.ts' does not exist.", "File '/relative.tsx' does not exist.", @@ -40,7 +34,7 @@ "======== Module name './relative.js' was successfully resolved to '/relative.d.ts'. ========", "======== Resolving module './relative' from '/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/relative', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/relative', target file types: TypeScript, Declaration.", "File '/relative.ts' does not exist.", "File '/relative.tsx' does not exist.", "File '/relative.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/moduleResolutionWithRequireAndImport.trace.json b/tests/baselines/reference/moduleResolutionWithRequireAndImport.trace.json index 1b54938304529..45948920e644b 100644 --- a/tests/baselines/reference/moduleResolutionWithRequireAndImport.trace.json +++ b/tests/baselines/reference/moduleResolutionWithRequireAndImport.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './other' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/other', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/other', target file types: TypeScript, Declaration.", "File '/other.ts' exist - use it as a name resolution result.", "======== Module name './other' was successfully resolved to '/other.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_empty.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_empty.trace.json index c1e5657623ecc..831f49cdd03e2 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_empty.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_empty.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_notSpecified.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_notSpecified.trace.json index c1e5657623ecc..831f49cdd03e2 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_notSpecified.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_notSpecified.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one.trace.json index 92259211af165..a70fad0c236e5 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ios.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo.ios.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_oneBlank.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_oneBlank.trace.json index c1e5657623ecc..831f49cdd03e2 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_oneBlank.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_oneBlank.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_oneNotFound.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_oneNotFound.trace.json index c0bf8c1d4367e..6e38fccb02f82 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_oneNotFound.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_oneNotFound.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ios.ts' does not exist.", "File '/foo.ios.tsx' does not exist.", "File '/foo.ios.d.ts' does not exist.", "Directory '/foo' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/foo', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: JavaScript.", "File '/foo.ios.js' does not exist.", "File '/foo.ios.jsx' does not exist.", "Directory '/foo' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json index ec663458f8e72..2431f6284e8f8 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_dirModuleWithIndex.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ios.ts' does not exist.", "File '/foo.ios.tsx' does not exist.", "File '/foo.ios.d.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule.trace.json index d79615de72961..0ead690c08a3d 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'some-library' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'some-library' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'some-library' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/some-library/package.json' does not exist.", "File '/node_modules/some-library.ios.ts' does not exist.", "File '/node_modules/some-library.ios.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModulePath.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModulePath.trace.json index 3a7c320e60a15..26c207562cc3c 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModulePath.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModulePath.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'some-library/foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'some-library/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'some-library/foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/some-library/package.json' does not exist.", "File '/node_modules/some-library/foo.ios.ts' does not exist.", "File '/node_modules/some-library/foo.ios.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json index bb8df8b026651..2e183a6dfe6a4 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalModule_withPaths.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name 'some-library'.", "Module name 'some-library', matched pattern 'some-library'.", "Trying substitution 'node_modules/some-library/lib', candidate module location: 'node_modules/some-library/lib'.", - "Loading module as file / folder, candidate module location '/node_modules/some-library/lib', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/some-library/lib', target file types: TypeScript, Declaration.", "File '/node_modules/some-library/lib.ios.ts' does not exist.", "File '/node_modules/some-library/lib.ios.tsx' does not exist.", "File '/node_modules/some-library/lib.ios.d.ts' does not exist.", @@ -20,7 +20,7 @@ "'paths' option is specified, looking for a pattern to match module name 'some-library/index'.", "Module name 'some-library/index', matched pattern 'some-library/*'.", "Trying substitution 'node_modules/some-library/lib/*', candidate module location: 'node_modules/some-library/lib/index'.", - "Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index', target file types: TypeScript, Declaration.", "File '/node_modules/some-library/lib/index.ios.ts' does not exist.", "File '/node_modules/some-library/lib/index.ios.tsx' does not exist.", "File '/node_modules/some-library/lib/index.ios.d.ts' exist - use it as a name resolution result.", @@ -32,10 +32,7 @@ "'paths' option is specified, looking for a pattern to match module name 'some-library/index.js'.", "Module name 'some-library/index.js', matched pattern 'some-library/*'.", "Trying substitution 'node_modules/some-library/lib/*', candidate module location: 'node_modules/some-library/lib/index.js'.", - "Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index.js', target file type 'TypeScript'.", - "File '/node_modules/some-library/lib/index.js.ios.ts' does not exist.", - "File '/node_modules/some-library/lib/index.js.ios.tsx' does not exist.", - "File '/node_modules/some-library/lib/index.js.ios.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/some-library/lib/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/some-library/lib/index.js' has a '.js' extension - stripping it.", "File '/node_modules/some-library/lib/index.ios.ts' does not exist.", "File '/node_modules/some-library/lib/index.ios.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalTSModule.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalTSModule.trace.json index 7224d4d6498d8..f45b6dd6005b9 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalTSModule.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_externalTSModule.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'some-library' from '/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'some-library' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'some-library' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/some-library/package.json' does not exist.", "File '/node_modules/some-library.ios.ts' does not exist.", "File '/node_modules/some-library.ios.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsModule.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsModule.trace.json index 473007233e556..f1472c7f4c459 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsModule.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsModule.trace.json @@ -1,18 +1,16 @@ [ "======== Resolving module './foo.js' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo.js', target file type 'TypeScript'.", - "File '/foo.js.ios.ts' does not exist.", - "File '/foo.js.ios.tsx' does not exist.", - "File '/foo.js.ios.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/foo.js', target file types: TypeScript, Declaration.", "File name '/foo.js' has a '.js' extension - stripping it.", "File '/foo.ios.ts' does not exist.", "File '/foo.ios.tsx' does not exist.", "File '/foo.ios.d.ts' does not exist.", + "File '/foo.js.ios.ts' does not exist.", + "File '/foo.js.ios.tsx' does not exist.", + "File '/foo.js.ios.d.ts' does not exist.", "Directory '/foo.js' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/foo.js', target file type 'JavaScript'.", - "File '/foo.js.ios.js' does not exist.", - "File '/foo.js.ios.jsx' does not exist.", + "Loading module as file / folder, candidate module location '/foo.js', target file types: JavaScript.", "File name '/foo.js' has a '.js' extension - stripping it.", "File '/foo.ios.js' exist - use it as a name resolution result.", "======== Module name './foo.js' was successfully resolved to '/foo.ios.js'. ========" diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsonModule.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsonModule.trace.json index ed1b58abf25e5..2bb786d31c5e7 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsonModule.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_one_jsonModule.trace.json @@ -1,16 +1,12 @@ [ "======== Resolving module './foo.json' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo.json', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo.json', target file types: TypeScript, Declaration.", "File '/foo.json.ios.ts' does not exist.", "File '/foo.json.ios.tsx' does not exist.", "File '/foo.json.ios.d.ts' does not exist.", - "File name '/foo.json' has a '.json' extension - stripping it.", - "File '/foo.json.ios.d.ts' does not exist.", "Directory '/foo.json' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/foo.json', target file type 'JavaScript'.", - "File '/foo.json.ios.js' does not exist.", - "File '/foo.json.ios.jsx' does not exist.", + "Loading module as file / folder, candidate module location '/foo.json', target file types: JavaScript, JSON.", "File name '/foo.json' has a '.json' extension - stripping it.", "File '/foo.ios.json' exist - use it as a name resolution result.", "======== Module name './foo.json' was successfully resolved to '/foo.ios.json'. ========" diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json index 4a68f95ae8332..862e6d5e1d6f9 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank1.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo-ios.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo-ios.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json index 57c28e81bfa10..e5e1c49a6ed7f 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank2.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo-ios.ts' does not exist.", "File '/foo__native.ts' exist - use it as a name resolution result.", "======== Module name './foo' was successfully resolved to '/foo__native.ts'. ========" diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json index 693d55759f0a7..a75b78d6939d4 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank3.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo-ios.ts' does not exist.", "File '/foo__native.ts' does not exist.", "File '/foo.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json index 1a4b097e7fdd3..e28284a291ff0 100644 --- a/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSuffixes_threeLastIsBlank4.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './foo' from '/index.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo-ios.ts' does not exist.", "File '/foo__native.ts' does not exist.", "File '/foo.ts' does not exist.", @@ -12,7 +12,7 @@ "File '/foo__native.d.ts' does not exist.", "File '/foo.d.ts' does not exist.", "Directory '/foo' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/foo', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/foo', target file types: JavaScript.", "File '/foo-ios.js' does not exist.", "File '/foo__native.js' does not exist.", "File '/foo.js' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks.trace.json b/tests/baselines/reference/moduleResolutionWithSymlinks.trace.json index 19e44e72d6163..2bd12d2725d26 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSymlinks.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './library-a' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/library-a', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/library-a', target file types: TypeScript, Declaration.", "File '/src/library-a.ts' does not exist.", "File '/src/library-a.tsx' does not exist.", "File '/src/library-a.d.ts' does not exist.", @@ -10,7 +10,7 @@ "======== Module name './library-a' was successfully resolved to '/src/library-a/index.ts'. ========", "======== Resolving module './library-b' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/library-b', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/library-b', target file types: TypeScript, Declaration.", "File '/src/library-b.ts' does not exist.", "File '/src/library-b.tsx' does not exist.", "File '/src/library-b.d.ts' does not exist.", @@ -19,7 +19,7 @@ "======== Module name './library-b' was successfully resolved to '/src/library-b/index.ts'. ========", "======== Resolving module 'library-a' from '/src/library-b/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'library-a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'library-a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/src/library-b/node_modules/library-a/package.json' does not exist.", "File '/src/library-b/node_modules/library-a.ts' does not exist.", "File '/src/library-b/node_modules/library-a.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_notInNodeModules.trace.json b/tests/baselines/reference/moduleResolutionWithSymlinks_notInNodeModules.trace.json index 477bae0b4e203..5db0197c68c54 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks_notInNodeModules.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_notInNodeModules.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './shared/abc' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/shared/abc', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/shared/abc', target file types: TypeScript, Declaration.", "File '/src/shared/abc.ts' exist - use it as a name resolution result.", "======== Module name './shared/abc' was successfully resolved to '/src/shared/abc.ts'. ========", "======== Resolving module './shared2/abc' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/shared2/abc', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/shared2/abc', target file types: TypeScript, Declaration.", "File '/src/shared2/abc.ts' exist - use it as a name resolution result.", "======== Module name './shared2/abc' was successfully resolved to '/src/shared2/abc.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json index 414d4d5dec720..f45e3ce16dc27 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.trace.json @@ -8,7 +8,7 @@ "======== Type reference directive 'linked' was successfully resolved to '/app/node_modules/linked/index.d.ts', primary: false. ========", "======== Resolving module 'real' from '/app/node_modules/linked/index.d.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'real' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/app/node_modules/linked/node_modules' does not exist, skipping all lookups in it.", "File '/app/node_modules/real/package.json' does not exist.", "File '/app/node_modules/real.ts' does not exist.", @@ -20,7 +20,7 @@ "======== Module name 'real' was successfully resolved to '/app/node_modules/real/index.d.ts'. ========", "======== Resolving module 'linked' from '/app/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'linked' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'linked' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/app/node_modules/linked/package.json' does not exist according to earlier cached lookups.", "File '/app/node_modules/linked.ts' does not exist.", "File '/app/node_modules/linked.tsx' does not exist.", @@ -31,7 +31,7 @@ "======== Module name 'linked' was successfully resolved to '/app/node_modules/linked/index.d.ts'. ========", "======== Resolving module 'linked2' from '/app/app.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'linked2' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'linked2' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/app/node_modules/linked2/package.json' does not exist.", "File '/app/node_modules/linked2.ts' does not exist.", "File '/app/node_modules/linked2.tsx' does not exist.", @@ -42,7 +42,7 @@ "======== Module name 'linked2' was successfully resolved to '/app/node_modules/linked2/index.d.ts'. ========", "======== Resolving module 'real' from '/app/node_modules/linked2/index.d.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'real' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/app/node_modules/linked2/node_modules' does not exist, skipping all lookups in it.", "File '/app/node_modules/real/package.json' does not exist according to earlier cached lookups.", "File '/app/node_modules/real.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.trace.json b/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.trace.json index 19e44e72d6163..2bd12d2725d26 100644 --- a/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.trace.json +++ b/tests/baselines/reference/moduleResolutionWithSymlinks_withOutDir.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './library-a' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/library-a', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/library-a', target file types: TypeScript, Declaration.", "File '/src/library-a.ts' does not exist.", "File '/src/library-a.tsx' does not exist.", "File '/src/library-a.d.ts' does not exist.", @@ -10,7 +10,7 @@ "======== Module name './library-a' was successfully resolved to '/src/library-a/index.ts'. ========", "======== Resolving module './library-b' from '/src/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/src/library-b', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/library-b', target file types: TypeScript, Declaration.", "File '/src/library-b.ts' does not exist.", "File '/src/library-b.tsx' does not exist.", "File '/src/library-b.d.ts' does not exist.", @@ -19,7 +19,7 @@ "======== Module name './library-b' was successfully resolved to '/src/library-b/index.ts'. ========", "======== Resolving module 'library-a' from '/src/library-b/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'library-a' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'library-a' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/src/library-b/node_modules/library-a/package.json' does not exist.", "File '/src/library-b/node_modules/library-a.ts' does not exist.", "File '/src/library-b/node_modules/library-a.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_classicPrefersTs.symbols b/tests/baselines/reference/moduleResolution_classicPrefersTs.symbols new file mode 100644 index 0000000000000..460fa111175b6 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_classicPrefersTs.symbols @@ -0,0 +1,12 @@ +=== /dir1/dir2/dir3/a.js === + +export default "dir1/dir2/dir3/a.js"; + +=== /dir1/dir2/a.ts === + +export default "dir1/dir2/a.ts"; + +=== /dir1/dir2/dir3/index.ts === +import a from "a"; +>a : Symbol(a, Decl(index.ts, 0, 6)) + diff --git a/tests/baselines/reference/moduleResolution_classicPrefersTs.types b/tests/baselines/reference/moduleResolution_classicPrefersTs.types new file mode 100644 index 0000000000000..1a2abec612795 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_classicPrefersTs.types @@ -0,0 +1,12 @@ +=== /dir1/dir2/dir3/a.js === + +export default "dir1/dir2/dir3/a.js"; + +=== /dir1/dir2/a.ts === + +export default "dir1/dir2/a.ts"; + +=== /dir1/dir2/dir3/index.ts === +import a from "a"; +>a : "dir1/dir2/a.ts" + diff --git a/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot.trace.json b/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot.trace.json index a0ff3e6a5f767..cfdc94c7e4468 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo/bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo/bar.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json b/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json index ebeee4299fe01..d1053c8094fd3 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot_fakeScopedPackage.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo/@bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo/@bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo/@bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/@bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo/@bar.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_scopedPackage.trace.json b/tests/baselines/reference/moduleResolution_packageJson_scopedPackage.trace.json index 959e178b57e02..97d8afc46adca 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_scopedPackage.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_scopedPackage.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module '@foo/bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@foo/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@foo/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/@foo/bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/@foo/bar.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json index fa6937b140151..d25bc70b08c2c 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo/bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/foo/bar/package.json' does not exist.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", @@ -11,7 +11,7 @@ "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'.", "File '/node_modules/foo/bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/types.d.ts', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/types.d.ts', target file types: TypeScript, Declaration.", "File '/node_modules/foo/bar/types.d.ts.ts' does not exist.", "File '/node_modules/foo/bar/types.d.ts.tsx' does not exist.", "File '/node_modules/foo/bar/types.d.ts.d.ts' does not exist.", @@ -20,7 +20,7 @@ "File '/node_modules/foo/bar/index.tsx' does not exist.", "File '/node_modules/foo/bar/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'foo/bar' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo/bar' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/bar/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo/bar.js' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json index 8bc7e06171163..76ec74cec9264 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_fakeScopedPackage.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo/@bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo/@bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo/@bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/foo/@bar/package.json' does not exist.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", @@ -11,7 +11,7 @@ "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'.", "File '/node_modules/foo/@bar/types.d.ts' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/@bar/types.d.ts', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/@bar/types.d.ts', target file types: TypeScript, Declaration.", "File '/node_modules/foo/@bar/types.d.ts.ts' does not exist.", "File '/node_modules/foo/@bar/types.d.ts.tsx' does not exist.", "File '/node_modules/foo/@bar/types.d.ts.d.ts' does not exist.", @@ -20,7 +20,7 @@ "File '/node_modules/foo/@bar/index.tsx' does not exist.", "File '/node_modules/foo/@bar/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'foo/@bar' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo/@bar' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/@bar/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo/@bar.js' does not exist.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json index cf2b1082bf88f..5be14f09f5a1f 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/index.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo.ts' does not exist.", @@ -11,10 +11,7 @@ "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'src/index.js' that references '/node_modules/foo/src/index.js'.", "File '/node_modules/foo/src/index.js' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/src/index.js', target file type 'TypeScript'.", - "File '/node_modules/foo/src/index.js.ts' does not exist.", - "File '/node_modules/foo/src/index.js.tsx' does not exist.", - "File '/node_modules/foo/src/index.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/src/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/foo/src/index.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/src/index.ts' does not exist.", "File '/node_modules/foo/src/index.tsx' does not exist.", diff --git a/tests/baselines/reference/nodeModulesAtTypesPriority.errors.txt b/tests/baselines/reference/nodeModulesAtTypesPriority.errors.txt new file mode 100644 index 0000000000000..0f305430542d1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAtTypesPriority.errors.txt @@ -0,0 +1,34 @@ +error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation + + +!!! error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== /node_modules/@types/react/index.d.ts (0 errors) ==== + declare const React: any; + export = React; + +==== /node_modules/@types/redux/index.d.ts (0 errors) ==== + export declare function createStore(): void; + +==== /packages/a/node_modules/react/index.js (0 errors) ==== + module.exports = {}; + +==== /packages/a/node_modules/redux/index.d.ts (0 errors) ==== + export declare function createStore(): void; + +==== /packages/a/node_modules/redux/index.js (0 errors) ==== + module.exports = {}; + +==== /packages/a/index.ts (0 errors) ==== + import React from "react"; + import { createStore } from "redux"; + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAtTypesPriority.symbols b/tests/baselines/reference/nodeModulesAtTypesPriority.symbols new file mode 100644 index 0000000000000..5ba5bfdeab965 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAtTypesPriority.symbols @@ -0,0 +1,22 @@ +=== /node_modules/@types/react/index.d.ts === +declare const React: any; +>React : Symbol(React, Decl(index.d.ts, 0, 13)) + +export = React; +>React : Symbol(React, Decl(index.d.ts, 0, 13)) + +=== /node_modules/@types/redux/index.d.ts === +export declare function createStore(): void; +>createStore : Symbol(createStore, Decl(index.d.ts, 0, 0)) + +=== /packages/a/node_modules/redux/index.d.ts === +export declare function createStore(): void; +>createStore : Symbol(createStore, Decl(index.d.ts, 0, 0)) + +=== /packages/a/index.ts === +import React from "react"; +>React : Symbol(React, Decl(index.ts, 0, 6)) + +import { createStore } from "redux"; +>createStore : Symbol(createStore, Decl(index.ts, 1, 8)) + diff --git a/tests/baselines/reference/nodeModulesAtTypesPriority.trace.json b/tests/baselines/reference/nodeModulesAtTypesPriority.trace.json new file mode 100644 index 0000000000000..99f4fb69909e1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAtTypesPriority.trace.json @@ -0,0 +1,184 @@ +[ + "File '/node_modules/@types/react/package.json' does not exist.", + "File '/node_modules/@types/package.json' does not exist.", + "File '/node_modules/package.json' does not exist.", + "File '/package.json' does not exist.", + "File '/node_modules/@types/redux/package.json' does not exist.", + "File '/node_modules/@types/package.json' does not exist according to earlier cached lookups.", + "File '/node_modules/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/packages/a/node_modules/redux/package.json' does not exist.", + "File '/packages/a/node_modules/package.json' does not exist.", + "File '/packages/a/package.json' does not exist.", + "File '/packages/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File '/packages/a/package.json' does not exist according to earlier cached lookups.", + "File '/packages/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module 'react' from '/packages/a/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'node', 'require', 'types'.", + "File '/packages/a/package.json' does not exist according to earlier cached lookups.", + "File '/packages/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'react' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "File '/packages/a/node_modules/react/package.json' does not exist.", + "File '/packages/a/node_modules/react.ts' does not exist.", + "File '/packages/a/node_modules/react.tsx' does not exist.", + "File '/packages/a/node_modules/react.d.ts' does not exist.", + "File '/packages/a/node_modules/react/index.ts' does not exist.", + "File '/packages/a/node_modules/react/index.tsx' does not exist.", + "File '/packages/a/node_modules/react/index.d.ts' does not exist.", + "Directory '/packages/a/node_modules/@types' does not exist, skipping all lookups in it.", + "Directory '/packages/node_modules' does not exist, skipping all lookups in it.", + "File '/node_modules/react.ts' does not exist.", + "File '/node_modules/react.tsx' does not exist.", + "File '/node_modules/react.d.ts' does not exist.", + "File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups.", + "File '/node_modules/@types/react.d.ts' does not exist.", + "File '/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.", + "Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'.", + "======== Module name 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts'. ========", + "======== Resolving module 'redux' from '/packages/a/index.ts'. ========", + "Module resolution kind is not specified, using 'Node16'.", + "Resolving in CJS mode with conditions 'node', 'require', 'types'.", + "File '/packages/a/package.json' does not exist according to earlier cached lookups.", + "File '/packages/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "Loading module 'redux' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", + "File '/packages/a/node_modules/redux/package.json' does not exist according to earlier cached lookups.", + "File '/packages/a/node_modules/redux.ts' does not exist.", + "File '/packages/a/node_modules/redux.tsx' does not exist.", + "File '/packages/a/node_modules/redux.d.ts' does not exist.", + "File '/packages/a/node_modules/redux/index.ts' does not exist.", + "File '/packages/a/node_modules/redux/index.tsx' does not exist.", + "File '/packages/a/node_modules/redux/index.d.ts' exist - use it as a name resolution result.", + "Resolving real path for '/packages/a/node_modules/redux/index.d.ts', result '/packages/a/node_modules/redux/index.d.ts'.", + "======== Module name 'redux' was successfully resolved to '/packages/a/node_modules/redux/index.d.ts'. ========", + "======== Resolving type reference directive 'react', containing file '__inferred type names__.ts', root directory '/node_modules/@types'. ========", + "Resolving with primary search path '/node_modules/@types'.", + "File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups.", + "File '/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.", + "Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'.", + "======== Type reference directive 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts', primary: true. ========", + "======== Resolving type reference directive 'redux', containing file '__inferred type names__.ts', root directory '/node_modules/@types'. ========", + "Resolving with primary search path '/node_modules/@types'.", + "File '/node_modules/@types/redux/package.json' does not exist according to earlier cached lookups.", + "File '/node_modules/@types/redux/index.d.ts' exist - use it as a name resolution result.", + "Resolving real path for '/node_modules/@types/redux/index.d.ts', result '/node_modules/@types/redux/index.d.ts'.", + "======== Type reference directive 'redux' was successfully resolved to '/node_modules/@types/redux/index.d.ts', primary: true. ========", + "File 'package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "File 'package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups." +] \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAtTypesPriority.types b/tests/baselines/reference/nodeModulesAtTypesPriority.types new file mode 100644 index 0000000000000..441d367b9aa23 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAtTypesPriority.types @@ -0,0 +1,22 @@ +=== /node_modules/@types/react/index.d.ts === +declare const React: any; +>React : any + +export = React; +>React : any + +=== /node_modules/@types/redux/index.d.ts === +export declare function createStore(): void; +>createStore : () => void + +=== /packages/a/node_modules/redux/index.d.ts === +export declare function createStore(): void; +>createStore : () => void + +=== /packages/a/index.ts === +import React from "react"; +>React : any + +import { createStore } from "redux"; +>createStore : () => void + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json index c6764326f5e55..c780ff097e58f 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=node16).trace.json @@ -9,7 +9,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -18,8 +18,6 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -30,12 +28,10 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -43,7 +39,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types'.", "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", @@ -54,7 +50,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types@>=4'.", "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", @@ -65,13 +61,11 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", @@ -80,7 +74,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", "Module name 'foo', matched pattern 'foo'.", @@ -92,7 +86,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -101,8 +95,6 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -113,12 +105,10 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -126,7 +116,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types'.", "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", @@ -137,7 +127,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types@>=4'.", "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", @@ -148,13 +138,11 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", @@ -163,7 +151,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", "Module name 'foo', matched pattern 'foo'.", diff --git a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json index a7c19c8a9ae12..07f013e5604b6 100644 --- a/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesExportsBlocksTypesVersions(module=nodenext).trace.json @@ -9,7 +9,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -18,8 +18,6 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -30,12 +28,10 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -43,7 +39,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types'.", "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", @@ -54,7 +50,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types@>=4'.", "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", @@ -65,13 +61,11 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", @@ -80,7 +74,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", "Module name 'foo', matched pattern 'foo'.", @@ -92,7 +86,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -101,8 +95,6 @@ "File '/node_modules/exports-and-types-versions/dist/foo.d.ts' does not exist.", "Export specifier './foo' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/foo' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './foo' with target './dist/foo.js'.", "File name '/node_modules/exports-and-types-versions/dist/foo.js' has a '.js' extension - stripping it.", @@ -113,12 +105,10 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/nope' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Export specifier './nope' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "======== Module name 'exports-and-types-versions/nope' was not resolved. ========", @@ -126,7 +116,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types'.", "Using 'exports' subpath './yep' with target './types/foo.d.ts'.", @@ -137,7 +127,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-yep' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Matched 'exports' condition 'types@>=4'.", "Using 'exports' subpath './versioned-yep' with target './types/foo.d.ts'.", @@ -148,13 +138,11 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'exports-and-types-versions/versioned-nah' from 'node_modules' folder, target file type 'JavaScript'.", "File '/node_modules/exports-and-types-versions/package.json' exists according to earlier cached lookups.", "Saw non-matching condition 'types@<4'.", "Export specifier './versioned-nah' does not exist in package.json scope at path '/node_modules/exports-and-types-versions'.", @@ -163,7 +151,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'just-types-versions/foo' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File '/node_modules/just-types-versions/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '*' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'foo'.", "Module name 'foo', matched pattern 'foo'.", diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json index 6b1d472400a9e..0b338e8c685e2 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).trace.json @@ -5,7 +5,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/node/node_modules/inner/package.json'.", "'package.json' does not have a 'typesVersions' field.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", @@ -18,7 +18,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", @@ -30,7 +30,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.js' has a '.js' extension - stripping it.", @@ -124,7 +124,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", @@ -136,7 +136,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", @@ -148,7 +148,7 @@ "Module resolution kind is not specified, using 'Node16'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.js' has a '.js' extension - stripping it.", diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json index cb0668334dbb7..d46f96f8ba0c3 100644 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=nodenext).trace.json @@ -5,7 +5,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/node/node_modules/inner/package.json'.", "'package.json' does not have a 'typesVersions' field.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", @@ -18,7 +18,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", @@ -30,7 +30,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.js' has a '.js' extension - stripping it.", @@ -124,7 +124,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/cjs/index.cjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './cjs/*.cjs' with target './index.cjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.cjs' has a '.cjs' extension - stripping it.", @@ -136,7 +136,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/mjs/index.mjs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './mjs/*.mjs' with target './index.mjs'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.mjs' has a '.mjs' extension - stripping it.", @@ -148,7 +148,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", "File 'tests/cases/conformance/node/package.json' exists according to earlier cached lookups.", - "Loading module 'inner/js/index.js' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'inner/js/index.js' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/conformance/node/node_modules/inner/package.json' exists according to earlier cached lookups.", "Using 'exports' subpath './js/*.js' with target './index.js'.", "File name 'tests/cases/conformance/node/node_modules/inner/index.js' has a '.js' extension - stripping it.", diff --git a/tests/baselines/reference/packageJsonMain.trace.json b/tests/baselines/reference/packageJsonMain.trace.json index e5ae23f1d011a..4b7e05671e9a4 100644 --- a/tests/baselines/reference/packageJsonMain.trace.json +++ b/tests/baselines/reference/packageJsonMain.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo.ts' does not exist.", @@ -11,7 +11,7 @@ "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.", "File '/node_modules/foo/oof' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", "File '/node_modules/foo/oof.d.ts' does not exist.", @@ -20,19 +20,19 @@ "File '/node_modules/foo/index.tsx' does not exist.", "File '/node_modules/foo/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo.js' does not exist.", "File '/node_modules/foo.jsx' does not exist.", "'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.", "File '/node_modules/foo/oof' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: JavaScript.", "File '/node_modules/foo/oof.js' exist - use it as a name resolution result.", "Resolving real path for '/node_modules/foo/oof.js', result '/node_modules/foo/oof.js'.", "======== Module name 'foo' was successfully resolved to '/node_modules/foo/oof.js'. ========", "======== Resolving module 'bar' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/bar/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/bar.ts' does not exist.", @@ -43,20 +43,20 @@ "'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.", "File '/node_modules/bar/rab.js' exist - use it as a name resolution result.", "File '/node_modules/bar/rab.js' has an unsupported extension, so skipping it.", - "Loading module as file / folder, candidate module location '/node_modules/bar/rab.js', target file type 'TypeScript'.", - "File '/node_modules/bar/rab.js.ts' does not exist.", - "File '/node_modules/bar/rab.js.tsx' does not exist.", - "File '/node_modules/bar/rab.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/bar/rab.js', target file types: TypeScript, Declaration.", "File name '/node_modules/bar/rab.js' has a '.js' extension - stripping it.", "File '/node_modules/bar/rab.ts' does not exist.", "File '/node_modules/bar/rab.tsx' does not exist.", "File '/node_modules/bar/rab.d.ts' does not exist.", + "File '/node_modules/bar/rab.js.ts' does not exist.", + "File '/node_modules/bar/rab.js.tsx' does not exist.", + "File '/node_modules/bar/rab.js.d.ts' does not exist.", "Directory '/node_modules/bar/rab.js' does not exist, skipping all lookups in it.", "File '/node_modules/bar/index.ts' does not exist.", "File '/node_modules/bar/index.tsx' does not exist.", "File '/node_modules/bar/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'bar' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'bar' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/bar/package.json' exists according to earlier cached lookups.", "File '/node_modules/bar.js' does not exist.", "File '/node_modules/bar.jsx' does not exist.", @@ -66,7 +66,7 @@ "======== Module name 'bar' was successfully resolved to '/node_modules/bar/rab.js'. ========", "======== Resolving module 'baz' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'baz' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'baz' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/baz/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/baz.ts' does not exist.", @@ -76,7 +76,7 @@ "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.", "File '/node_modules/baz/zab' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file types: TypeScript, Declaration.", "File '/node_modules/baz/zab.ts' does not exist.", "File '/node_modules/baz/zab.tsx' does not exist.", "File '/node_modules/baz/zab.d.ts' does not exist.", @@ -87,13 +87,13 @@ "File '/node_modules/baz/index.tsx' does not exist.", "File '/node_modules/baz/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'baz' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'baz' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/baz/package.json' exists according to earlier cached lookups.", "File '/node_modules/baz.js' does not exist.", "File '/node_modules/baz.jsx' does not exist.", "'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.", "File '/node_modules/baz/zab' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/node_modules/baz/zab', target file types: JavaScript.", "File '/node_modules/baz/zab.js' does not exist.", "File '/node_modules/baz/zab.jsx' does not exist.", "File '/node_modules/baz/zab/index.js' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json b/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json index 97a56a2ce4e9b..fe5615b96b033 100644 --- a/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json +++ b/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'foo' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at '/node_modules/foo/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File '/node_modules/foo.ts' does not exist.", @@ -11,7 +11,7 @@ "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.", "File '/node_modules/foo/oof' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", "File '/node_modules/foo/oof.d.ts' does not exist.", @@ -22,13 +22,13 @@ "File '/node_modules/foo/index.tsx' does not exist.", "File '/node_modules/foo/index.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/package.json' exists according to earlier cached lookups.", "File '/node_modules/foo.js' does not exist.", "File '/node_modules/foo.jsx' does not exist.", "'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.", "File '/node_modules/foo/oof' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/oof', target file types: JavaScript.", "File '/node_modules/foo/oof.js' does not exist.", "File '/node_modules/foo/oof.jsx' does not exist.", "File '/node_modules/foo/oof/index.js' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.trace.json index ef2cb3b367fdd..d193b5545255d 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.trace.json @@ -3,24 +3,24 @@ "Explicitly specified module resolution kind: 'NodeJs'.", "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'folder2/file2'.", "Resolving module name 'folder2/file2' relative to base url 'c:/root' - 'c:/root/folder2/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/folder2/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder2/file2', target file types: TypeScript, Declaration.", "File 'c:/root/folder2/file2.ts' exist - use it as a name resolution result.", "======== Module name 'folder2/file2' was successfully resolved to 'c:/root/folder2/file2.ts'. ========", "======== Resolving module './file3' from 'c:/root/folder2/file2.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file types: TypeScript, Declaration.", "File 'c:/root/folder2/file3.ts' exist - use it as a name resolution result.", "======== Module name './file3' was successfully resolved to 'c:/root/folder2/file3.ts'. ========", "======== Resolving module 'file4' from 'c:/root/folder2/file2.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'file4'.", "Resolving module name 'file4' relative to base url 'c:/root' - 'c:/root/file4'.", - "Loading module as file / folder, candidate module location 'c:/root/file4', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/file4', target file types: TypeScript, Declaration.", "File 'c:/root/file4.ts' does not exist.", "File 'c:/root/file4.tsx' does not exist.", "File 'c:/root/file4.d.ts' does not exist.", "Directory 'c:/root/file4' does not exist, skipping all lookups in it.", - "Loading module 'file4' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'c:/root/folder2/node_modules' does not exist, skipping all lookups in it.", "Directory 'c:/root/node_modules' does not exist, skipping all lookups in it.", "File 'c:/node_modules/file4/package.json' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.trace.json index ef2cb3b367fdd..d193b5545255d 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.trace.json @@ -3,24 +3,24 @@ "Explicitly specified module resolution kind: 'NodeJs'.", "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'folder2/file2'.", "Resolving module name 'folder2/file2' relative to base url 'c:/root' - 'c:/root/folder2/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/folder2/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder2/file2', target file types: TypeScript, Declaration.", "File 'c:/root/folder2/file2.ts' exist - use it as a name resolution result.", "======== Module name 'folder2/file2' was successfully resolved to 'c:/root/folder2/file2.ts'. ========", "======== Resolving module './file3' from 'c:/root/folder2/file2.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder2/file3', target file types: TypeScript, Declaration.", "File 'c:/root/folder2/file3.ts' exist - use it as a name resolution result.", "======== Module name './file3' was successfully resolved to 'c:/root/folder2/file3.ts'. ========", "======== Resolving module 'file4' from 'c:/root/folder2/file2.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'file4'.", "Resolving module name 'file4' relative to base url 'c:/root' - 'c:/root/file4'.", - "Loading module as file / folder, candidate module location 'c:/root/file4', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/file4', target file types: TypeScript, Declaration.", "File 'c:/root/file4.ts' does not exist.", "File 'c:/root/file4.tsx' does not exist.", "File 'c:/root/file4.d.ts' does not exist.", "Directory 'c:/root/file4' does not exist, skipping all lookups in it.", - "Loading module 'file4' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'c:/root/folder2/node_modules' does not exist, skipping all lookups in it.", "Directory 'c:/root/node_modules' does not exist, skipping all lookups in it.", "File 'c:/node_modules/file4/package.json' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.trace.json index 3b6710408fc0f..3a82cb67e94f7 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name 'folder2/file1'.", "Module name 'folder2/file1', matched pattern '*'.", "Trying substitution '*', candidate module location: 'folder2/file1'.", - "Loading module as file / folder, candidate module location 'c:/root/folder2/file1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder2/file1', target file types: TypeScript, Declaration.", "File 'c:/root/folder2/file1.ts' exist - use it as a name resolution result.", "======== Module name 'folder2/file1' was successfully resolved to 'c:/root/folder2/file1.ts'. ========", "======== Resolving module 'folder3/file2' from 'c:/root/folder1/file1.ts'. ========", @@ -14,9 +14,9 @@ "'paths' option is specified, looking for a pattern to match module name 'folder3/file2'.", "Module name 'folder3/file2', matched pattern '*'.", "Trying substitution '*', candidate module location: 'folder3/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/folder3/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/folder3/file2', target file types: TypeScript, Declaration.", "Trying substitution 'generated/*', candidate module location: 'generated/folder3/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/folder3/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/folder3/file2', target file types: TypeScript, Declaration.", "File 'c:/root/generated/folder3/file2.ts' exist - use it as a name resolution result.", "======== Module name 'folder3/file2' was successfully resolved to 'c:/root/generated/folder3/file2.ts'. ========", "======== Resolving module 'components/file3' from 'c:/root/folder1/file1.ts'. ========", @@ -25,7 +25,7 @@ "'paths' option is specified, looking for a pattern to match module name 'components/file3'.", "Module name 'components/file3', matched pattern 'components/*'.", "Trying substitution 'shared/components/*', candidate module location: 'shared/components/file3'.", - "Loading module as file / folder, candidate module location 'c:/root/shared/components/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/shared/components/file3', target file types: TypeScript, Declaration.", "File 'c:/root/shared/components/file3.ts' does not exist.", "File 'c:/root/shared/components/file3.tsx' does not exist.", "File 'c:/root/shared/components/file3.d.ts' does not exist.", @@ -40,18 +40,18 @@ "'paths' option is specified, looking for a pattern to match module name 'file4'.", "Module name 'file4', matched pattern '*'.", "Trying substitution '*', candidate module location: 'file4'.", - "Loading module as file / folder, candidate module location 'c:/root/file4', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/file4', target file types: TypeScript, Declaration.", "File 'c:/root/file4.ts' does not exist.", "File 'c:/root/file4.tsx' does not exist.", "File 'c:/root/file4.d.ts' does not exist.", "Directory 'c:/root/file4' does not exist, skipping all lookups in it.", "Trying substitution 'generated/*', candidate module location: 'generated/file4'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/file4', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/file4', target file types: TypeScript, Declaration.", "File 'c:/root/generated/file4.ts' does not exist.", "File 'c:/root/generated/file4.tsx' does not exist.", "File 'c:/root/generated/file4.d.ts' does not exist.", "Directory 'c:/root/generated/file4' does not exist, skipping all lookups in it.", - "Loading module 'file4' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file4' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'c:/root/folder1/node_modules' does not exist, skipping all lookups in it.", "Directory 'c:/root/node_modules' does not exist, skipping all lookups in it.", "File 'c:/node_modules/file4.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution6_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution6_node.trace.json index 50f9bd862c104..9ae8cd832df77 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution6_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution6_node.trace.json @@ -6,11 +6,11 @@ "Checking if 'c:/root/generated/src/' is the longest matching prefix for 'c:/root/src/project/file3' - 'false'.", "Longest matching prefix for 'c:/root/src/project/file3' is 'c:/root/src/'.", "Loading 'project/file3' from the root dir 'c:/root/src/', candidate location 'c:/root/src/project/file3'.", - "Loading module as file / folder, candidate module location 'c:/root/src/project/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/src/project/file3', target file types: TypeScript, Declaration.", "Directory 'c:/root/src/project' does not exist, skipping all lookups in it.", "Trying other entries in 'rootDirs'.", "Loading 'project/file3' from the root dir 'c:/root/generated/src', candidate location 'c:/root/generated/src/project/file3'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/src/project/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/src/project/file3', target file types: TypeScript, Declaration.", "File 'c:/root/generated/src/project/file3.ts' exist - use it as a name resolution result.", "======== Module name './project/file3' was successfully resolved to 'c:/root/generated/src/project/file3.ts'. ========", "======== Resolving module '../file2' from 'c:/root/generated/src/project/file3.ts'. ========", @@ -20,14 +20,14 @@ "Checking if 'c:/root/generated/src/' is the longest matching prefix for 'c:/root/generated/src/file2' - 'true'.", "Longest matching prefix for 'c:/root/generated/src/file2' is 'c:/root/generated/src/'.", "Loading 'file2' from the root dir 'c:/root/generated/src/', candidate location 'c:/root/generated/src/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/src/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/src/file2', target file types: TypeScript, Declaration.", "File 'c:/root/generated/src/file2.ts' does not exist.", "File 'c:/root/generated/src/file2.tsx' does not exist.", "File 'c:/root/generated/src/file2.d.ts' does not exist.", "Directory 'c:/root/generated/src/file2' does not exist, skipping all lookups in it.", "Trying other entries in 'rootDirs'.", "Loading 'file2' from the root dir 'c:/root/src', candidate location 'c:/root/src/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/src/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/src/file2', target file types: TypeScript, Declaration.", "File 'c:/root/src/file2.ts' does not exist.", "File 'c:/root/src/file2.tsx' does not exist.", "File 'c:/root/src/file2.d.ts' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json index dd78aa4d4494e..c479911f3a6d2 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json @@ -6,11 +6,11 @@ "Checking if 'c:/root/generated/src/' is the longest matching prefix for 'c:/root/src/project/file2' - 'false'.", "Longest matching prefix for 'c:/root/src/project/file2' is 'c:/root/src/'.", "Loading 'project/file2' from the root dir 'c:/root/src/', candidate location 'c:/root/src/project/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/src/project/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/src/project/file2', target file types: TypeScript, Declaration.", "Directory 'c:/root/src/project' does not exist, skipping all lookups in it.", "Trying other entries in 'rootDirs'.", "Loading 'project/file2' from the root dir 'c:/root/generated/src', candidate location 'c:/root/generated/src/project/file2'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/src/project/file2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/src/project/file2', target file types: TypeScript, Declaration.", "File 'c:/root/generated/src/project/file2.ts' exist - use it as a name resolution result.", "======== Module name './project/file2' was successfully resolved to 'c:/root/generated/src/project/file2.ts'. ========", "======== Resolving module 'module3' from 'c:/root/src/file1.ts'. ========", @@ -19,18 +19,18 @@ "'paths' option is specified, looking for a pattern to match module name 'module3'.", "Module name 'module3', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module3'.", - "Loading module as file / folder, candidate module location 'c:/root/module3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/module3', target file types: TypeScript, Declaration.", "File 'c:/root/module3.ts' does not exist.", "File 'c:/root/module3.tsx' does not exist.", "File 'c:/root/module3.d.ts' does not exist.", "Directory 'c:/root/module3' does not exist, skipping all lookups in it.", "Trying substitution 'c:/shared/*', candidate module location: 'c:/shared/module3'.", - "Loading module as file / folder, candidate module location 'c:/shared/module3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/shared/module3', target file types: TypeScript, Declaration.", "File 'c:/shared/module3.ts' does not exist.", "File 'c:/shared/module3.tsx' does not exist.", "File 'c:/shared/module3.d.ts' does not exist.", "Directory 'c:/shared/module3' does not exist, skipping all lookups in it.", - "Loading module 'module3' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'module3' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'c:/root/src/node_modules' does not exist, skipping all lookups in it.", "Directory 'c:/root/node_modules' does not exist, skipping all lookups in it.", "File 'c:/node_modules/module3.ts' does not exist.", @@ -44,13 +44,13 @@ "'paths' option is specified, looking for a pattern to match module name 'module1'.", "Module name 'module1', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module1'.", - "Loading module as file / folder, candidate module location 'c:/root/module1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/module1', target file types: TypeScript, Declaration.", "File 'c:/root/module1.ts' does not exist.", "File 'c:/root/module1.tsx' does not exist.", "File 'c:/root/module1.d.ts' does not exist.", "Directory 'c:/root/module1' does not exist, skipping all lookups in it.", "Trying substitution 'c:/shared/*', candidate module location: 'c:/shared/module1'.", - "Loading module as file / folder, candidate module location 'c:/shared/module1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/shared/module1', target file types: TypeScript, Declaration.", "File 'c:/shared/module1.ts' does not exist.", "File 'c:/shared/module1.tsx' does not exist.", "File 'c:/shared/module1.d.ts' does not exist.", @@ -65,7 +65,7 @@ "'paths' option is specified, looking for a pattern to match module name 'templates/module2'.", "Module name 'templates/module2', matched pattern 'templates/*'.", "Trying substitution 'generated/src/templates/*', candidate module location: 'generated/src/templates/module2'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/src/templates/module2', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/src/templates/module2', target file types: TypeScript, Declaration.", "File 'c:/root/generated/src/templates/module2.ts' exist - use it as a name resolution result.", "======== Module name 'templates/module2' was successfully resolved to 'c:/root/generated/src/templates/module2.ts'. ========", "======== Resolving module '../file3' from 'c:/root/generated/src/project/file2.ts'. ========", @@ -75,14 +75,14 @@ "Checking if 'c:/root/generated/src/' is the longest matching prefix for 'c:/root/generated/src/file3' - 'true'.", "Longest matching prefix for 'c:/root/generated/src/file3' is 'c:/root/generated/src/'.", "Loading 'file3' from the root dir 'c:/root/generated/src/', candidate location 'c:/root/generated/src/file3'.", - "Loading module as file / folder, candidate module location 'c:/root/generated/src/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/generated/src/file3', target file types: TypeScript, Declaration.", "File 'c:/root/generated/src/file3.ts' does not exist.", "File 'c:/root/generated/src/file3.tsx' does not exist.", "File 'c:/root/generated/src/file3.d.ts' does not exist.", "Directory 'c:/root/generated/src/file3' does not exist, skipping all lookups in it.", "Trying other entries in 'rootDirs'.", "Loading 'file3' from the root dir 'c:/root/src', candidate location 'c:/root/src/file3'.", - "Loading module as file / folder, candidate module location 'c:/root/src/file3', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/root/src/file3', target file types: TypeScript, Declaration.", "File 'c:/root/src/file3.ts' does not exist.", "File 'c:/root/src/file3.tsx' does not exist.", "File 'c:/root/src/file3.d.ts' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json index 3a069183090a0..687fbea905136 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name '/foo'.", "Module name '/foo', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module '/bar' from '/root/a.ts'. ========", @@ -14,12 +14,12 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, Declaration.", "File '/bar.ts' does not exist.", "File '/bar.tsx' does not exist.", "File '/bar.d.ts' does not exist.", @@ -28,7 +28,7 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json index f00e7ffab8564..6ca8a0875cd02 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_differentRootTypes.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name '/foo'.", "Module name '/foo', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module '/bar' from '/root/a.ts'. ========", @@ -14,12 +14,12 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, Declaration.", "File '/bar.ts' does not exist.", "File '/bar.tsx' does not exist.", "File '/bar.d.ts' does not exist.", @@ -28,7 +28,7 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'c:/foo' from '/root/a.ts'. ========", @@ -37,7 +37,7 @@ "'paths' option is specified, looking for a pattern to match module name 'c:/foo'.", "Module name 'c:/foo', matched pattern 'c:/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'c:/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'c:/bar' from '/root/a.ts'. ========", @@ -46,18 +46,18 @@ "'paths' option is specified, looking for a pattern to match module name 'c:/bar'.", "Module name 'c:/bar', matched pattern 'c:/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location 'c:/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/bar', target file types: TypeScript, Declaration.", "Directory 'c:/' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'c:/bar'.", "'paths' option is specified, looking for a pattern to match module name 'c:/bar'.", "Module name 'c:/bar', matched pattern 'c:/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'c:/bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'c:\\foo' from '/root/a.ts'. ========", @@ -66,7 +66,7 @@ "'paths' option is specified, looking for a pattern to match module name 'c:\\foo'.", "Module name 'c:\\foo', matched pattern 'c:\\*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'c:\\foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'c:\\bar' from '/root/a.ts'. ========", @@ -75,18 +75,18 @@ "'paths' option is specified, looking for a pattern to match module name 'c:\\bar'.", "Module name 'c:\\bar', matched pattern 'c:\\*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location 'c:/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'c:/bar', target file types: TypeScript, Declaration.", "Directory 'c:/' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'c:\\bar'.", "'paths' option is specified, looking for a pattern to match module name 'c:\\bar'.", "Module name 'c:\\bar', matched pattern 'c:\\*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'c:\\bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module '//server/foo' from '/root/a.ts'. ========", @@ -95,7 +95,7 @@ "'paths' option is specified, looking for a pattern to match module name '//server/foo'.", "Module name '//server/foo', matched pattern '//server/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name '//server/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module '//server/bar' from '/root/a.ts'. ========", @@ -104,18 +104,18 @@ "'paths' option is specified, looking for a pattern to match module name '//server/bar'.", "Module name '//server/bar', matched pattern '//server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '//server/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '//server/bar', target file types: TypeScript, Declaration.", "Directory '//server/' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '//server/bar'.", "'paths' option is specified, looking for a pattern to match module name '//server/bar'.", "Module name '//server/bar', matched pattern '//server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name '//server/bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module '\\\\server\\foo' from '/root/a.ts'. ========", @@ -124,7 +124,7 @@ "'paths' option is specified, looking for a pattern to match module name '\\\\server\\foo'.", "Module name '\\\\server\\foo', matched pattern '\\\\server\\*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name '\\\\server\\foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module '\\\\server\\bar' from '/root/a.ts'. ========", @@ -133,18 +133,18 @@ "'paths' option is specified, looking for a pattern to match module name '\\\\server\\bar'.", "Module name '\\\\server\\bar', matched pattern '\\\\server\\*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '//server/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '//server/bar', target file types: TypeScript, Declaration.", "Directory '//server/' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '\\\\server\\bar'.", "'paths' option is specified, looking for a pattern to match module name '\\\\server\\bar'.", "Module name '\\\\server\\bar', matched pattern '\\\\server\\*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name '\\\\server\\bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'file:///foo' from '/root/a.ts'. ========", @@ -153,7 +153,7 @@ "'paths' option is specified, looking for a pattern to match module name 'file:///foo'.", "Module name 'file:///foo', matched pattern 'file:///*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'file:///foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'file:///bar' from '/root/a.ts'. ========", @@ -162,19 +162,19 @@ "'paths' option is specified, looking for a pattern to match module name 'file:///bar'.", "Module name 'file:///bar', matched pattern 'file:///*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module 'file:///bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file:///bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/root/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'file:///bar'.", "'paths' option is specified, looking for a pattern to match module name 'file:///bar'.", "Module name 'file:///bar', matched pattern 'file:///*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'file:///bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'file://c:/foo' from '/root/a.ts'. ========", @@ -183,7 +183,7 @@ "'paths' option is specified, looking for a pattern to match module name 'file://c:/foo'.", "Module name 'file://c:/foo', matched pattern 'file://c:/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'file://c:/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'file://c:/bar' from '/root/a.ts'. ========", @@ -192,19 +192,19 @@ "'paths' option is specified, looking for a pattern to match module name 'file://c:/bar'.", "Module name 'file://c:/bar', matched pattern 'file://c:/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module 'file://c:/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file://c:/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/root/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'file://c:/bar'.", "'paths' option is specified, looking for a pattern to match module name 'file://c:/bar'.", "Module name 'file://c:/bar', matched pattern 'file://c:/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'file://c:/bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'file://server/foo' from '/root/a.ts'. ========", @@ -213,7 +213,7 @@ "'paths' option is specified, looking for a pattern to match module name 'file://server/foo'.", "Module name 'file://server/foo', matched pattern 'file://server/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'file://server/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'file://server/bar' from '/root/a.ts'. ========", @@ -222,19 +222,19 @@ "'paths' option is specified, looking for a pattern to match module name 'file://server/bar'.", "Module name 'file://server/bar', matched pattern 'file://server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module 'file://server/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'file://server/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/root/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'file://server/bar'.", "'paths' option is specified, looking for a pattern to match module name 'file://server/bar'.", "Module name 'file://server/bar', matched pattern 'file://server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'file://server/bar' was successfully resolved to '/root/src/bar.js'. ========", "======== Resolving module 'http://server/foo' from '/root/a.ts'. ========", @@ -243,7 +243,7 @@ "'paths' option is specified, looking for a pattern to match module name 'http://server/foo'.", "Module name 'http://server/foo', matched pattern 'http://server/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name 'http://server/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module 'http://server/bar' from '/root/a.ts'. ========", @@ -252,19 +252,19 @@ "'paths' option is specified, looking for a pattern to match module name 'http://server/bar'.", "Module name 'http://server/bar', matched pattern 'http://server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module 'http://server/bar' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'http://server/bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/root/node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name 'http://server/bar'.", "'paths' option is specified, looking for a pattern to match module name 'http://server/bar'.", "Module name 'http://server/bar', matched pattern 'http://server/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name 'http://server/bar' was successfully resolved to '/root/src/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json index 9ee9c816b6363..ddba5cc95fe22 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_multipleAliases.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name '/import/foo'.", "Module name '/import/foo', matched pattern '/import/*'.", "Trying substitution './import/*', candidate module location: './import/foo'.", - "Loading module as file / folder, candidate module location '/root/import/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/import/foo', target file types: TypeScript, Declaration.", "File '/root/import/foo.ts' exist - use it as a name resolution result.", "======== Module name '/import/foo' was successfully resolved to '/root/import/foo.ts'. ========", "======== Resolving module '/client/bar' from '/root/src/a.ts'. ========", @@ -14,18 +14,18 @@ "'paths' option is specified, looking for a pattern to match module name '/client/bar'.", "Module name '/client/bar', matched pattern '/client/*'.", "Trying substitution './client/*', candidate module location: './client/bar'.", - "Loading module as file / folder, candidate module location '/root/client/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/client/bar', target file types: TypeScript, Declaration.", "File '/root/client/bar.ts' does not exist.", "File '/root/client/bar.tsx' does not exist.", "File '/root/client/bar.d.ts' does not exist.", "Directory '/root/client/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/client/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/client/bar', target file types: TypeScript, Declaration.", "Directory '/client' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '/client/bar'.", "'paths' option is specified, looking for a pattern to match module name '/client/bar'.", "Module name '/client/bar', matched pattern '/client/*'.", "Trying substitution './client/*', candidate module location: './client/bar'.", - "Loading module as file / folder, candidate module location '/root/client/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/client/bar', target file types: JavaScript.", "File '/root/client/bar.js' exist - use it as a name resolution result.", "======== Module name '/client/bar' was successfully resolved to '/root/client/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json index 1b2d42bacdd6b..1824f929011ad 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.trace.json @@ -5,8 +5,8 @@ "'paths' option is specified, looking for a pattern to match module name '/foo'.", "Module name '/foo', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ts' exist - use it as a name resolution result.", "======== Module name '/foo' was successfully resolved to '/foo.ts'. ========", "======== Resolving module '/bar' from '/root/a.ts'. ========", @@ -15,8 +15,8 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", + "Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, Declaration.", "File '/bar.ts' does not exist.", "File '/bar.tsx' does not exist.", "File '/bar.d.ts' does not exist.", @@ -25,8 +25,8 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '/*'.", "Trying substitution './src/*', candidate module location: './src/bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", - "Loading module as file / folder, candidate module location '/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", + "Loading module as file / folder, candidate module location '/bar', target file types: JavaScript.", "File '/bar.js' exist - use it as a name resolution result.", "======== Module name '/bar' was successfully resolved to '/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json index 7eaac73acb929..138b6f8528492 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot.trace.json @@ -5,7 +5,7 @@ "'paths' option is specified, looking for a pattern to match module name '/foo'.", "Module name '/foo', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", "File '/root/src/foo.ts' exist - use it as a name resolution result.", "======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ========", "======== Resolving module '/bar' from '/root/a.ts'. ========", @@ -14,12 +14,12 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", "File '/root/src/bar.ts' does not exist.", "File '/root/src/bar.tsx' does not exist.", "File '/root/src/bar.d.ts' does not exist.", "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, Declaration.", "File '/bar.ts' does not exist.", "File '/bar.tsx' does not exist.", "File '/bar.d.ts' does not exist.", @@ -28,7 +28,7 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", "File '/root/src/bar.js' exist - use it as a name resolution result.", "======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json index 505871d8f31d0..3dbf81032ddab 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.trace.json @@ -5,8 +5,8 @@ "'paths' option is specified, looking for a pattern to match module name '/foo'.", "Module name '/foo', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", - "Loading module as file / folder, candidate module location '/foo', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/foo', target file types: TypeScript, Declaration.", + "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, Declaration.", "File '/foo.ts' exist - use it as a name resolution result.", "======== Module name '/foo' was successfully resolved to '/foo.ts'. ========", "======== Resolving module '/bar' from '/root/a.ts'. ========", @@ -15,8 +15,8 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: TypeScript, Declaration.", + "Loading module as file / folder, candidate module location '/bar', target file types: TypeScript, Declaration.", "File '/bar.ts' does not exist.", "File '/bar.tsx' does not exist.", "File '/bar.d.ts' does not exist.", @@ -25,8 +25,8 @@ "'paths' option is specified, looking for a pattern to match module name '/bar'.", "Module name '/bar', matched pattern '*'.", "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", - "Loading module as file / folder, candidate module location '/bar', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/root/src/bar', target file types: JavaScript.", + "Loading module as file / folder, candidate module location '/bar', target file types: JavaScript.", "File '/bar.js' exist - use it as a name resolution result.", "======== Module name '/bar' was successfully resolved to '/bar.js'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtensionInName.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtensionInName.trace.json index c23f61c1c3e2c..771d7c8ccf8ae 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtensionInName.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtensionInName.trace.json @@ -5,14 +5,14 @@ "'paths' option is specified, looking for a pattern to match module name 'zone.js'.", "Module name 'zone.js', matched pattern '*'.", "Trying substitution 'foo/*', candidate module location: 'foo/zone.js'.", - "Loading module as file / folder, candidate module location '/foo/zone.js', target file type 'TypeScript'.", - "File '/foo/zone.js.ts' does not exist.", - "File '/foo/zone.js.tsx' does not exist.", - "File '/foo/zone.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/foo/zone.js', target file types: TypeScript, Declaration.", "File name '/foo/zone.js' has a '.js' extension - stripping it.", "File '/foo/zone.ts' does not exist.", "File '/foo/zone.tsx' does not exist.", "File '/foo/zone.d.ts' does not exist.", + "File '/foo/zone.js.ts' does not exist.", + "File '/foo/zone.js.tsx' does not exist.", + "File '/foo/zone.js.d.ts' does not exist.", "File '/foo/zone.js/package.json' does not exist.", "File '/foo/zone.js/index.ts' does not exist.", "File '/foo/zone.js/index.tsx' does not exist.", @@ -24,7 +24,7 @@ "'paths' option is specified, looking for a pattern to match module name 'zone.tsx'.", "Module name 'zone.tsx', matched pattern '*'.", "Trying substitution 'foo/*', candidate module location: 'foo/zone.tsx'.", - "Loading module as file / folder, candidate module location '/foo/zone.tsx', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo/zone.tsx', target file types: TypeScript, Declaration.", "File '/foo/zone.tsx.ts' does not exist.", "File '/foo/zone.tsx.tsx' does not exist.", "File '/foo/zone.tsx.d.ts' does not exist.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json index 2597e6ac2eb84..ef53886c656c8 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.trace.json @@ -5,35 +5,33 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.js'.", "Module name 'foo/bar/foobar.js', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.js'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.js', target file type 'TypeScript'.", - "File '/node_modules/foo/bar/foobar.js.ts' does not exist.", - "File '/node_modules/foo/bar/foobar.js.tsx' does not exist.", - "File '/node_modules/foo/bar/foobar.js.d.ts' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.js', target file types: TypeScript, Declaration.", "File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/bar/foobar.ts' does not exist.", "File '/node_modules/foo/bar/foobar.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.d.ts' does not exist.", - "Directory '/node_modules/foo/bar/foobar.js' does not exist, skipping all lookups in it.", - "Trying substitution 'src/types', candidate module location: 'src/types'.", - "Loading module as file / folder, candidate module location '/src/types', target file type 'TypeScript'.", - "Loading module 'foo/bar/foobar.js' from 'node_modules' folder, target file type 'TypeScript'.", - "File '/node_modules/foo/package.json' does not exist.", "File '/node_modules/foo/bar/foobar.js.ts' does not exist.", "File '/node_modules/foo/bar/foobar.js.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.js.d.ts' does not exist.", + "Directory '/node_modules/foo/bar/foobar.js' does not exist, skipping all lookups in it.", + "Trying substitution 'src/types', candidate module location: 'src/types'.", + "Loading module as file / folder, candidate module location '/src/types', target file types: TypeScript, Declaration.", + "Loading module 'foo/bar/foobar.js' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "File '/node_modules/foo/package.json' does not exist.", "File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/bar/foobar.ts' does not exist.", "File '/node_modules/foo/bar/foobar.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.d.ts' does not exist.", + "File '/node_modules/foo/bar/foobar.js.ts' does not exist.", + "File '/node_modules/foo/bar/foobar.js.tsx' does not exist.", + "File '/node_modules/foo/bar/foobar.js.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", "File name '/node_modules/@types/foo/bar/foobar.js' has a '.js' extension - stripping it.", "'baseUrl' option is set to '/', using this value to resolve non-relative module name 'foo/bar/foobar.js'.", "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.js'.", "Module name 'foo/bar/foobar.js', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.js'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.js', target file type 'JavaScript'.", - "File '/node_modules/foo/bar/foobar.js.js' does not exist.", - "File '/node_modules/foo/bar/foobar.js.jsx' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.js', target file types: JavaScript.", "File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it.", "File '/node_modules/foo/bar/foobar.js' exist - use it as a name resolution result.", "File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json index 803520f12fd5a..85eb2837db1d4 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution_withExtension_failedLookup.trace.json @@ -6,16 +6,16 @@ "Module name 'foo', matched pattern 'foo'.", "Trying substitution 'foo/foo.ts', candidate module location: 'foo/foo.ts'.", "File '/foo/foo.ts' does not exist.", - "Loading module as file / folder, candidate module location '/foo/foo.ts', target file type 'TypeScript'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/foo/foo.ts', target file types: TypeScript, Declaration.", + "Loading module 'foo' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'baseUrl' option is set to '/', using this value to resolve non-relative module name 'foo'.", "'paths' option is specified, looking for a pattern to match module name 'foo'.", "Module name 'foo', matched pattern 'foo'.", "Trying substitution 'foo/foo.ts', candidate module location: 'foo/foo.ts'.", "File '/foo/foo.ts' does not exist.", - "Loading module as file / folder, candidate module location '/foo/foo.ts', target file type 'JavaScript'.", - "Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/foo/foo.ts', target file types: JavaScript.", + "Loading module 'foo' from 'node_modules' folder, target file types: JavaScript.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/pathsValidation4.trace.json b/tests/baselines/reference/pathsValidation4.trace.json index cd4f358050f29..78d0638aae1bf 100644 --- a/tests/baselines/reference/pathsValidation4.trace.json +++ b/tests/baselines/reference/pathsValidation4.trace.json @@ -5,12 +5,12 @@ "'paths' option is specified, looking for a pattern to match module name 'someModule'.", "'baseUrl' option is set to 'tests/cases/compiler/src', using this value to resolve non-relative module name 'someModule'.", "Resolving module name 'someModule' relative to base url 'tests/cases/compiler/src' - 'tests/cases/compiler/src/someModule'.", - "Loading module as file / folder, candidate module location 'tests/cases/compiler/src/someModule', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/compiler/src/someModule', target file types: TypeScript, Declaration.", "File 'tests/cases/compiler/src/someModule.ts' does not exist.", "File 'tests/cases/compiler/src/someModule.tsx' does not exist.", "File 'tests/cases/compiler/src/someModule.d.ts' does not exist.", "Directory 'tests/cases/compiler/src/someModule' does not exist, skipping all lookups in it.", - "Loading module 'someModule' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'someModule' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'tests/cases/compiler/src/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/compiler/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", @@ -21,11 +21,11 @@ "'paths' option is specified, looking for a pattern to match module name 'someModule'.", "'baseUrl' option is set to 'tests/cases/compiler/src', using this value to resolve non-relative module name 'someModule'.", "Resolving module name 'someModule' relative to base url 'tests/cases/compiler/src' - 'tests/cases/compiler/src/someModule'.", - "Loading module as file / folder, candidate module location 'tests/cases/compiler/src/someModule', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/compiler/src/someModule', target file types: JavaScript.", "File 'tests/cases/compiler/src/someModule.js' does not exist.", "File 'tests/cases/compiler/src/someModule.jsx' does not exist.", "Directory 'tests/cases/compiler/src/someModule' does not exist, skipping all lookups in it.", - "Loading module 'someModule' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'someModule' from 'node_modules' folder, target file types: JavaScript.", "Directory 'tests/cases/compiler/src/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/compiler/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/pathsValidation5.trace.json b/tests/baselines/reference/pathsValidation5.trace.json index 05ad95e91e0f7..e16277adccb7f 100644 --- a/tests/baselines/reference/pathsValidation5.trace.json +++ b/tests/baselines/reference/pathsValidation5.trace.json @@ -2,7 +2,7 @@ "======== Resolving module 'someModule' from 'tests/cases/compiler/src/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", "'paths' option is specified, looking for a pattern to match module name 'someModule'.", - "Loading module 'someModule' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'someModule' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory 'tests/cases/compiler/src/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/compiler/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", @@ -10,7 +10,7 @@ "Directory 'node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", "'paths' option is specified, looking for a pattern to match module name 'someModule'.", - "Loading module 'someModule' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'someModule' from 'node_modules' folder, target file types: JavaScript.", "Directory 'tests/cases/compiler/src/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/compiler/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json index 142a02242e654..f5569339da211 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNext.trace.json @@ -12,7 +12,7 @@ "File 'tests/package.json' does not exist according to earlier cached lookups.", "File 'package.json' does not exist according to earlier cached lookups.", "File '/package.json' does not exist according to earlier cached lookups.", - "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "Found 'package.json' at 'tests/cases/compiler/node_modules/@types/react/package.json'.", "'package.json' does not have a 'typesVersions' field.", "File 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts' exist - use it as a name resolution result.", @@ -22,7 +22,7 @@ "======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", - "Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'index.d.ts' that references 'tests/cases/compiler/node_modules/@types/react/index.d.ts'.", diff --git a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json index 626b13823e2f0..24ba72063b9a8 100644 --- a/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/tests/baselines/reference/reactJsxReactResolvedNodeNextEsm.trace.json @@ -5,7 +5,7 @@ "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in ESM mode with conditions 'node', 'import', 'types'.", "File 'tests/cases/compiler/package.json' exists according to earlier cached lookups.", - "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'react/jsx-runtime' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.", "Found 'package.json' at 'tests/cases/compiler/node_modules/@types/react/package.json'.", "'package.json' does not have a 'typesVersions' field.", "Using 'exports' subpath './*' with target './jsx-runtime.js'.", @@ -17,7 +17,7 @@ "======== Resolving module './' from 'tests/cases/compiler/node_modules/@types/react/jsx-runtime.d.ts'. ========", "Module resolution kind is not specified, using 'NodeNext'.", "Resolving in CJS mode with conditions 'node', 'require', 'types'.", - "Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/compiler/node_modules/@types/react/', target file types: TypeScript, JavaScript, Declaration.", "File 'tests/cases/compiler/node_modules/@types/react/package.json' exists according to earlier cached lookups.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'index.d.ts' that references 'tests/cases/compiler/node_modules/@types/react/index.d.ts'.", diff --git a/tests/baselines/reference/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json b/tests/baselines/reference/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json index 5fcf495860391..0671dcbd6317b 100644 --- a/tests/baselines/reference/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json +++ b/tests/baselines/reference/requireOfJsonFileWithoutResolveJsonModuleAndPathMapping.trace.json @@ -5,14 +5,14 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'.", "Module name 'foo/bar/foobar.json', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: TypeScript, Declaration.", "File '/node_modules/foo/bar/foobar.json.ts' does not exist.", "File '/node_modules/foo/bar/foobar.json.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.json.d.ts' does not exist.", "Directory '/node_modules/foo/bar/foobar.json' does not exist, skipping all lookups in it.", "Trying substitution 'src/types', candidate module location: 'src/types'.", - "Loading module as file / folder, candidate module location '/src/types', target file type 'TypeScript'.", - "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/types', target file types: TypeScript, Declaration.", + "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/foo/package.json' does not exist.", "File '/node_modules/foo/bar/foobar.json.ts' does not exist.", "File '/node_modules/foo/bar/foobar.json.tsx' does not exist.", @@ -22,13 +22,13 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'.", "Module name 'foo/bar/foobar.json', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: JavaScript.", "File '/node_modules/foo/bar/foobar.json.js' does not exist.", "File '/node_modules/foo/bar/foobar.json.jsx' does not exist.", "Directory '/node_modules/foo/bar/foobar.json' does not exist, skipping all lookups in it.", "Trying substitution 'src/types', candidate module location: 'src/types'.", - "Loading module as file / folder, candidate module location '/src/types', target file type 'JavaScript'.", - "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location '/src/types', target file types: JavaScript.", + "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file types: JavaScript.", "File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/foo/bar/foobar.json.js' does not exist.", "File '/node_modules/foo/bar/foobar.json.jsx' does not exist.", diff --git a/tests/baselines/reference/requireOfJsonFile_PathMapping.trace.json b/tests/baselines/reference/requireOfJsonFile_PathMapping.trace.json index e13cc91a3da29..57579896df342 100644 --- a/tests/baselines/reference/requireOfJsonFile_PathMapping.trace.json +++ b/tests/baselines/reference/requireOfJsonFile_PathMapping.trace.json @@ -5,31 +5,24 @@ "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'.", "Module name 'foo/bar/foobar.json', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: TypeScript, Declaration.", "File '/node_modules/foo/bar/foobar.json.ts' does not exist.", "File '/node_modules/foo/bar/foobar.json.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.json.d.ts' does not exist.", - "File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it.", - "File '/node_modules/foo/bar/foobar.json.d.ts' does not exist.", "Directory '/node_modules/foo/bar/foobar.json' does not exist, skipping all lookups in it.", "Trying substitution 'src/types', candidate module location: 'src/types'.", - "Loading module as file / folder, candidate module location '/src/types', target file type 'TypeScript'.", - "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/src/types', target file types: TypeScript, Declaration.", + "Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/foo/package.json' does not exist.", "File '/node_modules/foo/bar/foobar.json.ts' does not exist.", "File '/node_modules/foo/bar/foobar.json.tsx' does not exist.", "File '/node_modules/foo/bar/foobar.json.d.ts' does not exist.", - "File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it.", - "File '/node_modules/foo/bar/foobar.json.d.ts' does not exist.", "Directory '/node_modules/@types' does not exist, skipping all lookups in it.", - "File name '/node_modules/@types/foo/bar/foobar.json' has a '.json' extension - stripping it.", "'baseUrl' option is set to '/', using this value to resolve non-relative module name 'foo/bar/foobar.json'.", "'paths' option is specified, looking for a pattern to match module name 'foo/bar/foobar.json'.", "Module name 'foo/bar/foobar.json', matched pattern '*'.", "Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.", - "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'JavaScript'.", - "File '/node_modules/foo/bar/foobar.json.js' does not exist.", - "File '/node_modules/foo/bar/foobar.json.jsx' does not exist.", + "Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file types: JavaScript, JSON.", "File name '/node_modules/foo/bar/foobar.json' has a '.json' extension - stripping it.", "File '/node_modules/foo/bar/foobar.json' exist - use it as a name resolution result.", "File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.", diff --git a/tests/baselines/reference/scopedPackages.trace.json b/tests/baselines/reference/scopedPackages.trace.json index 29170ab5bd378..5a3ccdd092c25 100644 --- a/tests/baselines/reference/scopedPackages.trace.json +++ b/tests/baselines/reference/scopedPackages.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module '@cow/boy' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@cow/boy' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@cow/boy' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/@cow/boy/package.json' does not exist.", "File '/node_modules/@cow/boy.ts' does not exist.", "File '/node_modules/@cow/boy.tsx' does not exist.", @@ -13,7 +13,7 @@ "======== Module name '@cow/boy' was successfully resolved to '/node_modules/@cow/boy/index.d.ts'. ========", "======== Resolving module '@be/bop' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@be/bop' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@be/bop' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Scoped package detected, looking in 'be__bop'", "File '/node_modules/@types/be__bop/package.json' does not exist.", "File '/node_modules/@types/be__bop.d.ts' does not exist.", @@ -22,7 +22,7 @@ "======== Module name '@be/bop' was successfully resolved to '/node_modules/@types/be__bop/index.d.ts'. ========", "======== Resolving module '@be/bop/e/z' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module '@be/bop/e/z' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module '@be/bop/e/z' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Scoped package detected, looking in 'be__bop/e/z'", "File '/node_modules/@types/be__bop/package.json' does not exist according to earlier cached lookups.", "File '/node_modules/@types/be__bop/e/z.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js b/tests/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js index a566a262e4d7a..feee35691bf36 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js @@ -89,7 +89,7 @@ Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. File '/src/projects/b/src/package.json' does not exist according to earlier cached lookups. File '/src/projects/b/package.json' exists according to earlier cached lookups. -Loading module 'pg' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/src/projects/b/src/node_modules' does not exist, skipping all lookups in it. Directory '/src/projects/b/node_modules' does not exist, skipping all lookups in it. File '/src/projects/node_modules/@types/pg/package.json' exists according to earlier cached lookups. diff --git a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js index 7b22f14418075..1465574e71f9e 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js @@ -47,7 +47,7 @@ Output:: Module resolution kind is not specified, using 'NodeJs'. 'baseUrl' option is set to '/user/username/projects/myproject/packages/pkg2', using this value to resolve non-relative module name 'const'. Resolving module name 'const' relative to base url '/user/username/projects/myproject/packages/pkg2' - '/user/username/projects/myproject/packages/pkg2/const'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it as a name resolution result. ======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== [12:00:58 AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/index.js' does not exist @@ -56,7 +56,7 @@ File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it a ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -69,10 +69,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -83,7 +80,7 @@ Using compiler options of project reference redirect '/user/username/projects/my Module resolution kind is not specified, using 'NodeJs'. 'baseUrl' option is set to '/user/username/projects/myproject/packages/pkg2', using this value to resolve non-relative module name 'const'. Resolving module name 'const' relative to base url '/user/username/projects/myproject/packages/pkg2' - '/user/username/projects/myproject/packages/pkg2/const'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it as a name resolution result. ======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== diff --git a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js index 9f0d8d6ff0532..d7005853125ea 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js @@ -47,7 +47,7 @@ Output:: Module resolution kind is not specified, using 'NodeJs'. 'baseUrl' option is set to '/user/username/projects/myproject/packages/pkg2', using this value to resolve non-relative module name 'const'. Resolving module name 'const' relative to base url '/user/username/projects/myproject/packages/pkg2' - '/user/username/projects/myproject/packages/pkg2/const'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it as a name resolution result. ======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== [12:00:58 AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/index.js' does not exist @@ -56,7 +56,7 @@ File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it a ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -69,10 +69,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -84,7 +81,7 @@ Using compiler options of project reference redirect '/user/username/projects/my Module resolution kind is not specified, using 'NodeJs'. 'baseUrl' option is set to '/user/username/projects/myproject/packages/pkg2', using this value to resolve non-relative module name 'const'. Resolving module name 'const' relative to base url '/user/username/projects/myproject/packages/pkg2' - '/user/username/projects/myproject/packages/pkg2/const'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it as a name resolution result. ======== Module name 'const' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js index f56626112030d..d081292172fe6 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js @@ -54,10 +54,7 @@ Output:: ======== Resolving module './const.js' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/const.js.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/const.js.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/const.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it as a name resolution result. ======== Module name './const.js' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.ts'. ======== @@ -67,7 +64,7 @@ File '/user/username/projects/myproject/packages/pkg2/const.ts' exist - use it a ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -80,10 +77,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -93,10 +87,7 @@ Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/bui ======== Resolving module './const.js' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist. @@ -304,7 +295,7 @@ Output:: ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -317,10 +308,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/other.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/other.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/other.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/other.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/other.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/other.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/other.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/other.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/other.tsx' does not exist. @@ -396,7 +384,7 @@ Output:: ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -409,10 +397,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -422,10 +407,7 @@ Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/bui ======== Resolving module './const.js' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist. diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index b6c00656975f4..9305de1d4c865 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -54,7 +54,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it as a name resolution result. ======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== @@ -71,7 +71,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -81,7 +81,7 @@ Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/pac 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -94,7 +94,7 @@ File '/user/username/projects/myproject/packages/pkg2/package.json' exists accor Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. @@ -297,7 +297,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -310,10 +310,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -327,7 +324,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. @@ -416,7 +413,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -426,7 +423,7 @@ Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/pac 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -440,7 +437,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. @@ -524,7 +521,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -537,10 +534,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -554,7 +548,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. @@ -644,10 +638,7 @@ Output:: ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/const.cjs.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/const.cjs.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/const.cjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it as a name resolution result. ======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/const.cts'. ======== @@ -664,7 +655,7 @@ Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -677,10 +668,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' has 'main' field 'build/index.cjs' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs' exist - use it as a name resolution result. File '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.cts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.cts' exist - use it as a name resolution result. @@ -690,10 +678,7 @@ Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/bui Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/build/const.cjs.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.cjs.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.cjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js index 0db4bb6181274..25c14692f1944 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-moduleCaseChange.js @@ -89,7 +89,7 @@ interface Array { length: number; [n: number]: T; } Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. @@ -105,7 +105,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa/index.d.ts@3.0.0-beta-2'. ======== ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'plugin-two' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, Declaration. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.tsx' does not exist. @@ -117,7 +117,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myProject/plugin-two/index.d.ts'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myProject/plugin-two/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myProject/plugin-two/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myProject/plugin-two/node_modules/typescript-fsa.ts' does not exist. diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js index 49ea0557cde35..ed8b4eb993c45 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link-moduleCaseChange.js @@ -91,7 +91,7 @@ interface Array { length: number; [n: number]: T; } Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'plugin-two' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. @@ -101,10 +101,7 @@ File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'dist/commonjs/index.js' that references '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js'. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js' does not exist. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.ts' does not exist. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.tsx' does not exist. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.ts' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.tsx' does not exist. @@ -113,7 +110,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myProject/plugin-two/dist/commonjs/index.d.ts' with Package ID 'plugin-two/dist/commonjs/index.d.ts@0.1.3'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. @@ -129,7 +126,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa/index.d.ts@3.0.0-beta-2'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myProject/plugin-two/dist/commonjs/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myProject/plugin-two/dist/commonjs/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myProject/plugin-two/dist/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myProject/plugin-two/node_modules/typescript-fsa/package.json'. diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js index 5a03c9782e184..b155ae818b824 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package-with-indirect-link.js @@ -91,7 +91,7 @@ interface Array { length: number; [n: number]: T; } Output:: ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'plugin-two' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. @@ -101,10 +101,7 @@ File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'dist/commonjs/index.js' that references '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js'. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js' does not exist. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.ts' does not exist. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.tsx' does not exist. -File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.ts' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/dist/commonjs/index.tsx' does not exist. @@ -113,7 +110,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts' with Package ID 'plugin-two/dist/commonjs/index.d.ts@0.1.3'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. @@ -129,7 +126,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa/index.d.ts@3.0.0-beta-2'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-two/dist/commonjs/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/plugin-two/dist/commonjs/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/plugin-two/dist/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json'. diff --git a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js index a1ccbb06a2345..7551fb51042d0 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-same-version-is-referenced-through-source-and-another-symlinked-package.js @@ -89,7 +89,7 @@ interface Array { length: number; [n: number]: T; } Output:: ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-one/action.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa.ts' does not exist. @@ -105,7 +105,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'typescript-fsa' was successfully resolved to '/user/username/projects/myproject/plugin-one/node_modules/typescript-fsa/index.d.ts' with Package ID 'typescript-fsa/index.d.ts@3.0.0-beta-2'. ======== ======== Resolving module 'plugin-two' from '/user/username/projects/myproject/plugin-one/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'plugin-two' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'plugin-two' from 'node_modules' folder, target file types: TypeScript, Declaration. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two/package.json' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.ts' does not exist. File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.tsx' does not exist. @@ -117,7 +117,7 @@ Resolving real path for '/user/username/projects/myproject/plugin-one/node_modul ======== Module name 'plugin-two' was successfully resolved to '/user/username/projects/myproject/plugin-two/index.d.ts'. ======== ======== Resolving module 'typescript-fsa' from '/user/username/projects/myproject/plugin-two/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'typescript-fsa' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'typescript-fsa' from 'node_modules' folder, target file types: TypeScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa/package.json'. 'package.json' does not have a 'typesVersions' field. File '/user/username/projects/myproject/plugin-two/node_modules/typescript-fsa.ts' does not exist. diff --git a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js index 02b0f7e41d964..c7f28d8491c28 100644 --- a/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js +++ b/tests/baselines/reference/tscWatch/forceConsistentCasingInFileNames/with-nodeNext-resolution.js @@ -48,7 +48,7 @@ File '/Users/name/projects/package.json' does not exist according to earlier cac File '/Users/name/package.json' does not exist according to earlier cached lookups. File '/Users/package.json' does not exist according to earlier cached lookups. File '/package.json' does not exist according to earlier cached lookups. -Loading module 'yargs' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'yargs' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Directory '/Users/name/projects/web/src/node_modules' does not exist, skipping all lookups in it. File '/Users/name/projects/web/node_modules/yargs.ts' does not exist. File '/Users/name/projects/web/node_modules/yargs.tsx' does not exist. @@ -68,6 +68,7 @@ Resolving with primary search path '/Users/name/projects/web/node_modules/@types File '/Users/name/projects/web/node_modules/@types/yargs/package.json' exists according to earlier cached lookups. 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. +'package.json' does not have a 'main' field. File '/Users/name/projects/web/node_modules/@types/yargs/index.d.ts' exist - use it as a name resolution result. Resolving real path for '/Users/name/projects/web/node_modules/@types/yargs/index.d.ts', result '/Users/name/projects/web/node_modules/@types/yargs/index.d.ts'. ======== Type reference directive 'yargs' was successfully resolved to '/Users/name/projects/web/node_modules/@types/yargs/index.d.ts' with Package ID 'yargs/index.d.ts@17.0.12', primary: true. ======== diff --git a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js index 0a25238aa5262..091c57b620650 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-file-are-partially-used.js @@ -64,7 +64,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. -Loading module 'pkg' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg/package.json'. 'package.json' does not have a 'typesVersions' field. Matched 'exports' condition 'import'. @@ -83,7 +83,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. -Loading module 'pkg1' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg1/package.json'. 'package.json' does not have a 'typesVersions' field. Saw non-matching condition 'import'. @@ -98,12 +98,6 @@ Directory '/user/username/projects/node_modules' does not exist, skipping all lo Directory '/user/username/node_modules' does not exist, skipping all lookups in it. Directory '/user/node_modules' does not exist, skipping all lookups in it. Directory '/node_modules' does not exist, skipping all lookups in it. -File '/user/username/projects/myproject/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. -File '/user/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. -Loading module 'pkg1' from 'node_modules' folder, target file type 'JavaScript'. File '/user/username/projects/myproject/node_modules/pkg1/package.json' exists according to earlier cached lookups. Saw non-matching condition 'import'. Matched 'exports' condition 'require'. @@ -119,7 +113,7 @@ Directory '/node_modules' does not exist, skipping all lookups in it. ======== Resolving module './a' from '/user/username/projects/myproject/index.ts'. ======== Explicitly specified module resolution kind: 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/a', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/a', target file types: TypeScript, JavaScript, Declaration. File '/user/username/projects/myproject/a.ts' exist - use it as a name resolution result. ======== Module name './a' was successfully resolved to '/user/username/projects/myproject/a.ts'. ======== File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. @@ -242,7 +236,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. -Loading module 'pkg' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. Matched 'exports' condition 'import'. Using 'exports' subpath '.' with target './import.js'. 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 14cf44aff96ae..f326229b4234f 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 @@ -46,13 +46,10 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileA.ts ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== @@ -160,19 +157,16 @@ File '/user/username/projects/myproject/package.json' exists according to earlie ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. +File '/user/username/projects/myproject/src/fileB.mjs' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.js' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.jsx' does not exist. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileB.mjs 1 undefined Failed Lookup Locations @@ -272,13 +266,10 @@ File '/user/username/projects/myproject/package.json' exists according to earlie ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== @@ -380,19 +371,16 @@ File '/package.json' does not exist according to earlier cached lookups. ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. +File '/user/username/projects/myproject/src/fileB.mjs' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.js' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.jsx' does not exist. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileB.mjs 1 undefined Failed Lookup Locations 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 8144af275245e..47d25916f400b 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 @@ -46,19 +46,16 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileA.ts ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. +File '/user/username/projects/myproject/src/fileB.mjs' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.js' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.jsx' does not exist. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileB.mjs 1 undefined Failed Lookup Locations @@ -171,13 +168,10 @@ File '/user/username/projects/myproject/package.json' exists according to earlie ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== @@ -274,19 +268,16 @@ File '/user/username/projects/myproject/package.json' exists according to earlie ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. +File '/user/username/projects/myproject/src/fileB.mjs' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.js' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.jsx' does not exist. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileB.mjs 1 undefined Failed Lookup Locations @@ -478,13 +469,10 @@ File '/user/username/projects/myproject/package.json' exists according to earlie ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in ESM mode with conditions 'node', 'import', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== @@ -587,19 +575,16 @@ File '/package.json' does not exist according to earlier cached lookups. ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Module resolution kind is not specified, using 'Node16'. Resolving in CJS mode with conditions 'node', 'require', 'types'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. File '/user/username/projects/myproject/src/fileB.mts' does not exist. File '/user/username/projects/myproject/src/fileB.d.mts' does not exist. -Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'JavaScript'. +File '/user/username/projects/myproject/src/fileB.mjs' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. +File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.js' does not exist. File '/user/username/projects/myproject/src/fileB.mjs.jsx' does not exist. -File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -File '/user/username/projects/myproject/src/fileB.mjs' does not exist. Directory '/user/username/projects/myproject/src/fileB.mjs' does not exist, skipping all lookups in it. ======== Module name './fileB.mjs' was not resolved. ======== DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/fileB.mjs 1 undefined Failed Lookup Locations diff --git a/tests/baselines/reference/tscWatch/moduleResolution/watches-for-changes-to-package-json-main-fields.js b/tests/baselines/reference/tscWatch/moduleResolution/watches-for-changes-to-package-json-main-fields.js index 93c3f3fcb4802..88b69ff417087 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/watches-for-changes-to-package-json-main-fields.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/watches-for-changes-to-package-json-main-fields.js @@ -43,7 +43,7 @@ Output:: ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -55,10 +55,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' does not exist. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -67,10 +64,7 @@ Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/bui ======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== ======== Resolving module './const.js' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist. @@ -158,7 +152,7 @@ Output:: ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -170,10 +164,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'build/other.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/other.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/other.js' does not exist. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/other.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/other.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/other.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/other.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/other.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/other.tsx' does not exist. @@ -252,7 +243,7 @@ Output:: ======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg2' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. @@ -264,10 +255,7 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' does not exist. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. @@ -276,10 +264,7 @@ Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/bui ======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== ======== Resolving module './const.js' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.ts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.tsx' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.js.d.ts' does not exist. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.js', target file types: TypeScript, Declaration. File name '/user/username/projects/myproject/packages/pkg2/build/const.js' has a '.js' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not exist. File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist. diff --git a/tests/baselines/reference/tscWatch/resolutionCache/reusing-type-ref-resolution.js b/tests/baselines/reference/tscWatch/resolutionCache/reusing-type-ref-resolution.js index f0d7b8a5d6210..9d9b67ea03bb3 100644 --- a/tests/baselines/reference/tscWatch/resolutionCache/reusing-type-ref-resolution.js +++ b/tests/baselines/reference/tscWatch/resolutionCache/reusing-type-ref-resolution.js @@ -47,7 +47,7 @@ CreatingProgramWith:: FileWatcher:: Added:: WatchInfo: /src/project/fileWithImports.ts 250 undefined Source file ======== Resolving module 'pkg0' from '/src/project/fileWithImports.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg0' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg0' from 'node_modules' folder, target file types: TypeScript, Declaration. File '/src/project/node_modules/pkg0/package.json' does not exist. File '/src/project/node_modules/pkg0.ts' does not exist. File '/src/project/node_modules/pkg0.tsx' does not exist. @@ -59,14 +59,14 @@ Resolving real path for '/src/project/node_modules/pkg0/index.d.ts', result '/sr ======== Module name 'pkg0' was successfully resolved to '/src/project/node_modules/pkg0/index.d.ts'. ======== ======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg1' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, Declaration. File '/src/project/node_modules/pkg1.ts' does not exist. File '/src/project/node_modules/pkg1.tsx' does not exist. File '/src/project/node_modules/pkg1.d.ts' does not exist. Directory '/src/project/node_modules/@types' does not exist, skipping all lookups in it. Directory '/src/node_modules' does not exist, skipping all lookups in it. Directory '/node_modules' does not exist, skipping all lookups in it. -Loading module 'pkg1' from 'node_modules' folder, target file type 'JavaScript'. +Loading module 'pkg1' from 'node_modules' folder, target file types: JavaScript. File '/src/project/node_modules/pkg1.js' does not exist. File '/src/project/node_modules/pkg1.jsx' does not exist. Directory '/src/node_modules' does not exist, skipping all lookups in it. @@ -340,7 +340,7 @@ CreatingProgramWith:: Reusing resolution of module 'pkg0' from '/src/project/fileWithImports.ts' of old program, it was successfully resolved to '/src/project/node_modules/pkg0/index.d.ts'. ======== Resolving module 'pkg1' from '/src/project/fileWithImports.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'pkg1' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, Declaration. File '/src/project/node_modules/pkg1/package.json' does not exist. File '/src/project/node_modules/pkg1.ts' does not exist. File '/src/project/node_modules/pkg1.tsx' does not exist. diff --git a/tests/baselines/reference/tscWatch/watchApi/host-implements-does-not-implement-hasInvalidatedResolutions.js b/tests/baselines/reference/tscWatch/watchApi/host-implements-does-not-implement-hasInvalidatedResolutions.js index b18d7b8972d77..01e1adbedd0b2 100644 --- a/tests/baselines/reference/tscWatch/watchApi/host-implements-does-not-implement-hasInvalidatedResolutions.js +++ b/tests/baselines/reference/tscWatch/watchApi/host-implements-does-not-implement-hasInvalidatedResolutions.js @@ -36,7 +36,7 @@ CreatingProgramWith:: FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/main.ts 250 undefined Source file ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' does not exist. File '/user/username/projects/myproject/other.tsx' does not exist. File '/user/username/projects/myproject/other.d.ts' exist - use it as a name resolution result. @@ -108,7 +108,7 @@ CreatingProgramWith:: options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' does not exist. File '/user/username/projects/myproject/other.tsx' does not exist. File '/user/username/projects/myproject/other.d.ts' exist - use it as a name resolution result. @@ -167,7 +167,7 @@ CreatingProgramWith:: options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' does not exist. File '/user/username/projects/myproject/other.tsx' does not exist. File '/user/username/projects/myproject/other.d.ts' exist - use it as a name resolution result. @@ -232,7 +232,7 @@ CreatingProgramWith:: options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' exist - use it as a name resolution result. ======== Module name './other' was successfully resolved to '/user/username/projects/myproject/other.ts'. ======== FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/other.ts 250 undefined Source file diff --git a/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js b/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js index 71dac5e657e1b..e2261b18fcc41 100644 --- a/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js +++ b/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js @@ -36,7 +36,7 @@ CreatingProgramWith:: FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/main.ts 250 undefined Source file ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' does not exist. File '/user/username/projects/myproject/other.tsx' does not exist. File '/user/username/projects/myproject/other.d.ts' exist - use it as a name resolution result. @@ -218,7 +218,7 @@ CreatingProgramWith:: options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} ======== Resolving module './other' from '/user/username/projects/myproject/main.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file type 'TypeScript'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/other', target file types: TypeScript, Declaration. File '/user/username/projects/myproject/other.ts' exist - use it as a name resolution result. ======== Module name './other' was successfully resolved to '/user/username/projects/myproject/other.ts'. ======== FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/other.ts 250 undefined Source file diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js index 135e5bdd68f77..f5dd973e2f230 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/when-there-are-symlinks-to-folders-in-recursive-folders.js @@ -42,7 +42,7 @@ CreatingProgramWith:: FileWatcher:: Added:: WatchInfo: /home/user/projects/myproject/src/file.ts 250 undefined Source file ======== Resolving module 'a' from '/home/user/projects/myproject/src/file.ts'. ======== Module resolution kind is not specified, using 'NodeJs'. -Loading module 'a' from 'node_modules' folder, target file type 'TypeScript'. +Loading module 'a' from 'node_modules' folder, target file types: TypeScript, Declaration. Directory '/home/user/projects/myproject/src/node_modules' does not exist, skipping all lookups in it. File '/home/user/projects/myproject/node_modules/a/package.json' does not exist. File '/home/user/projects/myproject/node_modules/a.ts' does not exist. 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 79b1043dc47be..c801ffc134e61 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 @@ -74,7 +74,7 @@ Info 14 [00:00:41.000] 'package.json' does not have a 'typesVersions' field. Info 15 [00:00:42.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Info 16 [00:00:43.000] Module resolution kind is not specified, using 'Node16'. Info 17 [00:00:44.000] Resolving in ESM mode with conditions 'node', 'import', 'types'. -Info 18 [00:00:45.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. +Info 18 [00:00:45.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. Info 19 [00:00:46.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. Info 20 [00:00:47.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. Info 21 [00:00:48.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== @@ -245,39 +245,34 @@ Info 59 [00:01:35.000] File '/user/username/projects/myproject/package.json' e Info 60 [00:01:36.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Info 61 [00:01:37.000] Module resolution kind is not specified, using 'Node16'. Info 62 [00:01:38.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. -Info 63 [00:01:39.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 64 [00:01:40.000] File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -Info 65 [00:01:41.000] File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -Info 66 [00:01:42.000] File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. -Info 67 [00:01:43.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 68 [00:01:44.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 69 [00:01:45.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 70 [00:01:46.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 71 [00:01:47.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 72 [00:01:48.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 73 [00:01:49.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 74 [00:01:50.000] File '/package.json' does not exist according to earlier cached lookups. -Info 75 [00:01:51.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 76 [00:01:52.000] Different program with same set of files -Info 77 [00:01:53.000] Running: *ensureProjectForOpenFiles* -Info 78 [00:01:54.000] Before ensureProjectForOpenFiles: -Info 79 [00:01:55.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 79 [00:01:56.000] Files (3) - -Info 79 [00:01:57.000] ----------------------------------------------- -Info 79 [00:01:58.000] Open files: -Info 79 [00:01:59.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 79 [00:02:00.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 79 [00:02:01.000] After ensureProjectForOpenFiles: -Info 80 [00:02:02.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 80 [00:02:03.000] Files (3) - -Info 80 [00:02:04.000] ----------------------------------------------- -Info 80 [00:02:05.000] Open files: -Info 80 [00:02:06.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 80 [00:02:07.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 80 [00:02:08.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 81 [00:02:09.000] event: +Info 63 [00:01:39.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 64 [00:01:40.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 65 [00:01:41.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 66 [00:01:42.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 67 [00:01:43.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 68 [00:01:44.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 69 [00:01:45.000] File '/package.json' does not exist according to earlier cached lookups. +Info 70 [00:01:46.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 71 [00:01:47.000] Different program with same set of files +Info 72 [00:01:48.000] Running: *ensureProjectForOpenFiles* +Info 73 [00:01:49.000] Before ensureProjectForOpenFiles: +Info 74 [00:01:50.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 74 [00:01:51.000] Files (3) + +Info 74 [00:01:52.000] ----------------------------------------------- +Info 74 [00:01:53.000] Open files: +Info 74 [00:01:54.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 74 [00:01:55.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 74 [00:01:56.000] After ensureProjectForOpenFiles: +Info 75 [00:01:57.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 75 [00:01:58.000] Files (3) + +Info 75 [00:01:59.000] ----------------------------------------------- +Info 75 [00:02:00.000] Open files: +Info 75 [00:02:01.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 75 [00:02:02.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 75 [00:02:03.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 76 [00:02:04.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -298,14 +293,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 82 [00:02:10.000] request: +Info 77 [00:02:05.000] request: { "command": "geterr", "arguments": { @@ -336,8 +329,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -362,14 +353,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 83 [00:02:11.000] response: +Info 78 [00:02:06.000] response: { "responseRequired": false } @@ -392,14 +381,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 84 [00:02:12.000] event: +Info 79 [00:02:07.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -420,8 +407,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -446,14 +431,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 85 [00:02:13.000] event: +Info 80 [00:02:08.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/user/username/projects/myproject/package.json'.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -474,8 +457,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -500,16 +481,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 86 [00:02:14.000] event: +Info 81 [00:02:09.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 87 [00:02:15.000] event: +Info 82 [00:02:10.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":1}} Before running immediate callbacks and checking length (1) @@ -530,19 +509,17 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 88 [00:02:16.000] Modify package json file to add type module -Info 89 [00:02:20.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 90 [00:02:21.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 91 [00:02:22.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 92 [00:02:23.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 93 [00:02:24.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 83 [00:02:11.000] Modify package json file to add type module +Info 84 [00:02:15.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 85 [00:02:16.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 86 [00:02:17.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 87 [00:02:18.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 88 [00:02:19.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file Before running timeout callbacks //// [/user/username/projects/myproject/package.json] {"name":"app","version":"1.0.0","type":"module"} @@ -565,16 +542,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 94 [00:02:25.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 95 [00:02:26.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 96 [00:02:27.000] Scheduled: *ensureProjectForOpenFiles* +Info 89 [00:02:20.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 90 [00:02:21.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 91 [00:02:22.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -594,8 +569,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -620,56 +593,52 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 97 [00:02:28.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 98 [00:02:29.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 99 [00:02:30.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 100 [00:02:31.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 101 [00:02:32.000] File '/package.json' does not exist according to earlier cached lookups. -Info 102 [00:02:33.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 103 [00:02:34.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. -Info 104 [00:02:35.000] 'package.json' does not have a 'typesVersions' field. -Info 105 [00:02:36.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 106 [00:02:37.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info 107 [00:02:38.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== -Info 108 [00:02:39.000] Module resolution kind is not specified, using 'Node16'. -Info 109 [00:02:40.000] Resolving in ESM mode with conditions 'node', 'import', 'types'. -Info 110 [00:02:41.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 111 [00:02:42.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 112 [00:02:43.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 113 [00:02:44.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 114 [00:02:45.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 115 [00:02:46.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 116 [00:02:47.000] File '/package.json' does not exist according to earlier cached lookups. -Info 117 [00:02:48.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 118 [00:02:49.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 119 [00:02:50.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 120 [00:02:51.000] Different program with same set of files -Info 121 [00:02:52.000] Running: *ensureProjectForOpenFiles* -Info 122 [00:02:53.000] Before ensureProjectForOpenFiles: -Info 123 [00:02:54.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 123 [00:02:55.000] Files (3) - -Info 123 [00:02:56.000] ----------------------------------------------- -Info 123 [00:02:57.000] Open files: -Info 123 [00:02:58.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 123 [00:02:59.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 123 [00:03:00.000] After ensureProjectForOpenFiles: -Info 124 [00:03:01.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 124 [00:03:02.000] Files (3) - -Info 124 [00:03:03.000] ----------------------------------------------- -Info 124 [00:03:04.000] Open files: -Info 124 [00:03:05.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 124 [00:03:06.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 124 [00:03:07.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 125 [00:03:08.000] event: +Info 92 [00:02:23.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 93 [00:02:24.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 94 [00:02:25.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 95 [00:02:26.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 96 [00:02:27.000] File '/package.json' does not exist according to earlier cached lookups. +Info 97 [00:02:28.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 98 [00:02:29.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. +Info 99 [00:02:30.000] 'package.json' does not have a 'typesVersions' field. +Info 100 [00:02:31.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 101 [00:02:32.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info 102 [00:02:33.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info 103 [00:02:34.000] Module resolution kind is not specified, using 'Node16'. +Info 104 [00:02:35.000] Resolving in ESM mode with conditions 'node', 'import', 'types'. +Info 105 [00:02:36.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 106 [00:02:37.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 107 [00:02:38.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 108 [00:02:39.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 109 [00:02:40.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 110 [00:02:41.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 111 [00:02:42.000] File '/package.json' does not exist according to earlier cached lookups. +Info 112 [00:02:43.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 113 [00:02:44.000] Different program with same set of files +Info 114 [00:02:45.000] Running: *ensureProjectForOpenFiles* +Info 115 [00:02:46.000] Before ensureProjectForOpenFiles: +Info 116 [00:02:47.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 116 [00:02:48.000] Files (3) + +Info 116 [00:02:49.000] ----------------------------------------------- +Info 116 [00:02:50.000] Open files: +Info 116 [00:02:51.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 116 [00:02:52.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 116 [00:02:53.000] After ensureProjectForOpenFiles: +Info 117 [00:02:54.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 117 [00:02:55.000] Files (3) + +Info 117 [00:02:56.000] ----------------------------------------------- +Info 117 [00:02:57.000] Open files: +Info 117 [00:02:58.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 117 [00:02:59.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 117 [00:03:00.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 118 [00:03:01.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -695,7 +664,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 126 [00:03:09.000] request: +Info 119 [00:03:02.000] request: { "command": "geterr", "arguments": { @@ -755,7 +724,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 127 [00:03:10.000] response: +Info 120 [00:03:03.000] response: { "responseRequired": false } @@ -783,7 +752,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 128 [00:03:11.000] event: +Info 121 [00:03:04.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -833,7 +802,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 129 [00:03:12.000] event: +Info 122 [00:03:05.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} Before running immediate callbacks and checking length (1) @@ -883,9 +852,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 130 [00:03:13.000] event: +Info 123 [00:03:06.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 131 [00:03:14.000] event: +Info 124 [00:03:07.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":2}} Before running immediate callbacks and checking length (1) @@ -911,13 +880,13 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 132 [00:03:15.000] Delete package.json -Info 133 [00:03:17.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 134 [00:03:18.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 135 [00:03:19.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 136 [00:03:20.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 137 [00:03:21.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 138 [00:03:22.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 125 [00:03:08.000] Delete package.json +Info 126 [00:03:10.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 127 [00:03:11.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 128 [00:03:12.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 129 [00:03:13.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 130 [00:03:14.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 131 [00:03:15.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file Before running timeout callbacks //// [/user/username/projects/myproject/package.json] deleted @@ -943,9 +912,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 139 [00:03:23.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 140 [00:03:24.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 141 [00:03:25.000] Scheduled: *ensureProjectForOpenFiles* +Info 132 [00:03:16.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 133 [00:03:17.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 134 [00:03:18.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -994,48 +963,48 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 142 [00:03:26.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 143 [00:03:27.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 144 [00:03:28.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 145 [00:03:29.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 146 [00:03:30.000] File '/package.json' does not exist according to earlier cached lookups. -Info 147 [00:03:31.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 148 [00:03:32.000] File '/user/username/projects/myproject/package.json' does not exist. -Info 149 [00:03:33.000] File '/user/username/projects/package.json' does not exist. -Info 150 [00:03:34.000] File '/user/username/package.json' does not exist. -Info 151 [00:03:35.000] File '/user/package.json' does not exist. -Info 152 [00:03:36.000] File '/package.json' does not exist according to earlier cached lookups. -Info 153 [00:03:37.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 154 [00:03:38.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. -Info 155 [00:03:39.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 156 [00:03:40.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 157 [00:03:41.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 158 [00:03:42.000] File '/package.json' does not exist according to earlier cached lookups. -Info 159 [00:03:43.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 160 [00:03:44.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 161 [00:03:45.000] File '/package.json' does not exist according to earlier cached lookups. -Info 162 [00:03:46.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 163 [00:03:47.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 164 [00:03:48.000] Different program with same set of files -Info 165 [00:03:49.000] Running: *ensureProjectForOpenFiles* -Info 166 [00:03:50.000] Before ensureProjectForOpenFiles: -Info 167 [00:03:51.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 167 [00:03:52.000] Files (3) - -Info 167 [00:03:53.000] ----------------------------------------------- -Info 167 [00:03:54.000] Open files: -Info 167 [00:03:55.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 167 [00:03:56.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 167 [00:03:57.000] After ensureProjectForOpenFiles: -Info 168 [00:03:58.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 168 [00:03:59.000] Files (3) - -Info 168 [00:04:00.000] ----------------------------------------------- -Info 168 [00:04:01.000] Open files: -Info 168 [00:04:02.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 168 [00:04:03.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 168 [00:04:04.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 169 [00:04:05.000] event: +Info 135 [00:03:19.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 136 [00:03:20.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 137 [00:03:21.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 138 [00:03:22.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 139 [00:03:23.000] File '/package.json' does not exist according to earlier cached lookups. +Info 140 [00:03:24.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 141 [00:03:25.000] File '/user/username/projects/myproject/package.json' does not exist. +Info 142 [00:03:26.000] File '/user/username/projects/package.json' does not exist. +Info 143 [00:03:27.000] File '/user/username/package.json' does not exist. +Info 144 [00:03:28.000] File '/user/package.json' does not exist. +Info 145 [00:03:29.000] File '/package.json' does not exist according to earlier cached lookups. +Info 146 [00:03:30.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 147 [00:03:31.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +Info 148 [00:03:32.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 149 [00:03:33.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 150 [00:03:34.000] File '/user/package.json' does not exist according to earlier cached lookups. +Info 151 [00:03:35.000] File '/package.json' does not exist according to earlier cached lookups. +Info 152 [00:03:36.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 153 [00:03:37.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 154 [00:03:38.000] File '/package.json' does not exist according to earlier cached lookups. +Info 155 [00:03:39.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 156 [00:03:40.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 157 [00:03:41.000] Different program with same set of files +Info 158 [00:03:42.000] Running: *ensureProjectForOpenFiles* +Info 159 [00:03:43.000] Before ensureProjectForOpenFiles: +Info 160 [00:03:44.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 160 [00:03:45.000] Files (3) + +Info 160 [00:03:46.000] ----------------------------------------------- +Info 160 [00:03:47.000] Open files: +Info 160 [00:03:48.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 160 [00:03:49.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 160 [00:03:50.000] After ensureProjectForOpenFiles: +Info 161 [00:03:51.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 161 [00:03:52.000] Files (3) + +Info 161 [00:03:53.000] ----------------------------------------------- +Info 161 [00:03:54.000] Open files: +Info 161 [00:03:55.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 161 [00:03:56.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 161 [00:03:57.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 162 [00:03:58.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1063,7 +1032,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 170 [00:04:06.000] request: +Info 163 [00:03:59.000] request: { "command": "geterr", "arguments": { @@ -1127,7 +1096,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 171 [00:04:07.000] response: +Info 164 [00:04:00.000] response: { "responseRequired": false } @@ -1157,7 +1126,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 172 [00:04:08.000] event: +Info 165 [00:04:01.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1211,7 +1180,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 173 [00:04:09.000] event: +Info 166 [00:04:02.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ \"type\": \"module\" }`.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -1265,9 +1234,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 174 [00:04:10.000] event: +Info 167 [00:04:03.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 175 [00:04:11.000] event: +Info 168 [00:04:04.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":3}} Before running immediate callbacks and checking length (1) @@ -1295,10 +1264,10 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 176 [00:04:12.000] Modify package json file to without type module -Info 177 [00:04:15.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 178 [00:04:16.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 179 [00:04:17.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 169 [00:04:05.000] Modify package json file to without type module +Info 170 [00:04:08.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 171 [00:04:09.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 172 [00:04:10.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution Before running timeout callbacks //// [/user/username/projects/myproject/package.json] {"name":"app","version":"1.0.0"} @@ -1328,9 +1297,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 180 [00:04:18.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 181 [00:04:19.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 182 [00:04:20.000] Scheduled: *ensureProjectForOpenFiles* +Info 173 [00:04:11.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 174 [00:04:12.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 175 [00:04:13.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -1383,53 +1352,48 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 183 [00:04:21.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 184 [00:04:22.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 185 [00:04:23.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 186 [00:04:24.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 187 [00:04:25.000] File '/package.json' does not exist according to earlier cached lookups. -Info 188 [00:04:26.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 189 [00:04:27.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. -Info 190 [00:04:28.000] 'package.json' does not have a 'typesVersions' field. -Info 191 [00:04:29.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 192 [00:04:30.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info 193 [00:04:31.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== -Info 194 [00:04:32.000] Module resolution kind is not specified, using 'Node16'. -Info 195 [00:04:33.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. -Info 196 [00:04:34.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 197 [00:04:35.000] File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -Info 198 [00:04:36.000] File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -Info 199 [00:04:37.000] File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. -Info 200 [00:04:38.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 201 [00:04:39.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 202 [00:04:40.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 203 [00:04:41.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 204 [00:04:42.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 205 [00:04:43.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 206 [00:04:44.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 207 [00:04:45.000] File '/package.json' does not exist according to earlier cached lookups. -Info 208 [00:04:46.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 209 [00:04:47.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 210 [00:04:48.000] Different program with same set of files -Info 211 [00:04:49.000] Running: *ensureProjectForOpenFiles* -Info 212 [00:04:50.000] Before ensureProjectForOpenFiles: -Info 213 [00:04:51.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 213 [00:04:52.000] Files (3) - -Info 213 [00:04:53.000] ----------------------------------------------- -Info 213 [00:04:54.000] Open files: -Info 213 [00:04:55.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 213 [00:04:56.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 213 [00:04:57.000] After ensureProjectForOpenFiles: -Info 214 [00:04:58.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 214 [00:04:59.000] Files (3) - -Info 214 [00:05:00.000] ----------------------------------------------- -Info 214 [00:05:01.000] Open files: -Info 214 [00:05:02.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 214 [00:05:03.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 214 [00:05:04.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 215 [00:05:05.000] event: +Info 176 [00:04:14.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 177 [00:04:15.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 178 [00:04:16.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 179 [00:04:17.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 180 [00:04:18.000] File '/package.json' does not exist according to earlier cached lookups. +Info 181 [00:04:19.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 182 [00:04:20.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. +Info 183 [00:04:21.000] 'package.json' does not have a 'typesVersions' field. +Info 184 [00:04:22.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 185 [00:04:23.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info 186 [00:04:24.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info 187 [00:04:25.000] Module resolution kind is not specified, using 'Node16'. +Info 188 [00:04:26.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. +Info 189 [00:04:27.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 190 [00:04:28.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 191 [00:04:29.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 192 [00:04:30.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 193 [00:04:31.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 194 [00:04:32.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 195 [00:04:33.000] File '/package.json' does not exist according to earlier cached lookups. +Info 196 [00:04:34.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 197 [00:04:35.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 198 [00:04:36.000] Different program with same set of files +Info 199 [00:04:37.000] Running: *ensureProjectForOpenFiles* +Info 200 [00:04:38.000] Before ensureProjectForOpenFiles: +Info 201 [00:04:39.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 201 [00:04:40.000] Files (3) + +Info 201 [00:04:41.000] ----------------------------------------------- +Info 201 [00:04:42.000] Open files: +Info 201 [00:04:43.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 201 [00:04:44.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 201 [00:04:45.000] After ensureProjectForOpenFiles: +Info 202 [00:04:46.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 202 [00:04:47.000] Files (3) + +Info 202 [00:04:48.000] ----------------------------------------------- +Info 202 [00:04:49.000] Open files: +Info 202 [00:04:50.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 202 [00:04:51.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 202 [00:04:52.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 203 [00:04:53.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1450,14 +1414,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 216 [00:05:06.000] request: +Info 204 [00:04:54.000] request: { "command": "geterr", "arguments": { @@ -1488,8 +1450,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1514,14 +1474,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 217 [00:05:07.000] response: +Info 205 [00:04:55.000] response: { "responseRequired": false } @@ -1544,14 +1502,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 218 [00:05:08.000] event: +Info 206 [00:04:56.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1572,8 +1528,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1598,14 +1552,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 219 [00:05:09.000] event: +Info 207 [00:04:57.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/user/username/projects/myproject/package.json'.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -1626,8 +1578,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1652,16 +1602,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 220 [00:05:10.000] event: +Info 208 [00:04:58.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 221 [00:05:11.000] event: +Info 209 [00:04:59.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":4}} Before running immediate callbacks and checking length (1) @@ -1682,17 +1630,15 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 222 [00:05:12.000] Delete package.json -Info 223 [00:05:14.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 224 [00:05:15.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 225 [00:05:16.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 210 [00:05:00.000] Delete package.json +Info 211 [00:05:02.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 212 [00:05:03.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 213 [00:05:04.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution Before running timeout callbacks //// [/user/username/projects/myproject/package.json] deleted @@ -1713,16 +1659,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 226 [00:05:17.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 227 [00:05:18.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 228 [00:05:19.000] Scheduled: *ensureProjectForOpenFiles* +Info 214 [00:05:05.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 215 [00:05:06.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 216 [00:05:07.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -1742,8 +1686,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1768,56 +1710,54 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 229 [00:05:20.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 230 [00:05:21.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 231 [00:05:22.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 232 [00:05:23.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 217 [00:05:08.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 218 [00:05:09.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 219 [00:05:10.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 220 [00:05:11.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 221 [00:05:12.000] File '/package.json' does not exist according to earlier cached lookups. +Info 222 [00:05:13.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 223 [00:05:14.000] File '/user/username/projects/myproject/package.json' does not exist. +Info 224 [00:05:15.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 225 [00:05:16.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 226 [00:05:17.000] File '/user/package.json' does not exist according to earlier cached lookups. +Info 227 [00:05:18.000] File '/package.json' does not exist according to earlier cached lookups. +Info 228 [00:05:19.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 229 [00:05:20.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +Info 230 [00:05:21.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 231 [00:05:22.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 232 [00:05:23.000] File '/user/package.json' does not exist according to earlier cached lookups. Info 233 [00:05:24.000] File '/package.json' does not exist according to earlier cached lookups. -Info 234 [00:05:25.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 235 [00:05:26.000] File '/user/username/projects/myproject/package.json' does not exist. -Info 236 [00:05:27.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 237 [00:05:28.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 238 [00:05:29.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 239 [00:05:30.000] File '/package.json' does not exist according to earlier cached lookups. -Info 240 [00:05:31.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 241 [00:05:32.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. -Info 242 [00:05:33.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 243 [00:05:34.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 244 [00:05:35.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 245 [00:05:36.000] File '/package.json' does not exist according to earlier cached lookups. -Info 246 [00:05:37.000] Reusing resolution of module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. -Info 247 [00:05:38.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 248 [00:05:39.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 249 [00:05:40.000] File '/package.json' does not exist according to earlier cached lookups. -Info 250 [00:05:41.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 251 [00:05:42.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 252 [00:05:43.000] Different program with same set of files -Info 253 [00:05:44.000] Running: *ensureProjectForOpenFiles* -Info 254 [00:05:45.000] Before ensureProjectForOpenFiles: -Info 255 [00:05:46.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 255 [00:05:47.000] Files (3) - -Info 255 [00:05:48.000] ----------------------------------------------- -Info 255 [00:05:49.000] Open files: -Info 255 [00:05:50.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 255 [00:05:51.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 255 [00:05:52.000] After ensureProjectForOpenFiles: -Info 256 [00:05:53.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 256 [00:05:54.000] Files (3) - -Info 256 [00:05:55.000] ----------------------------------------------- -Info 256 [00:05:56.000] Open files: -Info 256 [00:05:57.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 256 [00:05:58.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 256 [00:05:59.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 257 [00:06:00.000] event: +Info 234 [00:05:25.000] Reusing resolution of module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. +Info 235 [00:05:26.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 236 [00:05:27.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 237 [00:05:28.000] File '/package.json' does not exist according to earlier cached lookups. +Info 238 [00:05:29.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 239 [00:05:30.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 240 [00:05:31.000] Different program with same set of files +Info 241 [00:05:32.000] Running: *ensureProjectForOpenFiles* +Info 242 [00:05:33.000] Before ensureProjectForOpenFiles: +Info 243 [00:05:34.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 243 [00:05:35.000] Files (3) + +Info 243 [00:05:36.000] ----------------------------------------------- +Info 243 [00:05:37.000] Open files: +Info 243 [00:05:38.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 243 [00:05:39.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 243 [00:05:40.000] After ensureProjectForOpenFiles: +Info 244 [00:05:41.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 244 [00:05:42.000] Files (3) + +Info 244 [00:05:43.000] ----------------------------------------------- +Info 244 [00:05:44.000] Open files: +Info 244 [00:05:45.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 244 [00:05:46.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 244 [00:05:47.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 245 [00:05:48.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1840,14 +1780,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 258 [00:06:01.000] request: +Info 246 [00:05:49.000] request: { "command": "geterr", "arguments": { @@ -1880,8 +1818,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1908,14 +1844,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 259 [00:06:02.000] response: +Info 247 [00:05:50.000] response: { "responseRequired": false } @@ -1940,14 +1874,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 260 [00:06:03.000] event: +Info 248 [00:05:51.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1970,8 +1902,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1998,14 +1928,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 261 [00:06:04.000] event: +Info 249 [00:05:52.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ \"type\": \"module\" }`.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -2028,8 +1956,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -2056,16 +1982,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 262 [00:06:05.000] event: +Info 250 [00:05:53.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 263 [00:06:06.000] event: +Info 251 [00:05:54.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":5}} Before running immediate callbacks and checking length (1) @@ -2088,8 +2012,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: 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 e5bc763d8120c..7251734939936 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 @@ -74,28 +74,23 @@ Info 14 [00:00:41.000] 'package.json' does not have a 'typesVersions' field. Info 15 [00:00:42.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== Info 16 [00:00:43.000] Module resolution kind is not specified, using 'Node16'. Info 17 [00:00:44.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. -Info 18 [00:00:45.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 19 [00:00:46.000] File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -Info 20 [00:00:47.000] File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -Info 21 [00:00:48.000] File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. -Info 22 [00:00:49.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 23 [00:00:50.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 24 [00:00:51.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 25 [00:00:52.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 26 [00:00:53.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 27 [00:00:54.000] File '/a/lib/package.json' does not exist. -Info 28 [00:00:55.000] File '/a/package.json' does not exist. -Info 29 [00:00:56.000] File '/package.json' does not exist. -Info 30 [00:00:57.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.es2016.full.d.ts 500 undefined WatchType: Closed Script info -Info 31 [00:00:58.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 32 [00:00:59.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 33 [00:01:00.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots -Info 34 [00:01:01.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots -Info 35 [00:01:02.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots -Info 36 [00:01:03.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots -Info 37 [00:01:04.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms -Info 38 [00:01:05.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 39 [00:01:06.000] Files (3) +Info 18 [00:00:45.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 19 [00:00:46.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 20 [00:00:47.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 21 [00:00:48.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 22 [00:00:49.000] File '/a/lib/package.json' does not exist. +Info 23 [00:00:50.000] File '/a/package.json' does not exist. +Info 24 [00:00:51.000] File '/package.json' does not exist. +Info 25 [00:00:52.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.es2016.full.d.ts 500 undefined WatchType: Closed Script info +Info 26 [00:00:53.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 27 [00:00:54.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 28 [00:00:55.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots +Info 29 [00:00:56.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots +Info 30 [00:00:57.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots +Info 31 [00:00:58.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Type roots +Info 32 [00:00:59.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 1 structureChanged: true structureIsReused:: Not Elapsed:: *ms +Info 33 [00:01:00.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 34 [00:01:01.000] Files (3) /a/lib/lib.es2016.full.d.ts /user/username/projects/myproject/src/fileB.mts /user/username/projects/myproject/src/fileA.ts @@ -110,21 +105,21 @@ Info 39 [00:01:06.000] Files (3) Matched by default include pattern '**/*' File is CommonJS module because '../package.json' does not have field "type" -Info 40 [00:01:07.000] ----------------------------------------------- -Info 41 [00:01:08.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 42 [00:01:09.000] event: +Info 35 [00:01:02.000] ----------------------------------------------- +Info 36 [00:01:03.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 37 [00:01:04.000] event: {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/user/username/projects/myproject/src/tsconfig.json"}} -Info 43 [00:01:10.000] event: +Info 38 [00:01:05.000] event: {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"f026568af42c61ce0537de8ee0fa07c9359a76dcfb046248ed49dc76c91e4a37","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":2,"tsSize":68,"tsx":0,"tsxSize":0,"dts":1,"dtsSize":334,"deferred":0,"deferredSize":0},"compilerOptions":{"target":"es2016","module":"node16","outDir":"","traceResolution":true},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":false,"files":false,"include":false,"exclude":false,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"FakeVersion"}}} -Info 44 [00:01:11.000] event: +Info 39 [00:01:06.000] event: {"seq":0,"type":"event","event":"configFileDiag","body":{"triggerFile":"/user/username/projects/myproject/src/fileA.ts","configFile":"/user/username/projects/myproject/src/tsconfig.json","diagnostics":[]}} -Info 45 [00:01:12.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 45 [00:01:13.000] Files (3) +Info 40 [00:01:07.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 40 [00:01:08.000] Files (3) -Info 45 [00:01:14.000] ----------------------------------------------- -Info 45 [00:01:15.000] Open files: -Info 45 [00:01:16.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 45 [00:01:17.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 40 [00:01:09.000] ----------------------------------------------- +Info 40 [00:01:10.000] Open files: +Info 40 [00:01:11.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 40 [00:01:12.000] Projects: /user/username/projects/myproject/src/tsconfig.json After request PolledWatches:: @@ -140,8 +135,6 @@ FsWatches:: {} /user/username/projects/myproject/src/fileb.mts: {} -/user/username/projects/myproject/src: - {} /a/lib/lib.es2016.full.d.ts: {} /user/username/projects/myproject/package.json: @@ -151,16 +144,16 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 45 [00:01:18.000] response: +Info 40 [00:01:13.000] response: { "responseRequired": false } -Info 46 [00:01:19.000] Modify package json file to add type module -Info 47 [00:01:23.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 48 [00:01:24.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 49 [00:01:25.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 50 [00:01:26.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 51 [00:01:27.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 41 [00:01:14.000] Modify package json file to add type module +Info 42 [00:01:18.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 43 [00:01:19.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 44 [00:01:20.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 45 [00:01:21.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 46 [00:01:22.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file Before running timeout callbacks //// [/user/username/projects/myproject/package.json] {"name":"app","version":"1.0.0","type":"module"} @@ -179,8 +172,6 @@ FsWatches:: {} /user/username/projects/myproject/src/fileb.mts: {} -/user/username/projects/myproject/src: - {} /a/lib/lib.es2016.full.d.ts: {} /user/username/projects/myproject/package.json: @@ -190,9 +181,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 52 [00:01:28.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 53 [00:01:29.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 54 [00:01:30.000] Scheduled: *ensureProjectForOpenFiles* +Info 47 [00:01:23.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 48 [00:01:24.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 49 [00:01:25.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -208,8 +199,6 @@ FsWatches:: {} /user/username/projects/myproject/src/fileb.mts: {} -/user/username/projects/myproject/src: - {} /a/lib/lib.es2016.full.d.ts: {} /user/username/projects/myproject/package.json: @@ -234,8 +223,6 @@ FsWatches:: {} /user/username/projects/myproject/src/fileb.mts: {} -/user/username/projects/myproject/src: - {} /a/lib/lib.es2016.full.d.ts: {} /user/username/projects/myproject/package.json: @@ -245,49 +232,47 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 55 [00:01:31.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 56 [00:01:32.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 57 [00:01:33.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 58 [00:01:34.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 59 [00:01:35.000] File '/package.json' does not exist according to earlier cached lookups. -Info 60 [00:01:36.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 61 [00:01:37.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. -Info 62 [00:01:38.000] 'package.json' does not have a 'typesVersions' field. -Info 63 [00:01:39.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 64 [00:01:40.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info 65 [00:01:41.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== -Info 66 [00:01:42.000] Module resolution kind is not specified, using 'Node16'. -Info 67 [00:01:43.000] Resolving in ESM mode with conditions 'node', 'import', 'types'. -Info 68 [00:01:44.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 69 [00:01:45.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 70 [00:01:46.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 71 [00:01:47.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 72 [00:01:48.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 73 [00:01:49.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 74 [00:01:50.000] File '/package.json' does not exist according to earlier cached lookups. -Info 75 [00:01:51.000] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 76 [00:01:52.000] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 77 [00:01:53.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 78 [00:01:54.000] Different program with same set of files -Info 79 [00:01:55.000] Running: *ensureProjectForOpenFiles* -Info 80 [00:01:56.000] Before ensureProjectForOpenFiles: -Info 81 [00:01:57.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 81 [00:01:58.000] Files (3) - -Info 81 [00:01:59.000] ----------------------------------------------- -Info 81 [00:02:00.000] Open files: -Info 81 [00:02:01.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 81 [00:02:02.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 81 [00:02:03.000] After ensureProjectForOpenFiles: -Info 82 [00:02:04.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 82 [00:02:05.000] Files (3) - -Info 82 [00:02:06.000] ----------------------------------------------- -Info 82 [00:02:07.000] Open files: -Info 82 [00:02:08.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 82 [00:02:09.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 82 [00:02:10.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 83 [00:02:11.000] event: +Info 50 [00:01:26.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 51 [00:01:27.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 52 [00:01:28.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 53 [00:01:29.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 54 [00:01:30.000] File '/package.json' does not exist according to earlier cached lookups. +Info 55 [00:01:31.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 56 [00:01:32.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. +Info 57 [00:01:33.000] 'package.json' does not have a 'typesVersions' field. +Info 58 [00:01:34.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 59 [00:01:35.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info 60 [00:01:36.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info 61 [00:01:37.000] Module resolution kind is not specified, using 'Node16'. +Info 62 [00:01:38.000] Resolving in ESM mode with conditions 'node', 'import', 'types'. +Info 63 [00:01:39.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 64 [00:01:40.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 65 [00:01:41.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 66 [00:01:42.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 67 [00:01:43.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 68 [00:01:44.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 69 [00:01:45.000] File '/package.json' does not exist according to earlier cached lookups. +Info 70 [00:01:46.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 2 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 71 [00:01:47.000] Different program with same set of files +Info 72 [00:01:48.000] Running: *ensureProjectForOpenFiles* +Info 73 [00:01:49.000] Before ensureProjectForOpenFiles: +Info 74 [00:01:50.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 74 [00:01:51.000] Files (3) + +Info 74 [00:01:52.000] ----------------------------------------------- +Info 74 [00:01:53.000] Open files: +Info 74 [00:01:54.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 74 [00:01:55.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 74 [00:01:56.000] After ensureProjectForOpenFiles: +Info 75 [00:01:57.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 75 [00:01:58.000] Files (3) + +Info 75 [00:01:59.000] ----------------------------------------------- +Info 75 [00:02:00.000] Open files: +Info 75 [00:02:01.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 75 [00:02:02.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 75 [00:02:03.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 76 [00:02:04.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -313,7 +298,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 84 [00:02:12.000] request: +Info 77 [00:02:05.000] request: { "command": "geterr", "arguments": { @@ -373,7 +358,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 85 [00:02:13.000] response: +Info 78 [00:02:06.000] response: { "responseRequired": false } @@ -401,7 +386,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 86 [00:02:14.000] event: +Info 79 [00:02:07.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -451,7 +436,7 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 87 [00:02:15.000] event: +Info 80 [00:02:08.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} Before running immediate callbacks and checking length (1) @@ -501,9 +486,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 88 [00:02:16.000] event: +Info 81 [00:02:09.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 89 [00:02:17.000] event: +Info 82 [00:02:10.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":1}} Before running immediate callbacks and checking length (1) @@ -529,12 +514,12 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 90 [00:02:18.000] Modify package json file to remove type module -Info 91 [00:02:22.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 92 [00:02:23.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 93 [00:02:24.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 94 [00:02:25.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 95 [00:02:26.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 83 [00:02:11.000] Modify package json file to remove type module +Info 84 [00:02:15.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 85 [00:02:16.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 86 [00:02:17.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 87 [00:02:18.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 88 [00:02:19.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 1:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file Before running timeout callbacks //// [/user/username/projects/myproject/package.json] {"name":"app","version":"1.0.0"} @@ -562,9 +547,9 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 96 [00:02:27.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 97 [00:02:28.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 98 [00:02:29.000] Scheduled: *ensureProjectForOpenFiles* +Info 89 [00:02:20.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 90 [00:02:21.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 91 [00:02:22.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -613,52 +598,47 @@ FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 99 [00:02:30.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 100 [00:02:31.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 101 [00:02:32.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 102 [00:02:33.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 103 [00:02:34.000] File '/package.json' does not exist according to earlier cached lookups. -Info 104 [00:02:35.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 105 [00:02:36.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. -Info 106 [00:02:37.000] 'package.json' does not have a 'typesVersions' field. -Info 107 [00:02:38.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 108 [00:02:39.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info 109 [00:02:40.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== -Info 110 [00:02:41.000] Module resolution kind is not specified, using 'Node16'. -Info 111 [00:02:42.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. -Info 112 [00:02:43.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file type 'TypeScript'. -Info 113 [00:02:44.000] File '/user/username/projects/myproject/src/fileB.mjs.ts' does not exist. -Info 114 [00:02:45.000] File '/user/username/projects/myproject/src/fileB.mjs.tsx' does not exist. -Info 115 [00:02:46.000] File '/user/username/projects/myproject/src/fileB.mjs.d.ts' does not exist. -Info 116 [00:02:47.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. -Info 117 [00:02:48.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. -Info 118 [00:02:49.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== -Info 119 [00:02:50.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 120 [00:02:51.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/src 0 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: Failed Lookup Locations -Info 121 [00:02:52.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 122 [00:02:53.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 123 [00:02:54.000] File '/package.json' does not exist according to earlier cached lookups. -Info 124 [00:02:55.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 125 [00:02:56.000] Different program with same set of files -Info 126 [00:02:57.000] Running: *ensureProjectForOpenFiles* -Info 127 [00:02:58.000] Before ensureProjectForOpenFiles: -Info 128 [00:02:59.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 128 [00:03:00.000] Files (3) - -Info 128 [00:03:01.000] ----------------------------------------------- -Info 128 [00:03:02.000] Open files: -Info 128 [00:03:03.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 128 [00:03:04.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 128 [00:03:05.000] After ensureProjectForOpenFiles: -Info 129 [00:03:06.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 129 [00:03:07.000] Files (3) - -Info 129 [00:03:08.000] ----------------------------------------------- -Info 129 [00:03:09.000] Open files: -Info 129 [00:03:10.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 129 [00:03:11.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 129 [00:03:12.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 130 [00:03:13.000] event: +Info 92 [00:02:23.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 93 [00:02:24.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 94 [00:02:25.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 95 [00:02:26.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 96 [00:02:27.000] File '/package.json' does not exist according to earlier cached lookups. +Info 97 [00:02:28.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 98 [00:02:29.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. +Info 99 [00:02:30.000] 'package.json' does not have a 'typesVersions' field. +Info 100 [00:02:31.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 101 [00:02:32.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info 102 [00:02:33.000] ======== Resolving module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts'. ======== +Info 103 [00:02:34.000] Module resolution kind is not specified, using 'Node16'. +Info 104 [00:02:35.000] Resolving in CJS mode with conditions 'node', 'require', 'types'. +Info 105 [00:02:36.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/fileB.mjs', target file types: TypeScript, JavaScript, Declaration. +Info 106 [00:02:37.000] File name '/user/username/projects/myproject/src/fileB.mjs' has a '.mjs' extension - stripping it. +Info 107 [00:02:38.000] File '/user/username/projects/myproject/src/fileB.mts' exist - use it as a name resolution result. +Info 108 [00:02:39.000] ======== Module name './fileB.mjs' was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. ======== +Info 109 [00:02:40.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 110 [00:02:41.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 111 [00:02:42.000] File '/package.json' does not exist according to earlier cached lookups. +Info 112 [00:02:43.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 3 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 113 [00:02:44.000] Different program with same set of files +Info 114 [00:02:45.000] Running: *ensureProjectForOpenFiles* +Info 115 [00:02:46.000] Before ensureProjectForOpenFiles: +Info 116 [00:02:47.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 116 [00:02:48.000] Files (3) + +Info 116 [00:02:49.000] ----------------------------------------------- +Info 116 [00:02:50.000] Open files: +Info 116 [00:02:51.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 116 [00:02:52.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 116 [00:02:53.000] After ensureProjectForOpenFiles: +Info 117 [00:02:54.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 117 [00:02:55.000] Files (3) + +Info 117 [00:02:56.000] ----------------------------------------------- +Info 117 [00:02:57.000] Open files: +Info 117 [00:02:58.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 117 [00:02:59.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 117 [00:03:00.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 118 [00:03:01.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -679,14 +659,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 131 [00:03:14.000] request: +Info 119 [00:03:02.000] request: { "command": "geterr", "arguments": { @@ -717,8 +695,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -743,14 +719,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 132 [00:03:15.000] response: +Info 120 [00:03:03.000] response: { "responseRequired": false } @@ -773,14 +747,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 133 [00:03:16.000] event: +Info 121 [00:03:04.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -801,8 +773,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -827,14 +797,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 134 [00:03:17.000] event: +Info 122 [00:03:05.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field `\"type\": \"module\"` to '/user/username/projects/myproject/package.json'.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -855,8 +823,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -881,16 +847,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 135 [00:03:18.000] event: +Info 123 [00:03:06.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 136 [00:03:19.000] event: +Info 124 [00:03:07.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":2}} Before running immediate callbacks and checking length (1) @@ -911,20 +875,18 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 137 [00:03:20.000] Delete package.json -Info 138 [00:03:22.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 139 [00:03:23.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 140 [00:03:24.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 141 [00:03:25.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 142 [00:03:26.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file -Info 143 [00:03:27.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 125 [00:03:08.000] Delete package.json +Info 126 [00:03:10.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 127 [00:03:11.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 128 [00:03:12.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 129 [00:03:13.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 130 [00:03:14.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file +Info 131 [00:03:15.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 250 undefined WatchType: package.json file Before running timeout callbacks //// [/user/username/projects/myproject/package.json] deleted @@ -945,16 +907,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 144 [00:03:28.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 145 [00:03:29.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 146 [00:03:30.000] Scheduled: *ensureProjectForOpenFiles* +Info 132 [00:03:16.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 133 [00:03:17.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 134 [00:03:18.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -974,8 +934,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1000,56 +958,54 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 147 [00:03:31.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 148 [00:03:32.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 149 [00:03:33.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 150 [00:03:34.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 135 [00:03:19.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 136 [00:03:20.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 137 [00:03:21.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 138 [00:03:22.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 139 [00:03:23.000] File '/package.json' does not exist according to earlier cached lookups. +Info 140 [00:03:24.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 141 [00:03:25.000] File '/user/username/projects/myproject/package.json' does not exist. +Info 142 [00:03:26.000] File '/user/username/projects/package.json' does not exist. +Info 143 [00:03:27.000] File '/user/username/package.json' does not exist. +Info 144 [00:03:28.000] File '/user/package.json' does not exist. +Info 145 [00:03:29.000] File '/package.json' does not exist according to earlier cached lookups. +Info 146 [00:03:30.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 147 [00:03:31.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +Info 148 [00:03:32.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 149 [00:03:33.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 150 [00:03:34.000] File '/user/package.json' does not exist according to earlier cached lookups. Info 151 [00:03:35.000] File '/package.json' does not exist according to earlier cached lookups. -Info 152 [00:03:36.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 153 [00:03:37.000] File '/user/username/projects/myproject/package.json' does not exist. -Info 154 [00:03:38.000] File '/user/username/projects/package.json' does not exist. -Info 155 [00:03:39.000] File '/user/username/package.json' does not exist. -Info 156 [00:03:40.000] File '/user/package.json' does not exist. -Info 157 [00:03:41.000] File '/package.json' does not exist according to earlier cached lookups. -Info 158 [00:03:42.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 159 [00:03:43.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. -Info 160 [00:03:44.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 161 [00:03:45.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 162 [00:03:46.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 163 [00:03:47.000] File '/package.json' does not exist according to earlier cached lookups. -Info 164 [00:03:48.000] Reusing resolution of module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. -Info 165 [00:03:49.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 166 [00:03:50.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 167 [00:03:51.000] File '/package.json' does not exist according to earlier cached lookups. -Info 168 [00:03:52.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 169 [00:03:53.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 170 [00:03:54.000] Different program with same set of files -Info 171 [00:03:55.000] Running: *ensureProjectForOpenFiles* -Info 172 [00:03:56.000] Before ensureProjectForOpenFiles: -Info 173 [00:03:57.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 173 [00:03:58.000] Files (3) - -Info 173 [00:03:59.000] ----------------------------------------------- -Info 173 [00:04:00.000] Open files: -Info 173 [00:04:01.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 173 [00:04:02.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 173 [00:04:03.000] After ensureProjectForOpenFiles: -Info 174 [00:04:04.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 174 [00:04:05.000] Files (3) - -Info 174 [00:04:06.000] ----------------------------------------------- -Info 174 [00:04:07.000] Open files: -Info 174 [00:04:08.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 174 [00:04:09.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 174 [00:04:10.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 175 [00:04:11.000] event: +Info 152 [00:03:36.000] Reusing resolution of module './fileB.mjs' from '/user/username/projects/myproject/src/fileA.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/src/fileB.mts'. +Info 153 [00:03:37.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 154 [00:03:38.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 155 [00:03:39.000] File '/package.json' does not exist according to earlier cached lookups. +Info 156 [00:03:40.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 157 [00:03:41.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 4 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 158 [00:03:42.000] Different program with same set of files +Info 159 [00:03:43.000] Running: *ensureProjectForOpenFiles* +Info 160 [00:03:44.000] Before ensureProjectForOpenFiles: +Info 161 [00:03:45.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 161 [00:03:46.000] Files (3) + +Info 161 [00:03:47.000] ----------------------------------------------- +Info 161 [00:03:48.000] Open files: +Info 161 [00:03:49.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 161 [00:03:50.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 161 [00:03:51.000] After ensureProjectForOpenFiles: +Info 162 [00:03:52.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 162 [00:03:53.000] Files (3) + +Info 162 [00:03:54.000] ----------------------------------------------- +Info 162 [00:03:55.000] Open files: +Info 162 [00:03:56.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 162 [00:03:57.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 162 [00:03:58.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 163 [00:03:59.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1072,14 +1028,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 176 [00:04:12.000] request: +Info 164 [00:04:00.000] request: { "command": "geterr", "arguments": { @@ -1112,8 +1066,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1140,14 +1092,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 177 [00:04:13.000] response: +Info 165 [00:04:01.000] response: { "responseRequired": false } @@ -1172,14 +1122,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 178 [00:04:14.000] event: +Info 166 [00:04:02.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1202,8 +1150,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1230,14 +1176,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 179 [00:04:15.000] event: +Info 167 [00:04:03.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ \"type\": \"module\" }`.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -1260,8 +1204,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1288,16 +1230,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 180 [00:04:16.000] event: +Info 168 [00:04:04.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 181 [00:04:17.000] event: +Info 169 [00:04:05.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":3}} Before running immediate callbacks and checking length (1) @@ -1320,17 +1260,15 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 182 [00:04:18.000] Modify package json file to add type module -Info 183 [00:04:21.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 184 [00:04:22.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 185 [00:04:23.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 170 [00:04:06.000] Modify package json file to add type module +Info 171 [00:04:09.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 172 [00:04:10.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 173 [00:04:11.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 0:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution Before running timeout callbacks //// [/user/username/projects/myproject/package.json] {"name":"app","version":"1.0.0","type":"module"} @@ -1355,16 +1293,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 186 [00:04:24.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 187 [00:04:25.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 188 [00:04:26.000] Scheduled: *ensureProjectForOpenFiles* +Info 174 [00:04:12.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 175 [00:04:13.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 176 [00:04:14.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -1386,8 +1322,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1414,48 +1348,46 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 189 [00:04:27.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 190 [00:04:28.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 191 [00:04:29.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 192 [00:04:30.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 193 [00:04:31.000] File '/package.json' does not exist according to earlier cached lookups. -Info 194 [00:04:32.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 195 [00:04:33.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. -Info 196 [00:04:34.000] 'package.json' does not have a 'typesVersions' field. -Info 197 [00:04:35.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 198 [00:04:36.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. -Info 199 [00:04:37.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 200 [00:04:38.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 201 [00:04:39.000] File '/package.json' does not exist according to earlier cached lookups. -Info 202 [00:04:40.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 203 [00:04:41.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 204 [00:04:42.000] Different program with same set of files -Info 205 [00:04:43.000] Running: *ensureProjectForOpenFiles* -Info 206 [00:04:44.000] Before ensureProjectForOpenFiles: -Info 207 [00:04:45.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 207 [00:04:46.000] Files (3) - -Info 207 [00:04:47.000] ----------------------------------------------- -Info 207 [00:04:48.000] Open files: -Info 207 [00:04:49.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 207 [00:04:50.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 207 [00:04:51.000] After ensureProjectForOpenFiles: -Info 208 [00:04:52.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 208 [00:04:53.000] Files (3) - -Info 208 [00:04:54.000] ----------------------------------------------- -Info 208 [00:04:55.000] Open files: -Info 208 [00:04:56.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 208 [00:04:57.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 208 [00:04:58.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 209 [00:04:59.000] event: +Info 177 [00:04:15.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 178 [00:04:16.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 179 [00:04:17.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 180 [00:04:18.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 181 [00:04:19.000] File '/package.json' does not exist according to earlier cached lookups. +Info 182 [00:04:20.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 183 [00:04:21.000] Found 'package.json' at '/user/username/projects/myproject/package.json'. +Info 184 [00:04:22.000] 'package.json' does not have a 'typesVersions' field. +Info 185 [00:04:23.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 186 [00:04:24.000] File '/user/username/projects/myproject/package.json' exists according to earlier cached lookups. +Info 187 [00:04:25.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 188 [00:04:26.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 189 [00:04:27.000] File '/package.json' does not exist according to earlier cached lookups. +Info 190 [00:04:28.000] FileWatcher:: Close:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 191 [00:04:29.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 5 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 192 [00:04:30.000] Different program with same set of files +Info 193 [00:04:31.000] Running: *ensureProjectForOpenFiles* +Info 194 [00:04:32.000] Before ensureProjectForOpenFiles: +Info 195 [00:04:33.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 195 [00:04:34.000] Files (3) + +Info 195 [00:04:35.000] ----------------------------------------------- +Info 195 [00:04:36.000] Open files: +Info 195 [00:04:37.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 195 [00:04:38.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 195 [00:04:39.000] After ensureProjectForOpenFiles: +Info 196 [00:04:40.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 196 [00:04:41.000] Files (3) + +Info 196 [00:04:42.000] ----------------------------------------------- +Info 196 [00:04:43.000] Open files: +Info 196 [00:04:44.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 196 [00:04:45.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 196 [00:04:46.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 197 [00:04:47.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1476,14 +1408,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 210 [00:05:00.000] request: +Info 198 [00:04:48.000] request: { "command": "geterr", "arguments": { @@ -1514,8 +1444,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1540,14 +1468,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 211 [00:05:01.000] response: +Info 199 [00:04:49.000] response: { "responseRequired": false } @@ -1570,14 +1496,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 212 [00:05:02.000] event: +Info 200 [00:04:50.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1598,8 +1522,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1624,14 +1546,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 213 [00:05:03.000] event: +Info 201 [00:04:51.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} Before running immediate callbacks and checking length (1) @@ -1652,8 +1572,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1678,16 +1596,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 214 [00:05:04.000] event: +Info 202 [00:04:52.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 215 [00:05:05.000] event: +Info 203 [00:04:53.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":4}} Before running immediate callbacks and checking length (1) @@ -1708,17 +1624,15 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 216 [00:05:06.000] Delete package.json -Info 217 [00:05:08.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 218 [00:05:09.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 219 [00:05:10.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 204 [00:04:54.000] Delete package.json +Info 205 [00:04:56.000] FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 206 [00:04:57.000] Scheduled: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 207 [00:04:58.000] Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/package.json 2:: WatchInfo: /user/username/projects/myproject/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution Before running timeout callbacks //// [/user/username/projects/myproject/package.json] deleted @@ -1739,16 +1653,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 220 [00:05:11.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation -Info 221 [00:05:12.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json -Info 222 [00:05:13.000] Scheduled: *ensureProjectForOpenFiles* +Info 208 [00:04:59.000] Running: /user/username/projects/myproject/src/tsconfig.jsonFailedLookupInvalidation +Info 209 [00:05:00.000] Scheduled: /user/username/projects/myproject/src/tsconfig.json +Info 210 [00:05:01.000] Scheduled: *ensureProjectForOpenFiles* After running timeout callbacks PolledWatches:: @@ -1768,8 +1680,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1794,55 +1704,53 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 223 [00:05:14.000] Running: /user/username/projects/myproject/src/tsconfig.json -Info 224 [00:05:15.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json -Info 225 [00:05:16.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 226 [00:05:17.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 211 [00:05:02.000] Running: /user/username/projects/myproject/src/tsconfig.json +Info 212 [00:05:03.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json +Info 213 [00:05:04.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 214 [00:05:05.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 215 [00:05:06.000] File '/package.json' does not exist according to earlier cached lookups. +Info 216 [00:05:07.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 217 [00:05:08.000] File '/user/username/projects/myproject/package.json' does not exist. +Info 218 [00:05:09.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 219 [00:05:10.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 220 [00:05:11.000] File '/user/package.json' does not exist according to earlier cached lookups. +Info 221 [00:05:12.000] File '/package.json' does not exist according to earlier cached lookups. +Info 222 [00:05:13.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. +Info 223 [00:05:14.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +Info 224 [00:05:15.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +Info 225 [00:05:16.000] File '/user/username/package.json' does not exist according to earlier cached lookups. +Info 226 [00:05:17.000] File '/user/package.json' does not exist according to earlier cached lookups. Info 227 [00:05:18.000] File '/package.json' does not exist according to earlier cached lookups. -Info 228 [00:05:19.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 229 [00:05:20.000] File '/user/username/projects/myproject/package.json' does not exist. -Info 230 [00:05:21.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 231 [00:05:22.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 232 [00:05:23.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 233 [00:05:24.000] File '/package.json' does not exist according to earlier cached lookups. -Info 234 [00:05:25.000] File '/user/username/projects/myproject/src/package.json' does not exist according to earlier cached lookups. -Info 235 [00:05:26.000] File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. -Info 236 [00:05:27.000] File '/user/username/projects/package.json' does not exist according to earlier cached lookups. -Info 237 [00:05:28.000] File '/user/username/package.json' does not exist according to earlier cached lookups. -Info 238 [00:05:29.000] File '/user/package.json' does not exist according to earlier cached lookups. -Info 239 [00:05:30.000] File '/package.json' does not exist according to earlier cached lookups. -Info 240 [00:05:31.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. -Info 241 [00:05:32.000] File '/a/package.json' does not exist according to earlier cached lookups. -Info 242 [00:05:33.000] File '/package.json' does not exist according to earlier cached lookups. -Info 243 [00:05:34.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution -Info 244 [00:05:35.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms -Info 245 [00:05:36.000] Different program with same set of files -Info 246 [00:05:37.000] Running: *ensureProjectForOpenFiles* -Info 247 [00:05:38.000] Before ensureProjectForOpenFiles: -Info 248 [00:05:39.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 248 [00:05:40.000] Files (3) - -Info 248 [00:05:41.000] ----------------------------------------------- -Info 248 [00:05:42.000] Open files: -Info 248 [00:05:43.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 248 [00:05:44.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 248 [00:05:45.000] After ensureProjectForOpenFiles: -Info 249 [00:05:46.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) -Info 249 [00:05:47.000] Files (3) - -Info 249 [00:05:48.000] ----------------------------------------------- -Info 249 [00:05:49.000] Open files: -Info 249 [00:05:50.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined -Info 249 [00:05:51.000] Projects: /user/username/projects/myproject/src/tsconfig.json -Info 249 [00:05:52.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts -Info 250 [00:05:53.000] event: +Info 228 [00:05:19.000] File '/a/lib/package.json' does not exist according to earlier cached lookups. +Info 229 [00:05:20.000] File '/a/package.json' does not exist according to earlier cached lookups. +Info 230 [00:05:21.000] File '/package.json' does not exist according to earlier cached lookups. +Info 231 [00:05:22.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/package.json 2000 undefined Project: /user/username/projects/myproject/src/tsconfig.json WatchType: File location affecting resolution +Info 232 [00:05:23.000] Finishing updateGraphWorker: Project: /user/username/projects/myproject/src/tsconfig.json Version: 6 structureChanged: true structureIsReused:: SafeModules Elapsed:: *ms +Info 233 [00:05:24.000] Different program with same set of files +Info 234 [00:05:25.000] Running: *ensureProjectForOpenFiles* +Info 235 [00:05:26.000] Before ensureProjectForOpenFiles: +Info 236 [00:05:27.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 236 [00:05:28.000] Files (3) + +Info 236 [00:05:29.000] ----------------------------------------------- +Info 236 [00:05:30.000] Open files: +Info 236 [00:05:31.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 236 [00:05:32.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 236 [00:05:33.000] After ensureProjectForOpenFiles: +Info 237 [00:05:34.000] Project '/user/username/projects/myproject/src/tsconfig.json' (Configured) +Info 237 [00:05:35.000] Files (3) + +Info 237 [00:05:36.000] ----------------------------------------------- +Info 237 [00:05:37.000] Open files: +Info 237 [00:05:38.000] FileName: /user/username/projects/myproject/src/fileA.ts ProjectRootPath: undefined +Info 237 [00:05:39.000] Projects: /user/username/projects/myproject/src/tsconfig.json +Info 237 [00:05:40.000] got projects updated in background, updating diagnostics for /user/username/projects/myproject/src/fileA.ts +Info 238 [00:05:41.000] event: {"seq":0,"type":"event","event":"projectsUpdatedInBackground","body":{"openFiles":["/user/username/projects/myproject/src/fileA.ts"]}} After running timeout callbacks @@ -1865,14 +1773,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 251 [00:05:54.000] request: +Info 239 [00:05:42.000] request: { "command": "geterr", "arguments": { @@ -1905,8 +1811,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -1933,14 +1837,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 252 [00:05:55.000] response: +Info 240 [00:05:43.000] response: { "responseRequired": false } @@ -1965,14 +1867,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 253 [00:05:56.000] event: +Info 241 [00:05:44.000] event: {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} After checking timeout queue length (1) and running @@ -1995,8 +1895,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -2023,14 +1921,12 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 254 [00:05:57.000] event: +Info 242 [00:05:45.000] event: {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[{"start":{"line":1,"offset":21},"end":{"line":1,"offset":34},"text":"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"./fileB.mjs\")' call instead.\n To convert this file to an ECMAScript module, change its file extension to '.mts' or create a local package.json file with `{ \"type\": \"module\" }`.","code":1479,"category":"error"}]}} Before running immediate callbacks and checking length (1) @@ -2053,8 +1949,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: @@ -2081,16 +1975,14 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: {} -Info 255 [00:05:58.000] event: +Info 243 [00:05:46.000] event: {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/user/username/projects/myproject/src/fileA.ts","diagnostics":[]}} -Info 256 [00:05:59.000] event: +Info 244 [00:05:47.000] event: {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":5}} Before running immediate callbacks and checking length (1) @@ -2113,8 +2005,6 @@ FsWatches:: {} /user/username/projects/myproject/package.json: {} -/user/username/projects/myproject/src: - {} FsWatchesRecursive:: /user/username/projects/myproject/src: diff --git a/tests/baselines/reference/tsserver/resolutionCache/avoid-unnecessary-lookup-invalidation-on-save.js b/tests/baselines/reference/tsserver/resolutionCache/avoid-unnecessary-lookup-invalidation-on-save.js index fbea990af19b1..61195786d353b 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/avoid-unnecessary-lookup-invalidation-on-save.js +++ b/tests/baselines/reference/tsserver/resolutionCache/avoid-unnecessary-lookup-invalidation-on-save.js @@ -50,7 +50,7 @@ Info 7 [00:00:42.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /us Info 8 [00:00:43.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info 9 [00:00:44.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 10 [00:00:45.000] Module resolution kind is not specified, using 'NodeJs'. -Info 11 [00:00:46.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 11 [00:00:46.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 12 [00:00:47.000] File '/user/username/projects/myproject/src/node_modules/module1/package.json' does not exist. Info 13 [00:00:48.000] File '/user/username/projects/myproject/src/node_modules/module1.ts' does not exist. Info 14 [00:00:49.000] File '/user/username/projects/myproject/src/node_modules/module1.tsx' does not exist. @@ -60,7 +60,7 @@ Info 17 [00:00:52.000] Resolving real path for '/user/username/projects/myproj Info 18 [00:00:53.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/src/node_modules/module1/index.ts'. ======== Info 19 [00:00:54.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 20 [00:00:55.000] Module resolution kind is not specified, using 'NodeJs'. -Info 21 [00:00:56.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 21 [00:00:56.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 22 [00:00:57.000] File '/user/username/projects/myproject/src/node_modules/module2.ts' does not exist. Info 23 [00:00:58.000] File '/user/username/projects/myproject/src/node_modules/module2.tsx' does not exist. Info 24 [00:00:59.000] File '/user/username/projects/myproject/src/node_modules/module2.d.ts' does not exist. diff --git a/tests/baselines/reference/tsserver/resolutionCache/can-load-typings-that-are-proper-modules.js b/tests/baselines/reference/tsserver/resolutionCache/can-load-typings-that-are-proper-modules.js index c0a67bdb3bab0..c4830f90813f8 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/can-load-typings-that-are-proper-modules.js +++ b/tests/baselines/reference/tsserver/resolutionCache/can-load-typings-that-are-proper-modules.js @@ -18,11 +18,11 @@ Info 2 [00:00:21.000] For info: /a/b/app.js :: No config files found. Info 3 [00:00:22.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* Info 4 [00:00:23.000] ======== Resolving module 'lib' from '/a/b/app.js'. ======== Info 5 [00:00:24.000] Module resolution kind is not specified, using 'NodeJs'. -Info 6 [00:00:25.000] Loading module 'lib' from 'node_modules' folder, target file type 'TypeScript'. +Info 6 [00:00:25.000] Loading module 'lib' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 7 [00:00:26.000] Directory '/a/b/node_modules' does not exist, skipping all lookups in it. Info 8 [00:00:27.000] Directory '/a/node_modules' does not exist, skipping all lookups in it. Info 9 [00:00:28.000] Directory '/node_modules' does not exist, skipping all lookups in it. -Info 10 [00:00:29.000] Loading module 'lib' from 'node_modules' folder, target file type 'JavaScript'. +Info 10 [00:00:29.000] Loading module 'lib' from 'node_modules' folder, target file types: JavaScript. Info 11 [00:00:30.000] Directory '/a/b/node_modules' does not exist, skipping all lookups in it. Info 12 [00:00:31.000] Directory '/a/node_modules' does not exist, skipping all lookups in it. Info 13 [00:00:32.000] Directory '/node_modules' does not exist, skipping all lookups in it. diff --git a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-different-folders.js b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-different-folders.js index 103ee9e45adba..a190dd0dd595c 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-different-folders.js +++ b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-different-folders.js @@ -65,7 +65,7 @@ Info 10 [00:00:59.000] FileWatcher:: Added:: WatchInfo: /user/username/project Info 11 [00:01:00.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info 12 [00:01:01.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 13 [00:01:02.000] Module resolution kind is not specified, using 'NodeJs'. -Info 14 [00:01:03.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 14 [00:01:03.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 15 [00:01:04.000] Directory '/user/username/projects/myproject/product/src/node_modules' does not exist, skipping all lookups in it. Info 16 [00:01:05.000] File '/user/username/projects/myproject/product/node_modules/module1/package.json' does not exist. Info 17 [00:01:06.000] File '/user/username/projects/myproject/product/node_modules/module1.ts' does not exist. @@ -76,7 +76,7 @@ Info 21 [00:01:10.000] Resolving real path for '/user/username/projects/myproj Info 22 [00:01:11.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 23 [00:01:12.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 24 [00:01:13.000] Module resolution kind is not specified, using 'NodeJs'. -Info 25 [00:01:14.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 25 [00:01:14.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 26 [00:01:15.000] Directory '/user/username/projects/myproject/product/src/node_modules' does not exist, skipping all lookups in it. Info 27 [00:01:16.000] File '/user/username/projects/myproject/product/node_modules/module2.ts' does not exist. Info 28 [00:01:17.000] File '/user/username/projects/myproject/product/node_modules/module2.tsx' does not exist. @@ -95,37 +95,37 @@ Info 40 [00:01:29.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr Info 41 [00:01:30.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules 1 undefined WatchType: node_modules for closed script infos and package.jsons affecting module specifier cache Info 42 [00:01:31.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 43 [00:01:32.000] Module resolution kind is not specified, using 'NodeJs'. -Info 44 [00:01:33.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 44 [00:01:33.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 45 [00:01:34.000] Directory '/user/username/projects/myproject/product/src/feature/node_modules' does not exist, skipping all lookups in it. Info 46 [00:01:35.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product/src'. Info 47 [00:01:36.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 48 [00:01:37.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 49 [00:01:38.000] Module resolution kind is not specified, using 'NodeJs'. -Info 50 [00:01:39.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 50 [00:01:39.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 51 [00:01:40.000] Directory '/user/username/projects/myproject/product/src/feature/node_modules' does not exist, skipping all lookups in it. Info 52 [00:01:41.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product/src'. Info 53 [00:01:42.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== Info 54 [00:01:43.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 55 [00:01:44.000] Module resolution kind is not specified, using 'NodeJs'. -Info 56 [00:01:45.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 56 [00:01:45.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 57 [00:01:46.000] Directory '/user/username/projects/myproject/product/test/node_modules' does not exist, skipping all lookups in it. Info 58 [00:01:47.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product'. Info 59 [00:01:48.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 60 [00:01:49.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 61 [00:01:50.000] Module resolution kind is not specified, using 'NodeJs'. -Info 62 [00:01:51.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 62 [00:01:51.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 63 [00:01:52.000] Directory '/user/username/projects/myproject/product/test/node_modules' does not exist, skipping all lookups in it. Info 64 [00:01:53.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product'. Info 65 [00:01:54.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== Info 66 [00:01:55.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 67 [00:01:56.000] Module resolution kind is not specified, using 'NodeJs'. -Info 68 [00:01:57.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 68 [00:01:57.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 69 [00:01:58.000] Directory '/user/username/projects/myproject/product/test/src/node_modules' does not exist, skipping all lookups in it. Info 70 [00:01:59.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product/test'. Info 71 [00:02:00.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 72 [00:02:01.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 73 [00:02:02.000] Module resolution kind is not specified, using 'NodeJs'. -Info 74 [00:02:03.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 74 [00:02:03.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 75 [00:02:04.000] Directory '/user/username/projects/myproject/product/test/src/node_modules' does not exist, skipping all lookups in it. Info 76 [00:02:05.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product/test'. Info 77 [00:02:06.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== diff --git a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-same-folder.js b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-same-folder.js index 207b8312dfe7e..756bbcec01ecd 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-same-folder.js +++ b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-files-in-same-folder.js @@ -55,7 +55,7 @@ Info 8 [00:00:45.000] FileWatcher:: Added:: WatchInfo: /user/username/project Info 9 [00:00:46.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info 10 [00:00:47.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 11 [00:00:48.000] Module resolution kind is not specified, using 'NodeJs'. -Info 12 [00:00:49.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 12 [00:00:49.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 13 [00:00:50.000] File '/user/username/projects/myproject/src/node_modules/module1/package.json' does not exist. Info 14 [00:00:51.000] File '/user/username/projects/myproject/src/node_modules/module1.ts' does not exist. Info 15 [00:00:52.000] File '/user/username/projects/myproject/src/node_modules/module1.tsx' does not exist. @@ -65,7 +65,7 @@ Info 18 [00:00:55.000] Resolving real path for '/user/username/projects/myproj Info 19 [00:00:56.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/src/node_modules/module1/index.ts'. ======== Info 20 [00:00:57.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 21 [00:00:58.000] Module resolution kind is not specified, using 'NodeJs'. -Info 22 [00:00:59.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 22 [00:00:59.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 23 [00:01:00.000] File '/user/username/projects/myproject/src/node_modules/module2.ts' does not exist. Info 24 [00:01:01.000] File '/user/username/projects/myproject/src/node_modules/module2.tsx' does not exist. Info 25 [00:01:02.000] File '/user/username/projects/myproject/src/node_modules/module2.d.ts' does not exist. diff --git a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-inferred-project.js b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-inferred-project.js index f84e7445c0fbf..91b4b76280eca 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-inferred-project.js +++ b/tests/baselines/reference/tsserver/resolutionCache/non-relative-module-name-from-inferred-project.js @@ -49,22 +49,22 @@ Info 8 [00:00:55.000] FileWatcher:: Added:: WatchInfo: /user/username/project Info 9 [00:00:56.000] Starting updateGraphWorker: Project: /dev/null/inferredProject1* Info 10 [00:00:57.000] ======== Resolving module './feature/file2' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 11 [00:00:58.000] Module resolution kind is not specified, using 'NodeJs'. -Info 12 [00:00:59.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/feature/file2', target file type 'TypeScript'. +Info 12 [00:00:59.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/feature/file2', target file types: TypeScript, Declaration. Info 13 [00:01:00.000] File '/user/username/projects/myproject/product/src/feature/file2.ts' exist - use it as a name resolution result. Info 14 [00:01:01.000] ======== Module name './feature/file2' was successfully resolved to '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 15 [00:01:02.000] ======== Resolving module '../test/file4' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 16 [00:01:03.000] Module resolution kind is not specified, using 'NodeJs'. -Info 17 [00:01:04.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/test/file4', target file type 'TypeScript'. +Info 17 [00:01:04.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/test/file4', target file types: TypeScript, Declaration. Info 18 [00:01:05.000] File '/user/username/projects/myproject/product/test/file4.ts' exist - use it as a name resolution result. Info 19 [00:01:06.000] ======== Module name '../test/file4' was successfully resolved to '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 20 [00:01:07.000] ======== Resolving module '../test/src/file3' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 21 [00:01:08.000] Module resolution kind is not specified, using 'NodeJs'. -Info 22 [00:01:09.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/test/src/file3', target file type 'TypeScript'. +Info 22 [00:01:09.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/test/src/file3', target file types: TypeScript, Declaration. Info 23 [00:01:10.000] File '/user/username/projects/myproject/product/test/src/file3.ts' exist - use it as a name resolution result. Info 24 [00:01:11.000] ======== Module name '../test/src/file3' was successfully resolved to '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 25 [00:01:12.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 26 [00:01:13.000] Module resolution kind is not specified, using 'NodeJs'. -Info 27 [00:01:14.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 27 [00:01:14.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 28 [00:01:15.000] Directory '/user/username/projects/myproject/product/src/node_modules' does not exist, skipping all lookups in it. Info 29 [00:01:16.000] File '/user/username/projects/myproject/product/node_modules/module1/package.json' does not exist. Info 30 [00:01:17.000] File '/user/username/projects/myproject/product/node_modules/module1.ts' does not exist. @@ -75,7 +75,7 @@ Info 34 [00:01:21.000] Resolving real path for '/user/username/projects/myproj Info 35 [00:01:22.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 36 [00:01:23.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 37 [00:01:24.000] Module resolution kind is not specified, using 'NodeJs'. -Info 38 [00:01:25.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 38 [00:01:25.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 39 [00:01:26.000] Directory '/user/username/projects/myproject/product/src/node_modules' does not exist, skipping all lookups in it. Info 40 [00:01:27.000] File '/user/username/projects/myproject/product/node_modules/module2.ts' does not exist. Info 41 [00:01:28.000] File '/user/username/projects/myproject/product/node_modules/module2.tsx' does not exist. @@ -91,13 +91,13 @@ Info 50 [00:01:37.000] ======== Module name 'module2' was successfully resolve Info 51 [00:01:38.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/product/src/feature/file2.ts 500 undefined WatchType: Closed Script info Info 52 [00:01:39.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 53 [00:01:40.000] Module resolution kind is not specified, using 'NodeJs'. -Info 54 [00:01:41.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 54 [00:01:41.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 55 [00:01:42.000] Directory '/user/username/projects/myproject/product/src/feature/node_modules' does not exist, skipping all lookups in it. Info 56 [00:01:43.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product/src'. Info 57 [00:01:44.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 58 [00:01:45.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 59 [00:01:46.000] Module resolution kind is not specified, using 'NodeJs'. -Info 60 [00:01:47.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 60 [00:01:47.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 61 [00:01:48.000] Directory '/user/username/projects/myproject/product/src/feature/node_modules' does not exist, skipping all lookups in it. Info 62 [00:01:49.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product/src'. Info 63 [00:01:50.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== @@ -108,26 +108,26 @@ Info 67 [00:01:54.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /us Info 68 [00:01:55.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/product/test/file4.ts 500 undefined WatchType: Closed Script info Info 69 [00:01:56.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 70 [00:01:57.000] Module resolution kind is not specified, using 'NodeJs'. -Info 71 [00:01:58.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 71 [00:01:58.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 72 [00:01:59.000] Directory '/user/username/projects/myproject/product/test/node_modules' does not exist, skipping all lookups in it. Info 73 [00:02:00.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product'. Info 74 [00:02:01.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 75 [00:02:02.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 76 [00:02:03.000] Module resolution kind is not specified, using 'NodeJs'. -Info 77 [00:02:04.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 77 [00:02:04.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 78 [00:02:05.000] Directory '/user/username/projects/myproject/product/test/node_modules' does not exist, skipping all lookups in it. Info 79 [00:02:06.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product'. Info 80 [00:02:07.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== Info 81 [00:02:08.000] FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/product/test/src/file3.ts 500 undefined WatchType: Closed Script info Info 82 [00:02:09.000] ======== Resolving module 'module1' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 83 [00:02:10.000] Module resolution kind is not specified, using 'NodeJs'. -Info 84 [00:02:11.000] Loading module 'module1' from 'node_modules' folder, target file type 'TypeScript'. +Info 84 [00:02:11.000] Loading module 'module1' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 85 [00:02:12.000] Directory '/user/username/projects/myproject/product/test/src/node_modules' does not exist, skipping all lookups in it. Info 86 [00:02:13.000] Resolution for module 'module1' was found in cache from location '/user/username/projects/myproject/product/test'. Info 87 [00:02:14.000] ======== Module name 'module1' was successfully resolved to '/user/username/projects/myproject/product/node_modules/module1/index.ts'. ======== Info 88 [00:02:15.000] ======== Resolving module 'module2' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 89 [00:02:16.000] Module resolution kind is not specified, using 'NodeJs'. -Info 90 [00:02:17.000] Loading module 'module2' from 'node_modules' folder, target file type 'TypeScript'. +Info 90 [00:02:17.000] Loading module 'module2' from 'node_modules' folder, target file types: TypeScript, Declaration. Info 91 [00:02:18.000] Directory '/user/username/projects/myproject/product/test/src/node_modules' does not exist, skipping all lookups in it. Info 92 [00:02:19.000] Resolution for module 'module2' was found in cache from location '/user/username/projects/myproject/product/test'. Info 93 [00:02:20.000] ======== Module name 'module2' was successfully resolved to '/user/username/projects/myproject/node_modules/module2/index.ts'. ======== diff --git a/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-different-folders.js b/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-different-folders.js index 321cdeabd21a1..5b3f01301a18e 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-different-folders.js +++ b/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-different-folders.js @@ -69,32 +69,32 @@ Info 12 [00:00:53.000] FileWatcher:: Added:: WatchInfo: /user/username/project Info 13 [00:00:54.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info 14 [00:00:55.000] ======== Resolving module './module1' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 15 [00:00:56.000] Module resolution kind is not specified, using 'NodeJs'. -Info 16 [00:00:57.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file type 'TypeScript'. +Info 16 [00:00:57.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file types: TypeScript, Declaration. Info 17 [00:00:58.000] File '/user/username/projects/myproject/product/src/module1.ts' exist - use it as a name resolution result. Info 18 [00:00:59.000] ======== Module name './module1' was successfully resolved to '/user/username/projects/myproject/product/src/module1.ts'. ======== Info 19 [00:01:00.000] ======== Resolving module '../module2' from '/user/username/projects/myproject/product/src/file1.ts'. ======== Info 20 [00:01:01.000] Module resolution kind is not specified, using 'NodeJs'. -Info 21 [00:01:02.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file type 'TypeScript'. +Info 21 [00:01:02.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file types: TypeScript, Declaration. Info 22 [00:01:03.000] File '/user/username/projects/myproject/product/module2.ts' exist - use it as a name resolution result. Info 23 [00:01:04.000] ======== Module name '../module2' was successfully resolved to '/user/username/projects/myproject/product/module2.ts'. ======== Info 24 [00:01:05.000] ======== Resolving module '../module1' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 25 [00:01:06.000] Module resolution kind is not specified, using 'NodeJs'. -Info 26 [00:01:07.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file type 'TypeScript'. +Info 26 [00:01:07.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file types: TypeScript, Declaration. Info 27 [00:01:08.000] File '/user/username/projects/myproject/product/src/module1.ts' exist - use it as a name resolution result. Info 28 [00:01:09.000] ======== Module name '../module1' was successfully resolved to '/user/username/projects/myproject/product/src/module1.ts'. ======== Info 29 [00:01:10.000] ======== Resolving module '../../module2' from '/user/username/projects/myproject/product/src/feature/file2.ts'. ======== Info 30 [00:01:11.000] Module resolution kind is not specified, using 'NodeJs'. -Info 31 [00:01:12.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file type 'TypeScript'. +Info 31 [00:01:12.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file types: TypeScript, Declaration. Info 32 [00:01:13.000] File '/user/username/projects/myproject/product/module2.ts' exist - use it as a name resolution result. Info 33 [00:01:14.000] ======== Module name '../../module2' was successfully resolved to '/user/username/projects/myproject/product/module2.ts'. ======== Info 34 [00:01:15.000] ======== Resolving module '../src/module1}' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 35 [00:01:16.000] Module resolution kind is not specified, using 'NodeJs'. -Info 36 [00:01:17.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1}', target file type 'TypeScript'. +Info 36 [00:01:17.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1}', target file types: TypeScript, Declaration. Info 37 [00:01:18.000] File '/user/username/projects/myproject/product/src/module1}.ts' does not exist. Info 38 [00:01:19.000] File '/user/username/projects/myproject/product/src/module1}.tsx' does not exist. Info 39 [00:01:20.000] File '/user/username/projects/myproject/product/src/module1}.d.ts' does not exist. Info 40 [00:01:21.000] Directory '/user/username/projects/myproject/product/src/module1}' does not exist, skipping all lookups in it. -Info 41 [00:01:22.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1}', target file type 'JavaScript'. +Info 41 [00:01:22.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1}', target file types: JavaScript. Info 42 [00:01:23.000] File '/user/username/projects/myproject/product/src/module1}.js' does not exist. Info 43 [00:01:24.000] File '/user/username/projects/myproject/product/src/module1}.jsx' does not exist. Info 44 [00:01:25.000] Directory '/user/username/projects/myproject/product/src/module1}' does not exist, skipping all lookups in it. @@ -103,17 +103,17 @@ Info 46 [00:01:27.000] DirectoryWatcher:: Added:: WatchInfo: /user/username/pr Info 47 [00:01:28.000] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/product 1 undefined Project: /user/username/projects/myproject/tsconfig.json WatchType: Failed Lookup Locations Info 48 [00:01:29.000] ======== Resolving module '../module2' from '/user/username/projects/myproject/product/test/file4.ts'. ======== Info 49 [00:01:30.000] Module resolution kind is not specified, using 'NodeJs'. -Info 50 [00:01:31.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file type 'TypeScript'. +Info 50 [00:01:31.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file types: TypeScript, Declaration. Info 51 [00:01:32.000] File '/user/username/projects/myproject/product/module2.ts' exist - use it as a name resolution result. Info 52 [00:01:33.000] ======== Module name '../module2' was successfully resolved to '/user/username/projects/myproject/product/module2.ts'. ======== Info 53 [00:01:34.000] ======== Resolving module '../../src/module1' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 54 [00:01:35.000] Module resolution kind is not specified, using 'NodeJs'. -Info 55 [00:01:36.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file type 'TypeScript'. +Info 55 [00:01:36.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/src/module1', target file types: TypeScript, Declaration. Info 56 [00:01:37.000] File '/user/username/projects/myproject/product/src/module1.ts' exist - use it as a name resolution result. Info 57 [00:01:38.000] ======== Module name '../../src/module1' was successfully resolved to '/user/username/projects/myproject/product/src/module1.ts'. ======== Info 58 [00:01:39.000] ======== Resolving module '../../module2' from '/user/username/projects/myproject/product/test/src/file3.ts'. ======== Info 59 [00:01:40.000] Module resolution kind is not specified, using 'NodeJs'. -Info 60 [00:01:41.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file type 'TypeScript'. +Info 60 [00:01:41.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/product/module2', target file types: TypeScript, Declaration. Info 61 [00:01:42.000] File '/user/username/projects/myproject/product/module2.ts' exist - use it as a name resolution result. Info 62 [00:01:43.000] ======== Module name '../../module2' was successfully resolved to '/user/username/projects/myproject/product/module2.ts'. ======== Info 63 [00:01:44.000] FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 500 undefined WatchType: Closed Script info diff --git a/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-same-folder.js b/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-same-folder.js index dec53b0c2da02..0f173cf49676b 100644 --- a/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-same-folder.js +++ b/tests/baselines/reference/tsserver/resolutionCache/relative-module-name-from-files-in-same-folder.js @@ -59,12 +59,12 @@ Info 10 [00:00:39.000] FileWatcher:: Added:: WatchInfo: /user/username/project Info 11 [00:00:40.000] Starting updateGraphWorker: Project: /user/username/projects/myproject/tsconfig.json Info 12 [00:00:41.000] ======== Resolving module './module1' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 13 [00:00:42.000] Module resolution kind is not specified, using 'NodeJs'. -Info 14 [00:00:43.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/module1', target file type 'TypeScript'. +Info 14 [00:00:43.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/src/module1', target file types: TypeScript, Declaration. Info 15 [00:00:44.000] File '/user/username/projects/myproject/src/module1.ts' exist - use it as a name resolution result. Info 16 [00:00:45.000] ======== Module name './module1' was successfully resolved to '/user/username/projects/myproject/src/module1.ts'. ======== Info 17 [00:00:46.000] ======== Resolving module '../module2' from '/user/username/projects/myproject/src/file1.ts'. ======== Info 18 [00:00:47.000] Module resolution kind is not specified, using 'NodeJs'. -Info 19 [00:00:48.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/module2', target file type 'TypeScript'. +Info 19 [00:00:48.000] Loading module as file / folder, candidate module location '/user/username/projects/myproject/module2', target file types: TypeScript, Declaration. Info 20 [00:00:49.000] File '/user/username/projects/myproject/module2.ts' exist - use it as a name resolution result. Info 21 [00:00:50.000] ======== Module name '../module2' was successfully resolved to '/user/username/projects/myproject/module2.ts'. ======== Info 22 [00:00:51.000] Reusing resolution of module './module1' from '/user/username/projects/myproject/src/file2.ts' found in cache from location '/user/username/projects/myproject/src', it was successfully resolved to '/user/username/projects/myproject/src/module1.ts'. diff --git a/tests/baselines/reference/typeReferenceDirectives10.trace.json b/tests/baselines/reference/typeReferenceDirectives10.trace.json index ef7f8aca2b0a3..7d52d66a6b411 100644 --- a/tests/baselines/reference/typeReferenceDirectives10.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives10.trace.json @@ -7,7 +7,7 @@ "======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========", "======== Resolving module './ref' from '/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/ref', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, Declaration.", "File '/ref.ts' does not exist.", "File '/ref.tsx' does not exist.", "File '/ref.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/typeReferenceDirectives11.trace.json b/tests/baselines/reference/typeReferenceDirectives11.trace.json index 572648804aeb1..38aa6ed8a53b2 100644 --- a/tests/baselines/reference/typeReferenceDirectives11.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives11.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './mod1' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/mod1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, Declaration.", "File '/mod1.ts' exist - use it as a name resolution result.", "======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========", diff --git a/tests/baselines/reference/typeReferenceDirectives12.trace.json b/tests/baselines/reference/typeReferenceDirectives12.trace.json index e9cbd4215822b..cd97596ba13b8 100644 --- a/tests/baselines/reference/typeReferenceDirectives12.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives12.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './main' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/main', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/main', target file types: TypeScript, Declaration.", "File '/main.ts' exist - use it as a name resolution result.", "======== Module name './main' was successfully resolved to '/main.ts'. ========", "======== Resolving module './mod1' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/mod1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, Declaration.", "File '/mod1.ts' exist - use it as a name resolution result.", "======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/mod1.ts', root directory '/types'. ========", diff --git a/tests/baselines/reference/typeReferenceDirectives13.trace.json b/tests/baselines/reference/typeReferenceDirectives13.trace.json index ef7f8aca2b0a3..7d52d66a6b411 100644 --- a/tests/baselines/reference/typeReferenceDirectives13.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives13.trace.json @@ -7,7 +7,7 @@ "======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========", "======== Resolving module './ref' from '/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/ref', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, Declaration.", "File '/ref.ts' does not exist.", "File '/ref.tsx' does not exist.", "File '/ref.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/typeReferenceDirectives5.trace.json b/tests/baselines/reference/typeReferenceDirectives5.trace.json index ef7f8aca2b0a3..7d52d66a6b411 100644 --- a/tests/baselines/reference/typeReferenceDirectives5.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives5.trace.json @@ -7,7 +7,7 @@ "======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========", "======== Resolving module './ref' from '/app.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/ref', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/ref', target file types: TypeScript, Declaration.", "File '/ref.ts' does not exist.", "File '/ref.tsx' does not exist.", "File '/ref.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/typeReferenceDirectives8.trace.json b/tests/baselines/reference/typeReferenceDirectives8.trace.json index 572648804aeb1..38aa6ed8a53b2 100644 --- a/tests/baselines/reference/typeReferenceDirectives8.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives8.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module './mod1' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/mod1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, Declaration.", "File '/mod1.ts' exist - use it as a name resolution result.", "======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========", diff --git a/tests/baselines/reference/typeReferenceDirectives9.trace.json b/tests/baselines/reference/typeReferenceDirectives9.trace.json index e9cbd4215822b..cd97596ba13b8 100644 --- a/tests/baselines/reference/typeReferenceDirectives9.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives9.trace.json @@ -1,12 +1,12 @@ [ "======== Resolving module './main' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/main', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/main', target file types: TypeScript, Declaration.", "File '/main.ts' exist - use it as a name resolution result.", "======== Module name './main' was successfully resolved to '/main.ts'. ========", "======== Resolving module './mod1' from '/mod2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location '/mod1', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/mod1', target file types: TypeScript, Declaration.", "File '/mod1.ts' exist - use it as a name resolution result.", "======== Module name './mod1' was successfully resolved to '/mod1.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/mod1.ts', root directory '/types'. ========", diff --git a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json index fdcbcdb7ab1d0..b4a6fcf3f916b 100644 --- a/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json +++ b/tests/baselines/reference/typeRootsFromMultipleNodeModulesDirectories.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'xyz' from '/foo/bar/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'xyz' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'xyz' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/xyz.ts' does not exist.", "File '/foo/node_modules/xyz.tsx' does not exist.", @@ -11,7 +11,7 @@ "File '/node_modules/xyz.tsx' does not exist.", "File '/node_modules/xyz.d.ts' does not exist.", "File '/node_modules/@types/xyz.d.ts' does not exist.", - "Loading module 'xyz' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'xyz' from 'node_modules' folder, target file types: JavaScript.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/xyz.js' does not exist.", "File '/foo/node_modules/xyz.jsx' does not exist.", @@ -20,7 +20,7 @@ "======== Module name 'xyz' was not resolved. ========", "======== Resolving module 'pdq' from '/foo/bar/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'pdq' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'pdq' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/pdq.ts' does not exist.", "File '/foo/node_modules/pdq.tsx' does not exist.", @@ -30,7 +30,7 @@ "File '/node_modules/pdq.tsx' does not exist.", "File '/node_modules/pdq.d.ts' does not exist.", "File '/node_modules/@types/pdq.d.ts' does not exist.", - "Loading module 'pdq' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'pdq' from 'node_modules' folder, target file types: JavaScript.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/pdq.js' does not exist.", "File '/foo/node_modules/pdq.jsx' does not exist.", @@ -39,7 +39,7 @@ "======== Module name 'pdq' was not resolved. ========", "======== Resolving module 'abc' from '/foo/bar/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'abc' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'abc' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/abc.ts' does not exist.", "File '/foo/node_modules/abc.tsx' does not exist.", @@ -49,7 +49,7 @@ "File '/node_modules/abc.tsx' does not exist.", "File '/node_modules/abc.d.ts' does not exist.", "File '/node_modules/@types/abc.d.ts' does not exist.", - "Loading module 'abc' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'abc' from 'node_modules' folder, target file types: JavaScript.", "Directory '/foo/bar/node_modules' does not exist, skipping all lookups in it.", "File '/foo/node_modules/abc.js' does not exist.", "File '/foo/node_modules/abc.jsx' does not exist.", diff --git a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json index a15e20239c65a..97cac6a86a6be 100644 --- a/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json +++ b/tests/baselines/reference/typeRootsFromNodeModulesInParentDirectory.trace.json @@ -1,13 +1,13 @@ [ "======== Resolving module 'xyz' from '/src/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'xyz' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'xyz' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Directory '/src/node_modules' does not exist, skipping all lookups in it.", "File '/node_modules/xyz.ts' does not exist.", "File '/node_modules/xyz.tsx' does not exist.", "File '/node_modules/xyz.d.ts' does not exist.", "File '/node_modules/@types/xyz.d.ts' does not exist.", - "Loading module 'xyz' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'xyz' from 'node_modules' folder, target file types: JavaScript.", "Directory '/src/node_modules' does not exist, skipping all lookups in it.", "File '/node_modules/xyz.js' does not exist.", "File '/node_modules/xyz.jsx' does not exist.", diff --git a/tests/baselines/reference/typesVersions.ambientModules.trace.json b/tests/baselines/reference/typesVersions.ambientModules.trace.json index 67a3b617bce03..9fb62da4c4b93 100644 --- a/tests/baselines/reference/typesVersions.ambientModules.trace.json +++ b/tests/baselines/reference/typesVersions.ambientModules.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'ext' from 'tests/cases/conformance/moduleResolution/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json'.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext.ts' does not exist.", @@ -13,7 +13,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -21,7 +21,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/moduleResolution/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", @@ -34,14 +34,14 @@ "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/other/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/other/ts3.1/index', target file types: TypeScript, Declaration.", "Directory 'tests/cases/conformance/moduleResolution/node_modules/@types' does not exist, skipping all lookups in it.", "Directory 'tests/cases/conformance/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/node_modules' does not exist, skipping all lookups in it.", "Directory 'node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: JavaScript.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", @@ -52,7 +52,7 @@ "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/other/ts3.1/index', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/other/ts3.1/index', target file types: JavaScript.", "Directory 'tests/cases/conformance/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/node_modules' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/typesVersions.emptyTypes.trace.json b/tests/baselines/reference/typesVersions.emptyTypes.trace.json index e7a9e7547cf97..4dbe26804df34 100644 --- a/tests/baselines/reference/typesVersions.emptyTypes.trace.json +++ b/tests/baselines/reference/typesVersions.emptyTypes.trace.json @@ -3,7 +3,7 @@ "Module resolution kind is not specified, using 'NodeJs'.", "'baseUrl' option is set to '/', using this value to resolve non-relative module name 'a'.", "Resolving module name 'a' relative to base url '/' - '/a'.", - "Loading module as file / folder, candidate module location '/a', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a', target file types: TypeScript, Declaration.", "File '/a.ts' does not exist.", "File '/a.tsx' does not exist.", "File '/a.d.ts' does not exist.", @@ -16,7 +16,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File '/a/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location '/a/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/ts3.1/index', target file types: TypeScript, Declaration.", "File '/a/ts3.1/index.ts' does not exist.", "File '/a/ts3.1/index.tsx' does not exist.", "File '/a/ts3.1/index.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/typesVersions.justIndex.trace.json b/tests/baselines/reference/typesVersions.justIndex.trace.json index 263d16b0b4ba4..20d2e2af4c391 100644 --- a/tests/baselines/reference/typesVersions.justIndex.trace.json +++ b/tests/baselines/reference/typesVersions.justIndex.trace.json @@ -3,7 +3,7 @@ "Module resolution kind is not specified, using 'NodeJs'.", "'baseUrl' option is set to '/', using this value to resolve non-relative module name 'a'.", "Resolving module name 'a' relative to base url '/' - '/a'.", - "Loading module as file / folder, candidate module location '/a', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a', target file types: TypeScript, Declaration.", "File '/a.ts' does not exist.", "File '/a.tsx' does not exist.", "File '/a.d.ts' does not exist.", @@ -16,7 +16,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File '/a/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location '/a/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/a/ts3.1/index', target file types: TypeScript, Declaration.", "File '/a/ts3.1/index.ts' does not exist.", "File '/a/ts3.1/index.tsx' does not exist.", "File '/a/ts3.1/index.d.ts' exist - use it as a name resolution result.", diff --git a/tests/baselines/reference/typesVersions.multiFile.trace.json b/tests/baselines/reference/typesVersions.multiFile.trace.json index 5ee8a7b292e21..3f1bb17771930 100644 --- a/tests/baselines/reference/typesVersions.multiFile.trace.json +++ b/tests/baselines/reference/typesVersions.multiFile.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'ext' from 'tests/cases/conformance/moduleResolution/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json'.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext.ts' does not exist.", @@ -13,7 +13,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -21,7 +21,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/moduleResolution/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/moduleResolution/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json index a0c6ad8f1cfd0..4f61bb9906663 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.", @@ -13,7 +13,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -21,7 +21,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", @@ -34,14 +34,14 @@ "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other/ts3.1/index', target file types: TypeScript, Declaration.", "Directory 'tests/cases/conformance/declarationEmit/node_modules/@types' does not exist, skipping all lookups in it.", "Directory 'tests/cases/conformance/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/node_modules' does not exist, skipping all lookups in it.", "Directory 'node_modules' does not exist, skipping all lookups in it.", "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'JavaScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: JavaScript.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", @@ -52,7 +52,7 @@ "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'index'.", "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other/ts3.1/index', target file type 'JavaScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other/ts3.1/index', target file types: JavaScript.", "Directory 'tests/cases/conformance/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/cases/node_modules' does not exist, skipping all lookups in it.", "Directory 'tests/node_modules' does not exist, skipping all lookups in it.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json index c283d3ef124e6..d178f7d9e7686 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.", @@ -13,7 +13,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -21,7 +21,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json index 64f195b78e58f..710ce7f903f49 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module '../' from 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/', target file types: TypeScript, Declaration.", "Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.", "'package.json' has a 'typesVersions' field with version-specific path mappings.", "'package.json' does not have a 'typings' field.", @@ -10,14 +10,14 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", "======== Module name '../' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/s3.1/index.d.ts@1.0.0'. ========", "======== Resolving module '../other' from 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/other', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/other', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' exist - use it as a name resolution result.", @@ -25,7 +25,7 @@ "======== Module name '../other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' with Package ID 'ext/other.d.ts@1.0.0'. ========", "======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.tsx' does not exist.", @@ -36,7 +36,7 @@ "Module name 'index', matched pattern '*'.", "Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -44,7 +44,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "Module name 'other', matched pattern '*'.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json index 95ccfa6aa8be1..9ef935090529a 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module '../other' from 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/other', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/other', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' exist - use it as a name resolution result.", @@ -10,7 +10,7 @@ "======== Module name '../other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' with Package ID 'ext/other.d.ts@1.0.0'. ========", "======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext.tsx' does not exist.", @@ -21,7 +21,7 @@ "Module name 'index', matched pattern 'index'.", "Trying substitution 'ts3.1/index', candidate module location: 'ts3.1/index'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index' does not exist.", - "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.ts' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.", @@ -29,7 +29,7 @@ "======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========", "======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'ext/other' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.", "'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.", "File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.ts' does not exist.", diff --git a/tests/baselines/reference/typingsLookup4.trace.json b/tests/baselines/reference/typingsLookup4.trace.json index a493f6f8883a1..cc7c9b824dbd3 100644 --- a/tests/baselines/reference/typingsLookup4.trace.json +++ b/tests/baselines/reference/typingsLookup4.trace.json @@ -1,7 +1,7 @@ [ "======== Resolving module 'jquery' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'jquery' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'jquery' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/jquery.ts' does not exist.", "File '/node_modules/jquery.tsx' does not exist.", "File '/node_modules/jquery.d.ts' does not exist.", @@ -14,7 +14,7 @@ "======== Module name 'jquery' was successfully resolved to '/node_modules/@types/jquery/jquery.d.ts'. ========", "======== Resolving module 'kquery' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'kquery' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'kquery' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/kquery.ts' does not exist.", "File '/node_modules/kquery.tsx' does not exist.", "File '/node_modules/kquery.d.ts' does not exist.", @@ -23,7 +23,7 @@ "File '/node_modules/@types/kquery.d.ts' does not exist.", "'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.", "File '/node_modules/@types/kquery/kquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/kquery/kquery.ts' does not exist.", "File '/node_modules/@types/kquery/kquery.tsx' does not exist.", "File '/node_modules/@types/kquery/kquery.d.ts' exist - use it as a name resolution result.", @@ -31,7 +31,7 @@ "======== Module name 'kquery' was successfully resolved to '/node_modules/@types/kquery/kquery.d.ts'. ========", "======== Resolving module 'lquery' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'lquery' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'lquery' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/lquery.ts' does not exist.", "File '/node_modules/lquery.tsx' does not exist.", "File '/node_modules/lquery.d.ts' does not exist.", @@ -40,13 +40,13 @@ "File '/node_modules/@types/lquery.d.ts' does not exist.", "'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.", "File '/node_modules/@types/lquery/lquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/lquery/lquery.ts' exist - use it as a name resolution result.", "Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'.", "======== Module name 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts'. ========", "======== Resolving module 'mquery' from '/a.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'mquery' from 'node_modules' folder, target file type 'TypeScript'.", + "Loading module 'mquery' from 'node_modules' folder, target file types: TypeScript, Declaration.", "File '/node_modules/mquery.ts' does not exist.", "File '/node_modules/mquery.tsx' does not exist.", "File '/node_modules/mquery.d.ts' does not exist.", @@ -55,7 +55,7 @@ "File '/node_modules/@types/mquery.d.ts' does not exist.", "'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.", "File '/node_modules/@types/mquery/mquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/mquery/mquery.ts' does not exist.", "File '/node_modules/@types/mquery/mquery.tsx' does not exist.", "File '/node_modules/@types/mquery/mquery.d.ts' does not exist.", @@ -75,7 +75,7 @@ "File '/node_modules/@types/kquery/package.json' exists according to earlier cached lookups.", "'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.", "File '/node_modules/@types/kquery/kquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/kquery/kquery.ts' does not exist.", "File '/node_modules/@types/kquery/kquery.tsx' does not exist.", "File '/node_modules/@types/kquery/kquery.d.ts' exist - use it as a name resolution result.", @@ -86,7 +86,7 @@ "File '/node_modules/@types/lquery/package.json' exists according to earlier cached lookups.", "'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.", "File '/node_modules/@types/lquery/lquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/lquery/lquery.ts' exist - use it as a name resolution result.", "Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'.", "======== Type reference directive 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts', primary: true. ========", @@ -95,7 +95,7 @@ "File '/node_modules/@types/mquery/package.json' exists according to earlier cached lookups.", "'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.", "File '/node_modules/@types/mquery/mquery' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file type 'TypeScript'.", + "Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file types: TypeScript, Declaration.", "File '/node_modules/@types/mquery/mquery.ts' does not exist.", "File '/node_modules/@types/mquery/mquery.tsx' does not exist.", "File '/node_modules/@types/mquery/mquery.d.ts' does not exist.", diff --git a/tests/cases/compiler/moduleResolutionWithExtensions_preferTs.ts b/tests/cases/compiler/moduleResolutionWithExtensions_preferTs.ts deleted file mode 100644 index 5688408b72b43..0000000000000 --- a/tests/cases/compiler/moduleResolutionWithExtensions_preferTs.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @noImplicitReferences: true -// @traceResolution: true - -// @Filename: /b.js - -// @Filename: /b/index.ts -export default 0; - -// @Filename: /a.ts -import b from "./b"; diff --git a/tests/cases/compiler/moduleResolution_classicPrefersTs.ts b/tests/cases/compiler/moduleResolution_classicPrefersTs.ts new file mode 100644 index 0000000000000..6eabe760ed007 --- /dev/null +++ b/tests/cases/compiler/moduleResolution_classicPrefersTs.ts @@ -0,0 +1,12 @@ +// @moduleResolution: classic +// @allowJs: true +// @noEmit: true + +// @Filename: /dir1/dir2/dir3/a.js +export default "dir1/dir2/dir3/a.js"; + +// @Filename: /dir1/dir2/a.ts +export default "dir1/dir2/a.ts"; + +// @Filename: /dir1/dir2/dir3/index.ts +import a from "a"; diff --git a/tests/cases/conformance/moduleResolution/extensionLoadingPriority.ts b/tests/cases/conformance/moduleResolution/extensionLoadingPriority.ts new file mode 100644 index 0000000000000..7686c3dfedf61 --- /dev/null +++ b/tests/cases/conformance/moduleResolution/extensionLoadingPriority.ts @@ -0,0 +1,20 @@ +// @moduleResolution: classic,node,node16,nodenext +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /project/a.js +export default "a.js"; + +// @Filename: /project/a.js.js +export default "a.js.js"; + +// @Filename: /project/dir/index.ts +export default "dir/index.ts"; + +// @Filename: /project/dir.js +export default "dir.js"; + +// @Filename: /project/b.ts +import a from "./a.js"; +import dir from "./dir"; diff --git a/tests/cases/conformance/moduleResolution/nodeModulesAtTypesPriority.ts b/tests/cases/conformance/moduleResolution/nodeModulesAtTypesPriority.ts new file mode 100644 index 0000000000000..22aa519480943 --- /dev/null +++ b/tests/cases/conformance/moduleResolution/nodeModulesAtTypesPriority.ts @@ -0,0 +1,24 @@ +// @module: node16 +// @strict: true +// @noEmit: true +// @traceResolution: true + +// @Filename: /node_modules/@types/react/index.d.ts +declare const React: any; +export = React; + +// @Filename: /node_modules/@types/redux/index.d.ts +export declare function createStore(): void; + +// @Filename: /packages/a/node_modules/react/index.js +module.exports = {}; + +// @Filename: /packages/a/node_modules/redux/index.d.ts +export declare function createStore(): void; + +// @Filename: /packages/a/node_modules/redux/index.js +module.exports = {}; + +// @Filename: /packages/a/index.ts +import React from "react"; +import { createStore } from "redux";