-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check nearest package.json dependencies for possible package names fo…
…r specifier candidates (#58176)
- Loading branch information
Showing
23 changed files
with
1,016 additions
and
6 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
74 changes: 74 additions & 0 deletions
74
...lines/reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.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,74 @@ | ||
//// [tests/cases/compiler/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.ts] //// | ||
|
||
//// [foo.d.ts] | ||
export declare class Foo { | ||
private f: any; | ||
} | ||
//// [index.d.ts] | ||
import { Foo } from "./foo.js"; | ||
export function create(): Foo; | ||
//// [package.json] | ||
{ | ||
"name": "package-a", | ||
"version": "0.0.1", | ||
"exports": { | ||
".": "./index.js", | ||
"./cls": "./foo.js" | ||
} | ||
} | ||
//// [package.json] | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"package-a": "file:../packageA" | ||
} | ||
} | ||
//// [index.d.ts] | ||
import { create } from "package-a"; | ||
export declare function invoke(): ReturnType<typeof create>; | ||
//// [package.json] | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"package-b": "file:../packageB", | ||
"package-a": "file:../packageA" | ||
} | ||
} | ||
//// [index.ts] | ||
import * as pkg from "package-b"; | ||
|
||
export const a = pkg.invoke(); | ||
|
||
//// [index.js] | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.a = void 0; | ||
const pkg = __importStar(require("package-b")); | ||
exports.a = pkg.invoke(); | ||
|
||
|
||
//// [index.d.ts] | ||
export declare const a: import("package-a/cls").Foo; |
36 changes: 36 additions & 0 deletions
36
.../reference/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.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 @@ | ||
//// [tests/cases/compiler/symlinkedWorkspaceDependenciesNoDirectLinkGeneratesDeepNonrelativeName.ts] //// | ||
|
||
=== workspace/packageA/foo.d.ts === | ||
export declare class Foo { | ||
>Foo : Symbol(Foo, Decl(foo.d.ts, 0, 0)) | ||
|
||
private f: any; | ||
>f : Symbol(Foo.f, Decl(foo.d.ts, 0, 26)) | ||
} | ||
=== workspace/packageA/index.d.ts === | ||
import { Foo } from "./foo.js"; | ||
>Foo : Symbol(Foo, Decl(index.d.ts, 0, 8)) | ||
|
||
export function create(): Foo; | ||
>create : Symbol(create, Decl(index.d.ts, 0, 31)) | ||
>Foo : Symbol(Foo, Decl(index.d.ts, 0, 8)) | ||
|
||
=== workspace/packageB/index.d.ts === | ||
import { create } from "package-a"; | ||
>create : Symbol(create, Decl(index.d.ts, 0, 8)) | ||
|
||
export declare function invoke(): ReturnType<typeof create>; | ||
>invoke : Symbol(invoke, Decl(index.d.ts, 0, 35)) | ||
>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) | ||
>create : Symbol(create, Decl(index.d.ts, 0, 8)) | ||
|
||
=== workspace/packageC/index.ts === | ||
import * as pkg from "package-b"; | ||
>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) | ||
|
||
export const a = pkg.invoke(); | ||
>a : Symbol(a, Decl(index.ts, 2, 12)) | ||
>pkg.invoke : Symbol(pkg.invoke, Decl(index.d.ts, 0, 35)) | ||
>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) | ||
>invoke : Symbol(pkg.invoke, Decl(index.d.ts, 0, 35)) | ||
|
Oops, something went wrong.