-
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.
Browse files
Browse the repository at this point in the history
🤖 Cherry-pick PR #32878 into release-3.6
- Loading branch information
Showing
8 changed files
with
139 additions
and
0 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
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/declarationEmitPathMappingMonorepo.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,30 @@ | ||
//// [tests/cases/compiler/declarationEmitPathMappingMonorepo.ts] //// | ||
|
||
//// [index.d.ts] | ||
declare module "@ts-bug/a" { | ||
export type AText = { | ||
value: string; | ||
}; | ||
export function a(text: string): AText; | ||
} | ||
|
||
//// [index.ts] | ||
import { a } from "@ts-bug/a"; | ||
|
||
export function b(text: string) { | ||
return a(text); | ||
} | ||
|
||
//// [index.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
var a_1 = require("@ts-bug/a"); | ||
function b(text) { | ||
return a_1.a(text); | ||
} | ||
exports.b = b; | ||
|
||
|
||
//// [index.d.ts] | ||
/// <reference types="@ts-bug/a" /> | ||
export declare function b(text: string): import("@ts-bug/a").AText; |
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/declarationEmitPathMappingMonorepo.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,29 @@ | ||
=== tests/cases/compiler/packages/a/index.d.ts === | ||
declare module "@ts-bug/a" { | ||
>"@ts-bug/a" : Symbol("@ts-bug/a", Decl(index.d.ts, 0, 0)) | ||
|
||
export type AText = { | ||
>AText : Symbol(AText, Decl(index.d.ts, 0, 28)) | ||
|
||
value: string; | ||
>value : Symbol(value, Decl(index.d.ts, 1, 25)) | ||
|
||
}; | ||
export function a(text: string): AText; | ||
>a : Symbol(a, Decl(index.d.ts, 3, 6)) | ||
>text : Symbol(text, Decl(index.d.ts, 4, 22)) | ||
>AText : Symbol(AText, Decl(index.d.ts, 0, 28)) | ||
} | ||
|
||
=== tests/cases/compiler/packages/b/src/index.ts === | ||
import { a } from "@ts-bug/a"; | ||
>a : Symbol(a, Decl(index.ts, 0, 8)) | ||
|
||
export function b(text: string) { | ||
>b : Symbol(b, Decl(index.ts, 0, 30)) | ||
>text : Symbol(text, Decl(index.ts, 2, 18)) | ||
|
||
return a(text); | ||
>a : Symbol(a, Decl(index.ts, 0, 8)) | ||
>text : Symbol(text, Decl(index.ts, 2, 18)) | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/baselines/reference/declarationEmitPathMappingMonorepo.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,29 @@ | ||
=== tests/cases/compiler/packages/a/index.d.ts === | ||
declare module "@ts-bug/a" { | ||
>"@ts-bug/a" : typeof import("@ts-bug/a") | ||
|
||
export type AText = { | ||
>AText : AText | ||
|
||
value: string; | ||
>value : string | ||
|
||
}; | ||
export function a(text: string): AText; | ||
>a : (text: string) => AText | ||
>text : string | ||
} | ||
|
||
=== tests/cases/compiler/packages/b/src/index.ts === | ||
import { a } from "@ts-bug/a"; | ||
>a : (text: string) => import("@ts-bug/a").AText | ||
|
||
export function b(text: string) { | ||
>b : (text: string) => import("@ts-bug/a").AText | ||
>text : string | ||
|
||
return a(text); | ||
>a(text) : import("@ts-bug/a").AText | ||
>a : (text: string) => import("@ts-bug/a").AText | ||
>text : string | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/cases/compiler/declarationEmitPathMappingMonorepo.ts
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,28 @@ | ||
// @filename: packages/a/index.d.ts | ||
declare module "@ts-bug/a" { | ||
export type AText = { | ||
value: string; | ||
}; | ||
export function a(text: string): AText; | ||
} | ||
|
||
// @filename: packages/b/src/index.ts | ||
import { a } from "@ts-bug/a"; | ||
|
||
export function b(text: string) { | ||
return a(text); | ||
} | ||
// @filename: packages/b/tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"declaration": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"@ts-bug/a": ["../a"] | ||
} | ||
} | ||
} | ||
|
||
// @link: tests/cases/compiler/packages/a -> tests/cases/compiler/node_modules/@ts-bug/a | ||
// @link: tests/cases/compiler/packages/b -> tests/cases/compiler/node_modules/@ts-bug/b |