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 #31541 from microsoft/packageId
Always use resolved file to figure out subModule name in package id
- Loading branch information
Showing
31 changed files
with
443 additions
and
253 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
44 changes: 44 additions & 0 deletions
44
tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.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,44 @@ | ||
//// [tests/cases/compiler/moduleResolutionPackageIdWithRelativeAndAbsolutePath.ts] //// | ||
|
||
//// [package.json] | ||
{ | ||
"name": "troublesome-lib", | ||
"version": "1.17.1" | ||
} | ||
//// [Compactable.d.ts] | ||
import { Option } from './Option'; | ||
export class Compactable { | ||
option: Option; | ||
} | ||
//// [Option.d.ts] | ||
export class Option { | ||
someProperty: string; | ||
} | ||
//// [app.d.ts] | ||
import { Option } from "troublesome-lib/lib/Option"; | ||
export class SharedOption extends Option { } | ||
export const makeSharedOption: () => SharedOption; | ||
//// [index.d.ts] | ||
import { Compactable } from "troublesome-lib/lib/Compactable"; // Including this will resolve Option as relative through the imports of compactable | ||
//// [package.json] | ||
{ | ||
"name": "troublesome-lib", | ||
"version": "1.17.1" | ||
} | ||
//// [Compactable.d.ts] | ||
import { Option } from './Option'; | ||
export class Compactable { | ||
option: Option; | ||
} | ||
//// [Option.d.ts] | ||
export class Option { | ||
someProperty: string; | ||
} | ||
//// [app.ts] | ||
import * as t from "anotherLib"; // Include the lib that recursively includes option as relative module resolution in this directory | ||
import { makeSharedOption } from "@shared/lib/app"; // Includes option as module in shared folder but as module in node_modules folder | ||
|
||
|
||
//// [/project/src/app.js] | ||
"use strict"; | ||
exports.__esModule = true; |
48 changes: 48 additions & 0 deletions
48
tests/baselines/reference/moduleResolutionPackageIdWithRelativeAndAbsolutePath.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,48 @@ | ||
=== /project/src/app.ts === | ||
import * as t from "anotherLib"; // Include the lib that recursively includes option as relative module resolution in this directory | ||
>t : Symbol(t, Decl(app.ts, 0, 6)) | ||
|
||
import { makeSharedOption } from "@shared/lib/app"; // Includes option as module in shared folder but as module in node_modules folder | ||
>makeSharedOption : Symbol(makeSharedOption, Decl(app.ts, 1, 8)) | ||
|
||
=== /shared/node_modules/troublesome-lib/lib/Option.d.ts === | ||
export class Option { | ||
>Option : Symbol(Option, Decl(Option.d.ts, 0, 0)) | ||
|
||
someProperty: string; | ||
>someProperty : Symbol(Option.someProperty, Decl(Option.d.ts, 0, 21)) | ||
} | ||
=== /shared/lib/app.d.ts === | ||
import { Option } from "troublesome-lib/lib/Option"; | ||
>Option : Symbol(Option, Decl(app.d.ts, 0, 8)) | ||
|
||
export class SharedOption extends Option { } | ||
>SharedOption : Symbol(SharedOption, Decl(app.d.ts, 0, 52)) | ||
>Option : Symbol(Option, Decl(app.d.ts, 0, 8)) | ||
|
||
export const makeSharedOption: () => SharedOption; | ||
>makeSharedOption : Symbol(makeSharedOption, Decl(app.d.ts, 2, 12)) | ||
>SharedOption : Symbol(SharedOption, Decl(app.d.ts, 0, 52)) | ||
|
||
=== /project/node_modules/anotherLib/index.d.ts === | ||
import { Compactable } from "troublesome-lib/lib/Compactable"; // Including this will resolve Option as relative through the imports of compactable | ||
>Compactable : Symbol(Compactable, Decl(index.d.ts, 0, 8)) | ||
|
||
=== /project/node_modules/troublesome-lib/lib/Compactable.d.ts === | ||
import { Option } from './Option'; | ||
>Option : Symbol(Option, Decl(Compactable.d.ts, 0, 8)) | ||
|
||
export class Compactable { | ||
>Compactable : Symbol(Compactable, Decl(Compactable.d.ts, 0, 34)) | ||
|
||
option: Option; | ||
>option : Symbol(Compactable.option, Decl(Compactable.d.ts, 1, 26)) | ||
>Option : Symbol(Option, Decl(Compactable.d.ts, 0, 8)) | ||
} | ||
=== /project/node_modules/troublesome-lib/lib/Option.d.ts === | ||
export class Option { | ||
>Option : Symbol(Option, Decl(Option.d.ts, 0, 0)) | ||
|
||
someProperty: string; | ||
>someProperty : Symbol(Option.someProperty, Decl(Option.d.ts, 0, 21)) | ||
} |
Oops, something went wrong.