-
Notifications
You must be signed in to change notification settings - Fork 9
test: sync enhanced-resolve test cases #182
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
base: main
Are you sure you want to change the base?
Changes from all commits
fce0bed
c41a17d
f4a5978
4de4f69
c5a9105
745d506
b2ff4a9
8c52218
8d5d82c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| fixtures/tsconfig/tsconfig_broken.json | ||
| fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json | ||
| fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json | ||
| pnpm-lock.yaml | ||
| **/.pnp.cjs | ||
| **/.pnp.cjs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| { | ||
| "name": "@exports-field/bad-specifier", | ||
| "version": "1.0.0", | ||
| "exports": { | ||
| ".": [ | ||
| "", | ||
| "./a/../b/../../pack1/index.js", | ||
| "././-bad-specifier-", | ||
| "-bad-specifier-", | ||
| "file.js", | ||
| "./a.js?foo=../" | ||
| ], | ||
| "./foo/*": [ | ||
| "", | ||
| "./a/../b/../../pack1/index.js", | ||
| "././-bad-specifier-", | ||
| "-bad-specifier-", | ||
| "file.js", | ||
| "./a.js?foo=../#../" | ||
| ], | ||
| "./bar": "-bad-specifier-", | ||
| "./baz": ["-bad-specifier-"], | ||
| "./baz-multi": ["-bad-specifier-", "foo"], | ||
| "./pattern/*.js": { | ||
| "default": ["-bad-specifier-", "./*.js"] | ||
| }, | ||
| "./slash": ["/bar", "./a.js"], | ||
| "./no-slash": [".bar", "./a.js"], | ||
| "./utils/": { | ||
| "browser": "/a/", | ||
| "default": "/b/" | ||
| }, | ||
| "./utils1/": "/a/", | ||
| "./utils2/": { | ||
| "default": "../this/" | ||
| }, | ||
| "./utils3/*": { | ||
| "default": "../this/*" | ||
| }, | ||
| "./utils4/*": "../src/*", | ||
| "./utils5/": "../src/", | ||
| "./*": ".", | ||
| "./valid/*.js": { | ||
| "default": ["-bad-specifier-", "./*.js"] | ||
| }, | ||
| "./non-existent.js": ["-bad-specifier-", "./non-existent.js", "./a.js"], | ||
| "./bad-specifier.js": ["-bad-specifier-", "../../a.js", "./a.js"], | ||
| "./bad-specifier1.js": ["-bad-specifier-", "foo", "./a.js"], | ||
| "./dep/multi": ["../../test", "./a.js"], | ||
| "./dep/multi1": ["../../test", "../../test/foo"], | ||
| "./dep/multi2": ["../../test"], | ||
| "./dep/multi3": ["./a/../b/../../pack1/index.js", "./a.js"], | ||
| "./dep/multi4": [ | ||
| "./a/../b/../../pack1/index.js", | ||
| "./c/../b/../../pack1/index.js" | ||
| ], | ||
| "./dep/multi5": ["./a/../b/../../pack1/index.js"] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "imports-field-chain", | ||
| "imports": { | ||
| "#a": "#b", | ||
| "#b": "./the.js" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = "the"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "name": "@exports-field/bad-specifier", | ||
| "version": "1.0.0", | ||
| "imports": { | ||
| "/utils/": "./a/", | ||
| "/utils1/": { | ||
| "browser": "./a/", | ||
| "default": "./b/" | ||
| }, | ||
| "a": "a.js", | ||
| "#": "a.js", | ||
| "#/dep": "a.js", | ||
| "#dep/": "a.js", | ||
| "#dep": [ | ||
| "./a/../b/../../pack1/index.js", | ||
| "././-bad-specifier-", | ||
| "./a.js?foo=../" | ||
| ], | ||
|
|
||
| "#dep/foo/*": [ | ||
| "./a/../b/../../pack1/index.js", | ||
| "././-bad-specifier-", | ||
| "./a.js?foo=../#../" | ||
| ], | ||
| "#dep/bar": "-bad-specifier-", | ||
| "#dep/baz": ["-bad-specifier-"], | ||
| "#dep/baz-multi": ["-bad-specifier-", "not-found"], | ||
| "#dep/pattern/*.js": { | ||
| "default": ["-bad-specifier-", "./*.js"] | ||
| }, | ||
| "#dep/array": ["./a.js", "-bad-specifier-"], | ||
| "#dep/array2": ["-bad-specifier-", "./a.js"], | ||
| "#dep/array3": ["./a.js"], | ||
| "#dep/empty": "", | ||
| "#dep/with-bad": ["../foo", "./a.js"], | ||
| "#dep/with-bad2": ["./a.js", "../foo"], | ||
| "#timezones/": "./data/timezones", | ||
| "#dep/multi": ["../../test", "./a.js"], | ||
| "#dep/multi1": ["../../test", "../../test/foo"], | ||
| "#dep/multi2": ["../../test"] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "imports-slash-pattern", | ||
| "imports": { | ||
| "#/*": "./src/*" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = "deep"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = "utils"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function button() { | ||
| return "button"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const newFile = "new-file"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as foo from "foo"; | ||
| import * as file1 from "foo/file1"; | ||
|
|
||
| import * as bar from "bar/file1"; | ||
| import * as myStar from "star-bar"; | ||
| import * as longest from "longest/bar"; | ||
| import * as packagedBrowser from "browser-field-package"; | ||
| import * as packagedMain from "main-field-package"; | ||
| import * as packagedIndex from "no-main-field-package"; | ||
| import * as newFile from "utils/old-file"; | ||
|
|
||
| console.log( | ||
| "HELLO WORLD!", | ||
| foo.message, | ||
| bar.message, | ||
| file1, | ||
| longest, | ||
| myStar.message, | ||
| packagedBrowser.message, | ||
| packagedMain.message, | ||
| packagedIndex.message, | ||
| newFile | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "bar"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "HELLO!"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const a = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const a = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const a = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "browser"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "node"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "browser-field", | ||
| "main": "node.ts", | ||
| "browser": "browser.ts" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "node"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "name": "main-field", | ||
| "main": "node.ts" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "index"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "name": "no-main-field" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "Hello Star!"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const message = "HELLO WORLD!"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function date() { | ||
| return "date"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "module": "commonjs", | ||
| "target": "es5", | ||
| "outDir": "./js_out", | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@components/*": [ | ||
| "${configDir}/src/utils/*", | ||
| "${configDir}/src/components/*" | ||
| ], | ||
| "@utils/*": ["./src/utils/*"], | ||
| "foo": ["${configDir}/src/mapped/foo"], | ||
| "foo/*": ["${configDir}/src/mapped/bar/*"], | ||
| "bar/*": ["./src/mapped/bar/*"], | ||
| "refs/*": ["${configDir}/src/refs/*"], | ||
| "*/old-file": ["${configDir}/src/components/new-file"], | ||
| "longest/*": [ | ||
| "${configDir}/src/mapped/longest/four.ts", | ||
| "${configDir}/src/mapped/longest/two.ts" | ||
| ], | ||
| "longest/bar": ["${configDir}/src/mapped/longest/three.ts"], | ||
| "*": ["${configDir}/src/mapped/star/*"] | ||
| }, | ||
| "composite": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function button() { | ||
| return "button"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import * as button from "@components/button"; | ||
| import * as date from "@utils/date"; | ||
|
|
||
| console.log("HELLO WORLD!", button, date); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function date() { | ||
| return "date"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "extends": "${configDir}/../base/tsconfig", | ||
| "compilerOptions": { | ||
| "baseUrl": "." | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const foo = "foo"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "extends": "${configDir}/../b/tsconfig", | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@lib/*": ["${configDir}/src/lib/*"] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const bar = "bar"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "extends": "${configDir}/../a/tsconfig", | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@util/*": ["${configDir}/src/util/*"] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": "../lib/tsconfig" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": "../../tsconfig-base/tsconfig" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const format = (s: string) => s; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@base/*": ["./src/*"] | ||
| } | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function button() { | ||
| return "button"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import * as button from "@components/button"; | ||
| import * as date from "@utils/date"; | ||
|
|
||
| console.log("HELLO WORLD!", button, date); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function date() { | ||
| return "date"; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "extends": ["react/tsconfig"], | ||
| "compilerOptions": { | ||
| "baseUrl": "." | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": "@my-tsconfig/base" | ||
|
stormslowly marked this conversation as resolved.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const Button = "button"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const bar = "bar"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const foo = "foo"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| // This is a line comment | ||
| "compilerOptions": { | ||
| /* This is a block comment */ | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| // Another line comment | ||
| "@components/*": ["${configDir}/src/components/*"], | ||
| "foo": ["${configDir}/src/mapped/foo"], | ||
| /* Block comment in paths */ | ||
| "bar/*": ["${configDir}/src/mapped/bar/*"] | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.