Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Resolution and Type Reference directive cache updates and its API changes #43700

Merged
merged 7 commits into from
Apr 22, 2021
Prev Previous commit
Update Baselines and/or Applied Lint Fixes
  • Loading branch information
typescript-bot committed Apr 22, 2021
commit 74993a2a64bb2e423b40204bb54ff749cdd4ef54
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"File '/node_modules/foo/index.ts' does not exist.",
"File '/node_modules/foo/index.tsx' does not exist.",
"File '/node_modules/foo/index.d.ts' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"======== Module name './index' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.2.3'. ========",
"======== Resolving module 'foo' from '/node_modules/a/index.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"File '/node_modules/@foo/bar/index.ts' does not exist.",
"File '/node_modules/@foo/bar/index.tsx' does not exist.",
"File '/node_modules/@foo/bar/index.d.ts' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/node_modules/@foo/bar/package.json' that indicates it was found.",
"File '/node_modules/@foo/bar/package.json' exists according to earlier cached lookups.",
"======== Module name './index' was successfully resolved to '/node_modules/@foo/bar/index.d.ts' with Package ID '@foo/bar/index.d.ts@1.2.3'. ========",
"======== Resolving module '@foo/bar' from '/node_modules/a/index.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"======== Resolving module '../' from '/a/b/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
"Using cached result of 'package.json' at '/a/package.json' that indicates it was not found.",
"File '/a/package.json' does not exist according to earlier cached lookups.",
"File '/a/index.ts' exist - use it as a name resolution result.",
"======== Module name '../' was successfully resolved to '/a/index.ts'. ========"
]
2 changes: 1 addition & 1 deletion tests/baselines/reference/library-reference-2.trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"======== Type reference directive 'jquery' was successfully resolved to '/types/jquery/jquery.d.ts', primary: true. ========",
"======== Resolving type reference directive 'jquery', containing file '/test/__inferred type names__.ts', root directory '/types'. ========",
"Resolving with primary search path '/types'.",
"Using cached result of 'package.json' at '/types/jquery/package.json' that indicates it was found.",
"File '/types/jquery/package.json' exists according to earlier cached lookups.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
"File '/types/jquery/jquery.d.ts' exist - use it as a name resolution result.",
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/library-reference-6.trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========",
"======== Resolving type reference directive 'alpha', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
"Resolving with primary search path '/node_modules/@types'.",
"Using cached result of 'package.json' at '/node_modules/@types/alpha/package.json' that indicates it was not found.",
"File '/node_modules/@types/alpha/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
"Resolving real path for '/node_modules/@types/alpha/index.d.ts', result '/node_modules/@types/alpha/index.d.ts'.",
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========"
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/library-reference-8.trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"======== Type reference directive 'beta' was successfully resolved to '/test/types/beta/index.d.ts', primary: true. ========",
"======== Resolving type reference directive 'beta', containing file '/test/types/alpha/index.d.ts', root directory '/test/types'. ========",
"Resolving with primary search path '/test/types'.",
"Using cached result of 'package.json' at '/test/types/beta/package.json' that indicates it was not found.",
"File '/test/types/beta/package.json' does not exist according to earlier cached lookups.",
"File '/test/types/beta/index.d.ts' exist - use it as a name resolution result.",
"Resolving real path for '/test/types/beta/index.d.ts', result '/test/types/beta/index.d.ts'.",
"======== Type reference directive 'beta' was successfully resolved to '/test/types/beta/index.d.ts', primary: true. ========",
"======== Resolving type reference directive 'alpha', containing file '/test/types/beta/index.d.ts', root directory '/test/types'. ========",
"Resolving with primary search path '/test/types'.",
"Using cached result of 'package.json' at '/test/types/alpha/package.json' that indicates it was not found.",
"File '/test/types/alpha/package.json' does not exist according to earlier cached lookups.",
"File '/test/types/alpha/index.d.ts' exist - use it as a name resolution result.",
"Resolving real path for '/test/types/alpha/index.d.ts', result '/test/types/alpha/index.d.ts'.",
"======== Type reference directive 'alpha' was successfully resolved to '/test/types/alpha/index.d.ts', primary: true. ========",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"File '/node_modules/shortid/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'shortid' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/shortid/package.json' that indicates it was not found.",
"File '/node_modules/shortid/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/shortid.js' does not exist.",
"File '/node_modules/shortid.jsx' does not exist.",
"File '/node_modules/shortid/index.js' exist - use it as a name resolution result.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"File '/project/node_modules/troublesome-lib/lib/Option.ts' does not exist.",
"File '/project/node_modules/troublesome-lib/lib/Option.tsx' does not exist.",
"File '/project/node_modules/troublesome-lib/lib/Option.d.ts' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/project/node_modules/troublesome-lib/package.json' that indicates it was found.",
"File '/project/node_modules/troublesome-lib/package.json' exists according to earlier cached lookups.",
"======== Module name './Option' was successfully resolved to '/project/node_modules/troublesome-lib/lib/Option.d.ts' with Package ID 'troublesome-lib/lib/Option.d.ts@1.17.1'. ========",
"======== Resolving module 'troublesome-lib/lib/Option' from '/shared/lib/app.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"File '/node_modules/normalize.css/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'normalize.css' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/normalize.css/package.json' that indicates it was found.",
"File '/node_modules/normalize.css/package.json' exists according to earlier cached lookups.",
"File '/node_modules/normalize.css.js' does not exist.",
"File '/node_modules/normalize.css.jsx' does not exist.",
"'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",
"'package.json' does not have a 'main' field.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"File '/node_modules/js/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'js' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/js/package.json' that indicates it was not found.",
"File '/node_modules/js/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/js.js' does not exist.",
"File '/node_modules/js.jsx' does not exist.",
"File '/node_modules/js/index.js' exist - use it as a name resolution result.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"File '/node_modules/foo/lib/test.ts' does not exist.",
"File '/node_modules/foo/lib/test.tsx' does not exist.",
"File '/node_modules/foo/lib/test.d.ts' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was not found.",
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
"======== Module name 'foo/test' was successfully resolved to '/node_modules/foo/lib/test.d.ts'. ========",
"======== Resolving module './relative.js' from '/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"======== Resolving module 'linked' from '/app/app.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module 'linked' from 'node_modules' folder, target file type 'TypeScript'.",
"Using cached result of 'package.json' at '/app/node_modules/linked/package.json' that indicates it was not found.",
"File '/app/node_modules/linked/package.json' does not exist according to earlier cached lookups.",
"File '/app/node_modules/linked.ts' does not exist.",
"File '/app/node_modules/linked.tsx' does not exist.",
"File '/app/node_modules/linked.d.ts' does not exist.",
Expand All @@ -44,7 +44,7 @@
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.",
"Directory '/app/node_modules/linked2/node_modules' does not exist, skipping all lookups in it.",
"Using cached result of 'package.json' at '/app/node_modules/real/package.json' that indicates it was not found.",
"File '/app/node_modules/real/package.json' does not exist according to earlier cached lookups.",
"File '/app/node_modules/real.ts' does not exist.",
"File '/app/node_modules/real.tsx' does not exist.",
"File '/app/node_modules/real.d.ts' does not exist.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"File '/node_modules/foo/bar/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo/bar' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/bar/package.json' that indicates it was not found.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/bar/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"File '/node_modules/foo/bar.js' does not exist.",
"File '/node_modules/foo/bar.jsx' does not exist.",
"'package.json' does not have a 'main' field.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"File '/node_modules/foo/@bar/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo/@bar' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/@bar/package.json' that indicates it was not found.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/@bar/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"File '/node_modules/foo/@bar.js' does not exist.",
"File '/node_modules/foo/@bar.jsx' does not exist.",
"'package.json' does not have a 'main' field.",
Expand Down
6 changes: 3 additions & 3 deletions tests/baselines/reference/packageJsonMain.trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
Expand Down Expand Up @@ -57,7 +57,7 @@
"File '/node_modules/bar/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'bar' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/bar/package.json' that indicates it was found.",
"File '/node_modules/bar/package.json' exists according to earlier cached lookups.",
"File '/node_modules/bar.js' does not exist.",
"File '/node_modules/bar.jsx' does not exist.",
"'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.",
Expand Down Expand Up @@ -88,7 +88,7 @@
"File '/node_modules/baz/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'baz' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/baz/package.json' that indicates it was found.",
"File '/node_modules/baz/package.json' exists according to earlier cached lookups.",
"File '/node_modules/baz.js' does not exist.",
"File '/node_modules/baz.jsx' does not exist.",
"'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was found.",
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"File '/node_modules/foo/bar/foobar.js.jsx' does not exist.",
"File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it.",
"File '/node_modules/foo/bar/foobar.js' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was not found.",
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
"======== Module name 'foo/bar/foobar.js' was successfully resolved to '/node_modules/foo/bar/foobar.js'. ========"
]
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Trying substitution 'src/types', candidate module location: 'src/types'.",
"Loading module as file / folder, candidate module location '/src/types', target file type 'JavaScript'.",
"Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was not found.",
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/foo/bar/foobar.json.js' does not exist.",
"File '/node_modules/foo/bar/foobar.json.jsx' does not exist.",
"======== Module name 'foo/bar/foobar.json' was not resolved. ========"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Trying substitution 'src/types', candidate module location: 'src/types'.",
"Loading module as file / folder, candidate module location '/src/types', target file type 'JavaScript'.",
"Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'JavaScript'.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was not found.",
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/foo/bar/foobar.json.js' does not exist.",
"File '/node_modules/foo/bar/foobar.json.jsx' does not exist.",
"'baseUrl' option is set to '/', using this value to resolve non-relative module name 'foo/bar/foobar.json'.",
Expand All @@ -38,6 +38,6 @@
"Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.",
"Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'Json'.",
"File '/node_modules/foo/bar/foobar.json' exist - use it as a name resolution result.",
"Using cached result of 'package.json' at '/node_modules/foo/package.json' that indicates it was not found.",
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
"======== Module name 'foo/bar/foobar.json' was successfully resolved to '/node_modules/foo/bar/foobar.json'. ========"
]
2 changes: 1 addition & 1 deletion tests/baselines/reference/scopedPackages.trace.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module '@be/bop/e/z' from 'node_modules' folder, target file type 'TypeScript'.",
"Scoped package detected, looking in 'be__bop/e/z'",
"Using cached result of 'package.json' at '/node_modules/@types/be__bop/package.json' that indicates it was not found.",
"File '/node_modules/@types/be__bop/package.json' does not exist according to earlier cached lookups.",
"File '/node_modules/@types/be__bop/e/z.d.ts' exist - use it as a name resolution result.",
"Resolving real path for '/node_modules/@types/be__bop/e/z.d.ts', result '/node_modules/@types/be__bop/e/z.d.ts'.",
"======== Module name '@be/bop/e/z' was successfully resolved to '/node_modules/@types/be__bop/e/z.d.ts'. ========"
Expand Down
Loading