mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accept new moduleResolution options on commandline (#46239)
This commit is contained in:
@@ -748,6 +748,8 @@ namespace ts {
|
||||
type: new Map(getEntries({
|
||||
node: ModuleResolutionKind.NodeJs,
|
||||
classic: ModuleResolutionKind.Classic,
|
||||
node12: ModuleResolutionKind.Node12,
|
||||
nodenext: ModuleResolutionKind.NodeNext,
|
||||
})),
|
||||
affectsModuleResolution: true,
|
||||
paramType: Diagnostics.STRATEGY,
|
||||
|
||||
@@ -117,6 +117,7 @@ namespace Harness {
|
||||
class CompilerTest {
|
||||
private static varyBy: readonly string[] = [
|
||||
"module",
|
||||
"moduleResolution",
|
||||
"target",
|
||||
"jsx",
|
||||
"removeComments",
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace ts {
|
||||
start: undefined,
|
||||
length: undefined,
|
||||
}, {
|
||||
messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic'.",
|
||||
messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic', 'node12', 'nodenext'.",
|
||||
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
|
||||
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
|
||||
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
|
||||
|
||||
==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ====
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ====
|
||||
export declare function thing(): void;
|
||||
==== tests/cases/compiler/index.ts (1 errors) ====
|
||||
import * as p from "pkg";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
p.thing();
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var p = require("pkg");
|
||||
p.thing();
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : any
|
||||
|
||||
p.thing();
|
||||
>p.thing() : any
|
||||
>p.thing : any
|
||||
>p : any
|
||||
>thing : any
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var p = require("pkg");
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var p = require("pkg");
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
|
||||
|
||||
==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ====
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ====
|
||||
export declare function thing(): void;
|
||||
==== tests/cases/compiler/index.ts (1 errors) ====
|
||||
import * as p from "pkg";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
p.thing();
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : any
|
||||
|
||||
p.thing();
|
||||
>p.thing() : any
|
||||
>p.thing : any
|
||||
>p : any
|
||||
>thing : any
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
|
||||
|
||||
==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ====
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ====
|
||||
export declare function thing(): void;
|
||||
==== tests/cases/compiler/index.ts (1 errors) ====
|
||||
import * as p from "pkg";
|
||||
~~~~~
|
||||
!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations.
|
||||
p.thing();
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : any
|
||||
|
||||
p.thing();
|
||||
>p.thing() : any
|
||||
>p.thing : any
|
||||
>p : any
|
||||
>thing : any
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//// [tests/cases/compiler/moduleResolutionWithModule.ts] ////
|
||||
|
||||
//// [package.json]
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
//// [entrypoint.d.ts]
|
||||
export declare function thing(): void;
|
||||
//// [index.ts]
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (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 });
|
||||
const p = __importStar(require("pkg"));
|
||||
p.thing();
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
|
||||
p.thing();
|
||||
>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
>p : Symbol(p, Decl(index.ts, 0, 6))
|
||||
>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0))
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts ===
|
||||
export declare function thing(): void;
|
||||
>thing : () => void
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import * as p from "pkg";
|
||||
>p : typeof p
|
||||
|
||||
p.thing();
|
||||
>p.thing() : void
|
||||
>p.thing : () => void
|
||||
>p : typeof p
|
||||
>thing : () => void
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// @moduleResolution: node,node12,nodenext
|
||||
// @module: commonjs,node12,nodenext
|
||||
// @filename: node_modules/pkg/package.json
|
||||
{
|
||||
"name": "pkg",
|
||||
"version": "0.0.1",
|
||||
"exports": "./entrypoint.js"
|
||||
}
|
||||
// @filename: node_modules/pkg/entrypoint.d.ts
|
||||
export declare function thing(): void;
|
||||
// @filename: index.ts
|
||||
import * as p from "pkg";
|
||||
p.thing();
|
||||
Reference in New Issue
Block a user