-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle more places where package direcroy is converted to canonical f…
…ile path (#50740) (#50747) * Add test for node16 resolution with package json lookup making casing incorrect * Handle more places where package direcroy is converted to canonical file path
- Loading branch information
1 parent
ea348f6
commit bb8cf90
Showing
13 changed files
with
220 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
...reference/tscWatch/forceConsistentCasingInFileNames/package-json-is-looked-up-for-file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
Input:: | ||
//// [/Users/name/projects/lib-boilerplate/package.json] | ||
{"name":"lib-boilerplate","version":"0.0.2","type":"module","exports":"./src/index.ts"} | ||
|
||
//// [/Users/name/projects/lib-boilerplate/src/index.ts] | ||
export function thing(): void {} | ||
|
||
|
||
//// [/Users/name/projects/lib-boilerplate/test/basic.spec.ts] | ||
import { thing } from 'lib-boilerplate' | ||
|
||
|
||
//// [/Users/name/projects/lib-boilerplate/tsconfig.json] | ||
{"compilerOptions":{"module":"node16","target":"es2021","forceConsistentCasingInFileNames":true,"traceResolution":true}} | ||
|
||
//// [/a/lib/lib.es2021.full.d.ts] | ||
/// <reference no-default-lib="true"/> | ||
interface Boolean {} | ||
interface Function {} | ||
interface CallableFunction {} | ||
interface NewableFunction {} | ||
interface IArguments {} | ||
interface Number { toExponential: any; } | ||
interface Object {} | ||
interface RegExp {} | ||
interface String { charAt: any; } | ||
interface Array<T> { length: number; [n: number]: T; } | ||
|
||
|
||
/a/lib/tsc.js -w --explainFiles | ||
Output:: | ||
>> Screen clear | ||
[[90m12:00:29 AM[0m] Starting compilation in watch mode... | ||
|
||
File '/Users/name/projects/lib-boilerplate/src/package.json' does not exist. | ||
Found 'package.json' at '/Users/name/projects/lib-boilerplate/package.json'. | ||
'package.json' does not have a 'typesVersions' field. | ||
File '/Users/name/projects/lib-boilerplate/test/package.json' does not exist. | ||
File '/Users/name/projects/lib-boilerplate/package.json' exists according to earlier cached lookups. | ||
======== Resolving module 'lib-boilerplate' from '/Users/name/projects/lib-boilerplate/test/basic.spec.ts'. ======== | ||
Module resolution kind is not specified, using 'Node16'. | ||
File '/Users/name/projects/lib-boilerplate/test/package.json' does not exist according to earlier cached lookups. | ||
File '/Users/name/projects/lib-boilerplate/package.json' exists according to earlier cached lookups. | ||
File '/Users/name/projects/lib-boilerplate/src/index.ts' exist - use it as a name resolution result. | ||
Resolving real path for '/Users/name/projects/lib-boilerplate/src/index.ts', result '/Users/name/projects/lib-boilerplate/src/index.ts'. | ||
======== Module name 'lib-boilerplate' was successfully resolved to '/Users/name/projects/lib-boilerplate/src/index.ts' with Package ID 'lib-boilerplate/src/index.ts@0.0.2'. ======== | ||
File '/a/lib/package.json' does not exist. | ||
File '/a/package.json' does not exist. | ||
File '/package.json' does not exist. | ||
../../../../a/lib/lib.es2021.full.d.ts | ||
Default library for target 'es2021' | ||
src/index.ts | ||
Matched by default include pattern '**/*' | ||
Imported via 'lib-boilerplate' from file 'test/basic.spec.ts' with packageId 'lib-boilerplate/src/index.ts@0.0.2' | ||
File is ECMAScript module because 'package.json' has field "type" with value "module" | ||
test/basic.spec.ts | ||
Matched by default include pattern '**/*' | ||
File is ECMAScript module because 'package.json' has field "type" with value "module" | ||
[[90m12:00:34 AM[0m] Found 0 errors. Watching for file changes. | ||
|
||
|
||
|
||
Program root files: ["/Users/name/projects/lib-boilerplate/src/index.ts","/Users/name/projects/lib-boilerplate/test/basic.spec.ts"] | ||
Program options: {"module":100,"target":8,"forceConsistentCasingInFileNames":true,"traceResolution":true,"watch":true,"explainFiles":true,"configFilePath":"/Users/name/projects/lib-boilerplate/tsconfig.json"} | ||
Program structureReused: Not | ||
Program files:: | ||
/a/lib/lib.es2021.full.d.ts | ||
/Users/name/projects/lib-boilerplate/src/index.ts | ||
/Users/name/projects/lib-boilerplate/test/basic.spec.ts | ||
|
||
Semantic diagnostics in builder refreshed for:: | ||
/a/lib/lib.es2021.full.d.ts | ||
/Users/name/projects/lib-boilerplate/src/index.ts | ||
/Users/name/projects/lib-boilerplate/test/basic.spec.ts | ||
|
||
Shape signatures in builder refreshed for:: | ||
/a/lib/lib.es2021.full.d.ts (used version) | ||
/users/name/projects/lib-boilerplate/src/index.ts (used version) | ||
/users/name/projects/lib-boilerplate/test/basic.spec.ts (used version) | ||
|
||
WatchedFiles:: | ||
/users/name/projects/lib-boilerplate/tsconfig.json: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/tsconfig.json","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/src/index.ts: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/src/index.ts","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/test/basic.spec.ts: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/test/basic.spec.ts","pollingInterval":250} | ||
/a/lib/lib.es2021.full.d.ts: | ||
{"fileName":"/a/lib/lib.es2021.full.d.ts","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/package.json: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/package.json","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/src/package.json: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/src/package.json","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/test/package.json: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/test/package.json","pollingInterval":250} | ||
/users/name/projects/lib-boilerplate/node_modules/@types: | ||
{"fileName":"/Users/name/projects/lib-boilerplate/node_modules/@types","pollingInterval":500} | ||
|
||
FsWatches:: | ||
|
||
FsWatchesRecursive:: | ||
/users/name/projects/lib-boilerplate/test: | ||
{"directoryName":"/Users/name/projects/lib-boilerplate/test"} | ||
/users/name/projects/lib-boilerplate: | ||
{"directoryName":"/users/name/projects/lib-boilerplate"} | ||
|
||
exitCode:: ExitStatus.undefined | ||
|
||
//// [/Users/name/projects/lib-boilerplate/src/index.js] | ||
export function thing() { } | ||
|
||
|
||
//// [/Users/name/projects/lib-boilerplate/test/basic.spec.js] | ||
export {}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.