@typescript-deploys/pr-build 5.4.0-pr-56476-3 → 5.4.0-pr-56439-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +78 -148
- package/lib/tsserver.js +146 -218
- package/lib/typescript.d.ts +5 -3
- package/lib/typescript.js +146 -218
- package/lib/typingsInstaller.js +11 -8
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -20161,6 +20161,7 @@ ${lanes.join("\n")}
|
|
|
20161
20161
|
}
|
|
20162
20162
|
function createNodeFactory(flags, baseFactory2) {
|
|
20163
20163
|
const update = flags & 8 /* NoOriginalNode */ ? updateWithoutOriginal : updateWithOriginal;
|
|
20164
|
+
const setOriginal = flags & 8 /* NoOriginalNode */ ? identity : setOriginalNode;
|
|
20164
20165
|
const parenthesizerRules = memoize(() => flags & 1 /* NoParenthesizerRules */ ? nullParenthesizerRules : createParenthesizerRules(factory2));
|
|
20165
20166
|
const converters = memoize(() => flags & 2 /* NoNodeConverters */ ? nullNodeConverters : createNodeConverters(factory2));
|
|
20166
20167
|
const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right));
|
|
@@ -23658,7 +23659,7 @@ ${lanes.join("\n")}
|
|
|
23658
23659
|
}
|
|
23659
23660
|
function cloneSourceFile(source) {
|
|
23660
23661
|
const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
|
|
23661
|
-
|
|
23662
|
+
setOriginal(node, source);
|
|
23662
23663
|
return node;
|
|
23663
23664
|
}
|
|
23664
23665
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
@@ -23791,7 +23792,7 @@ ${lanes.join("\n")}
|
|
|
23791
23792
|
const clone2 = createBaseIdentifier(node.escapedText);
|
|
23792
23793
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23793
23794
|
clone2.transformFlags = node.transformFlags;
|
|
23794
|
-
|
|
23795
|
+
setOriginal(clone2, node);
|
|
23795
23796
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
23796
23797
|
return clone2;
|
|
23797
23798
|
}
|
|
@@ -23802,7 +23803,7 @@ ${lanes.join("\n")}
|
|
|
23802
23803
|
clone2.flowNode = node.flowNode;
|
|
23803
23804
|
clone2.symbol = node.symbol;
|
|
23804
23805
|
clone2.transformFlags = node.transformFlags;
|
|
23805
|
-
|
|
23806
|
+
setOriginal(clone2, node);
|
|
23806
23807
|
const typeArguments = getIdentifierTypeArguments(node);
|
|
23807
23808
|
if (typeArguments)
|
|
23808
23809
|
setIdentifierTypeArguments(clone2, typeArguments);
|
|
@@ -23812,7 +23813,7 @@ ${lanes.join("\n")}
|
|
|
23812
23813
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
23813
23814
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23814
23815
|
clone2.transformFlags = node.transformFlags;
|
|
23815
|
-
|
|
23816
|
+
setOriginal(clone2, node);
|
|
23816
23817
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
23817
23818
|
return clone2;
|
|
23818
23819
|
}
|
|
@@ -23820,7 +23821,7 @@ ${lanes.join("\n")}
|
|
|
23820
23821
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
23821
23822
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23822
23823
|
clone2.transformFlags = node.transformFlags;
|
|
23823
|
-
|
|
23824
|
+
setOriginal(clone2, node);
|
|
23824
23825
|
return clone2;
|
|
23825
23826
|
}
|
|
23826
23827
|
function cloneNode(node) {
|
|
@@ -23845,7 +23846,7 @@ ${lanes.join("\n")}
|
|
|
23845
23846
|
const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
|
|
23846
23847
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23847
23848
|
clone2.transformFlags = node.transformFlags;
|
|
23848
|
-
|
|
23849
|
+
setOriginal(clone2, node);
|
|
23849
23850
|
for (const key in node) {
|
|
23850
23851
|
if (hasProperty(clone2, key) || !hasProperty(node, key)) {
|
|
23851
23852
|
continue;
|
|
@@ -24370,7 +24371,7 @@ ${lanes.join("\n")}
|
|
|
24370
24371
|
return typeof value === "number" ? createToken(value) : value;
|
|
24371
24372
|
}
|
|
24372
24373
|
function asEmbeddedStatement(statement) {
|
|
24373
|
-
return statement && isNotEmittedStatement(statement) ? setTextRange(
|
|
24374
|
+
return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement;
|
|
24374
24375
|
}
|
|
24375
24376
|
function asVariableDeclaration(variableDeclaration) {
|
|
24376
24377
|
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
|
|
@@ -29392,8 +29393,10 @@ ${lanes.join("\n")}
|
|
|
29392
29393
|
setTextRangePosWidth(sourceFile, 0, sourceText.length);
|
|
29393
29394
|
setFields(sourceFile);
|
|
29394
29395
|
if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) {
|
|
29396
|
+
const oldSourceFile = sourceFile;
|
|
29395
29397
|
sourceFile = reparseTopLevelAwait(sourceFile);
|
|
29396
|
-
|
|
29398
|
+
if (oldSourceFile !== sourceFile)
|
|
29399
|
+
setFields(sourceFile);
|
|
29397
29400
|
}
|
|
29398
29401
|
return sourceFile;
|
|
29399
29402
|
function setFields(sourceFile2) {
|
|
@@ -37553,39 +37556,34 @@ ${lanes.join("\n")}
|
|
|
37553
37556
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
37554
37557
|
}
|
|
37555
37558
|
}
|
|
37556
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude },
|
|
37557
|
-
const rawExcludeRegex = getRegularExpressionForWildcard(exclude,
|
|
37559
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
|
|
37560
|
+
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
|
|
37558
37561
|
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
37559
37562
|
const wildcardDirectories = {};
|
|
37560
|
-
const wildCardKeyToPath = /* @__PURE__ */ new Map();
|
|
37561
37563
|
if (include !== void 0) {
|
|
37562
37564
|
const recursiveKeys = [];
|
|
37563
37565
|
for (const file of include) {
|
|
37564
|
-
const spec = normalizePath(combinePaths(
|
|
37566
|
+
const spec = normalizePath(combinePaths(path, file));
|
|
37565
37567
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
37566
37568
|
continue;
|
|
37567
37569
|
}
|
|
37568
37570
|
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
37569
37571
|
if (match) {
|
|
37570
|
-
const { key,
|
|
37571
|
-
const
|
|
37572
|
-
const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0;
|
|
37572
|
+
const { key, flags } = match;
|
|
37573
|
+
const existingFlags = wildcardDirectories[key];
|
|
37573
37574
|
if (existingFlags === void 0 || existingFlags < flags) {
|
|
37574
|
-
wildcardDirectories[
|
|
37575
|
-
if (existingPath === void 0)
|
|
37576
|
-
wildCardKeyToPath.set(key, path);
|
|
37575
|
+
wildcardDirectories[key] = flags;
|
|
37577
37576
|
if (flags === 1 /* Recursive */) {
|
|
37578
37577
|
recursiveKeys.push(key);
|
|
37579
37578
|
}
|
|
37580
37579
|
}
|
|
37581
37580
|
}
|
|
37582
37581
|
}
|
|
37583
|
-
for (const
|
|
37584
|
-
if (hasProperty(wildcardDirectories,
|
|
37582
|
+
for (const key in wildcardDirectories) {
|
|
37583
|
+
if (hasProperty(wildcardDirectories, key)) {
|
|
37585
37584
|
for (const recursiveKey of recursiveKeys) {
|
|
37586
|
-
|
|
37587
|
-
|
|
37588
|
-
delete wildcardDirectories[path];
|
|
37585
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
|
|
37586
|
+
delete wildcardDirectories[key];
|
|
37589
37587
|
}
|
|
37590
37588
|
}
|
|
37591
37589
|
}
|
|
@@ -37593,9 +37591,6 @@ ${lanes.join("\n")}
|
|
|
37593
37591
|
}
|
|
37594
37592
|
return wildcardDirectories;
|
|
37595
37593
|
}
|
|
37596
|
-
function toCanonicalKey(path, useCaseSensitiveFileNames2) {
|
|
37597
|
-
return useCaseSensitiveFileNames2 ? path : toFileNameLowerCase(path);
|
|
37598
|
-
}
|
|
37599
37594
|
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
37600
37595
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
37601
37596
|
if (match) {
|
|
@@ -37603,16 +37598,13 @@ ${lanes.join("\n")}
|
|
|
37603
37598
|
const starWildcardIndex = spec.indexOf("*");
|
|
37604
37599
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
37605
37600
|
return {
|
|
37606
|
-
key:
|
|
37607
|
-
path: match[0],
|
|
37601
|
+
key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
|
|
37608
37602
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
37609
37603
|
};
|
|
37610
37604
|
}
|
|
37611
37605
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
37612
|
-
const path = removeTrailingDirectorySeparator(spec);
|
|
37613
37606
|
return {
|
|
37614
|
-
key:
|
|
37615
|
-
path,
|
|
37607
|
+
key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
|
|
37616
37608
|
flags: 1 /* Recursive */
|
|
37617
37609
|
};
|
|
37618
37610
|
}
|
|
@@ -39909,50 +39901,22 @@ ${lanes.join("\n")}
|
|
|
39909
39901
|
}
|
|
39910
39902
|
function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
|
|
39911
39903
|
let cache;
|
|
39912
|
-
|
|
39913
|
-
return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, deletePackageJsonInfo, clear: clear2, entries };
|
|
39904
|
+
return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, entries, getInternalMap };
|
|
39914
39905
|
function getPackageJsonInfo2(packageJsonPath) {
|
|
39915
|
-
|
|
39916
|
-
return void 0;
|
|
39917
|
-
const absolute = getNormalizedAbsolutePath(packageJsonPath, currentDirectory);
|
|
39918
|
-
const result = cache.get(absolute);
|
|
39919
|
-
if (result !== void 0)
|
|
39920
|
-
return result;
|
|
39921
|
-
if (!canonicalPathToCacheKey)
|
|
39922
|
-
return void 0;
|
|
39923
|
-
const path = getCanonicalFileName(absolute);
|
|
39924
|
-
if (path === absolute)
|
|
39925
|
-
return void 0;
|
|
39926
|
-
const cacheKey = canonicalPathToCacheKey.get(path);
|
|
39927
|
-
return cacheKey !== void 0 ? cache.get(cacheKey) : void 0;
|
|
39906
|
+
return cache == null ? void 0 : cache.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
|
|
39928
39907
|
}
|
|
39929
39908
|
function setPackageJsonInfo(packageJsonPath, info) {
|
|
39930
|
-
|
|
39931
|
-
(cache || (cache = /* @__PURE__ */ new Map())).set(absolute, info);
|
|
39932
|
-
const path = getCanonicalFileName(absolute);
|
|
39933
|
-
if (path !== absolute) {
|
|
39934
|
-
(canonicalPathToCacheKey ?? (canonicalPathToCacheKey = /* @__PURE__ */ new Map())).set(path, absolute);
|
|
39935
|
-
}
|
|
39936
|
-
}
|
|
39937
|
-
function deletePackageJsonInfo(packageJsonPath) {
|
|
39938
|
-
if (!cache)
|
|
39939
|
-
return;
|
|
39940
|
-
const absolute = getNormalizedAbsolutePath(packageJsonPath, currentDirectory);
|
|
39941
|
-
cache.delete(absolute);
|
|
39942
|
-
if (canonicalPathToCacheKey) {
|
|
39943
|
-
const path = getCanonicalFileName(absolute);
|
|
39944
|
-
const cacheKey = canonicalPathToCacheKey.get(path);
|
|
39945
|
-
if (cacheKey !== void 0) {
|
|
39946
|
-
cache.delete(cacheKey);
|
|
39947
|
-
canonicalPathToCacheKey.delete(path);
|
|
39948
|
-
}
|
|
39949
|
-
}
|
|
39909
|
+
(cache || (cache = /* @__PURE__ */ new Map())).set(toPath(packageJsonPath, currentDirectory, getCanonicalFileName), info);
|
|
39950
39910
|
}
|
|
39951
39911
|
function clear2() {
|
|
39952
39912
|
cache = void 0;
|
|
39953
39913
|
}
|
|
39954
39914
|
function entries() {
|
|
39955
|
-
|
|
39915
|
+
const iter = cache == null ? void 0 : cache.entries();
|
|
39916
|
+
return iter ? arrayFrom(iter) : [];
|
|
39917
|
+
}
|
|
39918
|
+
function getInternalMap() {
|
|
39919
|
+
return cache;
|
|
39956
39920
|
}
|
|
39957
39921
|
}
|
|
39958
39922
|
function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {
|
|
@@ -45013,8 +44977,8 @@ ${lanes.join("\n")}
|
|
|
45013
44977
|
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getPreferences({}, compilerOptions, importingSourceFile), {}, options);
|
|
45014
44978
|
}
|
|
45015
44979
|
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
|
|
45016
|
-
const info = getInfo(importingSourceFile.
|
|
45017
|
-
const modulePaths = getAllModulePaths(importingSourceFile.
|
|
44980
|
+
const info = getInfo(importingSourceFile.path, host);
|
|
44981
|
+
const modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options);
|
|
45018
44982
|
return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
|
|
45019
44983
|
modulePath,
|
|
45020
44984
|
info,
|
|
@@ -45091,7 +45055,7 @@ ${lanes.join("\n")}
|
|
|
45091
45055
|
if (!moduleSourceFile)
|
|
45092
45056
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
45093
45057
|
computedWithoutCache = true;
|
|
45094
|
-
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.
|
|
45058
|
+
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
45095
45059
|
const result = computeModuleSpecifiers(
|
|
45096
45060
|
modulePaths,
|
|
45097
45061
|
compilerOptions,
|
|
@@ -45105,7 +45069,7 @@ ${lanes.join("\n")}
|
|
|
45105
45069
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
45106
45070
|
}
|
|
45107
45071
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
45108
|
-
const info = getInfo(importingSourceFile.
|
|
45072
|
+
const info = getInfo(importingSourceFile.path, host);
|
|
45109
45073
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
45110
45074
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
45111
45075
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
@@ -45169,7 +45133,6 @@ ${lanes.join("\n")}
|
|
|
45169
45133
|
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
|
|
45170
45134
|
}
|
|
45171
45135
|
function getInfo(importingSourceFileName, host) {
|
|
45172
|
-
importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory());
|
|
45173
45136
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
|
|
45174
45137
|
const sourceDirectory = getDirectoryPath(importingSourceFileName);
|
|
45175
45138
|
return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
|
|
@@ -45204,7 +45167,7 @@ ${lanes.join("\n")}
|
|
|
45204
45167
|
if (relativePreference === 3 /* ExternalNonRelative */ && !pathIsRelative(maybeNonRelative)) {
|
|
45205
45168
|
const projectDirectory = compilerOptions.configFilePath ? toPath(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) : info.getCanonicalFileName(host.getCurrentDirectory());
|
|
45206
45169
|
const modulePath = toPath(moduleFileName, projectDirectory, getCanonicalFileName);
|
|
45207
|
-
const sourceIsInternal = startsWith(
|
|
45170
|
+
const sourceIsInternal = startsWith(sourceDirectory, projectDirectory);
|
|
45208
45171
|
const targetIsInternal = startsWith(modulePath, projectDirectory);
|
|
45209
45172
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
45210
45173
|
return maybeNonRelative;
|
|
@@ -45277,9 +45240,8 @@ ${lanes.join("\n")}
|
|
|
45277
45240
|
});
|
|
45278
45241
|
return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
|
|
45279
45242
|
}
|
|
45280
|
-
function getAllModulePaths(
|
|
45243
|
+
function getAllModulePaths(importingFilePath, importedFileName, host, preferences, options = {}) {
|
|
45281
45244
|
var _a;
|
|
45282
|
-
const importingFilePath = toPath(importingFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
45283
45245
|
const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
45284
45246
|
const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host);
|
|
45285
45247
|
if (cache) {
|
|
@@ -45287,7 +45249,7 @@ ${lanes.join("\n")}
|
|
|
45287
45249
|
if (cached == null ? void 0 : cached.modulePaths)
|
|
45288
45250
|
return cached.modulePaths;
|
|
45289
45251
|
}
|
|
45290
|
-
const modulePaths = getAllModulePathsWorker(
|
|
45252
|
+
const modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host);
|
|
45291
45253
|
if (cache) {
|
|
45292
45254
|
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
45293
45255
|
}
|
|
@@ -45310,7 +45272,7 @@ ${lanes.join("\n")}
|
|
|
45310
45272
|
}
|
|
45311
45273
|
);
|
|
45312
45274
|
const sortedPaths = [];
|
|
45313
|
-
for (let directory = getDirectoryPath(
|
|
45275
|
+
for (let directory = getDirectoryPath(importingFileName); allFileNames.size !== 0; ) {
|
|
45314
45276
|
const directoryStart = ensureTrailingDirectorySeparator(directory);
|
|
45315
45277
|
let pathsInDirectory;
|
|
45316
45278
|
allFileNames.forEach(({ path, isRedirect, isInNodeModules }, fileName) => {
|
|
@@ -45331,10 +45293,7 @@ ${lanes.join("\n")}
|
|
|
45331
45293
|
directory = newDirectory;
|
|
45332
45294
|
}
|
|
45333
45295
|
if (allFileNames.size) {
|
|
45334
|
-
const remainingPaths = arrayFrom(
|
|
45335
|
-
allFileNames.entries(),
|
|
45336
|
-
([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules })
|
|
45337
|
-
);
|
|
45296
|
+
const remainingPaths = arrayFrom(allFileNames.values());
|
|
45338
45297
|
if (remainingPaths.length > 1)
|
|
45339
45298
|
remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);
|
|
45340
45299
|
sortedPaths.push(...remainingPaths);
|
|
@@ -45538,7 +45497,7 @@ ${lanes.join("\n")}
|
|
|
45538
45497
|
}
|
|
45539
45498
|
const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();
|
|
45540
45499
|
const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));
|
|
45541
|
-
if (!(startsWith(
|
|
45500
|
+
if (!(startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
|
|
45542
45501
|
return void 0;
|
|
45543
45502
|
}
|
|
45544
45503
|
const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
|
|
@@ -110988,8 +110947,8 @@ ${lanes.join("\n")}
|
|
|
110988
110947
|
const specifier = getModuleSpecifier(
|
|
110989
110948
|
options,
|
|
110990
110949
|
currentSourceFile,
|
|
110991
|
-
|
|
110992
|
-
|
|
110950
|
+
toPath(outputFilePath2, host.getCurrentDirectory(), host.getCanonicalFileName),
|
|
110951
|
+
toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName),
|
|
110993
110952
|
host
|
|
110994
110953
|
);
|
|
110995
110954
|
if (!pathIsRelative(specifier)) {
|
|
@@ -118452,8 +118411,8 @@ ${lanes.join("\n")}
|
|
|
118452
118411
|
}
|
|
118453
118412
|
const baseName = getBaseNameOfFileName(fileOrDirectory);
|
|
118454
118413
|
const fsQueryResult = {
|
|
118455
|
-
fileExists: host.fileExists(
|
|
118456
|
-
directoryExists: host.directoryExists(
|
|
118414
|
+
fileExists: host.fileExists(fileOrDirectoryPath),
|
|
118415
|
+
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
|
118457
118416
|
};
|
|
118458
118417
|
if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
|
|
118459
118418
|
clearCache();
|
|
@@ -118547,9 +118506,11 @@ ${lanes.join("\n")}
|
|
|
118547
118506
|
);
|
|
118548
118507
|
}
|
|
118549
118508
|
function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {
|
|
118509
|
+
const missingFilePaths = program.getMissingFilePaths();
|
|
118510
|
+
const newMissingFilePathMap = arrayToMap(missingFilePaths, identity, returnTrue);
|
|
118550
118511
|
mutateMap(
|
|
118551
118512
|
missingFileWatches,
|
|
118552
|
-
|
|
118513
|
+
newMissingFilePathMap,
|
|
118553
118514
|
{
|
|
118554
118515
|
// Watch the missing files
|
|
118555
118516
|
createNewValue: createMissingFileWatch,
|
|
@@ -119395,8 +119356,7 @@ ${lanes.join("\n")}
|
|
|
119395
119356
|
return false;
|
|
119396
119357
|
if (program.getSourceFiles().some(sourceFileNotUptoDate))
|
|
119397
119358
|
return false;
|
|
119398
|
-
|
|
119399
|
-
if (missingPaths && forEachEntry(missingPaths, fileExists))
|
|
119359
|
+
if (program.getMissingFilePaths().some(fileExists))
|
|
119400
119360
|
return false;
|
|
119401
119361
|
const currentOptions = program.getCompilerOptions();
|
|
119402
119362
|
if (!compareDataObjects(currentOptions, newOptions))
|
|
@@ -119603,7 +119563,7 @@ ${lanes.join("\n")}
|
|
|
119603
119563
|
let redirectTargetsMap = createMultiMap();
|
|
119604
119564
|
let usesUriStyleNodeCoreModules = false;
|
|
119605
119565
|
const filesByName = /* @__PURE__ */ new Map();
|
|
119606
|
-
let
|
|
119566
|
+
let missingFilePaths;
|
|
119607
119567
|
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
|
|
119608
119568
|
let resolvedProjectReferences;
|
|
119609
119569
|
let projectReferenceRedirects;
|
|
@@ -119722,10 +119682,12 @@ ${lanes.join("\n")}
|
|
|
119722
119682
|
});
|
|
119723
119683
|
}
|
|
119724
119684
|
}
|
|
119685
|
+
missingFilePaths = arrayFrom(mapDefinedIterator(filesByName.entries(), ([path, file]) => file === void 0 ? path : void 0));
|
|
119725
119686
|
files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
119726
119687
|
processingDefaultLibFiles = void 0;
|
|
119727
119688
|
processingOtherFiles = void 0;
|
|
119728
119689
|
}
|
|
119690
|
+
Debug.assert(!!missingFilePaths);
|
|
119729
119691
|
if (oldProgram && host.onReleaseOldSourceFile) {
|
|
119730
119692
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
119731
119693
|
for (const oldSourceFile of oldSourceFiles) {
|
|
@@ -119770,7 +119732,8 @@ ${lanes.join("\n")}
|
|
|
119770
119732
|
getSourceFile,
|
|
119771
119733
|
getSourceFileByPath,
|
|
119772
119734
|
getSourceFiles: () => files,
|
|
119773
|
-
getMissingFilePaths: () =>
|
|
119735
|
+
getMissingFilePaths: () => missingFilePaths,
|
|
119736
|
+
// TODO: GH#18217
|
|
119774
119737
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
119775
119738
|
getFilesByNameMap: () => filesByName,
|
|
119776
119739
|
getCompilerOptions: () => options,
|
|
@@ -120197,7 +120160,7 @@ ${lanes.join("\n")}
|
|
|
120197
120160
|
const newSourceFiles = [];
|
|
120198
120161
|
const modifiedSourceFiles = [];
|
|
120199
120162
|
structureIsReused = 2 /* Completely */;
|
|
120200
|
-
if (
|
|
120163
|
+
if (oldProgram.getMissingFilePaths().some((missingFilePath) => host.fileExists(missingFilePath))) {
|
|
120201
120164
|
return 0 /* Not */;
|
|
120202
120165
|
}
|
|
120203
120166
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
@@ -120337,7 +120300,7 @@ ${lanes.join("\n")}
|
|
|
120337
120300
|
if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames))
|
|
120338
120301
|
return 1 /* SafeModules */;
|
|
120339
120302
|
}
|
|
120340
|
-
|
|
120303
|
+
missingFilePaths = oldProgram.getMissingFilePaths();
|
|
120341
120304
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
120342
120305
|
for (const newSourceFile of newSourceFiles) {
|
|
120343
120306
|
filesByName.set(newSourceFile.path, newSourceFile);
|
|
@@ -120394,7 +120357,7 @@ ${lanes.join("\n")}
|
|
|
120394
120357
|
const path = toPath3(f);
|
|
120395
120358
|
if (getSourceFileByPath(path))
|
|
120396
120359
|
return true;
|
|
120397
|
-
if (
|
|
120360
|
+
if (contains(missingFilePaths, path))
|
|
120398
120361
|
return false;
|
|
120399
120362
|
return host.fileExists(f);
|
|
120400
120363
|
},
|
|
@@ -121206,7 +121169,6 @@ ${lanes.join("\n")}
|
|
|
121206
121169
|
addFileToFilesByName(
|
|
121207
121170
|
file2,
|
|
121208
121171
|
path,
|
|
121209
|
-
fileName,
|
|
121210
121172
|
/*redirectedPath*/
|
|
121211
121173
|
void 0
|
|
121212
121174
|
);
|
|
@@ -121279,7 +121241,7 @@ ${lanes.join("\n")}
|
|
|
121279
121241
|
if (fileFromPackageId) {
|
|
121280
121242
|
const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path, toPath3(fileName), originalFileName, sourceFileOptions);
|
|
121281
121243
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
121282
|
-
addFileToFilesByName(dupFile, path,
|
|
121244
|
+
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
121283
121245
|
addFileIncludeReason(dupFile, reason);
|
|
121284
121246
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
121285
121247
|
processingOtherFiles.push(dupFile);
|
|
@@ -121289,7 +121251,7 @@ ${lanes.join("\n")}
|
|
|
121289
121251
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
121290
121252
|
}
|
|
121291
121253
|
}
|
|
121292
|
-
addFileToFilesByName(file, path,
|
|
121254
|
+
addFileToFilesByName(file, path, redirectedPath);
|
|
121293
121255
|
if (file) {
|
|
121294
121256
|
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
|
|
121295
121257
|
file.fileName = fileName;
|
|
@@ -121329,21 +121291,14 @@ ${lanes.join("\n")}
|
|
|
121329
121291
|
if (file)
|
|
121330
121292
|
fileReasons.add(file.path, reason);
|
|
121331
121293
|
}
|
|
121332
|
-
function addFileToFilesByName(file, path,
|
|
121294
|
+
function addFileToFilesByName(file, path, redirectedPath) {
|
|
121333
121295
|
if (redirectedPath) {
|
|
121334
|
-
|
|
121335
|
-
|
|
121296
|
+
filesByName.set(redirectedPath, file);
|
|
121297
|
+
filesByName.set(path, file || false);
|
|
121336
121298
|
} else {
|
|
121337
|
-
|
|
121299
|
+
filesByName.set(path, file);
|
|
121338
121300
|
}
|
|
121339
121301
|
}
|
|
121340
|
-
function updateFilesByNameMap(fileName, path, file) {
|
|
121341
|
-
filesByName.set(path, file);
|
|
121342
|
-
if (file !== void 0)
|
|
121343
|
-
missingFileNames.delete(path);
|
|
121344
|
-
else
|
|
121345
|
-
missingFileNames.set(path, fileName);
|
|
121346
|
-
}
|
|
121347
121302
|
function getProjectReferenceRedirect(fileName) {
|
|
121348
121303
|
const referencedProject = getProjectReferenceRedirectProject(fileName);
|
|
121349
121304
|
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
|
@@ -121664,7 +121619,6 @@ ${lanes.join("\n")}
|
|
|
121664
121619
|
/*file*/
|
|
121665
121620
|
void 0,
|
|
121666
121621
|
sourceFilePath,
|
|
121667
|
-
refPath,
|
|
121668
121622
|
/*redirectedPath*/
|
|
121669
121623
|
void 0
|
|
121670
121624
|
);
|
|
@@ -121676,7 +121630,6 @@ ${lanes.join("\n")}
|
|
|
121676
121630
|
addFileToFilesByName(
|
|
121677
121631
|
sourceFile,
|
|
121678
121632
|
sourceFilePath,
|
|
121679
|
-
refPath,
|
|
121680
121633
|
/*redirectedPath*/
|
|
121681
121634
|
void 0
|
|
121682
121635
|
);
|
|
@@ -121686,7 +121639,6 @@ ${lanes.join("\n")}
|
|
|
121686
121639
|
addFileToFilesByName(
|
|
121687
121640
|
sourceFile,
|
|
121688
121641
|
sourceFilePath,
|
|
121689
|
-
refPath,
|
|
121690
121642
|
/*redirectedPath*/
|
|
121691
121643
|
void 0
|
|
121692
121644
|
);
|
|
@@ -125381,7 +125333,7 @@ ${lanes.join("\n")}
|
|
|
125381
125333
|
const watcher = {
|
|
125382
125334
|
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
125383
125335
|
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
125384
|
-
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache());
|
|
125336
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
|
|
125385
125337
|
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
125386
125338
|
}) : noopFileWatcher,
|
|
125387
125339
|
resolutions: isSymlink ? 0 : resolutions,
|
|
@@ -125421,7 +125373,7 @@ ${lanes.join("\n")}
|
|
|
125421
125373
|
if (watcher == null ? void 0 : watcher.files)
|
|
125422
125374
|
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
125423
125375
|
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
125424
|
-
packageJsonMap.
|
|
125376
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
125425
125377
|
}
|
|
125426
125378
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
125427
125379
|
const program = resolutionHost.getCurrentProgram();
|
|
@@ -125606,14 +125558,9 @@ ${lanes.join("\n")}
|
|
|
125606
125558
|
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
125607
125559
|
}
|
|
125608
125560
|
function invalidatePackageJsonMap() {
|
|
125609
|
-
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().
|
|
125561
|
+
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
125610
125562
|
if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) {
|
|
125611
|
-
|
|
125612
|
-
const path = resolutionHost.toPath(key[0]);
|
|
125613
|
-
if (isInvalidatedFailedLookup(path)) {
|
|
125614
|
-
moduleResolutionCache.getPackageJsonInfoCache().deletePackageJsonInfo(key[0]);
|
|
125615
|
-
}
|
|
125616
|
-
}
|
|
125563
|
+
packageJsonMap.forEach((_value, path) => isInvalidatedFailedLookup(path) ? packageJsonMap.delete(path) : void 0);
|
|
125617
125564
|
}
|
|
125618
125565
|
}
|
|
125619
125566
|
function invalidateResolutionsOfFailedLookupLocations() {
|
|
@@ -126668,11 +126615,7 @@ ${lanes.join("\n")}
|
|
|
126668
126615
|
const oldProgram = getCurrentProgram();
|
|
126669
126616
|
builderProgram = createProgram2(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
126670
126617
|
resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram);
|
|
126671
|
-
updateMissingFilePathsWatch(
|
|
126672
|
-
builderProgram.getProgram(),
|
|
126673
|
-
missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()),
|
|
126674
|
-
watchMissingFilePath
|
|
126675
|
-
);
|
|
126618
|
+
updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()), watchMissingFilePath);
|
|
126676
126619
|
if (needsUpdateInTypeRootWatch) {
|
|
126677
126620
|
resolutionCache.updateTypeRootsWatch();
|
|
126678
126621
|
}
|
|
@@ -126965,15 +126908,8 @@ ${lanes.join("\n")}
|
|
|
126965
126908
|
cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind);
|
|
126966
126909
|
}
|
|
126967
126910
|
}
|
|
126968
|
-
function watchMissingFilePath(missingFilePath
|
|
126969
|
-
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
|
|
126970
|
-
missingFilePath,
|
|
126971
|
-
missingFileName,
|
|
126972
|
-
onMissingFileChange,
|
|
126973
|
-
500 /* Medium */,
|
|
126974
|
-
watchOptions,
|
|
126975
|
-
WatchType.MissingFile
|
|
126976
|
-
);
|
|
126911
|
+
function watchMissingFilePath(missingFilePath) {
|
|
126912
|
+
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, 500 /* Medium */, watchOptions, WatchType.MissingFile);
|
|
126977
126913
|
}
|
|
126978
126914
|
function onMissingFileChange(fileName, eventKind, missingFilePath) {
|
|
126979
126915
|
updateCachedSystemWithFile(fileName, missingFilePath, eventKind);
|
|
@@ -127480,7 +127416,6 @@ ${lanes.join("\n")}
|
|
|
127480
127416
|
mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
|
|
127481
127417
|
mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
|
|
127482
127418
|
mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
|
|
127483
|
-
mutateMapSkippingNewValues(state.lastCachedPackageJsonLookups, currentProjects, noopOnDelete);
|
|
127484
127419
|
if (state.watch) {
|
|
127485
127420
|
mutateMapSkippingNewValues(
|
|
127486
127421
|
state.allWatchedConfigFiles,
|
|
@@ -127729,7 +127664,7 @@ ${lanes.join("\n")}
|
|
|
127729
127664
|
return withProgramOrUndefined(action) || emptyArray;
|
|
127730
127665
|
}
|
|
127731
127666
|
function createProgram2() {
|
|
127732
|
-
var _a, _b
|
|
127667
|
+
var _a, _b;
|
|
127733
127668
|
Debug.assert(program === void 0);
|
|
127734
127669
|
if (state.options.dry) {
|
|
127735
127670
|
reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project);
|
|
@@ -127758,16 +127693,12 @@ ${lanes.join("\n")}
|
|
|
127758
127693
|
config.projectReferences
|
|
127759
127694
|
);
|
|
127760
127695
|
if (state.watch) {
|
|
127761
|
-
const entries = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().entries();
|
|
127762
127696
|
state.lastCachedPackageJsonLookups.set(
|
|
127763
127697
|
projectPath,
|
|
127764
|
-
|
|
127765
|
-
entries,
|
|
127766
|
-
([path, data]) =>
|
|
127767
|
-
|
|
127768
|
-
return [toPath2(state, path), path];
|
|
127769
|
-
}
|
|
127770
|
-
))
|
|
127698
|
+
state.moduleResolutionCache && map(
|
|
127699
|
+
state.moduleResolutionCache.getPackageJsonInfoCache().entries(),
|
|
127700
|
+
([path, data]) => [state.host.realpath && data ? toPath2(state, state.host.realpath(path)) : path, data]
|
|
127701
|
+
)
|
|
127771
127702
|
);
|
|
127772
127703
|
state.builderPrograms.set(projectPath, program);
|
|
127773
127704
|
}
|
|
@@ -128500,10 +128431,9 @@ ${lanes.join("\n")}
|
|
|
128500
128431
|
const extendedConfigStatus = forEach(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName));
|
|
128501
128432
|
if (extendedConfigStatus)
|
|
128502
128433
|
return extendedConfigStatus;
|
|
128503
|
-
const
|
|
128504
|
-
|
|
128505
|
-
|
|
128506
|
-
(path) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
|
|
128434
|
+
const dependentPackageFileStatus = forEach(
|
|
128435
|
+
state.lastCachedPackageJsonLookups.get(resolvedPath) || emptyArray,
|
|
128436
|
+
([path]) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
|
|
128507
128437
|
);
|
|
128508
128438
|
if (dependentPackageFileStatus)
|
|
128509
128439
|
return dependentPackageFileStatus;
|
|
@@ -128914,9 +128844,9 @@ ${lanes.join("\n")}
|
|
|
128914
128844
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath),
|
|
128915
128845
|
new Map(state.lastCachedPackageJsonLookups.get(resolvedPath)),
|
|
128916
128846
|
{
|
|
128917
|
-
createNewValue: (
|
|
128847
|
+
createNewValue: (path, _input) => watchFile(
|
|
128918
128848
|
state,
|
|
128919
|
-
|
|
128849
|
+
path,
|
|
128920
128850
|
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
128921
128851
|
2e3 /* High */,
|
|
128922
128852
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -134879,7 +134809,7 @@ ${lanes.join("\n")}
|
|
|
134879
134809
|
if ((importedModuleSymbol == null ? void 0 : importedModuleSymbol.declarations) && importedModuleSymbol.declarations.some((d) => isAmbientModule(d)))
|
|
134880
134810
|
return void 0;
|
|
134881
134811
|
const toImport = oldFromNew !== void 0 ? getSourceFileToImportFromResolved(importLiteral, resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew);
|
|
134882
|
-
return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile, newImportFromPath, toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0;
|
|
134812
|
+
return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile, getCanonicalFileName(newImportFromPath), toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0;
|
|
134883
134813
|
});
|
|
134884
134814
|
}
|
|
134885
134815
|
}
|
|
@@ -135736,11 +135666,11 @@ ${lanes.join("\n")}
|
|
|
135736
135666
|
const fileFromCache = sourceFileLike.get(path);
|
|
135737
135667
|
if (fileFromCache !== void 0)
|
|
135738
135668
|
return fileFromCache ? fileFromCache : void 0;
|
|
135739
|
-
if (!host.readFile || host.fileExists && !host.fileExists(
|
|
135669
|
+
if (!host.readFile || host.fileExists && !host.fileExists(path)) {
|
|
135740
135670
|
sourceFileLike.set(path, false);
|
|
135741
135671
|
return void 0;
|
|
135742
135672
|
}
|
|
135743
|
-
const text = host.readFile(
|
|
135673
|
+
const text = host.readFile(path);
|
|
135744
135674
|
const file = text ? createSourceFileLike(text) : false;
|
|
135745
135675
|
sourceFileLike.set(path, file);
|
|
135746
135676
|
return file ? file : void 0;
|
|
@@ -138313,7 +138243,7 @@ ${lanes.join("\n")}
|
|
|
138313
138243
|
const resolved = program.getResolvedModule(oldFile, moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
|
|
138314
138244
|
const fileName = (_a = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a.resolvedFileName;
|
|
138315
138245
|
if (fileName && targetSourceFile) {
|
|
138316
|
-
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.
|
|
138246
|
+
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.path, fileName, createModuleSpecifierResolutionHost(program, host));
|
|
138317
138247
|
append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
|
|
138318
138248
|
} else {
|
|
138319
138249
|
append(copiedOldImports, filterImport(i, factory.createStringLiteral(moduleSpecifierFromImport(i).text), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
|
|
@@ -138391,7 +138321,7 @@ ${lanes.join("\n")}
|
|
|
138391
138321
|
};
|
|
138392
138322
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
138393
138323
|
const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), targetFileName);
|
|
138394
|
-
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.
|
|
138324
|
+
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
138395
138325
|
const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
|
|
138396
138326
|
if (newImportDeclaration)
|
|
138397
138327
|
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
|
|
@@ -138526,7 +138456,7 @@ ${lanes.join("\n")}
|
|
|
138526
138456
|
}
|
|
138527
138457
|
function makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
|
|
138528
138458
|
const pathToTargetFile = resolvePath(getDirectoryPath(sourceFile.path), targetFileNameWithExtension);
|
|
138529
|
-
const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.
|
|
138459
|
+
const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToTargetFile, createModuleSpecifierResolutionHost(program, host));
|
|
138530
138460
|
if (useEs6Imports) {
|
|
138531
138461
|
const specifiers = imports.map((i) => factory.createImportSpecifier(
|
|
138532
138462
|
/*isTypeOnly*/
|
|
@@ -174918,7 +174848,6 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174918
174848
|
this.resolutionCache.clear();
|
|
174919
174849
|
this.resolutionCache = void 0;
|
|
174920
174850
|
this.cachedUnresolvedImportsPerFile = void 0;
|
|
174921
|
-
this.moduleSpecifierCache.clear();
|
|
174922
174851
|
this.moduleSpecifierCache = void 0;
|
|
174923
174852
|
this.directoryStructureHost = void 0;
|
|
174924
174853
|
this.exportMapCache = void 0;
|
|
@@ -175334,7 +175263,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175334
175263
|
this.program,
|
|
175335
175264
|
this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()),
|
|
175336
175265
|
// Watch the missing files
|
|
175337
|
-
(missingFilePath
|
|
175266
|
+
(missingFilePath) => this.addMissingFileWatcher(missingFilePath)
|
|
175338
175267
|
);
|
|
175339
175268
|
if (this.generatedFilesMap) {
|
|
175340
175269
|
const outPath = outFile(this.compilerOptions);
|
|
@@ -175448,7 +175377,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175448
175377
|
}
|
|
175449
175378
|
}
|
|
175450
175379
|
}
|
|
175451
|
-
addMissingFileWatcher(missingFilePath
|
|
175380
|
+
addMissingFileWatcher(missingFilePath) {
|
|
175452
175381
|
var _a;
|
|
175453
175382
|
if (isConfiguredProject(this)) {
|
|
175454
175383
|
const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(missingFilePath);
|
|
@@ -175456,7 +175385,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175456
175385
|
return noopFileWatcher;
|
|
175457
175386
|
}
|
|
175458
175387
|
const fileWatcher = this.projectService.watchFactory.watchFile(
|
|
175459
|
-
|
|
175388
|
+
missingFilePath,
|
|
175460
175389
|
(fileName, eventKind) => {
|
|
175461
175390
|
if (isConfiguredProject(this)) {
|
|
175462
175391
|
this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind);
|
|
@@ -175802,7 +175731,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175802
175731
|
/** @internal */
|
|
175803
175732
|
getPackageJsonsForAutoImport(rootDir) {
|
|
175804
175733
|
const packageJsons = this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir);
|
|
175805
|
-
this.packageJsonsForAutoImport = new Set(packageJsons.map((p) =>
|
|
175734
|
+
this.packageJsonsForAutoImport = new Set(packageJsons.map((p) => p.fileName));
|
|
175806
175735
|
return packageJsons;
|
|
175807
175736
|
}
|
|
175808
175737
|
/** @internal */
|
|
@@ -175889,7 +175818,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175889
175818
|
}
|
|
175890
175819
|
/** @internal */
|
|
175891
175820
|
watchNodeModulesForPackageJsonChanges(directoryPath) {
|
|
175892
|
-
return this.projectService.watchPackageJsonsInNodeModules(directoryPath, this);
|
|
175821
|
+
return this.projectService.watchPackageJsonsInNodeModules(this.toPath(directoryPath), this);
|
|
175893
175822
|
}
|
|
175894
175823
|
/** @internal */
|
|
175895
175824
|
getIncompleteCompletionsCache() {
|
|
@@ -177469,13 +177398,13 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177469
177398
|
(fileOrDirectory) => {
|
|
177470
177399
|
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
|
177471
177400
|
const fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
|
177472
|
-
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(
|
|
177401
|
+
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectoryPath))) {
|
|
177473
177402
|
this.logger.info(`Config: ${configFileName} Detected new package.json: ${fileOrDirectory}`);
|
|
177474
|
-
this.onAddPackageJson(
|
|
177403
|
+
this.onAddPackageJson(fileOrDirectoryPath);
|
|
177475
177404
|
}
|
|
177476
177405
|
const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
|
|
177477
177406
|
if (isIgnoredFileFromWildCardWatching({
|
|
177478
|
-
watchedDirPath:
|
|
177407
|
+
watchedDirPath: directory,
|
|
177479
177408
|
fileOrDirectory,
|
|
177480
177409
|
fileOrDirectoryPath,
|
|
177481
177410
|
configFileName,
|
|
@@ -178346,7 +178275,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178346
178275
|
if (value.info) {
|
|
178347
178276
|
project.removeFile(
|
|
178348
178277
|
value.info,
|
|
178349
|
-
project.fileExists(
|
|
178278
|
+
project.fileExists(path),
|
|
178350
178279
|
/*detachFromProject*/
|
|
178351
178280
|
true
|
|
178352
178281
|
);
|
|
@@ -178578,7 +178507,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178578
178507
|
watchClosedScriptInfo(info) {
|
|
178579
178508
|
Debug.assert(!info.fileWatcher);
|
|
178580
178509
|
if (!info.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !startsWith(info.path, this.globalCacheLocationDirectoryPath))) {
|
|
178581
|
-
const indexOfNodeModules = info.
|
|
178510
|
+
const indexOfNodeModules = info.path.indexOf("/node_modules/");
|
|
178582
178511
|
if (!this.host.getModifiedTime || indexOfNodeModules === -1) {
|
|
178583
178512
|
info.fileWatcher = this.watchFactory.watchFile(
|
|
178584
178513
|
info.fileName,
|
|
@@ -178589,12 +178518,12 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178589
178518
|
);
|
|
178590
178519
|
} else {
|
|
178591
178520
|
info.mTime = this.getModifiedTime(info);
|
|
178592
|
-
info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.
|
|
178521
|
+
info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.path.substr(0, indexOfNodeModules));
|
|
178593
178522
|
}
|
|
178594
178523
|
}
|
|
178595
178524
|
}
|
|
178596
|
-
createNodeModulesWatcher(dir
|
|
178597
|
-
|
|
178525
|
+
createNodeModulesWatcher(dir) {
|
|
178526
|
+
const watcher = this.watchFactory.watchDirectory(
|
|
178598
178527
|
dir,
|
|
178599
178528
|
(fileOrDirectory) => {
|
|
178600
178529
|
var _a;
|
|
@@ -178609,8 +178538,8 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178609
178538
|
});
|
|
178610
178539
|
}
|
|
178611
178540
|
if (result.refreshScriptInfoRefCount) {
|
|
178612
|
-
if (
|
|
178613
|
-
this.refreshScriptInfosInDirectory(
|
|
178541
|
+
if (dir === fileOrDirectoryPath) {
|
|
178542
|
+
this.refreshScriptInfosInDirectory(dir);
|
|
178614
178543
|
} else {
|
|
178615
178544
|
const info = this.getScriptInfoForPath(fileOrDirectoryPath);
|
|
178616
178545
|
if (info) {
|
|
@@ -178633,34 +178562,29 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178633
178562
|
close: () => {
|
|
178634
178563
|
var _a;
|
|
178635
178564
|
if (!result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) {
|
|
178636
|
-
watcher
|
|
178637
|
-
|
|
178638
|
-
this.nodeModulesWatchers.delete(dirPath);
|
|
178565
|
+
watcher.close();
|
|
178566
|
+
this.nodeModulesWatchers.delete(dir);
|
|
178639
178567
|
}
|
|
178640
178568
|
}
|
|
178641
178569
|
};
|
|
178642
|
-
this.nodeModulesWatchers.set(
|
|
178570
|
+
this.nodeModulesWatchers.set(dir, result);
|
|
178643
178571
|
return result;
|
|
178644
178572
|
}
|
|
178645
178573
|
/** @internal */
|
|
178646
178574
|
watchPackageJsonsInNodeModules(dir, project) {
|
|
178647
|
-
|
|
178648
|
-
const dirPath = this.toPath(dir);
|
|
178649
|
-
const watcher = this.nodeModulesWatchers.get(dirPath) || this.createNodeModulesWatcher(dir, dirPath);
|
|
178650
|
-
Debug.assert(!((_a = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.has(project.getProjectName())));
|
|
178575
|
+
const watcher = this.nodeModulesWatchers.get(dir) || this.createNodeModulesWatcher(dir);
|
|
178651
178576
|
(watcher.affectedModuleSpecifierCacheProjects || (watcher.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(project.getProjectName());
|
|
178652
178577
|
return {
|
|
178653
178578
|
close: () => {
|
|
178654
|
-
var
|
|
178655
|
-
(
|
|
178579
|
+
var _a;
|
|
178580
|
+
(_a = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.delete(project.getProjectName());
|
|
178656
178581
|
watcher.close();
|
|
178657
178582
|
}
|
|
178658
178583
|
};
|
|
178659
178584
|
}
|
|
178660
178585
|
watchClosedScriptInfoInNodeModules(dir) {
|
|
178661
178586
|
const watchDir = dir + "/node_modules";
|
|
178662
|
-
const
|
|
178663
|
-
const watcher = this.nodeModulesWatchers.get(watchedDirPath) || this.createNodeModulesWatcher(watchDir, watchedDirPath);
|
|
178587
|
+
const watcher = this.nodeModulesWatchers.get(watchDir) || this.createNodeModulesWatcher(watchDir);
|
|
178664
178588
|
watcher.refreshScriptInfoRefCount++;
|
|
178665
178589
|
return {
|
|
178666
178590
|
close: () => {
|
|
@@ -178670,7 +178594,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178670
178594
|
};
|
|
178671
178595
|
}
|
|
178672
178596
|
getModifiedTime(info) {
|
|
178673
|
-
return (this.host.getModifiedTime(info.
|
|
178597
|
+
return (this.host.getModifiedTime(info.path) || missingFileModifiedTime).getTime();
|
|
178674
178598
|
}
|
|
178675
178599
|
refreshScriptInfo(info) {
|
|
178676
178600
|
const mTime = this.getModifiedTime(info);
|
|
@@ -179859,6 +179783,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179859
179783
|
getPackageJsonsVisibleToFile(fileName, rootDir) {
|
|
179860
179784
|
const packageJsonCache = this.packageJsonCache;
|
|
179861
179785
|
const rootPath = rootDir && this.toPath(rootDir);
|
|
179786
|
+
const filePath = this.toPath(fileName);
|
|
179862
179787
|
const result = [];
|
|
179863
179788
|
const processDirectory = (directory) => {
|
|
179864
179789
|
switch (packageJsonCache.directoryHasPackageJson(directory)) {
|
|
@@ -179867,7 +179792,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179867
179792
|
return processDirectory(directory);
|
|
179868
179793
|
case -1 /* True */:
|
|
179869
179794
|
const packageJsonFileName = combinePaths(directory, "package.json");
|
|
179870
|
-
this.watchPackageJsonFile(packageJsonFileName
|
|
179795
|
+
this.watchPackageJsonFile(packageJsonFileName);
|
|
179871
179796
|
const info = packageJsonCache.getInDirectory(directory);
|
|
179872
179797
|
if (info)
|
|
179873
179798
|
result.push(info);
|
|
@@ -179876,13 +179801,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179876
179801
|
return true;
|
|
179877
179802
|
}
|
|
179878
179803
|
};
|
|
179879
|
-
forEachAncestorDirectory(getDirectoryPath(
|
|
179804
|
+
forEachAncestorDirectory(getDirectoryPath(filePath), processDirectory);
|
|
179880
179805
|
return result;
|
|
179881
179806
|
}
|
|
179882
179807
|
/** @internal */
|
|
179883
179808
|
getNearestAncestorDirectoryWithPackageJson(fileName) {
|
|
179884
179809
|
return forEachAncestorDirectory(fileName, (directory) => {
|
|
179885
|
-
switch (this.packageJsonCache.directoryHasPackageJson(directory)) {
|
|
179810
|
+
switch (this.packageJsonCache.directoryHasPackageJson(this.toPath(directory))) {
|
|
179886
179811
|
case -1 /* True */:
|
|
179887
179812
|
return directory;
|
|
179888
179813
|
case 0 /* False */:
|
|
@@ -179893,27 +179818,28 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179893
179818
|
});
|
|
179894
179819
|
}
|
|
179895
179820
|
/** @internal */
|
|
179896
|
-
watchPackageJsonFile(
|
|
179821
|
+
watchPackageJsonFile(path) {
|
|
179897
179822
|
const watchers = this.packageJsonFilesMap || (this.packageJsonFilesMap = /* @__PURE__ */ new Map());
|
|
179898
179823
|
if (!watchers.has(path)) {
|
|
179899
179824
|
this.invalidateProjectPackageJson(path);
|
|
179900
179825
|
watchers.set(
|
|
179901
179826
|
path,
|
|
179902
179827
|
this.watchFactory.watchFile(
|
|
179903
|
-
|
|
179828
|
+
path,
|
|
179904
179829
|
(fileName, eventKind) => {
|
|
179830
|
+
const path2 = this.toPath(fileName);
|
|
179905
179831
|
switch (eventKind) {
|
|
179906
179832
|
case 0 /* Created */:
|
|
179907
179833
|
return Debug.fail();
|
|
179908
179834
|
case 1 /* Changed */:
|
|
179909
|
-
this.packageJsonCache.addOrUpdate(
|
|
179910
|
-
this.invalidateProjectPackageJson(
|
|
179835
|
+
this.packageJsonCache.addOrUpdate(path2);
|
|
179836
|
+
this.invalidateProjectPackageJson(path2);
|
|
179911
179837
|
break;
|
|
179912
179838
|
case 2 /* Deleted */:
|
|
179913
|
-
this.packageJsonCache.delete(
|
|
179914
|
-
this.invalidateProjectPackageJson(
|
|
179915
|
-
watchers.get(
|
|
179916
|
-
watchers.delete(
|
|
179839
|
+
this.packageJsonCache.delete(path2);
|
|
179840
|
+
this.invalidateProjectPackageJson(path2);
|
|
179841
|
+
watchers.get(path2).close();
|
|
179842
|
+
watchers.delete(path2);
|
|
179917
179843
|
}
|
|
179918
179844
|
},
|
|
179919
179845
|
250 /* Low */,
|
|
@@ -179924,9 +179850,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179924
179850
|
}
|
|
179925
179851
|
}
|
|
179926
179852
|
/** @internal */
|
|
179927
|
-
onAddPackageJson(
|
|
179928
|
-
this.packageJsonCache.addOrUpdate(
|
|
179929
|
-
this.watchPackageJsonFile(
|
|
179853
|
+
onAddPackageJson(path) {
|
|
179854
|
+
this.packageJsonCache.addOrUpdate(path);
|
|
179855
|
+
this.watchPackageJsonFile(path);
|
|
179930
179856
|
}
|
|
179931
179857
|
/** @internal */
|
|
179932
179858
|
includePackageJsonAutoImports() {
|
|
@@ -179941,13 +179867,16 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179941
179867
|
}
|
|
179942
179868
|
/** @internal */
|
|
179943
179869
|
invalidateProjectPackageJson(packageJsonPath) {
|
|
179944
|
-
this.
|
|
179870
|
+
this.configuredProjects.forEach(invalidate);
|
|
179871
|
+
this.inferredProjects.forEach(invalidate);
|
|
179872
|
+
this.externalProjects.forEach(invalidate);
|
|
179873
|
+
function invalidate(project) {
|
|
179945
179874
|
if (packageJsonPath) {
|
|
179946
179875
|
project.onPackageJsonChange(packageJsonPath);
|
|
179947
179876
|
} else {
|
|
179948
179877
|
project.onAutoImportProviderSettingsChanged();
|
|
179949
179878
|
}
|
|
179950
|
-
}
|
|
179879
|
+
}
|
|
179951
179880
|
}
|
|
179952
179881
|
/** @internal */
|
|
179953
179882
|
getIncompleteCompletionsCache() {
|
|
@@ -179982,10 +179911,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179982
179911
|
for (const p of modulePaths) {
|
|
179983
179912
|
if (p.isInNodeModules) {
|
|
179984
179913
|
const nodeModulesPath = p.path.substring(0, p.path.indexOf(nodeModulesPathPart) + nodeModulesPathPart.length - 1);
|
|
179985
|
-
|
|
179986
|
-
if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(key2))) {
|
|
179914
|
+
if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(nodeModulesPath))) {
|
|
179987
179915
|
(containedNodeModulesWatchers || (containedNodeModulesWatchers = /* @__PURE__ */ new Map())).set(
|
|
179988
|
-
|
|
179916
|
+
nodeModulesPath,
|
|
179989
179917
|
host.watchNodeModulesForPackageJsonChanges(nodeModulesPath)
|
|
179990
179918
|
);
|
|
179991
179919
|
}
|
|
@@ -180024,7 +179952,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
180024
179952
|
}
|
|
180025
179953
|
},
|
|
180026
179954
|
clear() {
|
|
180027
|
-
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(
|
|
179955
|
+
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach((watcher) => watcher.close());
|
|
180028
179956
|
cache == null ? void 0 : cache.clear();
|
|
180029
179957
|
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.clear();
|
|
180030
179958
|
currentKey = void 0;
|
|
@@ -180065,37 +179993,37 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
180065
179993
|
const directoriesWithoutPackageJson = /* @__PURE__ */ new Map();
|
|
180066
179994
|
return {
|
|
180067
179995
|
addOrUpdate,
|
|
179996
|
+
forEach: packageJsons.forEach.bind(packageJsons),
|
|
179997
|
+
get: packageJsons.get.bind(packageJsons),
|
|
180068
179998
|
delete: (fileName) => {
|
|
180069
179999
|
packageJsons.delete(fileName);
|
|
180070
180000
|
directoriesWithoutPackageJson.set(getDirectoryPath(fileName), true);
|
|
180071
180001
|
},
|
|
180072
180002
|
getInDirectory: (directory) => {
|
|
180073
|
-
return packageJsons.get(
|
|
180003
|
+
return packageJsons.get(combinePaths(directory, "package.json")) || void 0;
|
|
180074
180004
|
},
|
|
180075
|
-
directoryHasPackageJson
|
|
180005
|
+
directoryHasPackageJson,
|
|
180076
180006
|
searchDirectoryAndAncestors: (directory) => {
|
|
180077
180007
|
forEachAncestorDirectory(directory, (ancestor) => {
|
|
180078
|
-
|
|
180079
|
-
if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) {
|
|
180008
|
+
if (directoryHasPackageJson(ancestor) !== 3 /* Maybe */) {
|
|
180080
180009
|
return true;
|
|
180081
180010
|
}
|
|
180082
|
-
const packageJsonFileName = combinePaths(ancestor, "package.json");
|
|
180011
|
+
const packageJsonFileName = host.toPath(combinePaths(ancestor, "package.json"));
|
|
180083
180012
|
if (tryFileExists(host, packageJsonFileName)) {
|
|
180084
|
-
addOrUpdate(packageJsonFileName
|
|
180013
|
+
addOrUpdate(packageJsonFileName);
|
|
180085
180014
|
} else {
|
|
180086
|
-
directoriesWithoutPackageJson.set(
|
|
180015
|
+
directoriesWithoutPackageJson.set(ancestor, true);
|
|
180087
180016
|
}
|
|
180088
180017
|
});
|
|
180089
180018
|
}
|
|
180090
180019
|
};
|
|
180091
|
-
function addOrUpdate(
|
|
180092
|
-
const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(
|
|
180093
|
-
packageJsons.set(
|
|
180094
|
-
directoriesWithoutPackageJson.delete(getDirectoryPath(
|
|
180020
|
+
function addOrUpdate(fileName) {
|
|
180021
|
+
const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host));
|
|
180022
|
+
packageJsons.set(fileName, packageJsonInfo);
|
|
180023
|
+
directoriesWithoutPackageJson.delete(getDirectoryPath(fileName));
|
|
180095
180024
|
}
|
|
180096
180025
|
function directoryHasPackageJson(directory) {
|
|
180097
|
-
|
|
180098
|
-
return packageJsons.has(combinePaths(path, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(path) ? 0 /* False */ : 3 /* Maybe */;
|
|
180026
|
+
return packageJsons.has(combinePaths(directory, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(directory) ? 0 /* False */ : 3 /* Maybe */;
|
|
180099
180027
|
}
|
|
180100
180028
|
}
|
|
180101
180029
|
var init_packageJsonCache = __esm({
|