From 61200368bb440ba8a40641be87c44d875ca31f69 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 2 Feb 2024 13:20:32 -0800 Subject: [PATCH] Use loader with extension substitution for package.json main, types, typesVersions (#57261) --- src/compiler/diagnosticMessages.json | 4 - src/compiler/moduleNameResolver.ts | 17 +-- ...odule(moduleresolution=bundler).errors.txt | 20 +++ ...odule(moduleresolution=bundler).trace.json | 99 +++++++++++++++ ...dule(moduleresolution=nodenext).trace.json | 117 ++++++++++++++++++ ...bundlerRelative1(module=esnext).trace.json | 1 - ...ndlerRelative1(module=preserve).trace.json | 1 - ...esolvepackagejsonexports=false).trace.json | 2 - .../non-relative-preserveSymlinks.js | 2 - ...ive-preserves-originalPath-on-cache-hit.js | 2 - ...-relative-uses-originalPath-for-caching.js | 6 +- ...ive-module-name-as-directory-load-index.js | 2 - ...lutionWithExtensions_unexpected.trace.json | 11 +- ...utionWithExtensions_unexpected2.trace.json | 12 +- ...ageRoot_mainFieldInSubDirectory.trace.json | 2 - .../node10Alternateresult_noTypes.trace.json | 7 +- .../reference/node10IsNode_node.trace.json | 2 - .../reference/node10IsNode_node10.trace.json | 2 - .../reference/packageJsonMain.trace.json | 19 ++- .../packageJsonMain_isNonRecursive.trace.json | 3 - ...stic1(moduleresolution=bundler).trace.json | 6 +- ...ostic1(moduleresolution=node16).trace.json | 6 +- ...project-correctly-with-preserveSymlinks.js | 3 - ...-file-from-referenced-project-correctly.js | 3 - ...for-changes-to-package-json-main-fields.js | 9 -- ...t-correctly-with-cts-and-mts-extensions.js | 15 --- ...age-with-indirect-link-moduleCaseChange.js | 2 - ...er-symlinked-package-with-indirect-link.js | 2 - .../tsc/moduleResolution/alternateResult.js | 66 ++++++---- .../moduleResolution/alternateResult.js | 36 ++++-- ...for-changes-to-package-json-main-fields.js | 6 - .../moduleResolution/alternateResult.js | 36 ++++-- .../typesVersions.ambientModules.trace.json | 1 - .../typesVersions.emptyTypes.trace.json | 1 - .../typesVersions.justIndex.trace.json | 1 - .../typesVersions.multiFile.trace.json | 1 - ...VersionsDeclarationEmit.ambient.trace.json | 1 - ...rsionsDeclarationEmit.multiFile.trace.json | 1 - ...it.multiFileBackReferenceToSelf.trace.json | 2 - ...ultiFileBackReferenceToUnmapped.trace.json | 1 - .../reference/typingsLookup4.trace.json | 6 - .../bundler/bundlerDirectoryModule.ts | 21 ++++ 42 files changed, 388 insertions(+), 169 deletions(-) create mode 100644 tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).errors.txt create mode 100644 tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).trace.json create mode 100644 tests/baselines/reference/bundlerDirectoryModule(moduleresolution=nodenext).trace.json create mode 100644 tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 344d92f054f..f3e66173766 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4723,10 +4723,6 @@ "category": "Message", "code": 6080 }, - "File '{0}' has an unsupported extension, so skipping it.": { - "category": "Message", - "code": 6081 - }, "Only 'amd' and 'system' modules are supported alongside --{0}.": { "category": "Error", "code": 6082 diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index eeff8c96c7b..d29142c7214 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -2090,7 +2090,6 @@ function loadModuleFromFileNoImplicitExtensions(extensions: Extensions, candidat /** * This function is only ever called with paths written in package.json files - never * module specifiers written in source files - and so it always allows the - * candidate to end with a TS extension (but will also try substituting a JS extension for a TS extension). */ function loadFileNameFromPackageJsonField(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { @@ -2459,15 +2458,9 @@ function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: st } const loader: ResolutionKindSpecificLoader = (extensions, candidate, onlyRecordFailures, state) => { - const fromFile = tryFile(candidate, onlyRecordFailures, state); + const fromFile = loadFileNameFromPackageJsonField(extensions, candidate, onlyRecordFailures, state); if (fromFile) { - const resolved = resolvedIfExtensionMatches(extensions, fromFile); - if (resolved) { - return noPackageId(resolved); - } - if (state.traceEnabled) { - trace(state.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); - } + return noPackageId(fromFile); } // Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types" @@ -2514,12 +2507,6 @@ function loadNodeModuleFromDirectoryWorker(extensions: Extensions, candidate: st } } -/** Resolve from an arbitrarily specified file. Return `undefined` if it has an unsupported extension. */ -function resolvedIfExtensionMatches(extensions: Extensions, path: string, resolvedUsingTsExtension?: boolean): PathAndExtension | undefined { - const ext = tryGetExtensionFromPath(path); - return ext !== undefined && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : undefined; -} - /** True if `extension` is one of the supported `extensions`. */ function extensionIsOk(extensions: Extensions, extension: string): boolean { return extensions & Extensions.JavaScript && (extension === Extension.Js || extension === Extension.Jsx || extension === Extension.Mjs || extension === Extension.Cjs) diff --git a/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).errors.txt b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).errors.txt new file mode 100644 index 00000000000..251f5168f39 --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).errors.txt @@ -0,0 +1,20 @@ +error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. + + +!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. +!!! error TS5109: Option 'moduleResolution' must be set to 'NodeNext' (or left unspecified) when option 'module' is set to 'NodeNext'. +==== /app/test.ts (0 errors) ==== + import { test } from '../lib'; + +==== /lib/package.json (0 errors) ==== + { + "main": "./cjs/index.js" + } + +==== /lib/cjs/index.js (0 errors) ==== + export function test() {} + +==== /lib/cjs/index.d.ts (0 errors) ==== + export function test(): void; + \ No newline at end of file diff --git a/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).trace.json b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).trace.json new file mode 100644 index 00000000000..c5b363606d1 --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=bundler).trace.json @@ -0,0 +1,99 @@ +[ + "======== Resolving module '../lib' from '/app/test.ts'. ========", + "Explicitly specified module resolution kind: 'Bundler'.", + "Resolving in CJS mode with conditions 'import', 'types'.", + "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration, JSON.", + "File '/lib.ts' does not exist.", + "File '/lib.tsx' does not exist.", + "File '/lib.d.ts' does not exist.", + "File '/lib.js' does not exist.", + "File '/lib.jsx' does not exist.", + "Found 'package.json' at '/lib/package.json'.", + "'package.json' does not have a 'typesVersions' field.", + "'package.json' does not have a 'typings' field.", + "'package.json' does not have a 'types' field.", + "'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'.", + "File name '/lib/cjs/index.js' has a '.js' extension - stripping it.", + "File '/lib/cjs/index.ts' does not exist.", + "File '/lib/cjs/index.tsx' does not exist.", + "File '/lib/cjs/index.d.ts' exists - use it as a name resolution result.", + "======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ========", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=nodenext).trace.json b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=nodenext).trace.json new file mode 100644 index 00000000000..d04a40759ed --- /dev/null +++ b/tests/baselines/reference/bundlerDirectoryModule(moduleresolution=nodenext).trace.json @@ -0,0 +1,117 @@ +[ + "File '/app/package.json' does not exist.", + "File '/package.json' does not exist.", + "======== Resolving module '../lib' from '/app/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeNext'.", + "Resolving in CJS mode with conditions 'require', 'types', 'node'.", + "Loading module as file / folder, candidate module location '/lib', target file types: TypeScript, JavaScript, Declaration.", + "File '/lib.ts' does not exist.", + "File '/lib.tsx' does not exist.", + "File '/lib.d.ts' does not exist.", + "File '/lib.js' does not exist.", + "File '/lib.jsx' does not exist.", + "Found 'package.json' at '/lib/package.json'.", + "'package.json' does not have a 'typesVersions' field.", + "'package.json' does not have a 'typings' field.", + "'package.json' does not have a 'types' field.", + "'package.json' has 'main' field './cjs/index.js' that references '/lib/cjs/index.js'.", + "File name '/lib/cjs/index.js' has a '.js' extension - stripping it.", + "File '/lib/cjs/index.ts' does not exist.", + "File '/lib/cjs/index.tsx' does not exist.", + "File '/lib/cjs/index.d.ts' exists - use it as a name resolution result.", + "======== Module name '../lib' was successfully resolved to '/lib/cjs/index.d.ts'. ========", + "File '/lib/cjs/package.json' does not exist.", + "File '/lib/package.json' exists according to earlier cached lookups.", + "File '/.ts/package.json' does not exist.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-es5' from '/.src/__lib_node_modules_lookup_lib.es5.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-es5'", + "Loading module '@typescript/lib-es5' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-es5' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators' from '/.src/__lib_node_modules_lookup_lib.decorators.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators'", + "Loading module '@typescript/lib-decorators' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-decorators/legacy' from '/.src/__lib_node_modules_lookup_lib.decorators.legacy.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-decorators/legacy'", + "Loading module '@typescript/lib-decorators/legacy' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-decorators/legacy' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-dom' from '/.src/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-dom'", + "Loading module '@typescript/lib-dom' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-dom' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-webworker/importscripts' from '/.src/__lib_node_modules_lookup_lib.webworker.importscripts.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-webworker/importscripts'", + "Loading module '@typescript/lib-webworker/importscripts' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-webworker/importscripts' was not resolved. ========", + "File '/.ts/package.json' does not exist according to earlier cached lookups.", + "File '/package.json' does not exist according to earlier cached lookups.", + "======== Resolving module '@typescript/lib-scripthost' from '/.src/__lib_node_modules_lookup_lib.scripthost.d.ts__.ts'. ========", + "Explicitly specified module resolution kind: 'Node10'.", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: TypeScript, Declaration.", + "Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Scoped package detected, looking in 'typescript__lib-scripthost'", + "Loading module '@typescript/lib-scripthost' from 'node_modules' folder, target file types: JavaScript.", + "Searching all ancestor node_modules directories for fallback extensions: JavaScript.", + "Directory '/.src/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name '@typescript/lib-scripthost' was not resolved. ========", + "File '/.ts/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/bundlerRelative1(module=esnext).trace.json b/tests/baselines/reference/bundlerRelative1(module=esnext).trace.json index c90d2d5fcf7..7cc32c65d7e 100644 --- a/tests/baselines/reference/bundlerRelative1(module=esnext).trace.json +++ b/tests/baselines/reference/bundlerRelative1(module=esnext).trace.json @@ -45,7 +45,6 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field '../foo' that references '/foo'.", - "File '/foo' does not exist.", "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON.", "File '/foo.ts' does not exist.", "File '/foo.tsx' does not exist.", diff --git a/tests/baselines/reference/bundlerRelative1(module=preserve).trace.json b/tests/baselines/reference/bundlerRelative1(module=preserve).trace.json index c90d2d5fcf7..7cc32c65d7e 100644 --- a/tests/baselines/reference/bundlerRelative1(module=preserve).trace.json +++ b/tests/baselines/reference/bundlerRelative1(module=preserve).trace.json @@ -45,7 +45,6 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field '../foo' that references '/foo'.", - "File '/foo' does not exist.", "Loading module as file / folder, candidate module location '/foo', target file types: TypeScript, JavaScript, Declaration, JSON.", "File '/foo.ts' does not exist.", "File '/foo.tsx' does not exist.", diff --git a/tests/baselines/reference/customConditions(resolvepackagejsonexports=false).trace.json b/tests/baselines/reference/customConditions(resolvepackagejsonexports=false).trace.json index a7928b92560..f84220f787e 100644 --- a/tests/baselines/reference/customConditions(resolvepackagejsonexports=false).trace.json +++ b/tests/baselines/reference/customConditions(resolvepackagejsonexports=false).trace.json @@ -13,8 +13,6 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'index.js' that references '/node_modules/lodash/index.js'.", - "File '/node_modules/lodash/index.js' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/lodash/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/lodash/index.js' has a '.js' extension - stripping it.", "File '/node_modules/lodash/index.ts' does not exist.", "File '/node_modules/lodash/index.tsx' does not exist.", diff --git a/tests/baselines/reference/moduleResolution/non-relative-preserveSymlinks.js b/tests/baselines/reference/moduleResolution/non-relative-preserveSymlinks.js index b8ffa99a4d1..410f76711d4 100644 --- a/tests/baselines/reference/moduleResolution/non-relative-preserveSymlinks.js +++ b/tests/baselines/reference/moduleResolution/non-relative-preserveSymlinks.js @@ -22,7 +22,6 @@ Resolution:: { "/app/node_modules/linked.ts", "/app/node_modules/linked.tsx", "/app/node_modules/linked.d.ts", - "/app/node_modules/linked/index", "/app/node_modules/linked/index.ts", "/app/node_modules/linked/index.tsx" ], @@ -54,7 +53,6 @@ Resolution:: { "/app/node_modules/linked.ts", "/app/node_modules/linked.tsx", "/app/node_modules/linked.d.ts", - "/app/node_modules/linked/index", "/app/node_modules/linked/index.ts", "/app/node_modules/linked/index.tsx" ], diff --git a/tests/baselines/reference/moduleResolution/non-relative-preserves-originalPath-on-cache-hit.js b/tests/baselines/reference/moduleResolution/non-relative-preserves-originalPath-on-cache-hit.js index f13c1b45d43..c43d3b2c072 100644 --- a/tests/baselines/reference/moduleResolution/non-relative-preserves-originalPath-on-cache-hit.js +++ b/tests/baselines/reference/moduleResolution/non-relative-preserves-originalPath-on-cache-hit.js @@ -32,7 +32,6 @@ Resolution:: { "/app/node_modules/linked.ts", "/app/node_modules/linked.tsx", "/app/node_modules/linked.d.ts", - "/app/node_modules/linked/index", "/app/node_modules/linked/index.ts", "/app/node_modules/linked/index.tsx" ], @@ -64,7 +63,6 @@ Resolution:: { "/app/node_modules/linked.ts", "/app/node_modules/linked.tsx", "/app/node_modules/linked.d.ts", - "/app/node_modules/linked/index", "/app/node_modules/linked/index.ts", "/app/node_modules/linked/index.tsx", "/app/lib/node_modules/linked/package.json", diff --git a/tests/baselines/reference/moduleResolution/non-relative-uses-originalPath-for-caching.js b/tests/baselines/reference/moduleResolution/non-relative-uses-originalPath-for-caching.js index 8db60837c2d..06090d52b2f 100644 --- a/tests/baselines/reference/moduleResolution/non-relative-uses-originalPath-for-caching.js +++ b/tests/baselines/reference/moduleResolution/non-relative-uses-originalPath-for-caching.js @@ -31,8 +31,7 @@ Resolution:: { "/sub/dir/node_modules/@types/a/index.d.ts", "/sub/node_modules/a.ts", "/sub/node_modules/a.tsx", - "/sub/node_modules/a.d.ts", - "/sub/node_modules/a/index" + "/sub/node_modules/a.d.ts" ], "affectingLocations": [ "/sub/node_modules/a/package.json" @@ -61,8 +60,7 @@ Resolution:: { "/sub/dir/node_modules/@types/a/index.d.ts", "/sub/node_modules/a.ts", "/sub/node_modules/a.tsx", - "/sub/node_modules/a.d.ts", - "/sub/node_modules/a/index" + "/sub/node_modules/a.d.ts" ], "affectingLocations": [ "/sub/node_modules/a/package.json" diff --git a/tests/baselines/reference/moduleResolution/relative-module-name-as-directory-load-index.js b/tests/baselines/reference/moduleResolution/relative-module-name-as-directory-load-index.js index d438ba81df7..8d1f4710358 100644 --- a/tests/baselines/reference/moduleResolution/relative-module-name-as-directory-load-index.js +++ b/tests/baselines/reference/moduleResolution/relative-module-name-as-directory-load-index.js @@ -21,7 +21,6 @@ Resolution:: { "/a/b/foo.ts", "/a/b/foo.tsx", "/a/b/foo.d.ts", - "/c/d", "/c/d.ts", "/c/d.tsx", "/c/d.d.ts", @@ -59,7 +58,6 @@ Resolution:: { "/a/b/foo.ts", "/a/b/foo.tsx", "/a/b/foo.d.ts", - "/c/d", "/c/d.ts", "/c/d.tsx", "/c/d.d.ts", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json index 4cf795b9f16..3a1310358ec 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected.trace.json @@ -13,8 +13,8 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.", - "File '/node_modules/normalize.css/normalize.css' exists - use it as a name resolution result.", - "File '/node_modules/normalize.css/normalize.css' has an unsupported extension, so skipping it.", + "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", + "File '/node_modules/normalize.css/normalize.d.css.ts' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: TypeScript, Declaration.", "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", "File '/node_modules/normalize.css/normalize.d.css.ts' does not exist.", @@ -34,8 +34,7 @@ "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' exists - use it as a name resolution result.", - "File '/node_modules/normalize.css/normalize.css' has an unsupported extension, so skipping it.", + "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: JavaScript.", "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", "File '/node_modules/normalize.css/normalize.css.js' does not exist.", @@ -55,8 +54,8 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.", - "File '/node_modules/normalize.css/normalize.css' exists - use it as a name resolution result.", - "File '/node_modules/normalize.css/normalize.css' has an unsupported extension, so skipping it.", + "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", + "File '/node_modules/normalize.css/normalize.d.css.ts' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/normalize.css/normalize.css', target file types: TypeScript, Declaration.", "File name '/node_modules/normalize.css/normalize.css' has a '.css' extension - stripping it.", "File '/node_modules/normalize.css/normalize.d.css.ts' does not exist.", diff --git a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json index 98b215113d1..824c82941bc 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json +++ b/tests/baselines/reference/moduleResolutionWithExtensions_unexpected2.trace.json @@ -10,8 +10,10 @@ "'package.json' does not have a 'typesVersions' field.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'.", - "File '/node_modules/foo/foo.js' exists - use it as a name resolution result.", - "File '/node_modules/foo/foo.js' has an unsupported extension, so skipping it.", + "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.", "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.", @@ -42,8 +44,10 @@ "File '/node_modules/foo.d.ts' does not exist.", "'package.json' does not have a 'typings' field.", "'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'.", - "File '/node_modules/foo/foo.js' exists - use it as a name resolution result.", - "File '/node_modules/foo/foo.js' has an unsupported extension, so skipping it.", + "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.", "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.", diff --git a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json index 7317c4f0718..748d82ec5fc 100644 --- a/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json +++ b/tests/baselines/reference/moduleResolution_packageJson_yesAtPackageRoot_mainFieldInSubDirectory.trace.json @@ -11,8 +11,6 @@ "'package.json' does not have a 'typings' field.", "'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 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/node10Alternateresult_noTypes.trace.json b/tests/baselines/reference/node10Alternateresult_noTypes.trace.json index 3135d22e9bc..94f5d7c7ec5 100644 --- a/tests/baselines/reference/node10Alternateresult_noTypes.trace.json +++ b/tests/baselines/reference/node10Alternateresult_noTypes.trace.json @@ -11,8 +11,10 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field './untyped.js' that references '/node_modules/pkg/untyped.js'.", - "File '/node_modules/pkg/untyped.js' exists - use it as a name resolution result.", - "File '/node_modules/pkg/untyped.js' has an unsupported extension, so skipping it.", + "File name '/node_modules/pkg/untyped.js' has a '.js' extension - stripping it.", + "File '/node_modules/pkg/untyped.ts' does not exist.", + "File '/node_modules/pkg/untyped.tsx' does not exist.", + "File '/node_modules/pkg/untyped.d.ts' does not exist.", "Loading module as file / folder, candidate module location '/node_modules/pkg/untyped.js', target file types: TypeScript, Declaration.", "File name '/node_modules/pkg/untyped.js' has a '.js' extension - stripping it.", "File '/node_modules/pkg/untyped.ts' does not exist.", @@ -32,6 +34,7 @@ "File '/node_modules/pkg.js' does not exist.", "File '/node_modules/pkg.jsx' does not exist.", "'package.json' has 'main' field './untyped.js' that references '/node_modules/pkg/untyped.js'.", + "File name '/node_modules/pkg/untyped.js' has a '.js' extension - stripping it.", "File '/node_modules/pkg/untyped.js' exists - use it as a name resolution result.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", "Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, Declaration.", diff --git a/tests/baselines/reference/node10IsNode_node.trace.json b/tests/baselines/reference/node10IsNode_node.trace.json index df07b412a50..7182602f406 100644 --- a/tests/baselines/reference/node10IsNode_node.trace.json +++ b/tests/baselines/reference/node10IsNode_node.trace.json @@ -11,8 +11,6 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'index.js' that references '/node_modules/fancy-lib/index.js'.", - "File '/node_modules/fancy-lib/index.js' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/fancy-lib/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/fancy-lib/index.js' has a '.js' extension - stripping it.", "File '/node_modules/fancy-lib/index.ts' does not exist.", "File '/node_modules/fancy-lib/index.tsx' does not exist.", diff --git a/tests/baselines/reference/node10IsNode_node10.trace.json b/tests/baselines/reference/node10IsNode_node10.trace.json index df07b412a50..7182602f406 100644 --- a/tests/baselines/reference/node10IsNode_node10.trace.json +++ b/tests/baselines/reference/node10IsNode_node10.trace.json @@ -11,8 +11,6 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'index.js' that references '/node_modules/fancy-lib/index.js'.", - "File '/node_modules/fancy-lib/index.js' does not exist.", - "Loading module as file / folder, candidate module location '/node_modules/fancy-lib/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/fancy-lib/index.js' has a '.js' extension - stripping it.", "File '/node_modules/fancy-lib/index.ts' does not exist.", "File '/node_modules/fancy-lib/index.tsx' does not exist.", diff --git a/tests/baselines/reference/packageJsonMain.trace.json b/tests/baselines/reference/packageJsonMain.trace.json index 304d04b9398..7a5ae1bf7af 100644 --- a/tests/baselines/reference/packageJsonMain.trace.json +++ b/tests/baselines/reference/packageJsonMain.trace.json @@ -11,7 +11,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", @@ -27,7 +26,6 @@ "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 types: JavaScript.", "File '/node_modules/foo/oof.js' exists - use it as a name resolution result.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", @@ -40,7 +38,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", @@ -64,8 +61,10 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.", - "File '/node_modules/bar/rab.js' exists - use it as a name resolution result.", - "File '/node_modules/bar/rab.js' has an unsupported extension, so skipping it.", + "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.", "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.", @@ -85,6 +84,7 @@ "File '/node_modules/bar.js' does not exist.", "File '/node_modules/bar.jsx' does not exist.", "'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.", + "File name '/node_modules/bar/rab.js' has a '.js' extension - stripping it.", "File '/node_modules/bar/rab.js' exists - use it as a name resolution result.", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update.", "Loading module 'bar' from 'node_modules' folder, target file types: TypeScript, Declaration.", @@ -96,8 +96,10 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.", - "File '/node_modules/bar/rab.js' exists - use it as a name resolution result.", - "File '/node_modules/bar/rab.js' has an unsupported extension, so skipping it.", + "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.", "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.", @@ -125,7 +127,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/baz/zab.ts' does not exist.", "File '/node_modules/baz/zab.tsx' does not exist.", @@ -143,7 +144,6 @@ "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 types: JavaScript.", "File '/node_modules/baz/zab.js' does not exist.", "File '/node_modules/baz/zab.jsx' does not exist.", @@ -158,7 +158,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/baz/zab.ts' does not exist.", "File '/node_modules/baz/zab.tsx' does not exist.", diff --git a/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json b/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json index 0630d940392..1b4d806fee2 100644 --- a/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json +++ b/tests/baselines/reference/packageJsonMain_isNonRecursive.trace.json @@ -11,7 +11,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", @@ -29,7 +28,6 @@ "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 types: JavaScript.", "File '/node_modules/foo/oof.js' does not exist.", "File '/node_modules/foo/oof.jsx' does not exist.", @@ -47,7 +45,6 @@ "'package.json' does not have a 'typings' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/foo/oof.ts' does not exist.", "File '/node_modules/foo/oof.tsx' does not exist.", diff --git a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json index 1ee77d07b8f..933be781da0 100644 --- a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json +++ b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json @@ -80,8 +80,10 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'index.js' that references '/node_modules/bar/index.js'.", - "File '/node_modules/bar/index.js' exists - use it as a name resolution result.", - "File '/node_modules/bar/index.js' has an unsupported extension, so skipping it.", + "File name '/node_modules/bar/index.js' has a '.js' extension - stripping 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.", "Loading module as file / folder, candidate module location '/node_modules/bar/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/bar/index.js' has a '.js' extension - stripping it.", "File '/node_modules/bar/index.ts' does not exist.", diff --git a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json index b60514374f3..61dde263ddf 100644 --- a/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json +++ b/tests/baselines/reference/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json @@ -75,8 +75,10 @@ "'package.json' does not have a 'typings' field.", "'package.json' does not have a 'types' field.", "'package.json' has 'main' field 'index.js' that references '/node_modules/bar/index.js'.", - "File '/node_modules/bar/index.js' exists - use it as a name resolution result.", - "File '/node_modules/bar/index.js' has an unsupported extension, so skipping it.", + "File name '/node_modules/bar/index.js' has a '.js' extension - stripping 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.", "Loading module as file / folder, candidate module location '/node_modules/bar/index.js', target file types: TypeScript, Declaration.", "File name '/node_modules/bar/index.js' has a '.js' extension - stripping it.", "File '/node_modules/bar/index.ts' does not exist.", 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 a5ed69cf232..167bea0011a 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 @@ -90,9 +90,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. 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 5d6238a600b..537033d44e9 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 @@ -88,9 +88,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. 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 70e0769a5bb..206787e7d38 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 @@ -100,9 +100,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -372,9 +369,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -457,9 +451,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. 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 deb77b02fb3..346657af305 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 @@ -105,9 +105,6 @@ Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/pac 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -374,9 +371,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -475,9 +469,6 @@ Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/pac 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -574,9 +565,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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' exists - 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 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. @@ -837,9 +825,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. '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' exists - 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 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' exists - 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-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 58fc118cbcf..9b09deb1c32 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 @@ -118,8 +118,6 @@ File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' 'package.json' does not have a 'typings' field. '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 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. 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 b3221b4b43c..8fa2d05c714 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 @@ -118,8 +118,6 @@ File '/user/username/projects/myproject/plugin-one/node_modules/plugin-two.d.ts' 'package.json' does not have a 'typings' field. '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 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. diff --git a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js index 1342155ec7c..4122151ca05 100644 --- a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -267,8 +267,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -567,8 +569,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -800,8 +804,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -1035,8 +1041,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -1244,8 +1252,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -2022,8 +2032,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -2338,8 +2350,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -2627,8 +2641,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -2860,8 +2876,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -3095,8 +3113,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -3304,8 +3324,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. diff --git a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js index 3344f7ee85b..0ae3f12b5db 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js @@ -260,8 +260,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -615,8 +617,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -926,8 +930,10 @@ File '/home/src/projects/project/node_modules/bar/package.json' exists according 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -1760,8 +1766,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -2321,8 +2329,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -2632,8 +2642,10 @@ File '/home/src/projects/project/node_modules/bar2/package.json' exists accordin 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. 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 415be11fd33..055a34b24ed 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 @@ -68,8 +68,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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 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. @@ -207,8 +205,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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 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. @@ -339,8 +335,6 @@ File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. 'package.json' does not have a 'typings' field. '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 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. diff --git a/tests/baselines/reference/tsserver/moduleResolution/alternateResult.js b/tests/baselines/reference/tsserver/moduleResolution/alternateResult.js index 1819ef93b3c..b7a73d7c308 100644 --- a/tests/baselines/reference/tsserver/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsserver/moduleResolution/alternateResult.js @@ -287,8 +287,10 @@ Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typesVersions' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -819,8 +821,10 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/packa Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -1480,8 +1484,10 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/packa Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar/index.ts' does not exist. @@ -2797,8 +2803,10 @@ Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typesVersions' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -3565,8 +3573,10 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/pack Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. @@ -4247,8 +4257,10 @@ Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/pack Info seq [hh:mm:ss:mss] 'package.json' does not have a 'typings' field. Info seq [hh:mm:ss:mss] 'package.json' does not have a 'types' field. Info seq [hh:mm:ss:mss] 'package.json' has 'main' field 'index.js' that references '/home/src/projects/project/node_modules/bar2/index.js'. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' exists - use it as a name resolution result. -Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.js' has an unsupported extension, so skipping it. +Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.tsx' does not exist. +Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.d.ts' does not exist. Info seq [hh:mm:ss:mss] Loading module as file / folder, candidate module location '/home/src/projects/project/node_modules/bar2/index.js', target file types: TypeScript, Declaration. Info seq [hh:mm:ss:mss] File name '/home/src/projects/project/node_modules/bar2/index.js' has a '.js' extension - stripping it. Info seq [hh:mm:ss:mss] File '/home/src/projects/project/node_modules/bar2/index.ts' does not exist. diff --git a/tests/baselines/reference/typesVersions.ambientModules.trace.json b/tests/baselines/reference/typesVersions.ambientModules.trace.json index 404be1ddac6..7a3ba4bd93a 100644 --- a/tests/baselines/reference/typesVersions.ambientModules.trace.json +++ b/tests/baselines/reference/typesVersions.ambientModules.trace.json @@ -13,7 +13,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typesVersions.emptyTypes.trace.json b/tests/baselines/reference/typesVersions.emptyTypes.trace.json index 1860a9288d3..a7adf8491e0 100644 --- a/tests/baselines/reference/typesVersions.emptyTypes.trace.json +++ b/tests/baselines/reference/typesVersions.emptyTypes.trace.json @@ -15,7 +15,6 @@ "'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'.", - "File '/a/ts3.1/index' does not exist.", "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.", diff --git a/tests/baselines/reference/typesVersions.justIndex.trace.json b/tests/baselines/reference/typesVersions.justIndex.trace.json index c027d7ee5f1..4257e16048a 100644 --- a/tests/baselines/reference/typesVersions.justIndex.trace.json +++ b/tests/baselines/reference/typesVersions.justIndex.trace.json @@ -15,7 +15,6 @@ "'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'.", - "File '/a/ts3.1/index' does not exist.", "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.", diff --git a/tests/baselines/reference/typesVersions.multiFile.trace.json b/tests/baselines/reference/typesVersions.multiFile.trace.json index 533725ea68f..1ee5210698d 100644 --- a/tests/baselines/reference/typesVersions.multiFile.trace.json +++ b/tests/baselines/reference/typesVersions.multiFile.trace.json @@ -13,7 +13,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json index 404be1ddac6..7a3ba4bd93a 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.ambient.trace.json @@ -13,7 +13,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json index 533725ea68f..1ee5210698d 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFile.trace.json @@ -13,7 +13,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json index a84c6cc0852..6a22badfbb4 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToSelf.trace.json @@ -13,7 +13,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", @@ -42,7 +41,6 @@ "'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'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json index 50d0ecbeb1d..bfdbb3d2beb 100644 --- a/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json +++ b/tests/baselines/reference/typesVersionsDeclarationEmit.multiFileBackReferenceToUnmapped.trace.json @@ -13,7 +13,6 @@ "'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 'index'.", "Trying substitution 'ts3.1/index', candidate module location: 'ts3.1/index'.", - "File '/.src/node_modules/ext/ts3.1/index' does not exist.", "Loading module as file / folder, candidate module location '/.src/node_modules/ext/ts3.1/index', target file types: TypeScript, Declaration.", "File '/.src/node_modules/ext/ts3.1/index.ts' does not exist.", "File '/.src/node_modules/ext/ts3.1/index.tsx' does not exist.", diff --git a/tests/baselines/reference/typingsLookup4.trace.json b/tests/baselines/reference/typingsLookup4.trace.json index 7f87e32255f..746760f576f 100644 --- a/tests/baselines/reference/typingsLookup4.trace.json +++ b/tests/baselines/reference/typingsLookup4.trace.json @@ -24,7 +24,6 @@ "File '/node_modules/@types/kquery.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/@types/kquery/kquery.ts' does not exist.", "File '/node_modules/@types/kquery/kquery.tsx' does not exist.", @@ -42,7 +41,6 @@ "File '/node_modules/@types/lquery.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/@types/lquery/lquery.ts' exists - use it as a name resolution result.", "Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'.", @@ -58,7 +56,6 @@ "File '/node_modules/@types/mquery.d.ts' does not exist.", "'package.json' does not have a 'typesVersions' field.", "'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 types: TypeScript, Declaration.", "File '/node_modules/@types/mquery/mquery.ts' does not exist.", "File '/node_modules/@types/mquery/mquery.tsx' does not exist.", @@ -78,7 +75,6 @@ "Resolving with primary search path '/node_modules/@types'.", "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 types: TypeScript, Declaration.", "File '/node_modules/@types/kquery/kquery.ts' does not exist.", "File '/node_modules/@types/kquery/kquery.tsx' does not exist.", @@ -89,7 +85,6 @@ "Resolving with primary search path '/node_modules/@types'.", "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 types: TypeScript, Declaration.", "File '/node_modules/@types/lquery/lquery.ts' exists - use it as a name resolution result.", "Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'.", @@ -98,7 +93,6 @@ "Resolving with primary search path '/node_modules/@types'.", "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 types: TypeScript, Declaration.", "File '/node_modules/@types/mquery/mquery.ts' does not exist.", "File '/node_modules/@types/mquery/mquery.tsx' does not exist.", diff --git a/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts b/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts new file mode 100644 index 00000000000..77055c33ed6 --- /dev/null +++ b/tests/cases/conformance/moduleResolution/bundler/bundlerDirectoryModule.ts @@ -0,0 +1,21 @@ +// @module: nodenext +// @moduleResolution: nodenext,bundler +// @noImplicitAny: true +// @noEmit: true +// @traceResolution: true +// @noTypesAndSymbols: true +// @noImplicitReferences: true + +// @Filename: /lib/package.json +{ + "main": "./cjs/index.js" +} + +// @Filename: /lib/cjs/index.js +export function test() {} + +// @Filename: /lib/cjs/index.d.ts +export function test(): void; + +// @Filename: /app/test.ts +import { test } from '../lib';