mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Module Resolution and Type Reference directive cache updates and its API changes (#43700)
* Make the module resolution cache apis for updating compiler options or clearing it * Cache package.json lookup results from module resolution * Use per directory cache for type reference directive resolution as well * Update Baselines and/or Applied Lint Fixes * Change trace according to feedback * Update Baselines and/or Applied Lint Fixes Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
This commit is contained in:
co-authored by
TypeScript Bot
parent
fb0b1d7295
commit
f6d425e1e3
@@ -4849,6 +4849,22 @@
|
||||
"category": "Error",
|
||||
"code": 6238
|
||||
},
|
||||
"File '{0}' exists according to earlier cached lookups.": {
|
||||
"category": "Message",
|
||||
"code": 6239
|
||||
},
|
||||
"File '{0}' does not exist according to earlier cached lookups.": {
|
||||
"category": "Message",
|
||||
"code": 6240
|
||||
},
|
||||
"Resolution for type reference directive '{0}' was found in cache from location '{1}'.": {
|
||||
"category": "Message",
|
||||
"code": 6241
|
||||
},
|
||||
"======== Resolving type reference directive '{0}', containing file '{1}'. ========": {
|
||||
"category": "Message",
|
||||
"code": 6242
|
||||
},
|
||||
|
||||
"Projects to reference": {
|
||||
"category": "Message",
|
||||
|
||||
@@ -101,9 +101,11 @@ namespace ts {
|
||||
traceEnabled: boolean;
|
||||
failedLookupLocations: Push<string>;
|
||||
resultFromCache?: ResolvedModuleWithFailedLookupLocations;
|
||||
packageJsonInfoCache: PackageJsonInfoCache | undefined;
|
||||
}
|
||||
|
||||
/** Just the fields that we use for module resolution. */
|
||||
/*@internal*/
|
||||
interface PackageJsonPathFields {
|
||||
typings?: string;
|
||||
types?: string;
|
||||
@@ -179,6 +181,7 @@ namespace ts {
|
||||
return typesVersions;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
interface VersionPaths {
|
||||
version: string;
|
||||
paths: MapLike<string[]>;
|
||||
@@ -281,13 +284,24 @@ namespace ts {
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
* is assumed to be the same as root directory of the project.
|
||||
*/
|
||||
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
|
||||
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache): ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
|
||||
const traceEnabled = isTraceEnabled(options, host);
|
||||
if (redirectedReference) {
|
||||
options = redirectedReference.commandLine.options;
|
||||
}
|
||||
const failedLookupLocations: string[] = [];
|
||||
const moduleResolutionState: ModuleResolutionState = { compilerOptions: options, host, traceEnabled, failedLookupLocations };
|
||||
|
||||
const containingDirectory = containingFile ? getDirectoryPath(containingFile) : undefined;
|
||||
const perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
|
||||
let result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName);
|
||||
if (result) {
|
||||
if (traceEnabled) {
|
||||
trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
||||
if (redirectedReference) trace(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName);
|
||||
trace(host, Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, containingDirectory);
|
||||
traceResult(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const typeRoots = getEffectiveTypeRoots(options, host);
|
||||
if (traceEnabled) {
|
||||
@@ -312,6 +326,8 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const failedLookupLocations: string[] = [];
|
||||
const moduleResolutionState: ModuleResolutionState = { compilerOptions: options, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache };
|
||||
let resolved = primaryLookup();
|
||||
let primary = true;
|
||||
if (!resolved) {
|
||||
@@ -323,18 +339,24 @@ namespace ts {
|
||||
if (resolved) {
|
||||
const { fileName, packageId } = resolved;
|
||||
const resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled);
|
||||
if (traceEnabled) {
|
||||
if (packageId) {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, resolvedFileName, packageIdToString(packageId), primary);
|
||||
}
|
||||
else {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, resolvedFileName, primary);
|
||||
}
|
||||
}
|
||||
resolvedTypeReferenceDirective = { primary, resolvedFileName, packageId, isExternalLibraryImport: pathContainsNodeModules(fileName) };
|
||||
}
|
||||
result = { resolvedTypeReferenceDirective, failedLookupLocations };
|
||||
perFolderCache?.set(typeReferenceDirectiveName, result);
|
||||
if (traceEnabled) traceResult(result);
|
||||
return result;
|
||||
|
||||
return { resolvedTypeReferenceDirective, failedLookupLocations };
|
||||
function traceResult(result: ResolvedTypeReferenceDirectiveWithFailedLookupLocations) {
|
||||
if (!result.resolvedTypeReferenceDirective?.resolvedFileName) {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
|
||||
}
|
||||
else if (result.resolvedTypeReferenceDirective.packageId) {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result.resolvedTypeReferenceDirective.resolvedFileName, packageIdToString(result.resolvedTypeReferenceDirective.packageId), result.resolvedTypeReferenceDirective.primary);
|
||||
}
|
||||
else {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result.resolvedTypeReferenceDirective.resolvedFileName, result.resolvedTypeReferenceDirective.primary);
|
||||
}
|
||||
}
|
||||
|
||||
function primaryLookup(): PathAndPackageId | undefined {
|
||||
// Check primary library paths
|
||||
@@ -378,11 +400,7 @@ namespace ts {
|
||||
const { path: candidate } = normalizePathAndParts(combinePaths(initialLocationForSecondaryLookup, typeReferenceDirectiveName));
|
||||
result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);
|
||||
}
|
||||
const resolvedFile = resolvedTypeScriptOnly(result);
|
||||
if (!resolvedFile && traceEnabled) {
|
||||
trace(host, Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
|
||||
}
|
||||
return resolvedFile;
|
||||
return resolvedTypeScriptOnly(result);
|
||||
}
|
||||
else {
|
||||
if (traceEnabled) {
|
||||
@@ -437,22 +455,39 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* Cached module resolutions per containing directory.
|
||||
* Cached resolutions per containing directory.
|
||||
* This assumes that any module id will have the same resolution for sibling files located in the same folder.
|
||||
*/
|
||||
export interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
|
||||
/*@internal*/ directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>;
|
||||
export interface PerDirectoryResolutionCache<T> {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<T>;
|
||||
clear(): void;
|
||||
/**
|
||||
* Updates with the current compilerOptions the cache will operate with.
|
||||
* This updates the redirects map as well if needed so module resolutions are cached if they can across the projects
|
||||
*/
|
||||
update(options: CompilerOptions): void;
|
||||
}
|
||||
|
||||
export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
|
||||
getPackageJsonInfoCache(): PackageJsonInfoCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
|
||||
* We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
|
||||
*/
|
||||
export interface NonRelativeModuleNameResolutionCache {
|
||||
export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
|
||||
getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
|
||||
/*@internal*/ moduleNameToDirectoryMap: CacheWithRedirects<PerModuleNameCache>;
|
||||
}
|
||||
|
||||
export interface PackageJsonInfoCache {
|
||||
/*@internal*/ getPackageJsonInfo(packageJsonPath: string): PackageJsonInfo | boolean | undefined;
|
||||
/*@internal*/ setPackageJsonInfo(packageJsonPath: string, info: PackageJsonInfo | boolean): void;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
export interface PerModuleNameCache {
|
||||
@@ -460,16 +495,6 @@ namespace ts {
|
||||
set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
|
||||
}
|
||||
|
||||
export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache {
|
||||
return createModuleResolutionCacheWithMaps(
|
||||
createCacheWithRedirects(options),
|
||||
createCacheWithRedirects(options),
|
||||
currentDirectory,
|
||||
getCanonicalFileName
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*@internal*/
|
||||
export interface CacheWithRedirects<T> {
|
||||
ownMap: ESMap<string, T>;
|
||||
@@ -521,33 +546,125 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function createModuleResolutionCacheWithMaps(
|
||||
directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>,
|
||||
moduleNameToDirectoryMap: CacheWithRedirects<PerModuleNameCache>,
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName): ModuleResolutionCache {
|
||||
function createPackageJsonInfoCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): PackageJsonInfoCache {
|
||||
let cache: ESMap<Path, PackageJsonInfo | boolean> | undefined;
|
||||
return { getPackageJsonInfo, setPackageJsonInfo, clear };
|
||||
function getPackageJsonInfo(packageJsonPath: string) {
|
||||
return cache?.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
|
||||
}
|
||||
function setPackageJsonInfo(packageJsonPath: string, info: PackageJsonInfo | boolean) {
|
||||
(cache ||= new Map()).set(toPath(packageJsonPath, currentDirectory, getCanonicalFileName), info);
|
||||
}
|
||||
function clear() {
|
||||
cache = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return { getOrCreateCacheForDirectory, getOrCreateCacheForModuleName, directoryToModuleNameMap, moduleNameToDirectoryMap };
|
||||
function getOrCreateCache<T>(cacheWithRedirects: CacheWithRedirects<T>, redirectedReference: ResolvedProjectReference | undefined, key: string, create: () => T): T {
|
||||
const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
|
||||
let result = cache.get(key);
|
||||
if (!result) {
|
||||
result = create();
|
||||
cache.set(key, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function updateRedirectsMap<T>(
|
||||
options: CompilerOptions,
|
||||
directoryToModuleNameMap: CacheWithRedirects<ESMap<string, T>>,
|
||||
moduleNameToDirectoryMap?: CacheWithRedirects<PerModuleNameCache>
|
||||
) {
|
||||
if (!options.configFile) return;
|
||||
if (directoryToModuleNameMap.redirectsMap.size === 0) {
|
||||
// The own map will be for projectCompilerOptions
|
||||
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size === 0);
|
||||
Debug.assert(directoryToModuleNameMap.ownMap.size === 0);
|
||||
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.ownMap.size === 0);
|
||||
directoryToModuleNameMap.redirectsMap.set(options.configFile.path, directoryToModuleNameMap.ownMap);
|
||||
moduleNameToDirectoryMap?.redirectsMap.set(options.configFile.path, moduleNameToDirectoryMap.ownMap);
|
||||
}
|
||||
else {
|
||||
// Set correct own map
|
||||
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size > 0);
|
||||
const ref: ResolvedProjectReference = {
|
||||
sourceFile: options.configFile,
|
||||
commandLine: { options } as ParsedCommandLine
|
||||
};
|
||||
directoryToModuleNameMap.setOwnMap(directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
|
||||
moduleNameToDirectoryMap?.setOwnMap(moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
|
||||
}
|
||||
directoryToModuleNameMap.setOwnOptions(options);
|
||||
moduleNameToDirectoryMap?.setOwnOptions(options);
|
||||
}
|
||||
|
||||
function createPerDirectoryResolutionCache<T>(currentDirectory: string, getCanonicalFileName: GetCanonicalFileName, directoryToModuleNameMap: CacheWithRedirects<ESMap<string, T>>): PerDirectoryResolutionCache<T> {
|
||||
return {
|
||||
getOrCreateCacheForDirectory,
|
||||
clear,
|
||||
update,
|
||||
};
|
||||
|
||||
function clear() {
|
||||
directoryToModuleNameMap.clear();
|
||||
}
|
||||
|
||||
function update(options: CompilerOptions) {
|
||||
updateRedirectsMap(options, directoryToModuleNameMap);
|
||||
}
|
||||
|
||||
function getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference) {
|
||||
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
||||
return getOrCreateCache<ESMap<string, ResolvedModuleWithFailedLookupLocations>>(directoryToModuleNameMap, redirectedReference, path, () => new Map());
|
||||
return getOrCreateCache<ESMap<string, T>>(directoryToModuleNameMap, redirectedReference, path, () => new Map());
|
||||
}
|
||||
}
|
||||
|
||||
export function createModuleResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: (s: string) => string,
|
||||
options?: CompilerOptions
|
||||
): ModuleResolutionCache;
|
||||
/*@internal*/
|
||||
export function createModuleResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName,
|
||||
options: undefined,
|
||||
directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>,
|
||||
moduleNameToDirectoryMap: CacheWithRedirects<PerModuleNameCache>,
|
||||
): ModuleResolutionCache;
|
||||
export function createModuleResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName,
|
||||
options?: CompilerOptions,
|
||||
directoryToModuleNameMap?: CacheWithRedirects<ESMap<string, ResolvedModuleWithFailedLookupLocations>>,
|
||||
moduleNameToDirectoryMap?: CacheWithRedirects<PerModuleNameCache>,
|
||||
): ModuleResolutionCache {
|
||||
const preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
moduleNameToDirectoryMap ||= createCacheWithRedirects(options);
|
||||
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
||||
|
||||
return {
|
||||
...packageJsonInfoCache,
|
||||
...preDirectoryResolutionCache,
|
||||
getOrCreateCacheForModuleName,
|
||||
clear,
|
||||
update,
|
||||
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
||||
};
|
||||
|
||||
function clear() {
|
||||
preDirectoryResolutionCache.clear();
|
||||
moduleNameToDirectoryMap!.clear();
|
||||
packageJsonInfoCache.clear();
|
||||
}
|
||||
|
||||
function update(options: CompilerOptions) {
|
||||
updateRedirectsMap(options, directoryToModuleNameMap!, moduleNameToDirectoryMap);
|
||||
}
|
||||
|
||||
function getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache {
|
||||
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
||||
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);
|
||||
}
|
||||
|
||||
function getOrCreateCache<T>(cacheWithRedirects: CacheWithRedirects<T>, redirectedReference: ResolvedProjectReference | undefined, key: string, create: () => T): T {
|
||||
const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
|
||||
let result = cache.get(key);
|
||||
if (!result) {
|
||||
result = create();
|
||||
cache.set(key, result);
|
||||
}
|
||||
return result;
|
||||
return getOrCreateCache(moduleNameToDirectoryMap!, redirectedReference, nonRelativeModuleName, createPerModuleNameCache);
|
||||
}
|
||||
|
||||
function createPerModuleNameCache(): PerModuleNameCache {
|
||||
@@ -623,6 +740,42 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function createTypeReferenceDirectiveResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: (s: string) => string,
|
||||
options?: CompilerOptions,
|
||||
packageJsonInfoCache?: PackageJsonInfoCache,
|
||||
): TypeReferenceDirectiveResolutionCache;
|
||||
/*@internal*/
|
||||
export function createTypeReferenceDirectiveResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName,
|
||||
options: undefined,
|
||||
packageJsonInfoCache: PackageJsonInfoCache | undefined,
|
||||
directoryToModuleNameMap: CacheWithRedirects<ESMap<string, ResolvedTypeReferenceDirectiveWithFailedLookupLocations>>,
|
||||
): TypeReferenceDirectiveResolutionCache;
|
||||
export function createTypeReferenceDirectiveResolutionCache(
|
||||
currentDirectory: string,
|
||||
getCanonicalFileName: GetCanonicalFileName,
|
||||
options?: CompilerOptions,
|
||||
packageJsonInfoCache?: PackageJsonInfoCache | undefined,
|
||||
directoryToModuleNameMap?: CacheWithRedirects<ESMap<string, ResolvedTypeReferenceDirectiveWithFailedLookupLocations>>,
|
||||
): TypeReferenceDirectiveResolutionCache {
|
||||
const preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
packageJsonInfoCache ||= createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
||||
|
||||
return {
|
||||
...packageJsonInfoCache,
|
||||
...preDirectoryResolutionCache,
|
||||
clear,
|
||||
};
|
||||
|
||||
function clear() {
|
||||
preDirectoryResolutionCache.clear();
|
||||
packageJsonInfoCache!.clear();
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined {
|
||||
const containingDirectory = getDirectoryPath(containingFile);
|
||||
const perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
|
||||
@@ -931,7 +1084,7 @@ namespace ts {
|
||||
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
||||
|
||||
const failedLookupLocations: string[] = [];
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations };
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache };
|
||||
|
||||
const result = forEach(extensions, ext => tryResolve(ext));
|
||||
return createResolvedModuleWithFailedLookupLocations(result?.value?.resolved, result?.value?.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
|
||||
@@ -1137,6 +1290,7 @@ namespace ts {
|
||||
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
interface PackageJsonInfo {
|
||||
packageDirectory: string;
|
||||
packageJsonContent: PackageJsonPathFields;
|
||||
@@ -1145,21 +1299,40 @@ namespace ts {
|
||||
|
||||
function getPackageJsonInfo(packageDirectory: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PackageJsonInfo | undefined {
|
||||
const { host, traceEnabled } = state;
|
||||
const directoryExists = !onlyRecordFailures && directoryProbablyExists(packageDirectory, host);
|
||||
const packageJsonPath = combinePaths(packageDirectory, "package.json");
|
||||
if (onlyRecordFailures) {
|
||||
state.failedLookupLocations.push(packageJsonPath);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const existing = state.packageJsonInfoCache?.getPackageJsonInfo(packageJsonPath);
|
||||
if (existing !== undefined) {
|
||||
if (typeof existing !== "boolean") {
|
||||
if (traceEnabled) trace(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
|
||||
return existing;
|
||||
}
|
||||
else {
|
||||
if (existing && traceEnabled) trace(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath);
|
||||
state.failedLookupLocations.push(packageJsonPath);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
const directoryExists = directoryProbablyExists(packageDirectory, host);
|
||||
if (directoryExists && host.fileExists(packageJsonPath)) {
|
||||
const packageJsonContent = readJson(packageJsonPath, host) as PackageJson;
|
||||
if (traceEnabled) {
|
||||
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
||||
}
|
||||
const versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
|
||||
return { packageDirectory, packageJsonContent, versionPaths };
|
||||
const result = { packageDirectory, packageJsonContent, versionPaths };
|
||||
state.packageJsonInfoCache?.setPackageJsonInfo(packageJsonPath, result);
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
if (directoryExists && traceEnabled) {
|
||||
trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
|
||||
}
|
||||
|
||||
state.packageJsonInfoCache?.setPackageJsonInfo(packageJsonPath, directoryExists);
|
||||
// record package json as one of failed lookup locations - in the future if this file will appear it will invalidate resolution results
|
||||
state.failedLookupLocations.push(packageJsonPath);
|
||||
}
|
||||
@@ -1448,7 +1621,7 @@ namespace ts {
|
||||
export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations {
|
||||
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
||||
const failedLookupLocations: string[] = [];
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations };
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache };
|
||||
const containingDirectory = getDirectoryPath(containingFile);
|
||||
|
||||
const resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
|
||||
@@ -1492,13 +1665,13 @@ namespace ts {
|
||||
* This is the minumum code needed to expose that functionality; the rest is in the host.
|
||||
*/
|
||||
/* @internal */
|
||||
export function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations {
|
||||
export function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string, packageJsonInfoCache: PackageJsonInfoCache): ResolvedModuleWithFailedLookupLocations {
|
||||
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
||||
if (traceEnabled) {
|
||||
trace(host, Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache);
|
||||
}
|
||||
const failedLookupLocations: string[] = [];
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations };
|
||||
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache };
|
||||
const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false);
|
||||
return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache);
|
||||
}
|
||||
|
||||
+13
-2
@@ -843,6 +843,7 @@ namespace ts {
|
||||
let _compilerOptionsObjectLiteralSyntax: ObjectLiteralExpression | false | undefined;
|
||||
|
||||
let moduleResolutionCache: ModuleResolutionCache | undefined;
|
||||
let typeReferenceDirectiveResolutionCache: TypeReferenceDirectiveResolutionCache | undefined;
|
||||
let actualResolveModuleNamesWorker: (moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference) => ResolvedModuleFull[];
|
||||
const hasInvalidatedResolution = host.hasInvalidatedResolution || returnFalse;
|
||||
if (host.resolveModuleNames) {
|
||||
@@ -857,7 +858,7 @@ namespace ts {
|
||||
});
|
||||
}
|
||||
else {
|
||||
moduleResolutionCache = createModuleResolutionCache(currentDirectory, x => host.getCanonicalFileName(x), options);
|
||||
moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options);
|
||||
const loader = (moduleName: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveModuleName(moduleName, containingFile, options, host, moduleResolutionCache, redirectedReference).resolvedModule!; // TODO: GH#18217
|
||||
actualResolveModuleNamesWorker = (moduleNames, containingFile, _reusedNames, redirectedReference) => loadWithLocalCache<ResolvedModuleFull>(Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader);
|
||||
}
|
||||
@@ -867,7 +868,15 @@ namespace ts {
|
||||
actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference) => host.resolveTypeReferenceDirectives!(Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options);
|
||||
}
|
||||
else {
|
||||
const loader = (typesRef: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference).resolvedTypeReferenceDirective!; // TODO: GH#18217
|
||||
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, /*options*/ undefined, moduleResolutionCache?.getPackageJsonInfoCache());
|
||||
const loader = (typesRef: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveTypeReferenceDirective(
|
||||
typesRef,
|
||||
containingFile,
|
||||
options,
|
||||
host,
|
||||
redirectedReference,
|
||||
typeReferenceDirectiveResolutionCache,
|
||||
).resolvedTypeReferenceDirective!; // TODO: GH#18217
|
||||
actualResolveTypeReferenceDirectiveNamesWorker = (typeReferenceDirectiveNames, containingFile, redirectedReference) => loadWithLocalCache<ResolvedTypeReferenceDirective>(Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader);
|
||||
}
|
||||
|
||||
@@ -1036,6 +1045,8 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
typeReferenceDirectiveResolutionCache = undefined;
|
||||
|
||||
// unconditionally set oldProgram to undefined to prevent it from being captured in closure
|
||||
oldProgram = undefined;
|
||||
|
||||
|
||||
@@ -166,15 +166,23 @@ namespace ts {
|
||||
const resolvedModuleNames = new Map<Path, ESMap<string, CachedResolvedModuleWithFailedLookupLocations>>();
|
||||
const perDirectoryResolvedModuleNames: CacheWithRedirects<ESMap<string, CachedResolvedModuleWithFailedLookupLocations>> = createCacheWithRedirects();
|
||||
const nonRelativeModuleNameCache: CacheWithRedirects<PerModuleNameCache> = createCacheWithRedirects();
|
||||
const moduleResolutionCache = createModuleResolutionCacheWithMaps(
|
||||
const moduleResolutionCache = createModuleResolutionCache(
|
||||
getCurrentDirectory(),
|
||||
resolutionHost.getCanonicalFileName,
|
||||
/*options*/ undefined,
|
||||
perDirectoryResolvedModuleNames,
|
||||
nonRelativeModuleNameCache,
|
||||
getCurrentDirectory(),
|
||||
resolutionHost.getCanonicalFileName
|
||||
);
|
||||
|
||||
const resolvedTypeReferenceDirectives = new Map<Path, ESMap<string, CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations>>();
|
||||
const perDirectoryResolvedTypeReferenceDirectives: CacheWithRedirects<ESMap<string, CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations>> = createCacheWithRedirects();
|
||||
const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
||||
getCurrentDirectory(),
|
||||
resolutionHost.getCanonicalFileName,
|
||||
/*options*/ undefined,
|
||||
moduleResolutionCache.getPackageJsonInfoCache(),
|
||||
perDirectoryResolvedTypeReferenceDirectives
|
||||
);
|
||||
|
||||
/**
|
||||
* These are the extensions that failed lookup files will have by default,
|
||||
@@ -284,9 +292,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
function clearPerDirectoryResolutions() {
|
||||
perDirectoryResolvedModuleNames.clear();
|
||||
nonRelativeModuleNameCache.clear();
|
||||
perDirectoryResolvedTypeReferenceDirectives.clear();
|
||||
moduleResolutionCache.clear();
|
||||
typeReferenceDirectiveResolutionCache.clear();
|
||||
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
||||
nonRelativeExternalModuleResolutions.clear();
|
||||
}
|
||||
@@ -320,7 +327,9 @@ namespace ts {
|
||||
resolutionHost.projectName,
|
||||
compilerOptions,
|
||||
host,
|
||||
globalCache);
|
||||
globalCache,
|
||||
moduleResolutionCache,
|
||||
);
|
||||
if (resolvedModule) {
|
||||
// Modify existing resolution so its saved in the directory cache as well
|
||||
(primaryResult.resolvedModule as any) = resolvedModule;
|
||||
@@ -333,6 +342,10 @@ namespace ts {
|
||||
return primaryResult;
|
||||
}
|
||||
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): CachedResolvedTypeReferenceDirectiveWithFailedLookupLocations {
|
||||
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache);
|
||||
}
|
||||
|
||||
interface ResolveNamesWithLocalCacheInput<T extends ResolutionWithFailedLookupLocations, R extends ResolutionWithResolvedFileName> {
|
||||
names: readonly string[];
|
||||
containingFile: string;
|
||||
|
||||
@@ -238,6 +238,7 @@ namespace ts {
|
||||
|
||||
readonly compilerHost: CompilerHost;
|
||||
readonly moduleResolutionCache: ModuleResolutionCache | undefined;
|
||||
readonly typeReferenceDirectiveResolutionCache: TypeReferenceDirectiveResolutionCache | undefined;
|
||||
|
||||
// Mutable state
|
||||
buildOrder: AnyBuildOrder | undefined;
|
||||
@@ -275,11 +276,17 @@ namespace ts {
|
||||
compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames);
|
||||
compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives);
|
||||
const moduleResolutionCache = !compilerHost.resolveModuleNames ? createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined;
|
||||
const typeReferenceDirectiveResolutionCache = !compilerHost.resolveTypeReferenceDirectives ? createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, /*options*/ undefined, moduleResolutionCache?.getPackageJsonInfoCache()) : undefined;
|
||||
if (!compilerHost.resolveModuleNames) {
|
||||
const loader = (moduleName: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveModuleName(moduleName, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference).resolvedModule!;
|
||||
compilerHost.resolveModuleNames = (moduleNames, containingFile, _reusedNames, redirectedReference) =>
|
||||
loadWithLocalCache<ResolvedModuleFull>(Debug.checkEachDefined(moduleNames), containingFile, redirectedReference, loader);
|
||||
}
|
||||
if (!compilerHost.resolveTypeReferenceDirectives) {
|
||||
const loader = (moduleName: string, containingFile: string, redirectedReference: ResolvedProjectReference | undefined) => resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective!;
|
||||
compilerHost.resolveTypeReferenceDirectives = (typeReferenceDirectiveNames, containingFile, redirectedReference) =>
|
||||
loadWithLocalCache<ResolvedTypeReferenceDirective>(Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, loader);
|
||||
}
|
||||
|
||||
const { watchFile, watchDirectory, writeLog } = createWatchFactory<ResolvedConfigFileName>(hostWithWatch, options);
|
||||
|
||||
@@ -310,6 +317,7 @@ namespace ts {
|
||||
|
||||
compilerHost,
|
||||
moduleResolutionCache,
|
||||
typeReferenceDirectiveResolutionCache,
|
||||
|
||||
// Mutable state
|
||||
buildOrder: undefined,
|
||||
@@ -548,7 +556,7 @@ namespace ts {
|
||||
function disableCache(state: SolutionBuilderState) {
|
||||
if (!state.cache) return;
|
||||
|
||||
const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache } = state;
|
||||
const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, typeReferenceDirectiveResolutionCache } = state;
|
||||
|
||||
host.readFile = cache.originalReadFile;
|
||||
host.fileExists = cache.originalFileExists;
|
||||
@@ -558,10 +566,8 @@ namespace ts {
|
||||
compilerHost.getSourceFile = cache.originalGetSourceFile;
|
||||
state.readFileWithCache = cache.originalReadFileWithCache;
|
||||
extendedConfigCache.clear();
|
||||
if (moduleResolutionCache) {
|
||||
moduleResolutionCache.directoryToModuleNameMap.clear();
|
||||
moduleResolutionCache.moduleNameToDirectoryMap.clear();
|
||||
}
|
||||
moduleResolutionCache?.clear();
|
||||
typeReferenceDirectiveResolutionCache?.clear();
|
||||
state.cache = undefined;
|
||||
}
|
||||
|
||||
@@ -842,7 +848,7 @@ namespace ts {
|
||||
const { host, compilerHost } = state;
|
||||
state.projectCompilerOptions = config.options;
|
||||
// Update module resolution cache if needed
|
||||
updateModuleResolutionCache(state, project, config);
|
||||
state.moduleResolutionCache?.update(config.options);
|
||||
|
||||
// Create program
|
||||
program = host.createProgram(
|
||||
@@ -1306,37 +1312,6 @@ namespace ts {
|
||||
return { buildResult, step: BuildStep.QueueReferencingProjects };
|
||||
}
|
||||
|
||||
function updateModuleResolutionCache(
|
||||
state: SolutionBuilderState,
|
||||
proj: ResolvedConfigFileName,
|
||||
config: ParsedCommandLine
|
||||
) {
|
||||
if (!state.moduleResolutionCache) return;
|
||||
|
||||
// Update module resolution cache if needed
|
||||
const { moduleResolutionCache } = state;
|
||||
const projPath = toPath(state, proj);
|
||||
if (moduleResolutionCache.directoryToModuleNameMap.redirectsMap.size === 0) {
|
||||
// The own map will be for projectCompilerOptions
|
||||
Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size === 0);
|
||||
moduleResolutionCache.directoryToModuleNameMap.redirectsMap.set(projPath, moduleResolutionCache.directoryToModuleNameMap.ownMap);
|
||||
moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.set(projPath, moduleResolutionCache.moduleNameToDirectoryMap.ownMap);
|
||||
}
|
||||
else {
|
||||
// Set correct own map
|
||||
Debug.assert(moduleResolutionCache.moduleNameToDirectoryMap.redirectsMap.size > 0);
|
||||
|
||||
const ref: ResolvedProjectReference = {
|
||||
sourceFile: config.options.configFile!,
|
||||
commandLine: config
|
||||
};
|
||||
moduleResolutionCache.directoryToModuleNameMap.setOwnMap(moduleResolutionCache.directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
|
||||
moduleResolutionCache.moduleNameToDirectoryMap.setOwnMap(moduleResolutionCache.moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
|
||||
}
|
||||
moduleResolutionCache.directoryToModuleNameMap.setOwnOptions(config.options);
|
||||
moduleResolutionCache.moduleNameToDirectoryMap.setOwnOptions(config.options);
|
||||
}
|
||||
|
||||
function checkConfigFileUpToDateStatus(state: SolutionBuilderState, configFile: string, oldestOutputFileTime: Date, oldestOutputFileName: string): Status.OutOfDateWithSelf | undefined {
|
||||
// Check tsconfig time
|
||||
const tsconfigTime = getModifiedTime(state.host, configFile);
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace ts {
|
||||
"File 'node_modules/@types/a.d.ts' does not exist.",
|
||||
"File 'node_modules/@types/a/index.d.ts' does not exist.",
|
||||
"Loading module 'a' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"File 'node_modules/a/package.json' does not exist.",
|
||||
"File 'node_modules/a/package.json' does not exist according to earlier cached lookups.",
|
||||
"File 'node_modules/a.js' does not exist.",
|
||||
"File 'node_modules/a.jsx' does not exist.",
|
||||
"File 'node_modules/a/index.js' does not exist.",
|
||||
|
||||
+29
-13
@@ -4707,13 +4707,13 @@ declare namespace ts {
|
||||
export {};
|
||||
}
|
||||
declare namespace ts {
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
* is assumed to be the same as root directory of the project.
|
||||
*/
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
|
||||
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
|
||||
/**
|
||||
* Given a set of options, returns the set of type directive names
|
||||
* that should be included for this program automatically.
|
||||
@@ -4722,30 +4722,46 @@ declare namespace ts {
|
||||
* More type directives might appear in the program later as a result of loading actual source files;
|
||||
* this list is only the set of defaults that are implicitly included.
|
||||
*/
|
||||
function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
||||
export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
||||
export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
}
|
||||
/**
|
||||
* Cached module resolutions per containing directory.
|
||||
* Cached resolutions per containing directory.
|
||||
* This assumes that any module id will have the same resolution for sibling files located in the same folder.
|
||||
*/
|
||||
interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
|
||||
export interface PerDirectoryResolutionCache<T> {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<T>;
|
||||
clear(): void;
|
||||
/**
|
||||
* Updates with the current compilerOptions the cache will operate with.
|
||||
* This updates the redirects map as well if needed so module resolutions are cached if they can across the projects
|
||||
*/
|
||||
update(options: CompilerOptions): void;
|
||||
}
|
||||
export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
|
||||
getPackageJsonInfoCache(): PackageJsonInfoCache;
|
||||
}
|
||||
/**
|
||||
* Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
|
||||
* We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
|
||||
*/
|
||||
interface NonRelativeModuleNameResolutionCache {
|
||||
export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
|
||||
getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
|
||||
}
|
||||
interface PerModuleNameCache {
|
||||
export interface PackageJsonInfoCache {
|
||||
clear(): void;
|
||||
}
|
||||
export interface PerModuleNameCache {
|
||||
get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
|
||||
}
|
||||
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
||||
function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
||||
export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
|
||||
export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export {};
|
||||
}
|
||||
declare namespace ts {
|
||||
/**
|
||||
|
||||
+29
-13
@@ -4707,13 +4707,13 @@ declare namespace ts {
|
||||
export {};
|
||||
}
|
||||
declare namespace ts {
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
* is assumed to be the same as root directory of the project.
|
||||
*/
|
||||
function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
|
||||
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference, cache?: TypeReferenceDirectiveResolutionCache): ResolvedTypeReferenceDirectiveWithFailedLookupLocations;
|
||||
/**
|
||||
* Given a set of options, returns the set of type directive names
|
||||
* that should be included for this program automatically.
|
||||
@@ -4722,30 +4722,46 @@ declare namespace ts {
|
||||
* More type directives might appear in the program later as a result of loading actual source files;
|
||||
* this list is only the set of defaults that are implicitly included.
|
||||
*/
|
||||
function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
||||
export function getAutomaticTypeDirectiveNames(options: CompilerOptions, host: ModuleResolutionHost): string[];
|
||||
export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
}
|
||||
/**
|
||||
* Cached module resolutions per containing directory.
|
||||
* Cached resolutions per containing directory.
|
||||
* This assumes that any module id will have the same resolution for sibling files located in the same folder.
|
||||
*/
|
||||
interface ModuleResolutionCache extends NonRelativeModuleNameResolutionCache {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<ResolvedModuleWithFailedLookupLocations>;
|
||||
export interface PerDirectoryResolutionCache<T> {
|
||||
getOrCreateCacheForDirectory(directoryName: string, redirectedReference?: ResolvedProjectReference): Map<T>;
|
||||
clear(): void;
|
||||
/**
|
||||
* Updates with the current compilerOptions the cache will operate with.
|
||||
* This updates the redirects map as well if needed so module resolutions are cached if they can across the projects
|
||||
*/
|
||||
update(options: CompilerOptions): void;
|
||||
}
|
||||
export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
|
||||
getPackageJsonInfoCache(): PackageJsonInfoCache;
|
||||
}
|
||||
/**
|
||||
* Stored map from non-relative module name to a table: directory -> result of module lookup in this directory
|
||||
* We support only non-relative module names because resolution of relative module names is usually more deterministic and thus less expensive.
|
||||
*/
|
||||
interface NonRelativeModuleNameResolutionCache {
|
||||
export interface NonRelativeModuleNameResolutionCache extends PackageJsonInfoCache {
|
||||
getOrCreateCacheForModuleName(nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference): PerModuleNameCache;
|
||||
}
|
||||
interface PerModuleNameCache {
|
||||
export interface PackageJsonInfoCache {
|
||||
clear(): void;
|
||||
}
|
||||
export interface PerModuleNameCache {
|
||||
get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
|
||||
}
|
||||
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
||||
function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions): ModuleResolutionCache;
|
||||
export function createTypeReferenceDirectiveResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string, options?: CompilerOptions, packageJsonInfoCache?: PackageJsonInfoCache): TypeReferenceDirectiveResolutionCache;
|
||||
export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined;
|
||||
export function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations;
|
||||
export {};
|
||||
}
|
||||
declare namespace ts {
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
"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.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"======== Module name './index' was successfully resolved to '/node_modules/foo/index.d.ts' with Package ID 'foo/index.d.ts@1.2.3'. ========",
|
||||
"======== Resolving module 'foo' from '/node_modules/a/index.d.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
|
||||
+1
-2
@@ -27,8 +27,7 @@
|
||||
"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.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/@foo/bar/package.json' exists according to earlier cached lookups.",
|
||||
"======== Module name './index' was successfully resolved to '/node_modules/@foo/bar/index.d.ts' with Package ID '@foo/bar/index.d.ts@1.2.3'. ========",
|
||||
"======== Resolving module '@foo/bar' from '/node_modules/a/index.d.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"======== Resolving module '../' from '/a/b/test.ts'. ========",
|
||||
"Explicitly specified module resolution kind: 'NodeJs'.",
|
||||
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
|
||||
"File '/a/package.json' does not exist.",
|
||||
"File '/a/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/a/index.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name '../' was successfully resolved to '/a/index.ts'. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File 'types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for 'types/jquery/index.d.ts', result '/src/types/jquery/index.d.ts'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/src/types/jquery/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/src/__inferred type names__.ts', root directory 'types'. ========",
|
||||
"Resolving with primary search path 'types'.",
|
||||
"File 'types/jquery/package.json' does not exist.",
|
||||
"File 'types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for 'types/jquery/index.d.ts', result '/src/types/jquery/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/src/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'jquery' was found in cache from location '/src'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/src/types/jquery/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -7,12 +7,7 @@
|
||||
"File 'types/jquery/jquery.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for 'types/jquery/jquery.d.ts', result '/foo/types/jquery/jquery.d.ts'.",
|
||||
"======== 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'.",
|
||||
"Found 'package.json' at './types/jquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"'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.",
|
||||
"Resolving real path for 'types/jquery/jquery.d.ts', result '/foo/types/jquery/jquery.d.ts'.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/foo/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'jquery' was found in cache from location '/foo'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/foo/types/jquery/jquery.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -10,8 +10,7 @@
|
||||
"======== 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'.",
|
||||
"Found 'package.json' at '/types/jquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/types/jquery/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' does not have a 'typings' field.",
|
||||
"'package.json' has 'types' 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.",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
|
||||
"Resolving with primary search path '/node_modules/@types'.",
|
||||
"File '/node_modules/@types/alpha/package.json' does not exist.",
|
||||
"File '/node_modules/@types/alpha/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/@types/alpha/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/alpha/index.d.ts', result '/node_modules/@types/alpha/index.d.ts'.",
|
||||
"======== Type reference directive 'alpha' was successfully resolved to '/node_modules/@types/alpha/index.d.ts', primary: true. ========"
|
||||
|
||||
@@ -13,26 +13,20 @@
|
||||
"======== Type reference directive 'beta' was successfully resolved to '/test/types/beta/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'beta', containing file '/test/types/alpha/index.d.ts', root directory '/test/types'. ========",
|
||||
"Resolving with primary search path '/test/types'.",
|
||||
"File '/test/types/beta/package.json' does not exist.",
|
||||
"File '/test/types/beta/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/test/types/beta/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/test/types/beta/index.d.ts', result '/test/types/beta/index.d.ts'.",
|
||||
"======== Type reference directive 'beta' was successfully resolved to '/test/types/beta/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/test/types/beta/index.d.ts', root directory '/test/types'. ========",
|
||||
"Resolving with primary search path '/test/types'.",
|
||||
"File '/test/types/alpha/package.json' does not exist.",
|
||||
"File '/test/types/alpha/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/test/types/alpha/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/test/types/alpha/index.d.ts', result '/test/types/alpha/index.d.ts'.",
|
||||
"======== Type reference directive 'alpha' was successfully resolved to '/test/types/alpha/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/test/__inferred type names__.ts', root directory '/test/types'. ========",
|
||||
"Resolving with primary search path '/test/types'.",
|
||||
"File '/test/types/alpha/package.json' does not exist.",
|
||||
"File '/test/types/alpha/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/test/types/alpha/index.d.ts', result '/test/types/alpha/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'alpha', containing file '/test/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'alpha' was found in cache from location '/test'.",
|
||||
"======== Type reference directive 'alpha' was successfully resolved to '/test/types/alpha/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'beta', containing file '/test/__inferred type names__.ts', root directory '/test/types'. ========",
|
||||
"Resolving with primary search path '/test/types'.",
|
||||
"File '/test/types/beta/package.json' does not exist.",
|
||||
"File '/test/types/beta/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/test/types/beta/index.d.ts', result '/test/types/beta/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'beta', containing file '/test/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'beta' was found in cache from location '/test'.",
|
||||
"======== Type reference directive 'beta' was successfully resolved to '/test/types/beta/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -11,7 +11,7 @@
|
||||
"File '/node_modules/shortid/index.d.ts' does not exist.",
|
||||
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
|
||||
"Loading module 'shortid' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"File '/node_modules/shortid/package.json' does not exist.",
|
||||
"File '/node_modules/shortid/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/shortid.js' does not exist.",
|
||||
"File '/node_modules/shortid.jsx' does not exist.",
|
||||
"File '/node_modules/shortid/index.js' exist - use it as a name resolution result.",
|
||||
|
||||
+1
-2
@@ -54,8 +54,7 @@
|
||||
"File '/project/node_modules/troublesome-lib/lib/Option.ts' does not exist.",
|
||||
"File '/project/node_modules/troublesome-lib/lib/Option.tsx' does not exist.",
|
||||
"File '/project/node_modules/troublesome-lib/lib/Option.d.ts' exist - use it as a name resolution result.",
|
||||
"Found 'package.json' at '/project/node_modules/troublesome-lib/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/project/node_modules/troublesome-lib/package.json' exists according to earlier cached lookups.",
|
||||
"======== Module name './Option' was successfully resolved to '/project/node_modules/troublesome-lib/lib/Option.d.ts' with Package ID 'troublesome-lib/lib/Option.d.ts@1.17.1'. ========",
|
||||
"======== Resolving module 'troublesome-lib/lib/Option' from '/shared/lib/app.d.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/normalize.css/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/normalize.css/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/normalize.css.js' does not exist.",
|
||||
"File '/node_modules/normalize.css.jsx' does not exist.",
|
||||
"'package.json' has 'main' field 'normalize.css' that references '/node_modules/normalize.css/normalize.css'.",
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/foo/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/foo.js' does not exist.",
|
||||
"File '/node_modules/foo.jsx' does not exist.",
|
||||
"'package.json' does not have a 'main' field.",
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
"File '/node_modules/js/index.d.ts' does not exist.",
|
||||
"Directory '/node_modules/@types' does not exist, skipping all lookups in it.",
|
||||
"Loading module 'js' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"File '/node_modules/js/package.json' does not exist.",
|
||||
"File '/node_modules/js/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/js.js' does not exist.",
|
||||
"File '/node_modules/js.jsx' does not exist.",
|
||||
"File '/node_modules/js/index.js' exist - use it as a name resolution result.",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"File '/node_modules/foo/lib/test.ts' does not exist.",
|
||||
"File '/node_modules/foo/lib/test.tsx' does not exist.",
|
||||
"File '/node_modules/foo/lib/test.d.ts' exist - use it as a name resolution result.",
|
||||
"File '/node_modules/foo/package.json' does not exist.",
|
||||
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
|
||||
"======== Module name 'foo/test' was successfully resolved to '/node_modules/foo/lib/test.d.ts'. ========",
|
||||
"======== Resolving module './relative.js' from '/test.ts'. ========",
|
||||
"Explicitly specified module resolution kind: 'NodeJs'.",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"======== Resolving module 'linked' from '/app/app.ts'. ========",
|
||||
"Explicitly specified module resolution kind: 'NodeJs'.",
|
||||
"Loading module 'linked' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"File '/app/node_modules/linked/package.json' does not exist.",
|
||||
"File '/app/node_modules/linked/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/app/node_modules/linked.ts' does not exist.",
|
||||
"File '/app/node_modules/linked.tsx' does not exist.",
|
||||
"File '/app/node_modules/linked.d.ts' does not exist.",
|
||||
@@ -44,7 +44,7 @@
|
||||
"Explicitly specified module resolution kind: 'NodeJs'.",
|
||||
"Loading module 'real' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Directory '/app/node_modules/linked2/node_modules' does not exist, skipping all lookups in it.",
|
||||
"File '/app/node_modules/real/package.json' does not exist.",
|
||||
"File '/app/node_modules/real/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/app/node_modules/real.ts' does not exist.",
|
||||
"File '/app/node_modules/real.tsx' does not exist.",
|
||||
"File '/app/node_modules/real.d.ts' does not exist.",
|
||||
|
||||
@@ -21,9 +21,8 @@
|
||||
"File '/node_modules/foo/bar/index.d.ts' does not exist.",
|
||||
"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.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/bar/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/bar.js' does not exist.",
|
||||
"File '/node_modules/foo/bar.jsx' does not exist.",
|
||||
"'package.json' does not have a 'main' field.",
|
||||
|
||||
+2
-3
@@ -21,9 +21,8 @@
|
||||
"File '/node_modules/foo/@bar/index.d.ts' does not exist.",
|
||||
"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.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/@bar/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/@bar.js' does not exist.",
|
||||
"File '/node_modules/foo/@bar.jsx' does not exist.",
|
||||
"'package.json' does not have a 'main' field.",
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/foo/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/foo.js' does not exist.",
|
||||
"File '/node_modules/foo.jsx' does not exist.",
|
||||
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
|
||||
@@ -58,8 +57,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/bar/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/bar/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/bar.js' does not exist.",
|
||||
"File '/node_modules/bar.jsx' does not exist.",
|
||||
"'package.json' has 'main' field 'rab.js' that references '/node_modules/bar/rab.js'.",
|
||||
@@ -90,8 +88,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/baz/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/baz/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/baz.js' does not exist.",
|
||||
"File '/node_modules/baz.jsx' does not exist.",
|
||||
"'package.json' has 'main' field 'zab' that references '/node_modules/baz/zab'.",
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
"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'.",
|
||||
"Found 'package.json' at '/node_modules/foo/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/foo/package.json' exists according to earlier cached lookups.",
|
||||
"File '/node_modules/foo.js' does not exist.",
|
||||
"File '/node_modules/foo.jsx' does not exist.",
|
||||
"'package.json' has 'main' field 'oof' that references '/node_modules/foo/oof'.",
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@
|
||||
"File '/node_modules/foo/bar/foobar.js.jsx' does not exist.",
|
||||
"File name '/node_modules/foo/bar/foobar.js' has a '.js' extension - stripping it.",
|
||||
"File '/node_modules/foo/bar/foobar.js' exist - use it as a name resolution result.",
|
||||
"File '/node_modules/foo/package.json' does not exist.",
|
||||
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
|
||||
"======== Module name 'foo/bar/foobar.js' was successfully resolved to '/node_modules/foo/bar/foobar.js'. ========"
|
||||
]
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
"Trying substitution 'src/types', candidate module location: 'src/types'.",
|
||||
"Loading module as file / folder, candidate module location '/src/types', target file type 'JavaScript'.",
|
||||
"Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"File '/node_modules/foo/package.json' does not exist.",
|
||||
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/bar/foobar.json.js' does not exist.",
|
||||
"File '/node_modules/foo/bar/foobar.json.jsx' does not exist.",
|
||||
"======== Module name 'foo/bar/foobar.json' was not resolved. ========"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"Trying substitution 'src/types', candidate module location: 'src/types'.",
|
||||
"Loading module as file / folder, candidate module location '/src/types', target file type 'JavaScript'.",
|
||||
"Loading module 'foo/bar/foobar.json' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"File '/node_modules/foo/package.json' does not exist.",
|
||||
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/foo/bar/foobar.json.js' does not exist.",
|
||||
"File '/node_modules/foo/bar/foobar.json.jsx' does not exist.",
|
||||
"'baseUrl' option is set to '/', using this value to resolve non-relative module name 'foo/bar/foobar.json'.",
|
||||
@@ -38,6 +38,6 @@
|
||||
"Trying substitution 'node_modules/*', candidate module location: 'node_modules/foo/bar/foobar.json'.",
|
||||
"Loading module as file / folder, candidate module location '/node_modules/foo/bar/foobar.json', target file type 'Json'.",
|
||||
"File '/node_modules/foo/bar/foobar.json' exist - use it as a name resolution result.",
|
||||
"File '/node_modules/foo/package.json' does not exist.",
|
||||
"File '/node_modules/foo/package.json' does not exist according to earlier cached lookups.",
|
||||
"======== Module name 'foo/bar/foobar.json' was successfully resolved to '/node_modules/foo/bar/foobar.json'. ========"
|
||||
]
|
||||
@@ -24,7 +24,7 @@
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module '@be/bop/e/z' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Scoped package detected, looking in 'be__bop/e/z'",
|
||||
"File '/node_modules/@types/be__bop/package.json' does not exist.",
|
||||
"File '/node_modules/@types/be__bop/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/@types/be__bop/e/z.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/be__bop/e/z.d.ts', result '/node_modules/@types/be__bop/e/z.d.ts'.",
|
||||
"======== Module name '@be/bop/e/z' was successfully resolved to '/node_modules/@types/be__bop/e/z.d.ts'. ========"
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -12,10 +12,7 @@
|
||||
"File '/ref.tsx' does not exist.",
|
||||
"File '/ref.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name './ref' was successfully resolved to '/ref.d.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -18,10 +18,7 @@
|
||||
"======== Resolving module './main' from '/mod1.ts'. ========",
|
||||
"Resolution for module './main' was found in cache from location '/'.",
|
||||
"======== Module name './main' was successfully resolved to '/main.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -12,10 +12,7 @@
|
||||
"File '/ref.tsx' does not exist.",
|
||||
"File '/ref.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name './ref' was successfully resolved to '/ref.d.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -12,10 +12,7 @@
|
||||
"File '/ref.tsx' does not exist.",
|
||||
"File '/ref.d.ts' exist - use it as a name resolution result.",
|
||||
"======== Module name './ref' was successfully resolved to '/ref.d.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -18,10 +18,7 @@
|
||||
"======== Resolving module './main' from '/mod1.ts'. ========",
|
||||
"Resolution for module './main' was found in cache from location '/'.",
|
||||
"======== Module name './main' was successfully resolved to '/main.ts'. ========",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========",
|
||||
"Resolving with primary search path '/types'.",
|
||||
"File '/types/lib/package.json' does not exist.",
|
||||
"File '/types/lib/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'lib' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -22,8 +22,7 @@
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/moduleResolution/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
@@ -43,8 +42,7 @@
|
||||
"Directory 'node_modules' does not exist, skipping all lookups in it.",
|
||||
"Directory '/node_modules' does not exist, skipping all lookups in it.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/moduleResolution/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/moduleResolution/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
@@ -43,8 +42,7 @@
|
||||
"Directory 'node_modules' does not exist, skipping all lookups in it.",
|
||||
"Directory '/node_modules' does not exist, skipping all lookups in it.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'JavaScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
|
||||
+6
-9
@@ -21,14 +21,12 @@
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.ts' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.tsx' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' exist - use it as a name resolution result.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"======== Module name '../other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' with Package ID 'ext/other.d.ts@1.0.0'. ========",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"======== Module name '../other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/other.d.ts' with Package ID 'ext/ther.d.ts@1.0.0'. ========",
|
||||
"======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.tsx' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.d.ts' does not exist.",
|
||||
@@ -43,12 +41,11 @@
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.tsx' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts', result 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts'.",
|
||||
"======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/ts3.1/index.d.ts@1.0.0'. ========",
|
||||
"======== Module name 'ext' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/index.d.ts' with Package ID 'ext/s3.1/index.d.ts@1.0.0'. ========",
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"Module name 'other', matched pattern '*'.",
|
||||
"Trying substitution 'ts3.1/*', candidate module location: 'ts3.1/other'.",
|
||||
@@ -56,5 +53,5 @@
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.tsx' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts', result 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts'.",
|
||||
"======== Module name 'ext/other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts' with Package ID 'ext/ts3.1/other.d.ts@1.0.0'. ========"
|
||||
"======== Module name 'ext/other' was successfully resolved to 'tests/cases/conformance/declarationEmit/node_modules/ext/ts3.1/other.d.ts' with Package ID 'ext/s3.1/other.d.ts@1.0.0'. ========"
|
||||
]
|
||||
+2
-4
@@ -11,8 +11,7 @@
|
||||
"======== Resolving module 'ext' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.ts' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.tsx' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext.d.ts' does not exist.",
|
||||
@@ -31,8 +30,7 @@
|
||||
"======== Resolving module 'ext/other' from 'tests/cases/conformance/declarationEmit/main.ts'. ========",
|
||||
"Module resolution kind is not specified, using 'NodeJs'.",
|
||||
"Loading module 'ext/other' from 'node_modules' folder, target file type 'TypeScript'.",
|
||||
"Found 'package.json' at 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json'.",
|
||||
"'package.json' has a 'typesVersions' field with version-specific path mappings.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has a 'typesVersions' entry '>=3.1.0-0' that matches compiler version '3.1.0-dev', looking for a pattern to match module name 'other'.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.ts' does not exist.",
|
||||
"File 'tests/cases/conformance/declarationEmit/node_modules/ext/other.tsx' does not exist.",
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
|
||||
"Resolving with primary search path '/node_modules/@types'.",
|
||||
"File '/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'jquery' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -5,10 +5,7 @@
|
||||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
|
||||
"Resolving with primary search path '/node_modules/@types'.",
|
||||
"File '/node_modules/@types/jquery/package.json' does not exist.",
|
||||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'.",
|
||||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts'. ========",
|
||||
"Resolution for type reference directive 'jquery' was found in cache from location '/'.",
|
||||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========"
|
||||
]
|
||||
@@ -65,16 +65,14 @@
|
||||
"======== 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'.",
|
||||
"Found 'package.json' at '/node_modules/@types/jquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/@types/jquery/package.json' exists according to earlier cached lookups.",
|
||||
"'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.",
|
||||
"Resolving real path for '/node_modules/@types/jquery/jquery.d.ts', result '/node_modules/@types/jquery/jquery.d.ts'.",
|
||||
"======== 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'.",
|
||||
"Found 'package.json' at '/node_modules/@types/kquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/@types/kquery/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'.",
|
||||
"File '/node_modules/@types/kquery/kquery' does not exist.",
|
||||
"Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file type 'TypeScript'.",
|
||||
@@ -85,8 +83,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'.",
|
||||
"Found 'package.json' at '/node_modules/@types/lquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/@types/lquery/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'.",
|
||||
"File '/node_modules/@types/lquery/lquery' does not exist.",
|
||||
"Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file type 'TypeScript'.",
|
||||
@@ -95,8 +92,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'.",
|
||||
"Found 'package.json' at '/node_modules/@types/mquery/package.json'.",
|
||||
"'package.json' does not have a 'typesVersions' field.",
|
||||
"File '/node_modules/@types/mquery/package.json' exists according to earlier cached lookups.",
|
||||
"'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'.",
|
||||
"File '/node_modules/@types/mquery/mquery' does not exist.",
|
||||
"Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file type 'TypeScript'.",
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
"======== Module name 'a' was successfully resolved to '/node_modules/@types/a/index.d.ts'. ========",
|
||||
"======== Resolving type reference directive 'a', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========",
|
||||
"Resolving with primary search path '/node_modules/@types'.",
|
||||
"File '/node_modules/@types/a/package.json' does not exist.",
|
||||
"File '/node_modules/@types/a/package.json' does not exist according to earlier cached lookups.",
|
||||
"File '/node_modules/@types/a/index.d.ts' exist - use it as a name resolution result.",
|
||||
"Resolving real path for '/node_modules/@types/a/index.d.ts', result '/node_modules/@types/a/index.d.ts'.",
|
||||
"======== Type reference directive 'a' was successfully resolved to '/node_modules/@types/a/index.d.ts', primary: true. ========"
|
||||
|
||||
Reference in New Issue
Block a user