typescript 5.4.0-dev.20231127 → 5.4.0-dev.20231128
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 +200 -160
- package/lib/tsserver.js +350 -289
- package/lib/typescript.js +349 -288
- package/lib/typingsInstaller.js +11 -7
- package/package.json +3 -3
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231128`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -17329,19 +17329,19 @@ ${lanes.join("\n")}
|
|
|
17329
17329
|
function mutateMapSkippingNewValues(map2, newMap, options) {
|
|
17330
17330
|
const { onDeleteValue, onExistingValue } = options;
|
|
17331
17331
|
map2.forEach((existingValue, key) => {
|
|
17332
|
-
|
|
17333
|
-
if (
|
|
17332
|
+
var _a;
|
|
17333
|
+
if (!(newMap == null ? void 0 : newMap.has(key))) {
|
|
17334
17334
|
map2.delete(key);
|
|
17335
17335
|
onDeleteValue(existingValue, key);
|
|
17336
17336
|
} else if (onExistingValue) {
|
|
17337
|
-
onExistingValue(existingValue,
|
|
17337
|
+
onExistingValue(existingValue, (_a = newMap.get) == null ? void 0 : _a.call(newMap, key), key);
|
|
17338
17338
|
}
|
|
17339
17339
|
});
|
|
17340
17340
|
}
|
|
17341
17341
|
function mutateMap(map2, newMap, options) {
|
|
17342
17342
|
mutateMapSkippingNewValues(map2, newMap, options);
|
|
17343
17343
|
const { createNewValue } = options;
|
|
17344
|
-
newMap.forEach((valueInNewMap, key) => {
|
|
17344
|
+
newMap == null ? void 0 : newMap.forEach((valueInNewMap, key) => {
|
|
17345
17345
|
if (!map2.has(key)) {
|
|
17346
17346
|
map2.set(key, createNewValue(key, valueInNewMap));
|
|
17347
17347
|
}
|
|
@@ -33709,8 +33709,9 @@ ${lanes.join("\n")}
|
|
|
33709
33709
|
function nextTokenIsStringLiteral() {
|
|
33710
33710
|
return nextToken() === 11 /* StringLiteral */;
|
|
33711
33711
|
}
|
|
33712
|
-
function
|
|
33713
|
-
|
|
33712
|
+
function nextTokenIsFromKeywordOrEqualsToken() {
|
|
33713
|
+
nextToken();
|
|
33714
|
+
return token() === 161 /* FromKeyword */ || token() === 64 /* EqualsToken */;
|
|
33714
33715
|
}
|
|
33715
33716
|
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
33716
33717
|
nextToken();
|
|
@@ -34407,7 +34408,7 @@ ${lanes.join("\n")}
|
|
|
34407
34408
|
identifier = parseIdentifier();
|
|
34408
34409
|
}
|
|
34409
34410
|
let isTypeOnly = false;
|
|
34410
|
-
if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(
|
|
34411
|
+
if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 /* FromKeyword */ || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) {
|
|
34411
34412
|
isTypeOnly = true;
|
|
34412
34413
|
identifier = isIdentifier2() ? parseIdentifier() : void 0;
|
|
34413
34414
|
}
|
|
@@ -37549,34 +37550,39 @@ ${lanes.join("\n")}
|
|
|
37549
37550
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
37550
37551
|
}
|
|
37551
37552
|
}
|
|
37552
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude },
|
|
37553
|
-
const rawExcludeRegex = getRegularExpressionForWildcard(exclude,
|
|
37553
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, basePath, useCaseSensitiveFileNames2) {
|
|
37554
|
+
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, basePath, "exclude");
|
|
37554
37555
|
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
37555
37556
|
const wildcardDirectories = {};
|
|
37557
|
+
const wildCardKeyToPath = /* @__PURE__ */ new Map();
|
|
37556
37558
|
if (include !== void 0) {
|
|
37557
37559
|
const recursiveKeys = [];
|
|
37558
37560
|
for (const file of include) {
|
|
37559
|
-
const spec = normalizePath(combinePaths(
|
|
37561
|
+
const spec = normalizePath(combinePaths(basePath, file));
|
|
37560
37562
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
37561
37563
|
continue;
|
|
37562
37564
|
}
|
|
37563
37565
|
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
37564
37566
|
if (match) {
|
|
37565
|
-
const { key, flags } = match;
|
|
37566
|
-
const
|
|
37567
|
+
const { key, path, flags } = match;
|
|
37568
|
+
const existingPath = wildCardKeyToPath.get(key);
|
|
37569
|
+
const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0;
|
|
37567
37570
|
if (existingFlags === void 0 || existingFlags < flags) {
|
|
37568
|
-
wildcardDirectories[
|
|
37571
|
+
wildcardDirectories[existingPath !== void 0 ? existingPath : path] = flags;
|
|
37572
|
+
if (existingPath === void 0)
|
|
37573
|
+
wildCardKeyToPath.set(key, path);
|
|
37569
37574
|
if (flags === 1 /* Recursive */) {
|
|
37570
37575
|
recursiveKeys.push(key);
|
|
37571
37576
|
}
|
|
37572
37577
|
}
|
|
37573
37578
|
}
|
|
37574
37579
|
}
|
|
37575
|
-
for (const
|
|
37576
|
-
if (hasProperty(wildcardDirectories,
|
|
37580
|
+
for (const path in wildcardDirectories) {
|
|
37581
|
+
if (hasProperty(wildcardDirectories, path)) {
|
|
37577
37582
|
for (const recursiveKey of recursiveKeys) {
|
|
37578
|
-
|
|
37579
|
-
|
|
37583
|
+
const key = toCanonicalKey(path, useCaseSensitiveFileNames2);
|
|
37584
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) {
|
|
37585
|
+
delete wildcardDirectories[path];
|
|
37580
37586
|
}
|
|
37581
37587
|
}
|
|
37582
37588
|
}
|
|
@@ -37584,6 +37590,9 @@ ${lanes.join("\n")}
|
|
|
37584
37590
|
}
|
|
37585
37591
|
return wildcardDirectories;
|
|
37586
37592
|
}
|
|
37593
|
+
function toCanonicalKey(path, useCaseSensitiveFileNames2) {
|
|
37594
|
+
return useCaseSensitiveFileNames2 ? path : toFileNameLowerCase(path);
|
|
37595
|
+
}
|
|
37587
37596
|
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
37588
37597
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
37589
37598
|
if (match) {
|
|
@@ -37591,13 +37600,16 @@ ${lanes.join("\n")}
|
|
|
37591
37600
|
const starWildcardIndex = spec.indexOf("*");
|
|
37592
37601
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
37593
37602
|
return {
|
|
37594
|
-
key:
|
|
37603
|
+
key: toCanonicalKey(match[0], useCaseSensitiveFileNames2),
|
|
37604
|
+
path: match[0],
|
|
37595
37605
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
37596
37606
|
};
|
|
37597
37607
|
}
|
|
37598
37608
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
37609
|
+
const path = removeTrailingDirectorySeparator(spec);
|
|
37599
37610
|
return {
|
|
37600
|
-
key:
|
|
37611
|
+
key: toCanonicalKey(path, useCaseSensitiveFileNames2),
|
|
37612
|
+
path,
|
|
37601
37613
|
flags: 1 /* Recursive */
|
|
37602
37614
|
};
|
|
37603
37615
|
}
|
|
@@ -39790,6 +39802,9 @@ ${lanes.join("\n")}
|
|
|
39790
39802
|
}
|
|
39791
39803
|
return result;
|
|
39792
39804
|
}
|
|
39805
|
+
function isPackageJsonInfo(entry) {
|
|
39806
|
+
return !!(entry == null ? void 0 : entry.contents);
|
|
39807
|
+
}
|
|
39793
39808
|
function compilerOptionValueToString(value) {
|
|
39794
39809
|
var _a;
|
|
39795
39810
|
if (value === null || typeof value !== "object") {
|
|
@@ -39894,7 +39909,7 @@ ${lanes.join("\n")}
|
|
|
39894
39909
|
}
|
|
39895
39910
|
function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
|
|
39896
39911
|
let cache;
|
|
39897
|
-
return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2,
|
|
39912
|
+
return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, getInternalMap };
|
|
39898
39913
|
function getPackageJsonInfo2(packageJsonPath) {
|
|
39899
39914
|
return cache == null ? void 0 : cache.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
|
|
39900
39915
|
}
|
|
@@ -39904,10 +39919,6 @@ ${lanes.join("\n")}
|
|
|
39904
39919
|
function clear2() {
|
|
39905
39920
|
cache = void 0;
|
|
39906
39921
|
}
|
|
39907
|
-
function entries() {
|
|
39908
|
-
const iter = cache == null ? void 0 : cache.entries();
|
|
39909
|
-
return iter ? arrayFrom(iter) : [];
|
|
39910
|
-
}
|
|
39911
39922
|
function getInternalMap() {
|
|
39912
39923
|
return cache;
|
|
39913
39924
|
}
|
|
@@ -40910,13 +40921,13 @@ ${lanes.join("\n")}
|
|
|
40910
40921
|
}
|
|
40911
40922
|
const existing = (_b = state.packageJsonInfoCache) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
40912
40923
|
if (existing !== void 0) {
|
|
40913
|
-
if (
|
|
40924
|
+
if (isPackageJsonInfo(existing)) {
|
|
40914
40925
|
if (traceEnabled)
|
|
40915
40926
|
trace(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath);
|
|
40916
40927
|
(_c = state.affectingLocations) == null ? void 0 : _c.push(packageJsonPath);
|
|
40917
40928
|
return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents };
|
|
40918
40929
|
} else {
|
|
40919
|
-
if (existing && traceEnabled)
|
|
40930
|
+
if (existing.directoryExists && traceEnabled)
|
|
40920
40931
|
trace(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath);
|
|
40921
40932
|
(_d = state.failedLookupLocations) == null ? void 0 : _d.push(packageJsonPath);
|
|
40922
40933
|
return void 0;
|
|
@@ -40938,7 +40949,7 @@ ${lanes.join("\n")}
|
|
|
40938
40949
|
trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
|
|
40939
40950
|
}
|
|
40940
40951
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
40941
|
-
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, directoryExists);
|
|
40952
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, { packageDirectory, directoryExists });
|
|
40942
40953
|
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
40943
40954
|
}
|
|
40944
40955
|
}
|
|
@@ -44970,8 +44981,8 @@ ${lanes.join("\n")}
|
|
|
44970
44981
|
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getPreferences({}, compilerOptions, importingSourceFile), {}, options);
|
|
44971
44982
|
}
|
|
44972
44983
|
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
|
|
44973
|
-
const info = getInfo(importingSourceFile.
|
|
44974
|
-
const modulePaths = getAllModulePaths(
|
|
44984
|
+
const info = getInfo(importingSourceFile.fileName, host);
|
|
44985
|
+
const modulePaths = getAllModulePaths(info, nodeModulesFileName, host, preferences, options);
|
|
44975
44986
|
return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
|
|
44976
44987
|
modulePath,
|
|
44977
44988
|
info,
|
|
@@ -44986,7 +44997,7 @@ ${lanes.join("\n")}
|
|
|
44986
44997
|
}
|
|
44987
44998
|
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) {
|
|
44988
44999
|
const info = getInfo(importingSourceFileName, host);
|
|
44989
|
-
const modulePaths = getAllModulePaths(
|
|
45000
|
+
const modulePaths = getAllModulePaths(info, toFileName2, host, userPreferences, options);
|
|
44990
45001
|
return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule(
|
|
44991
45002
|
modulePath,
|
|
44992
45003
|
info,
|
|
@@ -45048,7 +45059,7 @@ ${lanes.join("\n")}
|
|
|
45048
45059
|
if (!moduleSourceFile)
|
|
45049
45060
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
45050
45061
|
computedWithoutCache = true;
|
|
45051
|
-
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.
|
|
45062
|
+
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host));
|
|
45052
45063
|
const result = computeModuleSpecifiers(
|
|
45053
45064
|
modulePaths,
|
|
45054
45065
|
compilerOptions,
|
|
@@ -45062,7 +45073,7 @@ ${lanes.join("\n")}
|
|
|
45062
45073
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
45063
45074
|
}
|
|
45064
45075
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
45065
|
-
const info = getInfo(importingSourceFile.
|
|
45076
|
+
const info = getInfo(importingSourceFile.fileName, host);
|
|
45066
45077
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
45067
45078
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
45068
45079
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
@@ -45126,16 +45137,22 @@ ${lanes.join("\n")}
|
|
|
45126
45137
|
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);
|
|
45127
45138
|
}
|
|
45128
45139
|
function getInfo(importingSourceFileName, host) {
|
|
45140
|
+
importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory());
|
|
45129
45141
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
|
|
45130
45142
|
const sourceDirectory = getDirectoryPath(importingSourceFileName);
|
|
45131
|
-
return {
|
|
45143
|
+
return {
|
|
45144
|
+
getCanonicalFileName,
|
|
45145
|
+
importingSourceFileName,
|
|
45146
|
+
sourceDirectory,
|
|
45147
|
+
canonicalSourceDirectory: getCanonicalFileName(sourceDirectory)
|
|
45148
|
+
};
|
|
45132
45149
|
}
|
|
45133
45150
|
function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, importMode, { getAllowedEndingsInPreferredOrder: getAllowedEndingsInPrefererredOrder, relativePreference }, pathsOnly) {
|
|
45134
45151
|
const { baseUrl, paths, rootDirs } = compilerOptions;
|
|
45135
45152
|
if (pathsOnly && !paths) {
|
|
45136
45153
|
return void 0;
|
|
45137
45154
|
}
|
|
45138
|
-
const { sourceDirectory, getCanonicalFileName } = info;
|
|
45155
|
+
const { sourceDirectory, canonicalSourceDirectory, getCanonicalFileName } = info;
|
|
45139
45156
|
const allowedEndings = getAllowedEndingsInPrefererredOrder(importMode);
|
|
45140
45157
|
const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) || processEnding(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), allowedEndings, compilerOptions);
|
|
45141
45158
|
if (!baseUrl && !paths || relativePreference === 0 /* Relative */) {
|
|
@@ -45160,7 +45177,7 @@ ${lanes.join("\n")}
|
|
|
45160
45177
|
if (relativePreference === 3 /* ExternalNonRelative */ && !pathIsRelative(maybeNonRelative)) {
|
|
45161
45178
|
const projectDirectory = compilerOptions.configFilePath ? toPath(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) : info.getCanonicalFileName(host.getCurrentDirectory());
|
|
45162
45179
|
const modulePath = toPath(moduleFileName, projectDirectory, getCanonicalFileName);
|
|
45163
|
-
const sourceIsInternal = startsWith(
|
|
45180
|
+
const sourceIsInternal = startsWith(canonicalSourceDirectory, projectDirectory);
|
|
45164
45181
|
const targetIsInternal = startsWith(modulePath, projectDirectory);
|
|
45165
45182
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
45166
45183
|
return maybeNonRelative;
|
|
@@ -45233,8 +45250,9 @@ ${lanes.join("\n")}
|
|
|
45233
45250
|
});
|
|
45234
45251
|
return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
|
|
45235
45252
|
}
|
|
45236
|
-
function getAllModulePaths(
|
|
45253
|
+
function getAllModulePaths(info, importedFileName, host, preferences, options = {}) {
|
|
45237
45254
|
var _a;
|
|
45255
|
+
const importingFilePath = toPath(info.importingSourceFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
45238
45256
|
const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
45239
45257
|
const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host);
|
|
45240
45258
|
if (cache) {
|
|
@@ -45242,30 +45260,29 @@ ${lanes.join("\n")}
|
|
|
45242
45260
|
if (cached == null ? void 0 : cached.modulePaths)
|
|
45243
45261
|
return cached.modulePaths;
|
|
45244
45262
|
}
|
|
45245
|
-
const modulePaths = getAllModulePathsWorker(
|
|
45263
|
+
const modulePaths = getAllModulePathsWorker(info, importedFileName, host);
|
|
45246
45264
|
if (cache) {
|
|
45247
45265
|
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
45248
45266
|
}
|
|
45249
45267
|
return modulePaths;
|
|
45250
45268
|
}
|
|
45251
|
-
function getAllModulePathsWorker(
|
|
45252
|
-
const getCanonicalFileName = hostGetCanonicalFileName(host);
|
|
45269
|
+
function getAllModulePathsWorker(info, importedFileName, host) {
|
|
45253
45270
|
const allFileNames = /* @__PURE__ */ new Map();
|
|
45254
45271
|
let importedFileFromNodeModules = false;
|
|
45255
45272
|
forEachFileNameOfModule(
|
|
45256
|
-
|
|
45273
|
+
info.importingSourceFileName,
|
|
45257
45274
|
importedFileName,
|
|
45258
45275
|
host,
|
|
45259
45276
|
/*preferSymlinks*/
|
|
45260
45277
|
true,
|
|
45261
45278
|
(path, isRedirect) => {
|
|
45262
45279
|
const isInNodeModules = pathContainsNodeModules(path);
|
|
45263
|
-
allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect, isInNodeModules });
|
|
45280
|
+
allFileNames.set(path, { path: info.getCanonicalFileName(path), isRedirect, isInNodeModules });
|
|
45264
45281
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
45265
45282
|
}
|
|
45266
45283
|
);
|
|
45267
45284
|
const sortedPaths = [];
|
|
45268
|
-
for (let directory =
|
|
45285
|
+
for (let directory = info.canonicalSourceDirectory; allFileNames.size !== 0; ) {
|
|
45269
45286
|
const directoryStart = ensureTrailingDirectorySeparator(directory);
|
|
45270
45287
|
let pathsInDirectory;
|
|
45271
45288
|
allFileNames.forEach(({ path, isRedirect, isInNodeModules }, fileName) => {
|
|
@@ -45286,7 +45303,10 @@ ${lanes.join("\n")}
|
|
|
45286
45303
|
directory = newDirectory;
|
|
45287
45304
|
}
|
|
45288
45305
|
if (allFileNames.size) {
|
|
45289
|
-
const remainingPaths = arrayFrom(
|
|
45306
|
+
const remainingPaths = arrayFrom(
|
|
45307
|
+
allFileNames.entries(),
|
|
45308
|
+
([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules })
|
|
45309
|
+
);
|
|
45290
45310
|
if (remainingPaths.length > 1)
|
|
45291
45311
|
remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);
|
|
45292
45312
|
sortedPaths.push(...remainingPaths);
|
|
@@ -45446,7 +45466,7 @@ ${lanes.join("\n")}
|
|
|
45446
45466
|
}
|
|
45447
45467
|
return processEnding(shortest, allowedEndings, compilerOptions);
|
|
45448
45468
|
}
|
|
45449
|
-
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName,
|
|
45469
|
+
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
45450
45470
|
if (!host.fileExists || !host.readFile) {
|
|
45451
45471
|
return void 0;
|
|
45452
45472
|
}
|
|
@@ -45490,7 +45510,7 @@ ${lanes.join("\n")}
|
|
|
45490
45510
|
}
|
|
45491
45511
|
const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();
|
|
45492
45512
|
const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));
|
|
45493
|
-
if (!(startsWith(
|
|
45513
|
+
if (!(startsWith(canonicalSourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
|
|
45494
45514
|
return void 0;
|
|
45495
45515
|
}
|
|
45496
45516
|
const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
|
|
@@ -45503,7 +45523,7 @@ ${lanes.join("\n")}
|
|
|
45503
45523
|
let moduleFileToTry = path;
|
|
45504
45524
|
let maybeBlockedByTypesVersions = false;
|
|
45505
45525
|
const cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
45506
|
-
if (
|
|
45526
|
+
if (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
|
|
45507
45527
|
const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
45508
45528
|
const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
45509
45529
|
if (getResolvePackageJsonExports(options)) {
|
|
@@ -56992,9 +57012,13 @@ ${lanes.join("\n")}
|
|
|
56992
57012
|
function getConstraintOfTypeParameter(typeParameter) {
|
|
56993
57013
|
return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0;
|
|
56994
57014
|
}
|
|
57015
|
+
function isConstMappedType(type, depth) {
|
|
57016
|
+
const typeVariable = getHomomorphicTypeVariable(type);
|
|
57017
|
+
return !!typeVariable && isConstTypeVariable(typeVariable, depth);
|
|
57018
|
+
}
|
|
56995
57019
|
function isConstTypeVariable(type, depth = 0) {
|
|
56996
57020
|
var _a;
|
|
56997
|
-
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
57021
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 4096 /* Const */)) || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || getObjectFlags(type) & 32 /* Mapped */ && isConstMappedType(type, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
56998
57022
|
}
|
|
56999
57023
|
function getConstraintOfIndexedAccess(type) {
|
|
57000
57024
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -110941,8 +110965,8 @@ ${lanes.join("\n")}
|
|
|
110941
110965
|
const specifier = getModuleSpecifier(
|
|
110942
110966
|
options,
|
|
110943
110967
|
currentSourceFile,
|
|
110944
|
-
|
|
110945
|
-
|
|
110968
|
+
getNormalizedAbsolutePath(outputFilePath2, host.getCurrentDirectory()),
|
|
110969
|
+
getNormalizedAbsolutePath(declFileName, host.getCurrentDirectory()),
|
|
110946
110970
|
host
|
|
110947
110971
|
);
|
|
110948
110972
|
if (!pathIsRelative(specifier)) {
|
|
@@ -118405,8 +118429,8 @@ ${lanes.join("\n")}
|
|
|
118405
118429
|
}
|
|
118406
118430
|
const baseName = getBaseNameOfFileName(fileOrDirectory);
|
|
118407
118431
|
const fsQueryResult = {
|
|
118408
|
-
fileExists: host.fileExists(
|
|
118409
|
-
directoryExists: host.directoryExists(
|
|
118432
|
+
fileExists: host.fileExists(fileOrDirectory),
|
|
118433
|
+
directoryExists: host.directoryExists(fileOrDirectory)
|
|
118410
118434
|
};
|
|
118411
118435
|
if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
|
|
118412
118436
|
clearCache();
|
|
@@ -118488,23 +118512,10 @@ ${lanes.join("\n")}
|
|
|
118488
118512
|
}
|
|
118489
118513
|
});
|
|
118490
118514
|
}
|
|
118491
|
-
function updatePackageJsonWatch(lookups, packageJsonWatches, createPackageJsonWatch) {
|
|
118492
|
-
const newMap = new Map(lookups);
|
|
118493
|
-
mutateMap(
|
|
118494
|
-
packageJsonWatches,
|
|
118495
|
-
newMap,
|
|
118496
|
-
{
|
|
118497
|
-
createNewValue: createPackageJsonWatch,
|
|
118498
|
-
onDeleteValue: closeFileWatcher
|
|
118499
|
-
}
|
|
118500
|
-
);
|
|
118501
|
-
}
|
|
118502
118515
|
function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {
|
|
118503
|
-
const missingFilePaths = program.getMissingFilePaths();
|
|
118504
|
-
const newMissingFilePathMap = arrayToMap(missingFilePaths, identity, returnTrue);
|
|
118505
118516
|
mutateMap(
|
|
118506
118517
|
missingFileWatches,
|
|
118507
|
-
|
|
118518
|
+
program.getMissingFilePaths(),
|
|
118508
118519
|
{
|
|
118509
118520
|
// Watch the missing files
|
|
118510
118521
|
createNewValue: createMissingFileWatch,
|
|
@@ -118515,18 +118526,22 @@ ${lanes.join("\n")}
|
|
|
118515
118526
|
);
|
|
118516
118527
|
}
|
|
118517
118528
|
function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) {
|
|
118518
|
-
|
|
118519
|
-
|
|
118520
|
-
|
|
118521
|
-
|
|
118522
|
-
|
|
118523
|
-
|
|
118524
|
-
|
|
118525
|
-
|
|
118526
|
-
|
|
118527
|
-
|
|
118528
|
-
|
|
118529
|
-
|
|
118529
|
+
if (wildcardDirectories) {
|
|
118530
|
+
mutateMap(
|
|
118531
|
+
existingWatchedForWildcards,
|
|
118532
|
+
new Map(Object.entries(wildcardDirectories)),
|
|
118533
|
+
{
|
|
118534
|
+
// Create new watch and recursive info
|
|
118535
|
+
createNewValue: createWildcardDirectoryWatcher,
|
|
118536
|
+
// Close existing watch thats not needed any more
|
|
118537
|
+
onDeleteValue: closeFileWatcherOf,
|
|
118538
|
+
// Close existing watch that doesnt match in the flags
|
|
118539
|
+
onExistingValue: updateWildcardDirectoryWatcher
|
|
118540
|
+
}
|
|
118541
|
+
);
|
|
118542
|
+
} else {
|
|
118543
|
+
clearMap(existingWatchedForWildcards, closeFileWatcherOf);
|
|
118544
|
+
}
|
|
118530
118545
|
function createWildcardDirectoryWatcher(directory, flags) {
|
|
118531
118546
|
return {
|
|
118532
118547
|
watcher: watchDirectory(directory, flags),
|
|
@@ -119350,7 +119365,8 @@ ${lanes.join("\n")}
|
|
|
119350
119365
|
return false;
|
|
119351
119366
|
if (program.getSourceFiles().some(sourceFileNotUptoDate))
|
|
119352
119367
|
return false;
|
|
119353
|
-
|
|
119368
|
+
const missingPaths = program.getMissingFilePaths();
|
|
119369
|
+
if (missingPaths && forEachEntry(missingPaths, fileExists))
|
|
119354
119370
|
return false;
|
|
119355
119371
|
const currentOptions = program.getCompilerOptions();
|
|
119356
119372
|
if (!compareDataObjects(currentOptions, newOptions))
|
|
@@ -119557,7 +119573,7 @@ ${lanes.join("\n")}
|
|
|
119557
119573
|
let redirectTargetsMap = createMultiMap();
|
|
119558
119574
|
let usesUriStyleNodeCoreModules = false;
|
|
119559
119575
|
const filesByName = /* @__PURE__ */ new Map();
|
|
119560
|
-
let
|
|
119576
|
+
let missingFileNames = /* @__PURE__ */ new Map();
|
|
119561
119577
|
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
|
|
119562
119578
|
let resolvedProjectReferences;
|
|
119563
119579
|
let projectReferenceRedirects;
|
|
@@ -119676,12 +119692,10 @@ ${lanes.join("\n")}
|
|
|
119676
119692
|
});
|
|
119677
119693
|
}
|
|
119678
119694
|
}
|
|
119679
|
-
missingFilePaths = arrayFrom(mapDefinedIterator(filesByName.entries(), ([path, file]) => file === void 0 ? path : void 0));
|
|
119680
119695
|
files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
119681
119696
|
processingDefaultLibFiles = void 0;
|
|
119682
119697
|
processingOtherFiles = void 0;
|
|
119683
119698
|
}
|
|
119684
|
-
Debug.assert(!!missingFilePaths);
|
|
119685
119699
|
if (oldProgram && host.onReleaseOldSourceFile) {
|
|
119686
119700
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
119687
119701
|
for (const oldSourceFile of oldSourceFiles) {
|
|
@@ -119726,8 +119740,7 @@ ${lanes.join("\n")}
|
|
|
119726
119740
|
getSourceFile,
|
|
119727
119741
|
getSourceFileByPath,
|
|
119728
119742
|
getSourceFiles: () => files,
|
|
119729
|
-
getMissingFilePaths: () =>
|
|
119730
|
-
// TODO: GH#18217
|
|
119743
|
+
getMissingFilePaths: () => missingFileNames,
|
|
119731
119744
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
119732
119745
|
getFilesByNameMap: () => filesByName,
|
|
119733
119746
|
getCompilerOptions: () => options,
|
|
@@ -120154,7 +120167,7 @@ ${lanes.join("\n")}
|
|
|
120154
120167
|
const newSourceFiles = [];
|
|
120155
120168
|
const modifiedSourceFiles = [];
|
|
120156
120169
|
structureIsReused = 2 /* Completely */;
|
|
120157
|
-
if (oldProgram.getMissingFilePaths()
|
|
120170
|
+
if (forEachEntry(oldProgram.getMissingFilePaths(), (missingFileName) => host.fileExists(missingFileName))) {
|
|
120158
120171
|
return 0 /* Not */;
|
|
120159
120172
|
}
|
|
120160
120173
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
@@ -120294,7 +120307,7 @@ ${lanes.join("\n")}
|
|
|
120294
120307
|
if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames))
|
|
120295
120308
|
return 1 /* SafeModules */;
|
|
120296
120309
|
}
|
|
120297
|
-
|
|
120310
|
+
missingFileNames = oldProgram.getMissingFilePaths();
|
|
120298
120311
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
120299
120312
|
for (const newSourceFile of newSourceFiles) {
|
|
120300
120313
|
filesByName.set(newSourceFile.path, newSourceFile);
|
|
@@ -120351,7 +120364,7 @@ ${lanes.join("\n")}
|
|
|
120351
120364
|
const path = toPath3(f);
|
|
120352
120365
|
if (getSourceFileByPath(path))
|
|
120353
120366
|
return true;
|
|
120354
|
-
if (
|
|
120367
|
+
if (missingFileNames.has(path))
|
|
120355
120368
|
return false;
|
|
120356
120369
|
return host.fileExists(f);
|
|
120357
120370
|
},
|
|
@@ -121163,6 +121176,7 @@ ${lanes.join("\n")}
|
|
|
121163
121176
|
addFileToFilesByName(
|
|
121164
121177
|
file2,
|
|
121165
121178
|
path,
|
|
121179
|
+
fileName,
|
|
121166
121180
|
/*redirectedPath*/
|
|
121167
121181
|
void 0
|
|
121168
121182
|
);
|
|
@@ -121235,7 +121249,7 @@ ${lanes.join("\n")}
|
|
|
121235
121249
|
if (fileFromPackageId) {
|
|
121236
121250
|
const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path, toPath3(fileName), originalFileName, sourceFileOptions);
|
|
121237
121251
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
121238
|
-
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
121252
|
+
addFileToFilesByName(dupFile, path, fileName, redirectedPath);
|
|
121239
121253
|
addFileIncludeReason(dupFile, reason);
|
|
121240
121254
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
121241
121255
|
processingOtherFiles.push(dupFile);
|
|
@@ -121245,7 +121259,7 @@ ${lanes.join("\n")}
|
|
|
121245
121259
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
121246
121260
|
}
|
|
121247
121261
|
}
|
|
121248
|
-
addFileToFilesByName(file, path, redirectedPath);
|
|
121262
|
+
addFileToFilesByName(file, path, fileName, redirectedPath);
|
|
121249
121263
|
if (file) {
|
|
121250
121264
|
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
|
|
121251
121265
|
file.fileName = fileName;
|
|
@@ -121285,14 +121299,21 @@ ${lanes.join("\n")}
|
|
|
121285
121299
|
if (file)
|
|
121286
121300
|
fileReasons.add(file.path, reason);
|
|
121287
121301
|
}
|
|
121288
|
-
function addFileToFilesByName(file, path, redirectedPath) {
|
|
121302
|
+
function addFileToFilesByName(file, path, fileName, redirectedPath) {
|
|
121289
121303
|
if (redirectedPath) {
|
|
121290
|
-
|
|
121291
|
-
|
|
121304
|
+
updateFilesByNameMap(fileName, redirectedPath, file);
|
|
121305
|
+
updateFilesByNameMap(fileName, path, file || false);
|
|
121292
121306
|
} else {
|
|
121293
|
-
|
|
121307
|
+
updateFilesByNameMap(fileName, path, file);
|
|
121294
121308
|
}
|
|
121295
121309
|
}
|
|
121310
|
+
function updateFilesByNameMap(fileName, path, file) {
|
|
121311
|
+
filesByName.set(path, file);
|
|
121312
|
+
if (file !== void 0)
|
|
121313
|
+
missingFileNames.delete(path);
|
|
121314
|
+
else
|
|
121315
|
+
missingFileNames.set(path, fileName);
|
|
121316
|
+
}
|
|
121296
121317
|
function getProjectReferenceRedirect(fileName) {
|
|
121297
121318
|
const referencedProject = getProjectReferenceRedirectProject(fileName);
|
|
121298
121319
|
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
|
@@ -121613,6 +121634,7 @@ ${lanes.join("\n")}
|
|
|
121613
121634
|
/*file*/
|
|
121614
121635
|
void 0,
|
|
121615
121636
|
sourceFilePath,
|
|
121637
|
+
refPath,
|
|
121616
121638
|
/*redirectedPath*/
|
|
121617
121639
|
void 0
|
|
121618
121640
|
);
|
|
@@ -121624,6 +121646,7 @@ ${lanes.join("\n")}
|
|
|
121624
121646
|
addFileToFilesByName(
|
|
121625
121647
|
sourceFile,
|
|
121626
121648
|
sourceFilePath,
|
|
121649
|
+
refPath,
|
|
121627
121650
|
/*redirectedPath*/
|
|
121628
121651
|
void 0
|
|
121629
121652
|
);
|
|
@@ -121633,6 +121656,7 @@ ${lanes.join("\n")}
|
|
|
121633
121656
|
addFileToFilesByName(
|
|
121634
121657
|
sourceFile,
|
|
121635
121658
|
sourceFilePath,
|
|
121659
|
+
refPath,
|
|
121636
121660
|
/*redirectedPath*/
|
|
121637
121661
|
void 0
|
|
121638
121662
|
);
|
|
@@ -125611,8 +125635,8 @@ ${lanes.join("\n")}
|
|
|
125611
125635
|
function closeTypeRootsWatch() {
|
|
125612
125636
|
clearMap(typeRootsWatches, closeFileWatcher);
|
|
125613
125637
|
}
|
|
125614
|
-
function createTypeRootsWatch(
|
|
125615
|
-
return canWatchTypeRootPath(
|
|
125638
|
+
function createTypeRootsWatch(typeRoot) {
|
|
125639
|
+
return canWatchTypeRootPath(typeRoot) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => {
|
|
125616
125640
|
const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
|
|
125617
125641
|
if (cachedDirectoryStructureHost) {
|
|
125618
125642
|
cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
|
@@ -125621,7 +125645,7 @@ ${lanes.join("\n")}
|
|
|
125621
125645
|
resolutionHost.onChangedAutomaticTypeDirectiveNames();
|
|
125622
125646
|
const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
|
|
125623
125647
|
typeRoot,
|
|
125624
|
-
|
|
125648
|
+
resolutionHost.toPath(typeRoot),
|
|
125625
125649
|
rootPath,
|
|
125626
125650
|
rootPathComponents,
|
|
125627
125651
|
getCurrentDirectory,
|
|
@@ -125642,7 +125666,7 @@ ${lanes.join("\n")}
|
|
|
125642
125666
|
if (typeRoots) {
|
|
125643
125667
|
mutateMap(
|
|
125644
125668
|
typeRootsWatches,
|
|
125645
|
-
|
|
125669
|
+
new Set(typeRoots),
|
|
125646
125670
|
{
|
|
125647
125671
|
createNewValue: createTypeRootsWatch,
|
|
125648
125672
|
onDeleteValue: closeFileWatcher
|
|
@@ -126609,7 +126633,11 @@ ${lanes.join("\n")}
|
|
|
126609
126633
|
const oldProgram = getCurrentProgram();
|
|
126610
126634
|
builderProgram = createProgram2(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
126611
126635
|
resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram);
|
|
126612
|
-
updateMissingFilePathsWatch(
|
|
126636
|
+
updateMissingFilePathsWatch(
|
|
126637
|
+
builderProgram.getProgram(),
|
|
126638
|
+
missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()),
|
|
126639
|
+
watchMissingFilePath
|
|
126640
|
+
);
|
|
126613
126641
|
if (needsUpdateInTypeRootWatch) {
|
|
126614
126642
|
resolutionCache.updateTypeRootsWatch();
|
|
126615
126643
|
}
|
|
@@ -126902,8 +126930,15 @@ ${lanes.join("\n")}
|
|
|
126902
126930
|
cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind);
|
|
126903
126931
|
}
|
|
126904
126932
|
}
|
|
126905
|
-
function watchMissingFilePath(missingFilePath) {
|
|
126906
|
-
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
|
|
126933
|
+
function watchMissingFilePath(missingFilePath, missingFileName) {
|
|
126934
|
+
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
|
|
126935
|
+
missingFilePath,
|
|
126936
|
+
missingFileName,
|
|
126937
|
+
onMissingFileChange,
|
|
126938
|
+
500 /* Medium */,
|
|
126939
|
+
watchOptions,
|
|
126940
|
+
WatchType.MissingFile
|
|
126941
|
+
);
|
|
126907
126942
|
}
|
|
126908
126943
|
function onMissingFileChange(fileName, eventKind, missingFilePath) {
|
|
126909
126944
|
updateCachedSystemWithFile(fileName, missingFilePath, eventKind);
|
|
@@ -126915,15 +126950,11 @@ ${lanes.join("\n")}
|
|
|
126915
126950
|
}
|
|
126916
126951
|
}
|
|
126917
126952
|
function watchConfigFileWildCardDirectories() {
|
|
126918
|
-
|
|
126919
|
-
|
|
126920
|
-
|
|
126921
|
-
|
|
126922
|
-
|
|
126923
|
-
);
|
|
126924
|
-
} else if (watchedWildcardDirectories) {
|
|
126925
|
-
clearMap(watchedWildcardDirectories, closeFileWatcherOf);
|
|
126926
|
-
}
|
|
126953
|
+
updateWatchingWildcardDirectories(
|
|
126954
|
+
watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()),
|
|
126955
|
+
wildcardDirectories,
|
|
126956
|
+
watchWildcardDirectory
|
|
126957
|
+
);
|
|
126927
126958
|
}
|
|
126928
126959
|
function watchWildcardDirectory(directory, flags) {
|
|
126929
126960
|
return watchDirectory(
|
|
@@ -126995,7 +127026,7 @@ ${lanes.join("\n")}
|
|
|
126995
127026
|
);
|
|
126996
127027
|
}
|
|
126997
127028
|
function watchReferencedProject(configFileName2, configPath, commandLine) {
|
|
126998
|
-
var _a, _b, _c, _d
|
|
127029
|
+
var _a, _b, _c, _d;
|
|
126999
127030
|
commandLine.watcher || (commandLine.watcher = watchFile2(
|
|
127000
127031
|
configFileName2,
|
|
127001
127032
|
(_fileName, eventKind) => {
|
|
@@ -127010,55 +127041,50 @@ ${lanes.join("\n")}
|
|
|
127010
127041
|
((_a = commandLine.parsedCommandLine) == null ? void 0 : _a.watchOptions) || watchOptions,
|
|
127011
127042
|
WatchType.ConfigFileOfReferencedProject
|
|
127012
127043
|
));
|
|
127013
|
-
|
|
127014
|
-
|
|
127015
|
-
|
|
127016
|
-
|
|
127017
|
-
|
|
127018
|
-
|
|
127019
|
-
|
|
127020
|
-
|
|
127021
|
-
(fileOrDirectory)
|
|
127022
|
-
|
|
127023
|
-
|
|
127024
|
-
|
|
127025
|
-
|
|
127026
|
-
|
|
127027
|
-
|
|
127028
|
-
|
|
127029
|
-
|
|
127030
|
-
|
|
127031
|
-
|
|
127032
|
-
|
|
127033
|
-
|
|
127034
|
-
|
|
127035
|
-
|
|
127036
|
-
|
|
127037
|
-
|
|
127038
|
-
|
|
127039
|
-
|
|
127040
|
-
|
|
127041
|
-
|
|
127042
|
-
|
|
127043
|
-
|
|
127044
|
-
|
|
127045
|
-
|
|
127046
|
-
|
|
127047
|
-
|
|
127048
|
-
|
|
127049
|
-
|
|
127050
|
-
|
|
127051
|
-
|
|
127052
|
-
|
|
127053
|
-
);
|
|
127054
|
-
} else if (commandLine.watchedDirectories) {
|
|
127055
|
-
clearMap(commandLine.watchedDirectories, closeFileWatcherOf);
|
|
127056
|
-
commandLine.watchedDirectories = void 0;
|
|
127057
|
-
}
|
|
127044
|
+
updateWatchingWildcardDirectories(
|
|
127045
|
+
commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()),
|
|
127046
|
+
(_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories,
|
|
127047
|
+
(directory, flags) => {
|
|
127048
|
+
var _a2;
|
|
127049
|
+
return watchDirectory(
|
|
127050
|
+
directory,
|
|
127051
|
+
(fileOrDirectory) => {
|
|
127052
|
+
const fileOrDirectoryPath = toPath3(fileOrDirectory);
|
|
127053
|
+
if (cachedDirectoryStructureHost) {
|
|
127054
|
+
cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
|
127055
|
+
}
|
|
127056
|
+
nextSourceFileVersion(fileOrDirectoryPath);
|
|
127057
|
+
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
127058
|
+
if (!(config == null ? void 0 : config.parsedCommandLine))
|
|
127059
|
+
return;
|
|
127060
|
+
if (isIgnoredFileFromWildCardWatching({
|
|
127061
|
+
watchedDirPath: toPath3(directory),
|
|
127062
|
+
fileOrDirectory,
|
|
127063
|
+
fileOrDirectoryPath,
|
|
127064
|
+
configFileName: configFileName2,
|
|
127065
|
+
options: config.parsedCommandLine.options,
|
|
127066
|
+
program: config.parsedCommandLine.fileNames,
|
|
127067
|
+
currentDirectory,
|
|
127068
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
127069
|
+
writeLog,
|
|
127070
|
+
toPath: toPath3
|
|
127071
|
+
}))
|
|
127072
|
+
return;
|
|
127073
|
+
if (config.updateLevel !== 2 /* Full */) {
|
|
127074
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
127075
|
+
scheduleProgramUpdate();
|
|
127076
|
+
}
|
|
127077
|
+
},
|
|
127078
|
+
flags,
|
|
127079
|
+
((_a2 = commandLine.parsedCommandLine) == null ? void 0 : _a2.watchOptions) || watchOptions,
|
|
127080
|
+
WatchType.WildcardDirectoryOfReferencedProject
|
|
127081
|
+
);
|
|
127082
|
+
}
|
|
127083
|
+
);
|
|
127058
127084
|
updateExtendedConfigFilesWatches(
|
|
127059
127085
|
configPath,
|
|
127060
|
-
(
|
|
127061
|
-
((
|
|
127086
|
+
(_c = commandLine.parsedCommandLine) == null ? void 0 : _c.options,
|
|
127087
|
+
((_d = commandLine.parsedCommandLine) == null ? void 0 : _d.watchOptions) || watchOptions,
|
|
127062
127088
|
WatchType.ExtendedConfigOfReferencedProject
|
|
127063
127089
|
);
|
|
127064
127090
|
}
|
|
@@ -127396,9 +127422,9 @@ ${lanes.join("\n")}
|
|
|
127396
127422
|
function createStateBuildOrder(state) {
|
|
127397
127423
|
const buildOrder = createBuildOrder(state, state.rootNames.map((f) => resolveProjectName(state, f)));
|
|
127398
127424
|
state.resolvedConfigFilePaths.clear();
|
|
127399
|
-
const currentProjects = new
|
|
127425
|
+
const currentProjects = new Set(
|
|
127400
127426
|
getBuildOrderFromAnyBuildOrder(buildOrder).map(
|
|
127401
|
-
(resolved) =>
|
|
127427
|
+
(resolved) => toResolvedConfigFilePath(state, resolved)
|
|
127402
127428
|
)
|
|
127403
127429
|
);
|
|
127404
127430
|
const noopOnDelete = { onDeleteValue: noop };
|
|
@@ -127410,6 +127436,7 @@ ${lanes.join("\n")}
|
|
|
127410
127436
|
mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
|
|
127411
127437
|
mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
|
|
127412
127438
|
mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
|
|
127439
|
+
mutateMapSkippingNewValues(state.lastCachedPackageJsonLookups, currentProjects, noopOnDelete);
|
|
127413
127440
|
if (state.watch) {
|
|
127414
127441
|
mutateMapSkippingNewValues(
|
|
127415
127442
|
state.allWatchedConfigFiles,
|
|
@@ -127658,7 +127685,7 @@ ${lanes.join("\n")}
|
|
|
127658
127685
|
return withProgramOrUndefined(action) || emptyArray;
|
|
127659
127686
|
}
|
|
127660
127687
|
function createProgram2() {
|
|
127661
|
-
var _a, _b;
|
|
127688
|
+
var _a, _b, _c;
|
|
127662
127689
|
Debug.assert(program === void 0);
|
|
127663
127690
|
if (state.options.dry) {
|
|
127664
127691
|
reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project);
|
|
@@ -127687,12 +127714,13 @@ ${lanes.join("\n")}
|
|
|
127687
127714
|
config.projectReferences
|
|
127688
127715
|
);
|
|
127689
127716
|
if (state.watch) {
|
|
127717
|
+
const internalMap = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().getInternalMap();
|
|
127690
127718
|
state.lastCachedPackageJsonLookups.set(
|
|
127691
127719
|
projectPath,
|
|
127692
|
-
|
|
127693
|
-
|
|
127694
|
-
(
|
|
127695
|
-
)
|
|
127720
|
+
internalMap && new Set(arrayFrom(
|
|
127721
|
+
internalMap.values(),
|
|
127722
|
+
(data) => state.host.realpath && (isPackageJsonInfo(data) || data.directoryExists) ? state.host.realpath(combinePaths(data.packageDirectory, "package.json")) : combinePaths(data.packageDirectory, "package.json")
|
|
127723
|
+
))
|
|
127696
127724
|
);
|
|
127697
127725
|
state.builderPrograms.set(projectPath, program);
|
|
127698
127726
|
}
|
|
@@ -128425,9 +128453,10 @@ ${lanes.join("\n")}
|
|
|
128425
128453
|
const extendedConfigStatus = forEach(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName));
|
|
128426
128454
|
if (extendedConfigStatus)
|
|
128427
128455
|
return extendedConfigStatus;
|
|
128428
|
-
const
|
|
128429
|
-
|
|
128430
|
-
|
|
128456
|
+
const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath);
|
|
128457
|
+
const dependentPackageFileStatus = packageJsonLookups && forEachKey(
|
|
128458
|
+
packageJsonLookups,
|
|
128459
|
+
(path) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
|
|
128431
128460
|
);
|
|
128432
128461
|
if (dependentPackageFileStatus)
|
|
128433
128462
|
return dependentPackageFileStatus;
|
|
@@ -128784,7 +128813,7 @@ ${lanes.join("\n")}
|
|
|
128784
128813
|
return;
|
|
128785
128814
|
updateWatchingWildcardDirectories(
|
|
128786
128815
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath),
|
|
128787
|
-
|
|
128816
|
+
parsed.wildcardDirectories,
|
|
128788
128817
|
(dir, flags) => state.watchDirectory(
|
|
128789
128818
|
dir,
|
|
128790
128819
|
(fileOrDirectory) => {
|
|
@@ -128816,9 +128845,9 @@ ${lanes.join("\n")}
|
|
|
128816
128845
|
return;
|
|
128817
128846
|
mutateMap(
|
|
128818
128847
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath),
|
|
128819
|
-
|
|
128848
|
+
new Set(parsed.fileNames),
|
|
128820
128849
|
{
|
|
128821
|
-
createNewValue: (
|
|
128850
|
+
createNewValue: (input) => watchFile(
|
|
128822
128851
|
state,
|
|
128823
128852
|
input,
|
|
128824
128853
|
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
@@ -128836,11 +128865,11 @@ ${lanes.join("\n")}
|
|
|
128836
128865
|
return;
|
|
128837
128866
|
mutateMap(
|
|
128838
128867
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath),
|
|
128839
|
-
|
|
128868
|
+
state.lastCachedPackageJsonLookups.get(resolvedPath),
|
|
128840
128869
|
{
|
|
128841
|
-
createNewValue: (
|
|
128870
|
+
createNewValue: (input) => watchFile(
|
|
128842
128871
|
state,
|
|
128843
|
-
|
|
128872
|
+
input,
|
|
128844
128873
|
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
128845
128874
|
2e3 /* High */,
|
|
128846
128875
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -134803,7 +134832,7 @@ ${lanes.join("\n")}
|
|
|
134803
134832
|
if ((importedModuleSymbol == null ? void 0 : importedModuleSymbol.declarations) && importedModuleSymbol.declarations.some((d) => isAmbientModule(d)))
|
|
134804
134833
|
return void 0;
|
|
134805
134834
|
const toImport = oldFromNew !== void 0 ? getSourceFileToImportFromResolved(importLiteral, resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew);
|
|
134806
|
-
return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile,
|
|
134835
|
+
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;
|
|
134807
134836
|
});
|
|
134808
134837
|
}
|
|
134809
134838
|
}
|
|
@@ -135660,11 +135689,11 @@ ${lanes.join("\n")}
|
|
|
135660
135689
|
const fileFromCache = sourceFileLike.get(path);
|
|
135661
135690
|
if (fileFromCache !== void 0)
|
|
135662
135691
|
return fileFromCache ? fileFromCache : void 0;
|
|
135663
|
-
if (!host.readFile || host.fileExists && !host.fileExists(
|
|
135692
|
+
if (!host.readFile || host.fileExists && !host.fileExists(fileName)) {
|
|
135664
135693
|
sourceFileLike.set(path, false);
|
|
135665
135694
|
return void 0;
|
|
135666
135695
|
}
|
|
135667
|
-
const text = host.readFile(
|
|
135696
|
+
const text = host.readFile(fileName);
|
|
135668
135697
|
const file = text ? createSourceFileLike(text) : false;
|
|
135669
135698
|
sourceFileLike.set(path, file);
|
|
135670
135699
|
return file ? file : void 0;
|
|
@@ -138237,7 +138266,7 @@ ${lanes.join("\n")}
|
|
|
138237
138266
|
const resolved = program.getResolvedModule(oldFile, moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
|
|
138238
138267
|
const fileName = (_a = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a.resolvedFileName;
|
|
138239
138268
|
if (fileName && targetSourceFile) {
|
|
138240
|
-
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.
|
|
138269
|
+
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.fileName, fileName, createModuleSpecifierResolutionHost(program, host));
|
|
138241
138270
|
append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
|
|
138242
138271
|
} else {
|
|
138243
138272
|
append(copiedOldImports, filterImport(i, factory.createStringLiteral(moduleSpecifierFromImport(i).text), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
|
|
@@ -138315,7 +138344,7 @@ ${lanes.join("\n")}
|
|
|
138315
138344
|
};
|
|
138316
138345
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
138317
138346
|
const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), targetFileName);
|
|
138318
|
-
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.
|
|
138347
|
+
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
138319
138348
|
const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove);
|
|
138320
138349
|
if (newImportDeclaration)
|
|
138321
138350
|
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
|
|
@@ -138450,7 +138479,7 @@ ${lanes.join("\n")}
|
|
|
138450
138479
|
}
|
|
138451
138480
|
function makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
|
|
138452
138481
|
const pathToTargetFile = resolvePath(getDirectoryPath(sourceFile.path), targetFileNameWithExtension);
|
|
138453
|
-
const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.
|
|
138482
|
+
const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFile, createModuleSpecifierResolutionHost(program, host));
|
|
138454
138483
|
if (useEs6Imports) {
|
|
138455
138484
|
const specifiers = imports.map((i) => factory.createImportSpecifier(
|
|
138456
138485
|
/*isTypeOnly*/
|
|
@@ -165157,6 +165186,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165157
165186
|
parts.push({ text: tokenToString(node.operator) });
|
|
165158
165187
|
visitForDisplayParts(node.operand);
|
|
165159
165188
|
break;
|
|
165189
|
+
case 197 /* ThisType */:
|
|
165190
|
+
Debug.assertNode(node, isThisTypeNode);
|
|
165191
|
+
parts.push({ text: "this" });
|
|
165192
|
+
break;
|
|
165160
165193
|
default:
|
|
165161
165194
|
Debug.failBadSyntaxKind(node);
|
|
165162
165195
|
}
|
|
@@ -174826,6 +174859,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174826
174859
|
return path === options.configFilePath ? options.configFile : this.getSourceFile(path);
|
|
174827
174860
|
}
|
|
174828
174861
|
close() {
|
|
174862
|
+
var _a;
|
|
174829
174863
|
this.projectService.typingsCache.onProjectClosed(this);
|
|
174830
174864
|
this.closeWatchingTypingLocations();
|
|
174831
174865
|
this.cleanupProgram();
|
|
@@ -174842,6 +174876,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174842
174876
|
this.resolutionCache.clear();
|
|
174843
174877
|
this.resolutionCache = void 0;
|
|
174844
174878
|
this.cachedUnresolvedImportsPerFile = void 0;
|
|
174879
|
+
(_a = this.packageJsonWatches) == null ? void 0 : _a.forEach((watcher) => {
|
|
174880
|
+
watcher.projects.delete(this);
|
|
174881
|
+
watcher.close();
|
|
174882
|
+
});
|
|
174883
|
+
this.packageJsonWatches = void 0;
|
|
174884
|
+
this.moduleSpecifierCache.clear();
|
|
174845
174885
|
this.moduleSpecifierCache = void 0;
|
|
174846
174886
|
this.directoryStructureHost = void 0;
|
|
174847
174887
|
this.exportMapCache = void 0;
|
|
@@ -175036,13 +175076,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175036
175076
|
}
|
|
175037
175077
|
}
|
|
175038
175078
|
/** @internal */
|
|
175039
|
-
onPackageJsonChange(
|
|
175040
|
-
|
|
175041
|
-
if (
|
|
175042
|
-
this.
|
|
175043
|
-
if (this.autoImportProviderHost) {
|
|
175044
|
-
this.autoImportProviderHost.markAsDirty();
|
|
175045
|
-
}
|
|
175079
|
+
onPackageJsonChange() {
|
|
175080
|
+
this.moduleSpecifierCache.clear();
|
|
175081
|
+
if (this.autoImportProviderHost) {
|
|
175082
|
+
this.autoImportProviderHost.markAsDirty();
|
|
175046
175083
|
}
|
|
175047
175084
|
}
|
|
175048
175085
|
/** @internal */
|
|
@@ -175257,7 +175294,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175257
175294
|
this.program,
|
|
175258
175295
|
this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()),
|
|
175259
175296
|
// Watch the missing files
|
|
175260
|
-
(missingFilePath) => this.addMissingFileWatcher(missingFilePath)
|
|
175297
|
+
(missingFilePath, missingFileName) => this.addMissingFileWatcher(missingFilePath, missingFileName)
|
|
175261
175298
|
);
|
|
175262
175299
|
if (this.generatedFilesMap) {
|
|
175263
175300
|
const outPath = outFile(this.compilerOptions);
|
|
@@ -175371,7 +175408,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175371
175408
|
}
|
|
175372
175409
|
}
|
|
175373
175410
|
}
|
|
175374
|
-
addMissingFileWatcher(missingFilePath) {
|
|
175411
|
+
addMissingFileWatcher(missingFilePath, missingFileName) {
|
|
175375
175412
|
var _a;
|
|
175376
175413
|
if (isConfiguredProject(this)) {
|
|
175377
175414
|
const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(missingFilePath);
|
|
@@ -175379,7 +175416,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175379
175416
|
return noopFileWatcher;
|
|
175380
175417
|
}
|
|
175381
175418
|
const fileWatcher = this.projectService.watchFactory.watchFile(
|
|
175382
|
-
|
|
175419
|
+
getNormalizedAbsolutePath(missingFileName, this.currentDirectory),
|
|
175383
175420
|
(fileName, eventKind) => {
|
|
175384
175421
|
if (isConfiguredProject(this)) {
|
|
175385
175422
|
this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind);
|
|
@@ -175716,7 +175753,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175716
175753
|
getPackageJsonsVisibleToFile(fileName, rootDir) {
|
|
175717
175754
|
if (this.projectService.serverMode !== 0 /* Semantic */)
|
|
175718
175755
|
return emptyArray2;
|
|
175719
|
-
return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir);
|
|
175756
|
+
return this.projectService.getPackageJsonsVisibleToFile(fileName, this, rootDir);
|
|
175720
175757
|
}
|
|
175721
175758
|
/** @internal */
|
|
175722
175759
|
getNearestAncestorDirectoryWithPackageJson(fileName) {
|
|
@@ -175724,9 +175761,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175724
175761
|
}
|
|
175725
175762
|
/** @internal */
|
|
175726
175763
|
getPackageJsonsForAutoImport(rootDir) {
|
|
175727
|
-
|
|
175728
|
-
this.packageJsonsForAutoImport = new Set(packageJsons.map((p) => p.fileName));
|
|
175729
|
-
return packageJsons;
|
|
175764
|
+
return this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir);
|
|
175730
175765
|
}
|
|
175731
175766
|
/** @internal */
|
|
175732
175767
|
getPackageJsonCache() {
|
|
@@ -175812,7 +175847,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175812
175847
|
}
|
|
175813
175848
|
/** @internal */
|
|
175814
175849
|
watchNodeModulesForPackageJsonChanges(directoryPath) {
|
|
175815
|
-
return this.projectService.watchPackageJsonsInNodeModules(
|
|
175850
|
+
return this.projectService.watchPackageJsonsInNodeModules(directoryPath, this);
|
|
175816
175851
|
}
|
|
175817
175852
|
/** @internal */
|
|
175818
175853
|
getIncompleteCompletionsCache() {
|
|
@@ -177387,18 +177422,20 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177387
177422
|
* @internal
|
|
177388
177423
|
*/
|
|
177389
177424
|
watchWildcardDirectory(directory, flags, configFileName, config) {
|
|
177390
|
-
|
|
177425
|
+
let watcher = this.watchFactory.watchDirectory(
|
|
177391
177426
|
directory,
|
|
177392
177427
|
(fileOrDirectory) => {
|
|
177393
177428
|
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
|
177394
177429
|
const fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
|
177395
|
-
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(
|
|
177396
|
-
|
|
177397
|
-
this.
|
|
177430
|
+
if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectory))) {
|
|
177431
|
+
const file = this.getNormalizedAbsolutePath(fileOrDirectory);
|
|
177432
|
+
this.logger.info(`Config: ${configFileName} Detected new package.json: ${file}`);
|
|
177433
|
+
this.packageJsonCache.addOrUpdate(file, fileOrDirectoryPath);
|
|
177434
|
+
this.watchPackageJsonFile(file, fileOrDirectoryPath, result);
|
|
177398
177435
|
}
|
|
177399
177436
|
const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
|
|
177400
177437
|
if (isIgnoredFileFromWildCardWatching({
|
|
177401
|
-
watchedDirPath: directory,
|
|
177438
|
+
watchedDirPath: this.toPath(directory),
|
|
177402
177439
|
fileOrDirectory,
|
|
177403
177440
|
fileOrDirectoryPath,
|
|
177404
177441
|
configFileName,
|
|
@@ -177443,6 +177480,22 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177443
177480
|
WatchType.WildcardDirectory,
|
|
177444
177481
|
configFileName
|
|
177445
177482
|
);
|
|
177483
|
+
const result = {
|
|
177484
|
+
packageJsonWatches: void 0,
|
|
177485
|
+
close() {
|
|
177486
|
+
var _a;
|
|
177487
|
+
if (watcher) {
|
|
177488
|
+
watcher.close();
|
|
177489
|
+
watcher = void 0;
|
|
177490
|
+
(_a = result.packageJsonWatches) == null ? void 0 : _a.forEach((watcher2) => {
|
|
177491
|
+
watcher2.projects.delete(result);
|
|
177492
|
+
watcher2.close();
|
|
177493
|
+
});
|
|
177494
|
+
result.packageJsonWatches = void 0;
|
|
177495
|
+
}
|
|
177496
|
+
}
|
|
177497
|
+
};
|
|
177498
|
+
return result;
|
|
177446
177499
|
}
|
|
177447
177500
|
/** @internal */
|
|
177448
177501
|
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
|
|
@@ -178187,7 +178240,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178187
178240
|
config.watchedDirectoriesStale = false;
|
|
178188
178241
|
updateWatchingWildcardDirectories(
|
|
178189
178242
|
config.watchedDirectories || (config.watchedDirectories = /* @__PURE__ */ new Map()),
|
|
178190
|
-
|
|
178243
|
+
config.parsedCommandLine.wildcardDirectories,
|
|
178191
178244
|
// Create new directory watcher
|
|
178192
178245
|
(directory, flags) => this.watchWildcardDirectory(directory, flags, configFileName, config)
|
|
178193
178246
|
);
|
|
@@ -178269,7 +178322,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
178269
178322
|
if (value.info) {
|
|
178270
178323
|
project.removeFile(
|
|
178271
178324
|
value.info,
|
|
178272
|
-
project.fileExists(
|
|
178325
|
+
project.fileExists(value.info.fileName),
|
|
178273
178326
|
/*detachFromProject*/
|
|
178274
178327
|
true
|
|
178275
178328
|
);
|
|
@@ -178501,7 +178554,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178501
178554
|
watchClosedScriptInfo(info) {
|
|
178502
178555
|
Debug.assert(!info.fileWatcher);
|
|
178503
178556
|
if (!info.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !startsWith(info.path, this.globalCacheLocationDirectoryPath))) {
|
|
178504
|
-
const indexOfNodeModules = info.
|
|
178557
|
+
const indexOfNodeModules = info.fileName.indexOf("/node_modules/");
|
|
178505
178558
|
if (!this.host.getModifiedTime || indexOfNodeModules === -1) {
|
|
178506
178559
|
info.fileWatcher = this.watchFactory.watchFile(
|
|
178507
178560
|
info.fileName,
|
|
@@ -178512,12 +178565,12 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178512
178565
|
);
|
|
178513
178566
|
} else {
|
|
178514
178567
|
info.mTime = this.getModifiedTime(info);
|
|
178515
|
-
info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.
|
|
178568
|
+
info.fileWatcher = this.watchClosedScriptInfoInNodeModules(info.fileName.substring(0, indexOfNodeModules));
|
|
178516
178569
|
}
|
|
178517
178570
|
}
|
|
178518
178571
|
}
|
|
178519
|
-
createNodeModulesWatcher(dir) {
|
|
178520
|
-
|
|
178572
|
+
createNodeModulesWatcher(dir, dirPath) {
|
|
178573
|
+
let watcher = this.watchFactory.watchDirectory(
|
|
178521
178574
|
dir,
|
|
178522
178575
|
(fileOrDirectory) => {
|
|
178523
178576
|
var _a;
|
|
@@ -178526,14 +178579,14 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178526
178579
|
return;
|
|
178527
178580
|
const basename = getBaseFileName(fileOrDirectoryPath);
|
|
178528
178581
|
if (((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size) && (basename === "package.json" || basename === "node_modules")) {
|
|
178529
|
-
result.affectedModuleSpecifierCacheProjects.forEach((
|
|
178530
|
-
var _a2
|
|
178531
|
-
(
|
|
178582
|
+
result.affectedModuleSpecifierCacheProjects.forEach((project) => {
|
|
178583
|
+
var _a2;
|
|
178584
|
+
(_a2 = project.getModuleSpecifierCache()) == null ? void 0 : _a2.clear();
|
|
178532
178585
|
});
|
|
178533
178586
|
}
|
|
178534
178587
|
if (result.refreshScriptInfoRefCount) {
|
|
178535
|
-
if (
|
|
178536
|
-
this.refreshScriptInfosInDirectory(
|
|
178588
|
+
if (dirPath === fileOrDirectoryPath) {
|
|
178589
|
+
this.refreshScriptInfosInDirectory(dirPath);
|
|
178537
178590
|
} else {
|
|
178538
178591
|
const info = this.getScriptInfoForPath(fileOrDirectoryPath);
|
|
178539
178592
|
if (info) {
|
|
@@ -178555,30 +178608,35 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178555
178608
|
affectedModuleSpecifierCacheProjects: void 0,
|
|
178556
178609
|
close: () => {
|
|
178557
178610
|
var _a;
|
|
178558
|
-
if (!result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) {
|
|
178611
|
+
if (watcher && !result.refreshScriptInfoRefCount && !((_a = result.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.size)) {
|
|
178559
178612
|
watcher.close();
|
|
178560
|
-
|
|
178613
|
+
watcher = void 0;
|
|
178614
|
+
this.nodeModulesWatchers.delete(dirPath);
|
|
178561
178615
|
}
|
|
178562
178616
|
}
|
|
178563
178617
|
};
|
|
178564
|
-
this.nodeModulesWatchers.set(
|
|
178618
|
+
this.nodeModulesWatchers.set(dirPath, result);
|
|
178565
178619
|
return result;
|
|
178566
178620
|
}
|
|
178567
178621
|
/** @internal */
|
|
178568
178622
|
watchPackageJsonsInNodeModules(dir, project) {
|
|
178569
|
-
|
|
178570
|
-
|
|
178623
|
+
var _a;
|
|
178624
|
+
const dirPath = this.toPath(dir);
|
|
178625
|
+
const watcher = this.nodeModulesWatchers.get(dirPath) || this.createNodeModulesWatcher(dir, dirPath);
|
|
178626
|
+
Debug.assert(!((_a = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a.has(project)));
|
|
178627
|
+
(watcher.affectedModuleSpecifierCacheProjects || (watcher.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(project);
|
|
178571
178628
|
return {
|
|
178572
178629
|
close: () => {
|
|
178573
|
-
var
|
|
178574
|
-
(
|
|
178630
|
+
var _a2;
|
|
178631
|
+
(_a2 = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.delete(project);
|
|
178575
178632
|
watcher.close();
|
|
178576
178633
|
}
|
|
178577
178634
|
};
|
|
178578
178635
|
}
|
|
178579
178636
|
watchClosedScriptInfoInNodeModules(dir) {
|
|
178580
178637
|
const watchDir = dir + "/node_modules";
|
|
178581
|
-
const
|
|
178638
|
+
const watchDirPath = this.toPath(watchDir);
|
|
178639
|
+
const watcher = this.nodeModulesWatchers.get(watchDirPath) || this.createNodeModulesWatcher(watchDir, watchDirPath);
|
|
178582
178640
|
watcher.refreshScriptInfoRefCount++;
|
|
178583
178641
|
return {
|
|
178584
178642
|
close: () => {
|
|
@@ -178588,7 +178646,7 @@ All files are: ${JSON.stringify(names)}`, "Err" /* Err */);
|
|
|
178588
178646
|
};
|
|
178589
178647
|
}
|
|
178590
178648
|
getModifiedTime(info) {
|
|
178591
|
-
return (this.host.getModifiedTime(info.
|
|
178649
|
+
return (this.host.getModifiedTime(info.fileName) || missingFileModifiedTime).getTime();
|
|
178592
178650
|
}
|
|
178593
178651
|
refreshScriptInfo(info) {
|
|
178594
178652
|
const mTime = this.getModifiedTime(info);
|
|
@@ -178852,10 +178910,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178852
178910
|
});
|
|
178853
178911
|
}
|
|
178854
178912
|
if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports) {
|
|
178855
|
-
this.
|
|
178856
|
-
|
|
178857
|
-
|
|
178858
|
-
);
|
|
178913
|
+
this.forEachProject((project) => {
|
|
178914
|
+
project.onAutoImportProviderSettingsChanged();
|
|
178915
|
+
});
|
|
178859
178916
|
}
|
|
178860
178917
|
}
|
|
178861
178918
|
if (args.extraFileExtensions) {
|
|
@@ -179774,10 +179831,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179774
179831
|
this.currentPluginConfigOverrides.set(args.pluginName, args.configuration);
|
|
179775
179832
|
}
|
|
179776
179833
|
/** @internal */
|
|
179777
|
-
getPackageJsonsVisibleToFile(fileName, rootDir) {
|
|
179834
|
+
getPackageJsonsVisibleToFile(fileName, project, rootDir) {
|
|
179778
179835
|
const packageJsonCache = this.packageJsonCache;
|
|
179779
179836
|
const rootPath = rootDir && this.toPath(rootDir);
|
|
179780
|
-
const filePath = this.toPath(fileName);
|
|
179781
179837
|
const result = [];
|
|
179782
179838
|
const processDirectory = (directory) => {
|
|
179783
179839
|
switch (packageJsonCache.directoryHasPackageJson(directory)) {
|
|
@@ -179786,7 +179842,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179786
179842
|
return processDirectory(directory);
|
|
179787
179843
|
case -1 /* True */:
|
|
179788
179844
|
const packageJsonFileName = combinePaths(directory, "package.json");
|
|
179789
|
-
this.watchPackageJsonFile(packageJsonFileName);
|
|
179845
|
+
this.watchPackageJsonFile(packageJsonFileName, this.toPath(packageJsonFileName), project);
|
|
179790
179846
|
const info = packageJsonCache.getInDirectory(directory);
|
|
179791
179847
|
if (info)
|
|
179792
179848
|
result.push(info);
|
|
@@ -179795,13 +179851,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179795
179851
|
return true;
|
|
179796
179852
|
}
|
|
179797
179853
|
};
|
|
179798
|
-
forEachAncestorDirectory(getDirectoryPath(
|
|
179854
|
+
forEachAncestorDirectory(getDirectoryPath(fileName), processDirectory);
|
|
179799
179855
|
return result;
|
|
179800
179856
|
}
|
|
179801
179857
|
/** @internal */
|
|
179802
179858
|
getNearestAncestorDirectoryWithPackageJson(fileName) {
|
|
179803
179859
|
return forEachAncestorDirectory(fileName, (directory) => {
|
|
179804
|
-
switch (this.packageJsonCache.directoryHasPackageJson(
|
|
179860
|
+
switch (this.packageJsonCache.directoryHasPackageJson(directory)) {
|
|
179805
179861
|
case -1 /* True */:
|
|
179806
179862
|
return directory;
|
|
179807
179863
|
case 0 /* False */:
|
|
@@ -179812,41 +179868,54 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179812
179868
|
});
|
|
179813
179869
|
}
|
|
179814
179870
|
/** @internal */
|
|
179815
|
-
watchPackageJsonFile(path) {
|
|
179816
|
-
|
|
179817
|
-
|
|
179818
|
-
|
|
179819
|
-
|
|
179820
|
-
|
|
179821
|
-
|
|
179822
|
-
|
|
179823
|
-
|
|
179824
|
-
|
|
179825
|
-
|
|
179826
|
-
|
|
179827
|
-
|
|
179828
|
-
|
|
179829
|
-
|
|
179830
|
-
|
|
179831
|
-
|
|
179832
|
-
|
|
179833
|
-
|
|
179834
|
-
|
|
179835
|
-
|
|
179836
|
-
|
|
179837
|
-
|
|
179838
|
-
|
|
179839
|
-
250 /* Low */,
|
|
179840
|
-
this.hostConfiguration.watchOptions,
|
|
179841
|
-
WatchType.PackageJson
|
|
179842
|
-
)
|
|
179871
|
+
watchPackageJsonFile(file, path, project) {
|
|
179872
|
+
Debug.assert(project !== void 0);
|
|
179873
|
+
let result = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(path);
|
|
179874
|
+
if (!result) {
|
|
179875
|
+
let watcher = this.watchFactory.watchFile(
|
|
179876
|
+
file,
|
|
179877
|
+
(fileName, eventKind) => {
|
|
179878
|
+
switch (eventKind) {
|
|
179879
|
+
case 0 /* Created */:
|
|
179880
|
+
return Debug.fail();
|
|
179881
|
+
case 1 /* Changed */:
|
|
179882
|
+
this.packageJsonCache.addOrUpdate(fileName, path);
|
|
179883
|
+
this.onPackageJsonChange(result);
|
|
179884
|
+
break;
|
|
179885
|
+
case 2 /* Deleted */:
|
|
179886
|
+
this.packageJsonCache.delete(path);
|
|
179887
|
+
this.onPackageJsonChange(result);
|
|
179888
|
+
result.projects.clear();
|
|
179889
|
+
result.close();
|
|
179890
|
+
}
|
|
179891
|
+
},
|
|
179892
|
+
250 /* Low */,
|
|
179893
|
+
this.hostConfiguration.watchOptions,
|
|
179894
|
+
WatchType.PackageJson
|
|
179843
179895
|
);
|
|
179896
|
+
result = {
|
|
179897
|
+
projects: /* @__PURE__ */ new Set(),
|
|
179898
|
+
close: () => {
|
|
179899
|
+
var _a;
|
|
179900
|
+
if (result.projects.size || !watcher)
|
|
179901
|
+
return;
|
|
179902
|
+
watcher.close();
|
|
179903
|
+
watcher = void 0;
|
|
179904
|
+
(_a = this.packageJsonFilesMap) == null ? void 0 : _a.delete(path);
|
|
179905
|
+
this.packageJsonCache.invalidate(path);
|
|
179906
|
+
}
|
|
179907
|
+
};
|
|
179908
|
+
this.packageJsonFilesMap.set(path, result);
|
|
179844
179909
|
}
|
|
179910
|
+
result.projects.add(project);
|
|
179911
|
+
(project.packageJsonWatches ?? (project.packageJsonWatches = /* @__PURE__ */ new Set())).add(result);
|
|
179845
179912
|
}
|
|
179846
179913
|
/** @internal */
|
|
179847
|
-
|
|
179848
|
-
|
|
179849
|
-
|
|
179914
|
+
onPackageJsonChange(result) {
|
|
179915
|
+
result.projects.forEach((project) => {
|
|
179916
|
+
var _a;
|
|
179917
|
+
return (_a = project.onPackageJsonChange) == null ? void 0 : _a.call(project);
|
|
179918
|
+
});
|
|
179850
179919
|
}
|
|
179851
179920
|
/** @internal */
|
|
179852
179921
|
includePackageJsonAutoImports() {
|
|
@@ -179860,19 +179929,6 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179860
179929
|
}
|
|
179861
179930
|
}
|
|
179862
179931
|
/** @internal */
|
|
179863
|
-
invalidateProjectPackageJson(packageJsonPath) {
|
|
179864
|
-
this.configuredProjects.forEach(invalidate);
|
|
179865
|
-
this.inferredProjects.forEach(invalidate);
|
|
179866
|
-
this.externalProjects.forEach(invalidate);
|
|
179867
|
-
function invalidate(project) {
|
|
179868
|
-
if (packageJsonPath) {
|
|
179869
|
-
project.onPackageJsonChange(packageJsonPath);
|
|
179870
|
-
} else {
|
|
179871
|
-
project.onAutoImportProviderSettingsChanged();
|
|
179872
|
-
}
|
|
179873
|
-
}
|
|
179874
|
-
}
|
|
179875
|
-
/** @internal */
|
|
179876
179932
|
getIncompleteCompletionsCache() {
|
|
179877
179933
|
return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = createIncompleteCompletionsCache());
|
|
179878
179934
|
}
|
|
@@ -179905,9 +179961,10 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179905
179961
|
for (const p of modulePaths) {
|
|
179906
179962
|
if (p.isInNodeModules) {
|
|
179907
179963
|
const nodeModulesPath = p.path.substring(0, p.path.indexOf(nodeModulesPathPart) + nodeModulesPathPart.length - 1);
|
|
179908
|
-
|
|
179964
|
+
const key2 = host.toPath(nodeModulesPath);
|
|
179965
|
+
if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(key2))) {
|
|
179909
179966
|
(containedNodeModulesWatchers || (containedNodeModulesWatchers = /* @__PURE__ */ new Map())).set(
|
|
179910
|
-
|
|
179967
|
+
key2,
|
|
179911
179968
|
host.watchNodeModulesForPackageJsonChanges(nodeModulesPath)
|
|
179912
179969
|
);
|
|
179913
179970
|
}
|
|
@@ -179946,7 +180003,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179946
180003
|
}
|
|
179947
180004
|
},
|
|
179948
180005
|
clear() {
|
|
179949
|
-
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(
|
|
180006
|
+
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(closeFileWatcher);
|
|
179950
180007
|
cache == null ? void 0 : cache.clear();
|
|
179951
180008
|
containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.clear();
|
|
179952
180009
|
currentKey = void 0;
|
|
@@ -179987,34 +180044,38 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179987
180044
|
const directoriesWithoutPackageJson = /* @__PURE__ */ new Map();
|
|
179988
180045
|
return {
|
|
179989
180046
|
addOrUpdate,
|
|
179990
|
-
|
|
179991
|
-
get: packageJsons.get.bind(packageJsons),
|
|
180047
|
+
invalidate,
|
|
179992
180048
|
delete: (fileName) => {
|
|
179993
180049
|
packageJsons.delete(fileName);
|
|
179994
180050
|
directoriesWithoutPackageJson.set(getDirectoryPath(fileName), true);
|
|
179995
180051
|
},
|
|
179996
180052
|
getInDirectory: (directory) => {
|
|
179997
|
-
return packageJsons.get(combinePaths(directory, "package.json")) || void 0;
|
|
180053
|
+
return packageJsons.get(host.toPath(combinePaths(directory, "package.json"))) || void 0;
|
|
179998
180054
|
},
|
|
179999
|
-
directoryHasPackageJson,
|
|
180055
|
+
directoryHasPackageJson: (directory) => directoryHasPackageJson(host.toPath(directory)),
|
|
180000
180056
|
searchDirectoryAndAncestors: (directory) => {
|
|
180001
180057
|
forEachAncestorDirectory(directory, (ancestor) => {
|
|
180002
|
-
|
|
180058
|
+
const ancestorPath = host.toPath(ancestor);
|
|
180059
|
+
if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) {
|
|
180003
180060
|
return true;
|
|
180004
180061
|
}
|
|
180005
|
-
const packageJsonFileName =
|
|
180062
|
+
const packageJsonFileName = combinePaths(ancestor, "package.json");
|
|
180006
180063
|
if (tryFileExists(host, packageJsonFileName)) {
|
|
180007
|
-
addOrUpdate(packageJsonFileName);
|
|
180064
|
+
addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json"));
|
|
180008
180065
|
} else {
|
|
180009
|
-
directoriesWithoutPackageJson.set(
|
|
180066
|
+
directoriesWithoutPackageJson.set(ancestorPath, true);
|
|
180010
180067
|
}
|
|
180011
180068
|
});
|
|
180012
180069
|
}
|
|
180013
180070
|
};
|
|
180014
|
-
function addOrUpdate(fileName) {
|
|
180071
|
+
function addOrUpdate(fileName, path) {
|
|
180015
180072
|
const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host));
|
|
180016
|
-
packageJsons.set(
|
|
180017
|
-
directoriesWithoutPackageJson.delete(getDirectoryPath(
|
|
180073
|
+
packageJsons.set(path, packageJsonInfo);
|
|
180074
|
+
directoriesWithoutPackageJson.delete(getDirectoryPath(path));
|
|
180075
|
+
}
|
|
180076
|
+
function invalidate(path) {
|
|
180077
|
+
packageJsons.delete(path);
|
|
180078
|
+
directoriesWithoutPackageJson.delete(getDirectoryPath(path));
|
|
180018
180079
|
}
|
|
180019
180080
|
function directoryHasPackageJson(directory) {
|
|
180020
180081
|
return packageJsons.has(combinePaths(directory, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(directory) ? 0 /* False */ : 3 /* Maybe */;
|
|
@@ -186032,6 +186093,7 @@ ${e.message}`;
|
|
|
186032
186093
|
isOuterExpression: () => isOuterExpression,
|
|
186033
186094
|
isOutermostOptionalChain: () => isOutermostOptionalChain,
|
|
186034
186095
|
isOverrideModifier: () => isOverrideModifier,
|
|
186096
|
+
isPackageJsonInfo: () => isPackageJsonInfo,
|
|
186035
186097
|
isPackedArrayLiteral: () => isPackedArrayLiteral,
|
|
186036
186098
|
isParameter: () => isParameter,
|
|
186037
186099
|
isParameterDeclaration: () => isParameterDeclaration,
|
|
@@ -186683,7 +186745,6 @@ ${e.message}`;
|
|
|
186683
186745
|
updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
|
|
186684
186746
|
updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
|
|
186685
186747
|
updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
|
|
186686
|
-
updatePackageJsonWatch: () => updatePackageJsonWatch,
|
|
186687
186748
|
updateResolutionField: () => updateResolutionField,
|
|
186688
186749
|
updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher,
|
|
186689
186750
|
updateSourceFile: () => updateSourceFile,
|
|
@@ -188444,6 +188505,7 @@ ${e.message}`;
|
|
|
188444
188505
|
isOuterExpression: () => isOuterExpression,
|
|
188445
188506
|
isOutermostOptionalChain: () => isOutermostOptionalChain,
|
|
188446
188507
|
isOverrideModifier: () => isOverrideModifier,
|
|
188508
|
+
isPackageJsonInfo: () => isPackageJsonInfo,
|
|
188447
188509
|
isPackedArrayLiteral: () => isPackedArrayLiteral,
|
|
188448
188510
|
isParameter: () => isParameter,
|
|
188449
188511
|
isParameterDeclaration: () => isParameterDeclaration,
|
|
@@ -189095,7 +189157,6 @@ ${e.message}`;
|
|
|
189095
189157
|
updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
|
|
189096
189158
|
updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
|
|
189097
189159
|
updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
|
|
189098
|
-
updatePackageJsonWatch: () => updatePackageJsonWatch,
|
|
189099
189160
|
updateResolutionField: () => updateResolutionField,
|
|
189100
189161
|
updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher,
|
|
189101
189162
|
updateSourceFile: () => updateSourceFile,
|