Use the full local file path as the id for a submodule (#21471)

* Use the full file path as the id for a submodule

* Informal code review feedback
This commit is contained in:
Wesley Wigham 2018-01-30 11:09:48 -08:00 committed by GitHub
parent a60c5d0e9a
commit b0ea899d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 193 additions and 21 deletions

View File

@ -801,7 +801,7 @@ namespace ts {
}
const resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state);
if (resolvedFromFile) {
const nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : undefined;
const nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined;
const packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, /*onlyRecordFailures*/ false, state).packageId;
return withPackageId(packageId, resolvedFromFile);
}
@ -826,12 +826,13 @@ namespace ts {
*
* packageDirectory is the directory of the package itself.
* subModuleName is the path within the package.
* For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "" }. (Part before "/node_modules/" is ignored.)
* For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar" }.
* For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar" }.
* For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "index.d.ts" }. (Part before "/node_modules/" is ignored.)
* For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }.
* For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar/index.d.ts" }.
* For `/node_modules/foo/bar/index.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }.
*/
function parseNodeModuleFromPath(path: string): { packageDirectory: string, subModuleName: string } | undefined {
path = normalizePath(path);
function parseNodeModuleFromPath(resolved: PathAndExtension): { packageDirectory: string, subModuleName: string } | undefined {
const path = normalizePath(resolved.path);
const idx = path.lastIndexOf(nodeModulesPathPart);
if (idx === -1) {
return undefined;
@ -843,7 +844,7 @@ namespace ts {
indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName);
}
const packageDirectory = path.slice(0, indexAfterPackageName);
const subModuleName = removeExtensionAndIndex(path.slice(indexAfterPackageName + 1));
const subModuleName = removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + Extension.Dts;
return { packageDirectory, subModuleName };
}
@ -852,9 +853,17 @@ namespace ts {
return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex;
}
function removeExtensionAndIndex(path: string): string {
const noExtension = removeFileExtension(path);
return noExtension === "index" ? "" : removeSuffix(noExtension, "/index");
function addExtensionAndIndex(path: string): string {
if (path === "") {
return "index.d.ts";
}
if (endsWith(path, ".d.ts")) {
return path;
}
if (endsWith(path, "/index")) {
return path + ".d.ts";
}
return path + "/index.d.ts";
}
/* @internal */
@ -955,12 +964,31 @@ namespace ts {
subModuleName: string,
failedLookupLocations: Push<string>,
onlyRecordFailures: boolean,
{ host, traceEnabled }: ModuleResolutionState,
state: ModuleResolutionState,
): { found: boolean, packageJsonContent: PackageJsonPathFields | undefined, packageId: PackageId | undefined } {
const { host, traceEnabled } = state;
const directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host);
const packageJsonPath = pathToPackageJson(nodeModuleDirectory);
if (directoryExists && host.fileExists(packageJsonPath)) {
const packageJsonContent = readJson(packageJsonPath, host);
if (subModuleName === "") { // looking up the root - need to handle types/typings/main redirects for subModuleName
const path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state);
if (typeof path === "string") {
subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1));
}
else {
const jsPath = tryReadPackageJsonFields(/*readTypes*/ false, packageJsonContent, nodeModuleDirectory, state);
if (typeof jsPath === "string") {
subModuleName = removeExtension(removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), Extension.Js), Extension.Jsx) + Extension.Dts;
}
else {
subModuleName = "index.d.ts";
}
}
}
if (!endsWith(subModuleName, Extension.Dts)) {
subModuleName = addExtensionAndIndex(subModuleName);
}
const packageId: PackageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string"
? { name: packageJsonContent.name, subModuleName, version: packageJsonContent.version }
: undefined;

View File

@ -2,7 +2,7 @@
"======== Resolving module 'foo/use' from '/index.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo/use' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/use@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/use/index.d.ts@1.2.3'.",
"File '/node_modules/foo/use.ts' does not exist.",
"File '/node_modules/foo/use.tsx' does not exist.",
"File '/node_modules/foo/use.d.ts' exist - use it as a name resolution result.",
@ -26,12 +26,15 @@
"File '/node_modules/foo/index.ts' does not exist.",
"File '/node_modules/foo/index.tsx' does not exist.",
"File '/node_modules/foo/index.d.ts' exist - use it as a name resolution result.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/index.d.ts@1.2.3'.",
"======== Module name './index' was successfully resolved to '/node_modules/foo/index.d.ts'. ========",
"======== Resolving module 'foo' from '/node_modules/a/index.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at '/node_modules/a/node_modules/foo/package.json'. Package ID is 'foo@1.2.3'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' does not have a 'main' field.",
"Found 'package.json' at '/node_modules/a/node_modules/foo/package.json'. Package ID is 'foo/index.d.ts@1.2.3'.",
"File '/node_modules/a/node_modules/foo.ts' does not exist.",
"File '/node_modules/a/node_modules/foo.tsx' does not exist.",
"File '/node_modules/a/node_modules/foo.d.ts' does not exist.",

View File

@ -2,7 +2,7 @@
"======== Resolving module '@foo/bar/use' from '/index.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module '@foo/bar/use' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at '/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar/use@1.2.3'.",
"Found 'package.json' at '/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar/use/index.d.ts@1.2.3'.",
"File '/node_modules/@foo/bar/use.ts' does not exist.",
"File '/node_modules/@foo/bar/use.tsx' does not exist.",
"File '/node_modules/@foo/bar/use.d.ts' exist - use it as a name resolution result.",
@ -26,12 +26,15 @@
"File '/node_modules/@foo/bar/index.ts' does not exist.",
"File '/node_modules/@foo/bar/index.tsx' does not exist.",
"File '/node_modules/@foo/bar/index.d.ts' exist - use it as a name resolution result.",
"Found 'package.json' at '/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar@1.2.3'.",
"Found 'package.json' at '/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar/index.d.ts@1.2.3'.",
"======== Module name './index' was successfully resolved to '/node_modules/@foo/bar/index.d.ts'. ========",
"======== Resolving module '@foo/bar' from '/node_modules/a/index.d.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module '@foo/bar' from 'node_modules' folder, target file type 'TypeScript'.",
"Found 'package.json' at '/node_modules/a/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar@1.2.3'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' does not have a 'main' field.",
"Found 'package.json' at '/node_modules/a/node_modules/@foo/bar/package.json'. Package ID is '@foo/bar/index.d.ts@1.2.3'.",
"File '/node_modules/a/node_modules/@foo/bar.ts' does not exist.",
"File '/node_modules/a/node_modules/@foo/bar.tsx' does not exist.",
"File '/node_modules/a/node_modules/@foo/bar.d.ts' does not exist.",

View File

@ -1,6 +1,7 @@
[
"======== Resolving type reference directive 'jquery', containing file '/foo/consumer.ts', root directory './types'. ========",
"Resolving with primary search path './types'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references 'types/jquery/jquery.d.ts'.",
"Found 'package.json' at './types/jquery/package.json'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references 'types/jquery/jquery.d.ts'.",
"File 'types/jquery/jquery.d.ts' exist - use it as a name resolution result.",
@ -8,6 +9,7 @@
"======== Type reference directive 'jquery' was successfully resolved to '/foo/types/jquery/jquery.d.ts', primary: true. ========",
"======== Resolving type reference directive 'jquery', containing file '/foo/__inferred type names__.ts', root directory './types'. ========",
"Resolving with primary search path './types'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references 'types/jquery/jquery.d.ts'.",
"Found 'package.json' at './types/jquery/package.json'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references 'types/jquery/jquery.d.ts'.",
"File 'types/jquery/jquery.d.ts' exist - use it as a name resolution result.",

View File

@ -3,6 +3,7 @@
"Root directory cannot be determined, skipping primary search paths.",
"Looking up in 'node_modules' folder, initial location '/a/b'.",
"Directory '/a/b/node_modules' does not exist, skipping all lookups in it.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/a/node_modules/jquery/jquery.d.ts'.",
"Found 'package.json' at '/a/node_modules/jquery/package.json'.",
"File '/a/node_modules/jquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/a/node_modules/jquery/jquery.d.ts'.",

View File

@ -3,6 +3,8 @@
"Root directory cannot be determined, skipping primary search paths.",
"Looking up in 'node_modules' folder, initial location '/a/b'.",
"Directory '/a/b/node_modules' does not exist, skipping all lookups in it.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'dist/jquery.d.ts' that references '/a/node_modules/jquery/dist/jquery.d.ts'.",
"Found 'package.json' at '/a/node_modules/jquery/package.json'.",
"File '/a/node_modules/jquery.d.ts' does not exist.",
"'package.json' does not have a 'typings' field.",

View File

@ -1,6 +1,8 @@
[
"======== Resolving type reference directive 'jquery', containing file '/consumer.ts', root directory '/types'. ========",
"Resolving with primary search path '/types'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
"Found 'package.json' at '/types/jquery/package.json'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
@ -9,6 +11,8 @@
"======== Type reference directive 'jquery' was successfully resolved to '/types/jquery/jquery.d.ts', primary: true. ========",
"======== Resolving type reference directive 'jquery', containing file 'test/__inferred type names__.ts', root directory '/types'. ========",
"Resolving with primary search path '/types'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",
"Found 'package.json' at '/types/jquery/package.json'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'jquery.d.ts' that references '/types/jquery/jquery.d.ts'.",

View File

@ -0,0 +1,23 @@
//// [tests/cases/compiler/moduleLocalImportNotIncorrectlyRedirected.ts] ////
//// [package.json]
{
"name": "troublesome-lib",
"typings": "lib/index.d.ts",
"version": "0.0.1"
}
//// [index.d.ts]
import { Position } from './utilities/positioning';
export interface ISpinButton {}
//// [positioning.d.ts]
export * from './positioning/index';
//// [index.d.ts]
export declare enum Position {
top,
}
//// [index.ts]
import { ISpinButton } from "troublesome-lib";
//// [index.js]
"use strict";
exports.__esModule = true;

View File

@ -0,0 +1,20 @@
=== tests/cases/compiler/index.ts ===
import { ISpinButton } from "troublesome-lib";
>ISpinButton : Symbol(ISpinButton, Decl(index.ts, 0, 8))
=== tests/cases/compiler/node_modules/troublesome-lib/lib/index.d.ts ===
import { Position } from './utilities/positioning';
>Position : Symbol(Position, Decl(index.d.ts, 0, 8))
export interface ISpinButton {}
>ISpinButton : Symbol(ISpinButton, Decl(index.d.ts, 0, 51))
=== tests/cases/compiler/node_modules/troublesome-lib/lib/utilities/positioning.d.ts ===
export * from './positioning/index';
No type information for this code.=== tests/cases/compiler/node_modules/troublesome-lib/lib/utilities/positioning/index.d.ts ===
export declare enum Position {
>Position : Symbol(Position, Decl(index.d.ts, 0, 0))
top,
>top : Symbol(Position.top, Decl(index.d.ts, 0, 30))
}

View File

@ -0,0 +1,20 @@
=== tests/cases/compiler/index.ts ===
import { ISpinButton } from "troublesome-lib";
>ISpinButton : any
=== tests/cases/compiler/node_modules/troublesome-lib/lib/index.d.ts ===
import { Position } from './utilities/positioning';
>Position : typeof Position
export interface ISpinButton {}
>ISpinButton : ISpinButton
=== tests/cases/compiler/node_modules/troublesome-lib/lib/utilities/positioning.d.ts ===
export * from './positioning/index';
No type information for this code.=== tests/cases/compiler/node_modules/troublesome-lib/lib/utilities/positioning/index.d.ts ===
export declare enum Position {
>Position : Position
top,
>top : Position
}

View File

@ -2,6 +2,9 @@
"======== Resolving module 'normalize.css' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'normalize.css' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.",
"Found 'package.json' at '/node_modules/normalize.css/package.json'.",
"File '/node_modules/normalize.css.ts' does not exist.",
"File '/node_modules/normalize.css.tsx' does not exist.",
@ -13,6 +16,9 @@
"File '/node_modules/normalize.css/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'normalize.css' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.",
"Found 'package.json' at '/node_modules/normalize.css/package.json'.",
"File '/node_modules/normalize.css.js' does not exist.",
"File '/node_modules/normalize.css.jsx' does not exist.",

View File

@ -2,6 +2,8 @@
"======== Resolving module 'foo' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.ts' does not exist.",
"File '/node_modules/foo.tsx' does not exist.",
@ -24,6 +26,8 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'foo.js' that references '/node_modules/foo/foo.js'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",

View File

@ -2,6 +2,8 @@
"======== Resolving module 'foo/bar' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo/bar' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'.",
"Found 'package.json' at '/node_modules/foo/bar/package.json'.",
"File '/node_modules/foo/bar.ts' does not exist.",
"File '/node_modules/foo/bar.tsx' does not exist.",

View File

@ -2,6 +2,8 @@
"======== Resolving module 'foo/@bar' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo/@bar' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'.",
"Found 'package.json' at '/node_modules/foo/@bar/package.json'.",
"File '/node_modules/foo/@bar.ts' does not exist.",
"File '/node_modules/foo/@bar.tsx' does not exist.",

View File

@ -2,6 +2,8 @@
"======== Resolving module '@foo/bar' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module '@foo/bar' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/@foo/bar/types.d.ts'.",
"Found 'package.json' at '/node_modules/@foo/bar/package.json'.",
"File '/node_modules/@foo/bar.ts' does not exist.",
"File '/node_modules/@foo/bar.tsx' does not exist.",

View File

@ -3,7 +3,7 @@
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo/bar' from 'node_modules' folder, target file type 'TypeScript'.",
"File '/node_modules/foo/bar/package.json' does not exist.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/bar@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/bar/index.d.ts@1.2.3'.",
"File '/node_modules/foo/bar.ts' does not exist.",
"File '/node_modules/foo/bar.tsx' does not exist.",
"File '/node_modules/foo/bar.d.ts' does not exist.",
@ -13,7 +13,7 @@
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo/bar' from 'node_modules' folder, target file type 'JavaScript'.",
"File '/node_modules/foo/bar/package.json' does not exist.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/bar@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/bar/index.d.ts@1.2.3'.",
"File '/node_modules/foo/bar.js' does not exist.",
"File '/node_modules/foo/bar.jsx' does not exist.",
"File '/node_modules/foo/bar/index.js' exist - use it as a name resolution result.",

View File

@ -3,7 +3,7 @@
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo/@bar' from 'node_modules' folder, target file type 'TypeScript'.",
"File '/node_modules/foo/@bar/package.json' does not exist.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/@bar@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/@bar/index.d.ts@1.2.3'.",
"File '/node_modules/foo/@bar.ts' does not exist.",
"File '/node_modules/foo/@bar.tsx' does not exist.",
"File '/node_modules/foo/@bar.d.ts' does not exist.",
@ -13,7 +13,7 @@
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo/@bar' from 'node_modules' folder, target file type 'JavaScript'.",
"File '/node_modules/foo/@bar/package.json' does not exist.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/@bar@1.2.3'.",
"Found 'package.json' at '/node_modules/foo/package.json'. Package ID is 'foo/@bar/index.d.ts@1.2.3'.",
"File '/node_modules/foo/@bar.js' does not exist.",
"File '/node_modules/foo/@bar.jsx' does not exist.",
"File '/node_modules/foo/@bar/index.js' exist - use it as a name resolution result.",

View File

@ -2,6 +2,9 @@
"======== Resolving module 'foo' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.ts' does not exist.",
"File '/node_modules/foo.tsx' does not exist.",
@ -13,6 +16,9 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",
@ -25,6 +31,9 @@
"======== Resolving module 'bar' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'bar' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.",
"Found 'package.json' at '/node_modules/bar/package.json'.",
"File '/node_modules/bar.ts' does not exist.",
"File '/node_modules/bar.tsx' does not exist.",
@ -36,6 +45,9 @@
"File '/node_modules/bar/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'bar' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.",
"Found 'package.json' at '/node_modules/bar/package.json'.",
"File '/node_modules/bar.js' does not exist.",
"File '/node_modules/bar.jsx' does not exist.",
@ -46,6 +58,9 @@
"======== Resolving module 'baz' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'baz' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.",
"Found 'package.json' at '/node_modules/baz/package.json'.",
"File '/node_modules/baz.ts' does not exist.",
"File '/node_modules/baz.tsx' does not exist.",
@ -57,6 +72,9 @@
"File '/node_modules/baz/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'baz' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.",
"Found 'package.json' at '/node_modules/baz/package.json'.",
"File '/node_modules/baz.js' does not exist.",
"File '/node_modules/baz.jsx' does not exist.",

View File

@ -2,6 +2,9 @@
"======== Resolving module 'foo' from '/a.ts'. ========",
"Module resolution kind is not specified, using 'NodeJs'.",
"Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.ts' does not exist.",
"File '/node_modules/foo.tsx' does not exist.",
@ -13,6 +16,9 @@
"File '/node_modules/foo/index.d.ts' does not exist.",
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
"Loading module 'foo' from 'node_modules' folder, target file type 'JavaScript'.",
"'package.json' does not have a 'typings' field.",
"'package.json' does not have a 'types' field.",
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
"Found 'package.json' at '/node_modules/foo/package.json'.",
"File '/node_modules/foo.js' does not exist.",
"File '/node_modules/foo.jsx' does not exist.",

View File

@ -5,6 +5,7 @@
"File '/node_modules/jquery.ts' does not exist.",
"File '/node_modules/jquery.tsx' does not exist.",
"File '/node_modules/jquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'.",
"Found 'package.json' at '/node_modules/@types/jquery/package.json'.",
"File '/node_modules/@types/jquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'.",
@ -17,6 +18,7 @@
"File '/node_modules/kquery.ts' does not exist.",
"File '/node_modules/kquery.tsx' does not exist.",
"File '/node_modules/kquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.",
"Found 'package.json' at '/node_modules/@types/kquery/package.json'.",
"File '/node_modules/@types/kquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.",
@ -33,6 +35,7 @@
"File '/node_modules/lquery.ts' does not exist.",
"File '/node_modules/lquery.tsx' does not exist.",
"File '/node_modules/lquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.",
"Found 'package.json' at '/node_modules/@types/lquery/package.json'.",
"File '/node_modules/@types/lquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.",
@ -47,6 +50,7 @@
"File '/node_modules/mquery.ts' does not exist.",
"File '/node_modules/mquery.tsx' does not exist.",
"File '/node_modules/mquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.",
"Found 'package.json' at '/node_modules/@types/mquery/package.json'.",
"File '/node_modules/@types/mquery.d.ts' does not exist.",
"'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.",
@ -61,6 +65,7 @@
"======== Module name 'mquery' was successfully resolved to '/node_modules/@types/mquery/mquery/index.tsx'. ========",
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
"Resolving with primary search path '/node_modules/@types'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'.",
"Found 'package.json' at '/node_modules/@types/jquery/package.json'.",
"'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'.",
"File '/node_modules/@types/jquery/jquery.d.ts' exist - use it as a name resolution result.",
@ -68,6 +73,7 @@
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/jquery.d.ts', primary: true. ========",
"======== Resolving type reference directive 'kquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
"Resolving with primary search path '/node_modules/@types'.",
"'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.",
"Found 'package.json' at '/node_modules/@types/kquery/package.json'.",
"'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.",
"File '/node_modules/@types/kquery/kquery' does not exist.",
@ -79,6 +85,7 @@
"======== Type reference directive 'kquery' was successfully resolved to '/node_modules/@types/kquery/kquery.d.ts', primary: true. ========",
"======== Resolving type reference directive 'lquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
"Resolving with primary search path '/node_modules/@types'.",
"'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.",
"Found 'package.json' at '/node_modules/@types/lquery/package.json'.",
"'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.",
"File '/node_modules/@types/lquery/lquery' does not exist.",
@ -88,6 +95,7 @@
"======== Type reference directive 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts', primary: true. ========",
"======== Resolving type reference directive 'mquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
"Resolving with primary search path '/node_modules/@types'.",
"'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.",
"Found 'package.json' at '/node_modules/@types/mquery/package.json'.",
"'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.",
"File '/node_modules/@types/mquery/mquery' does not exist.",

View File

@ -0,0 +1,18 @@
// @noImplicitReferences: true
// @filename: node_modules/troublesome-lib/package.json
{
"name": "troublesome-lib",
"typings": "lib/index.d.ts",
"version": "0.0.1"
}
// @filename: node_modules/troublesome-lib/lib/index.d.ts
import { Position } from './utilities/positioning';
export interface ISpinButton {}
// @filename: node_modules/troublesome-lib/lib/utilities/positioning.d.ts
export * from './positioning/index';
// @filename: node_modules/troublesome-lib/lib/utilities/positioning/index.d.ts
export declare enum Position {
top,
}
// @filename: index.ts
import { ISpinButton } from "troublesome-lib";