-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8486 from Microsoft/symlinked-modules
use CompilerHost.realpath to resolve actual location for symlinks
- Loading branch information
Showing
12 changed files
with
230 additions
and
28 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//// [tests/cases/compiler/moduleResolutionWithSymlinks.ts] //// | ||
|
||
//// [index.ts] | ||
|
||
export class MyClass{} | ||
|
||
//// [index.ts] | ||
import {MyClass} from "library-a"; | ||
export { MyClass as MyClass2 } | ||
|
||
//// [app.ts] | ||
import { MyClass } from "./library-a"; | ||
import { MyClass2 } from "./library-b"; | ||
|
||
let x: MyClass; | ||
let y: MyClass2; | ||
x = y; | ||
y = x; | ||
|
||
//// [index.js] | ||
"use strict"; | ||
var MyClass = (function () { | ||
function MyClass() { | ||
} | ||
return MyClass; | ||
}()); | ||
exports.MyClass = MyClass; | ||
//// [index.js] | ||
"use strict"; | ||
var library_a_1 = require("library-a"); | ||
exports.MyClass2 = library_a_1.MyClass; | ||
//// [app.js] | ||
"use strict"; | ||
var x; | ||
var y; | ||
x = y; | ||
y = x; |
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/moduleResolutionWithSymlinks.symbols
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,36 @@ | ||
=== /src/app.ts === | ||
import { MyClass } from "./library-a"; | ||
>MyClass : Symbol(MyClass, Decl(app.ts, 0, 8)) | ||
|
||
import { MyClass2 } from "./library-b"; | ||
>MyClass2 : Symbol(MyClass2, Decl(app.ts, 1, 8)) | ||
|
||
let x: MyClass; | ||
>x : Symbol(x, Decl(app.ts, 3, 3)) | ||
>MyClass : Symbol(MyClass, Decl(app.ts, 0, 8)) | ||
|
||
let y: MyClass2; | ||
>y : Symbol(y, Decl(app.ts, 4, 3)) | ||
>MyClass2 : Symbol(MyClass2, Decl(app.ts, 1, 8)) | ||
|
||
x = y; | ||
>x : Symbol(x, Decl(app.ts, 3, 3)) | ||
>y : Symbol(y, Decl(app.ts, 4, 3)) | ||
|
||
y = x; | ||
>y : Symbol(y, Decl(app.ts, 4, 3)) | ||
>x : Symbol(x, Decl(app.ts, 3, 3)) | ||
|
||
=== /src/library-a/index.ts === | ||
|
||
export class MyClass{} | ||
>MyClass : Symbol(MyClass, Decl(index.ts, 0, 0)) | ||
|
||
=== /src/library-b/index.ts === | ||
import {MyClass} from "library-a"; | ||
>MyClass : Symbol(MyClass, Decl(index.ts, 0, 8)) | ||
|
||
export { MyClass as MyClass2 } | ||
>MyClass : Symbol(MyClass2, Decl(index.ts, 1, 8)) | ||
>MyClass2 : Symbol(MyClass2, Decl(index.ts, 1, 8)) | ||
|
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/moduleResolutionWithSymlinks.trace.json
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,32 @@ | ||
[ | ||
"======== Resolving module './library-a' from '/src/app.ts'. ========", | ||
"Module resolution kind is not specified, using 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/src/library-a'.", | ||
"File '/src/library-a.ts' does not exist.", | ||
"File '/src/library-a.tsx' does not exist.", | ||
"File '/src/library-a.d.ts' does not exist.", | ||
"File '/src/library-a/package.json' does not exist.", | ||
"File '/src/library-a/index.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/src/library-a/index.ts', result '/src/library-a/index.ts'", | ||
"======== Module name './library-a' was successfully resolved to '/src/library-a/index.ts'. ========", | ||
"======== Resolving module './library-b' from '/src/app.ts'. ========", | ||
"Module resolution kind is not specified, using 'NodeJs'.", | ||
"Loading module as file / folder, candidate module location '/src/library-b'.", | ||
"File '/src/library-b.ts' does not exist.", | ||
"File '/src/library-b.tsx' does not exist.", | ||
"File '/src/library-b.d.ts' does not exist.", | ||
"File '/src/library-b/package.json' does not exist.", | ||
"File '/src/library-b/index.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/src/library-b/index.ts', result '/src/library-b/index.ts'", | ||
"======== Module name './library-b' was successfully resolved to '/src/library-b/index.ts'. ========", | ||
"======== Resolving module 'library-a' from '/src/library-b/index.ts'. ========", | ||
"Module resolution kind is not specified, using 'NodeJs'.", | ||
"Loading module 'library-a' from 'node_modules' folder.", | ||
"File '/src/library-b/node_modules/library-a.ts' does not exist.", | ||
"File '/src/library-b/node_modules/library-a.tsx' does not exist.", | ||
"File '/src/library-b/node_modules/library-a.d.ts' does not exist.", | ||
"File '/src/library-b/node_modules/library-a/package.json' does not exist.", | ||
"File '/src/library-b/node_modules/library-a/index.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/src/library-b/node_modules/library-a/index.ts', result '/src/library-a/index.ts'", | ||
"======== Module name 'library-a' was successfully resolved to '/src/library-a/index.ts'. ========" | ||
] |
38 changes: 38 additions & 0 deletions
38
tests/baselines/reference/moduleResolutionWithSymlinks.types
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,38 @@ | ||
=== /src/app.ts === | ||
import { MyClass } from "./library-a"; | ||
>MyClass : typeof MyClass | ||
|
||
import { MyClass2 } from "./library-b"; | ||
>MyClass2 : typeof MyClass | ||
|
||
let x: MyClass; | ||
>x : MyClass | ||
>MyClass : MyClass | ||
|
||
let y: MyClass2; | ||
>y : MyClass | ||
>MyClass2 : MyClass | ||
|
||
x = y; | ||
>x = y : MyClass | ||
>x : MyClass | ||
>y : MyClass | ||
|
||
y = x; | ||
>y = x : MyClass | ||
>y : MyClass | ||
>x : MyClass | ||
|
||
=== /src/library-a/index.ts === | ||
|
||
export class MyClass{} | ||
>MyClass : MyClass | ||
|
||
=== /src/library-b/index.ts === | ||
import {MyClass} from "library-a"; | ||
>MyClass : typeof MyClass | ||
|
||
export { MyClass as MyClass2 } | ||
>MyClass : typeof MyClass | ||
>MyClass2 : typeof MyClass | ||
|
Oops, something went wrong.