@typescript-deploys/pr-build 5.4.0-pr-56458-11 → 5.4.0-pr-56488-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 +167 -90
- package/lib/tsserver.js +348 -220
- package/lib/typescript.js +347 -220
- package/lib/typingsInstaller.js +2 -2
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231121`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3661,7 +3661,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3661
3661
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3662
3662
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3663
3663
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3664
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3664
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
|
|
3665
3665
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3666
3666
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3667
3667
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -15974,7 +15974,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
15974
15974
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
15975
15975
|
}
|
|
15976
15976
|
function getObjectFlags(type) {
|
|
15977
|
-
return type.flags &
|
|
15977
|
+
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
15978
15978
|
}
|
|
15979
15979
|
function isUMDExportSymbol(symbol) {
|
|
15980
15980
|
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
|
@@ -36787,34 +36787,39 @@ function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
|
36787
36787
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
36788
36788
|
}
|
|
36789
36789
|
}
|
|
36790
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude },
|
|
36791
|
-
const rawExcludeRegex = getRegularExpressionForWildcard(exclude,
|
|
36790
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, basePath, useCaseSensitiveFileNames2) {
|
|
36791
|
+
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, basePath, "exclude");
|
|
36792
36792
|
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
36793
36793
|
const wildcardDirectories = {};
|
|
36794
|
+
const wildCardKeyToPath = /* @__PURE__ */ new Map();
|
|
36794
36795
|
if (include !== void 0) {
|
|
36795
36796
|
const recursiveKeys = [];
|
|
36796
36797
|
for (const file of include) {
|
|
36797
|
-
const spec = normalizePath(combinePaths(
|
|
36798
|
+
const spec = normalizePath(combinePaths(basePath, file));
|
|
36798
36799
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
36799
36800
|
continue;
|
|
36800
36801
|
}
|
|
36801
36802
|
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
36802
36803
|
if (match) {
|
|
36803
|
-
const { key, flags } = match;
|
|
36804
|
-
const
|
|
36804
|
+
const { key, path, flags } = match;
|
|
36805
|
+
const existingPath = wildCardKeyToPath.get(key);
|
|
36806
|
+
const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0;
|
|
36805
36807
|
if (existingFlags === void 0 || existingFlags < flags) {
|
|
36806
|
-
wildcardDirectories[
|
|
36808
|
+
wildcardDirectories[existingPath !== void 0 ? existingPath : path] = flags;
|
|
36809
|
+
if (existingPath === void 0)
|
|
36810
|
+
wildCardKeyToPath.set(key, path);
|
|
36807
36811
|
if (flags === 1 /* Recursive */) {
|
|
36808
36812
|
recursiveKeys.push(key);
|
|
36809
36813
|
}
|
|
36810
36814
|
}
|
|
36811
36815
|
}
|
|
36812
36816
|
}
|
|
36813
|
-
for (const
|
|
36814
|
-
if (hasProperty(wildcardDirectories,
|
|
36817
|
+
for (const path in wildcardDirectories) {
|
|
36818
|
+
if (hasProperty(wildcardDirectories, path)) {
|
|
36815
36819
|
for (const recursiveKey of recursiveKeys) {
|
|
36816
|
-
|
|
36817
|
-
|
|
36820
|
+
const key = toCanonicalKey(path, useCaseSensitiveFileNames2);
|
|
36821
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) {
|
|
36822
|
+
delete wildcardDirectories[path];
|
|
36818
36823
|
}
|
|
36819
36824
|
}
|
|
36820
36825
|
}
|
|
@@ -36822,6 +36827,9 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
36822
36827
|
}
|
|
36823
36828
|
return wildcardDirectories;
|
|
36824
36829
|
}
|
|
36830
|
+
function toCanonicalKey(path, useCaseSensitiveFileNames2) {
|
|
36831
|
+
return useCaseSensitiveFileNames2 ? path : toFileNameLowerCase(path);
|
|
36832
|
+
}
|
|
36825
36833
|
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
36826
36834
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
36827
36835
|
if (match) {
|
|
@@ -36829,13 +36837,16 @@ function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
|
36829
36837
|
const starWildcardIndex = spec.indexOf("*");
|
|
36830
36838
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
36831
36839
|
return {
|
|
36832
|
-
key:
|
|
36840
|
+
key: toCanonicalKey(match[0], useCaseSensitiveFileNames2),
|
|
36841
|
+
path: match[0],
|
|
36833
36842
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
36834
36843
|
};
|
|
36835
36844
|
}
|
|
36836
36845
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
36846
|
+
const path = removeTrailingDirectorySeparator(spec);
|
|
36837
36847
|
return {
|
|
36838
|
-
key:
|
|
36848
|
+
key: toCanonicalKey(path, useCaseSensitiveFileNames2),
|
|
36849
|
+
path,
|
|
36839
36850
|
flags: 1 /* Recursive */
|
|
36840
36851
|
};
|
|
36841
36852
|
}
|
|
@@ -37517,22 +37528,50 @@ function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) {
|
|
|
37517
37528
|
}
|
|
37518
37529
|
function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
|
|
37519
37530
|
let cache;
|
|
37520
|
-
|
|
37531
|
+
let canonicalPathToCacheKey;
|
|
37532
|
+
return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, deletePackageJsonInfo, clear: clear2, entries };
|
|
37521
37533
|
function getPackageJsonInfo2(packageJsonPath) {
|
|
37522
|
-
|
|
37534
|
+
if (!cache)
|
|
37535
|
+
return void 0;
|
|
37536
|
+
const absolute = getNormalizedAbsolutePath(packageJsonPath, currentDirectory);
|
|
37537
|
+
const result = cache.get(absolute);
|
|
37538
|
+
if (result !== void 0)
|
|
37539
|
+
return result;
|
|
37540
|
+
if (!canonicalPathToCacheKey)
|
|
37541
|
+
return void 0;
|
|
37542
|
+
const path = getCanonicalFileName(absolute);
|
|
37543
|
+
if (path === absolute)
|
|
37544
|
+
return void 0;
|
|
37545
|
+
const cacheKey = canonicalPathToCacheKey.get(path);
|
|
37546
|
+
return cacheKey !== void 0 ? cache.get(cacheKey) : void 0;
|
|
37523
37547
|
}
|
|
37524
37548
|
function setPackageJsonInfo(packageJsonPath, info) {
|
|
37525
|
-
|
|
37549
|
+
const absolute = getNormalizedAbsolutePath(packageJsonPath, currentDirectory);
|
|
37550
|
+
(cache || (cache = /* @__PURE__ */ new Map())).set(absolute, info);
|
|
37551
|
+
const path = getCanonicalFileName(absolute);
|
|
37552
|
+
if (path !== absolute) {
|
|
37553
|
+
(canonicalPathToCacheKey ?? (canonicalPathToCacheKey = /* @__PURE__ */ new Map())).set(path, absolute);
|
|
37554
|
+
}
|
|
37555
|
+
}
|
|
37556
|
+
function deletePackageJsonInfo(packageJsonPath) {
|
|
37557
|
+
if (!cache)
|
|
37558
|
+
return;
|
|
37559
|
+
const absolute = getNormalizedAbsolutePath(packageJsonPath, currentDirectory);
|
|
37560
|
+
cache.delete(absolute);
|
|
37561
|
+
if (canonicalPathToCacheKey) {
|
|
37562
|
+
const path = getCanonicalFileName(absolute);
|
|
37563
|
+
const cacheKey = canonicalPathToCacheKey.get(path);
|
|
37564
|
+
if (cacheKey !== void 0) {
|
|
37565
|
+
cache.delete(cacheKey);
|
|
37566
|
+
canonicalPathToCacheKey.delete(path);
|
|
37567
|
+
}
|
|
37568
|
+
}
|
|
37526
37569
|
}
|
|
37527
37570
|
function clear2() {
|
|
37528
37571
|
cache = void 0;
|
|
37529
37572
|
}
|
|
37530
37573
|
function entries() {
|
|
37531
|
-
|
|
37532
|
-
return iter ? arrayFrom(iter) : [];
|
|
37533
|
-
}
|
|
37534
|
-
function getInternalMap() {
|
|
37535
|
-
return cache;
|
|
37574
|
+
return cache == null ? void 0 : cache.entries();
|
|
37536
37575
|
}
|
|
37537
37576
|
}
|
|
37538
37577
|
function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create) {
|
|
@@ -42464,7 +42503,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
42464
42503
|
if (!moduleSourceFile)
|
|
42465
42504
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
42466
42505
|
computedWithoutCache = true;
|
|
42467
|
-
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.
|
|
42506
|
+
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.fileName, moduleSourceFile.originalFileName, host));
|
|
42468
42507
|
const result = computeModuleSpecifiers(
|
|
42469
42508
|
modulePaths,
|
|
42470
42509
|
compilerOptions,
|
|
@@ -42478,7 +42517,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
42478
42517
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
42479
42518
|
}
|
|
42480
42519
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
42481
|
-
const info = getInfo(importingSourceFile.
|
|
42520
|
+
const info = getInfo(importingSourceFile.fileName, host);
|
|
42482
42521
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
42483
42522
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
42484
42523
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
@@ -42542,6 +42581,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
42542
42581
|
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);
|
|
42543
42582
|
}
|
|
42544
42583
|
function getInfo(importingSourceFileName, host) {
|
|
42584
|
+
importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory());
|
|
42545
42585
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true);
|
|
42546
42586
|
const sourceDirectory = getDirectoryPath(importingSourceFileName);
|
|
42547
42587
|
return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
|
|
@@ -42576,7 +42616,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
|
|
|
42576
42616
|
if (relativePreference === 3 /* ExternalNonRelative */ && !pathIsRelative(maybeNonRelative)) {
|
|
42577
42617
|
const projectDirectory = compilerOptions.configFilePath ? toPath(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info.getCanonicalFileName) : info.getCanonicalFileName(host.getCurrentDirectory());
|
|
42578
42618
|
const modulePath = toPath(moduleFileName, projectDirectory, getCanonicalFileName);
|
|
42579
|
-
const sourceIsInternal = startsWith(sourceDirectory, projectDirectory);
|
|
42619
|
+
const sourceIsInternal = startsWith(info.getCanonicalFileName(sourceDirectory), projectDirectory);
|
|
42580
42620
|
const targetIsInternal = startsWith(modulePath, projectDirectory);
|
|
42581
42621
|
if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) {
|
|
42582
42622
|
return maybeNonRelative;
|
|
@@ -42649,8 +42689,9 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
|
|
|
42649
42689
|
});
|
|
42650
42690
|
return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
|
|
42651
42691
|
}
|
|
42652
|
-
function getAllModulePaths(
|
|
42692
|
+
function getAllModulePaths(importingFileName, importedFileName, host, preferences, options = {}) {
|
|
42653
42693
|
var _a;
|
|
42694
|
+
const importingFilePath = toPath(importingFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
42654
42695
|
const importedFilePath = toPath(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
42655
42696
|
const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host);
|
|
42656
42697
|
if (cache) {
|
|
@@ -42658,7 +42699,7 @@ function getAllModulePaths(importingFilePath, importedFileName, host, preference
|
|
|
42658
42699
|
if (cached == null ? void 0 : cached.modulePaths)
|
|
42659
42700
|
return cached.modulePaths;
|
|
42660
42701
|
}
|
|
42661
|
-
const modulePaths = getAllModulePathsWorker(
|
|
42702
|
+
const modulePaths = getAllModulePathsWorker(importingFileName, importedFileName, host);
|
|
42662
42703
|
if (cache) {
|
|
42663
42704
|
cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths);
|
|
42664
42705
|
}
|
|
@@ -42681,7 +42722,7 @@ function getAllModulePathsWorker(importingFileName, importedFileName, host) {
|
|
|
42681
42722
|
}
|
|
42682
42723
|
);
|
|
42683
42724
|
const sortedPaths = [];
|
|
42684
|
-
for (let directory = getDirectoryPath(importingFileName); allFileNames.size !== 0; ) {
|
|
42725
|
+
for (let directory = getDirectoryPath(getCanonicalFileName(importingFileName)); allFileNames.size !== 0; ) {
|
|
42685
42726
|
const directoryStart = ensureTrailingDirectorySeparator(directory);
|
|
42686
42727
|
let pathsInDirectory;
|
|
42687
42728
|
allFileNames.forEach(({ path, isRedirect, isInNodeModules }, fileName) => {
|
|
@@ -42702,7 +42743,10 @@ function getAllModulePathsWorker(importingFileName, importedFileName, host) {
|
|
|
42702
42743
|
directory = newDirectory;
|
|
42703
42744
|
}
|
|
42704
42745
|
if (allFileNames.size) {
|
|
42705
|
-
const remainingPaths = arrayFrom(
|
|
42746
|
+
const remainingPaths = arrayFrom(
|
|
42747
|
+
allFileNames.entries(),
|
|
42748
|
+
([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules })
|
|
42749
|
+
);
|
|
42706
42750
|
if (remainingPaths.length > 1)
|
|
42707
42751
|
remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators);
|
|
42708
42752
|
sortedPaths.push(...remainingPaths);
|
|
@@ -42906,7 +42950,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
42906
42950
|
}
|
|
42907
42951
|
const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation();
|
|
42908
42952
|
const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex));
|
|
42909
|
-
if (!(startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
|
|
42953
|
+
if (!(startsWith(getCanonicalFileName(sourceDirectory), pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) {
|
|
42910
42954
|
return void 0;
|
|
42911
42955
|
}
|
|
42912
42956
|
const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
|
|
@@ -56987,7 +57031,7 @@ function createTypeChecker(host) {
|
|
|
56987
57031
|
}
|
|
56988
57032
|
}
|
|
56989
57033
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
56990
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
57034
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
|
|
56991
57035
|
if (templates.length) {
|
|
56992
57036
|
let i = types.length;
|
|
56993
57037
|
while (i > 0) {
|
|
@@ -57387,14 +57431,19 @@ function createTypeChecker(host) {
|
|
|
57387
57431
|
function getConstituentCountOfTypes(types) {
|
|
57388
57432
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
57389
57433
|
}
|
|
57434
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
57435
|
+
if (types.length !== 2) {
|
|
57436
|
+
return false;
|
|
57437
|
+
}
|
|
57438
|
+
const [t1, t2] = types;
|
|
57439
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
57440
|
+
}
|
|
57390
57441
|
function getTypeFromIntersectionTypeNode(node) {
|
|
57391
57442
|
const links = getNodeLinks(node);
|
|
57392
57443
|
if (!links.resolvedType) {
|
|
57393
57444
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
57394
57445
|
const types = map(node.types, getTypeFromTypeNode);
|
|
57395
|
-
const
|
|
57396
|
-
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
57397
|
-
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
57446
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
57398
57447
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
57399
57448
|
}
|
|
57400
57449
|
return links.resolvedType;
|
|
@@ -57581,7 +57630,7 @@ function createTypeChecker(host) {
|
|
|
57581
57630
|
return type;
|
|
57582
57631
|
function addSpans(texts2, types2) {
|
|
57583
57632
|
for (let i = 0; i < types2.length; i++) {
|
|
57584
|
-
const t =
|
|
57633
|
+
const t = types2[i];
|
|
57585
57634
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
57586
57635
|
text += getTemplateStringForType(t) || "";
|
|
57587
57636
|
text += texts2[i + 1];
|
|
@@ -57601,20 +57650,16 @@ function createTypeChecker(host) {
|
|
|
57601
57650
|
return true;
|
|
57602
57651
|
}
|
|
57603
57652
|
}
|
|
57604
|
-
function stripObjectTypeTags(type) {
|
|
57605
|
-
if (type.flags & 2097152 /* Intersection */) {
|
|
57606
|
-
const nonObjectTypes = filter(type.types, (t) => !(t.flags & 524288 /* Object */));
|
|
57607
|
-
if (nonObjectTypes !== type.types) {
|
|
57608
|
-
return getIntersectionType(nonObjectTypes);
|
|
57609
|
-
}
|
|
57610
|
-
}
|
|
57611
|
-
return type;
|
|
57612
|
-
}
|
|
57613
57653
|
function getTemplateStringForType(type) {
|
|
57614
57654
|
return type.flags & 128 /* StringLiteral */ ? type.value : type.flags & 256 /* NumberLiteral */ ? "" + type.value : type.flags & 2048 /* BigIntLiteral */ ? pseudoBigIntToString(type.value) : type.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) ? type.intrinsicName : void 0;
|
|
57615
57655
|
}
|
|
57616
57656
|
function createTemplateLiteralType(texts, types) {
|
|
57617
57657
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
57658
|
+
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
57659
|
+
types,
|
|
57660
|
+
/*excludeKinds*/
|
|
57661
|
+
98304 /* Nullable */
|
|
57662
|
+
);
|
|
57618
57663
|
type.texts = texts;
|
|
57619
57664
|
type.types = types;
|
|
57620
57665
|
return type;
|
|
@@ -57908,7 +57953,10 @@ function createTypeChecker(host) {
|
|
|
57908
57953
|
return accessNode.kind === 212 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.kind === 199 /* IndexedAccessType */ ? accessNode.indexType : accessNode.kind === 167 /* ComputedPropertyName */ ? accessNode.expression : accessNode;
|
|
57909
57954
|
}
|
|
57910
57955
|
function isPatternLiteralPlaceholderType(type) {
|
|
57911
|
-
|
|
57956
|
+
if (type.flags & 2097152 /* Intersection */) {
|
|
57957
|
+
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
57958
|
+
}
|
|
57959
|
+
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57912
57960
|
}
|
|
57913
57961
|
function isPatternLiteralType(type) {
|
|
57914
57962
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
|
@@ -57923,7 +57971,7 @@ function createTypeChecker(host) {
|
|
|
57923
57971
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
57924
57972
|
}
|
|
57925
57973
|
function getGenericObjectFlags(type) {
|
|
57926
|
-
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57974
|
+
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
|
|
57927
57975
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
57928
57976
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
57929
57977
|
}
|
|
@@ -57935,7 +57983,7 @@ function createTypeChecker(host) {
|
|
|
57935
57983
|
}
|
|
57936
57984
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
57937
57985
|
}
|
|
57938
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ |
|
|
57986
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57939
57987
|
}
|
|
57940
57988
|
function getSimplifiedType(type, writing) {
|
|
57941
57989
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -58961,7 +59009,7 @@ function createTypeChecker(host) {
|
|
|
58961
59009
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
58962
59010
|
target.instantiations.set(id, result);
|
|
58963
59011
|
const resultObjectFlags = getObjectFlags(result);
|
|
58964
|
-
if (result.flags &
|
|
59012
|
+
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58965
59013
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
58966
59014
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
58967
59015
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -63677,8 +63725,8 @@ function createTypeChecker(host) {
|
|
|
63677
63725
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
63678
63726
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
63679
63727
|
}
|
|
63680
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63681
|
-
if (type.flags &
|
|
63728
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63729
|
+
if (type.flags & 138117121 /* ObjectFlagsType */) {
|
|
63682
63730
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
63683
63731
|
}
|
|
63684
63732
|
return result;
|
|
@@ -107945,8 +107993,8 @@ function transformDeclarations(context) {
|
|
|
107945
107993
|
const specifier = getModuleSpecifier(
|
|
107946
107994
|
options,
|
|
107947
107995
|
currentSourceFile,
|
|
107948
|
-
|
|
107949
|
-
|
|
107996
|
+
getNormalizedAbsolutePath(outputFilePath2, host.getCurrentDirectory()),
|
|
107997
|
+
getNormalizedAbsolutePath(declFileName, host.getCurrentDirectory()),
|
|
107950
107998
|
host
|
|
107951
107999
|
);
|
|
107952
108000
|
if (!pathIsRelative(specifier)) {
|
|
@@ -115372,8 +115420,8 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
|
|
|
115372
115420
|
}
|
|
115373
115421
|
const baseName = getBaseNameOfFileName(fileOrDirectory);
|
|
115374
115422
|
const fsQueryResult = {
|
|
115375
|
-
fileExists: host.fileExists(
|
|
115376
|
-
directoryExists: host.directoryExists(
|
|
115423
|
+
fileExists: host.fileExists(fileOrDirectory),
|
|
115424
|
+
directoryExists: host.directoryExists(fileOrDirectory)
|
|
115377
115425
|
};
|
|
115378
115426
|
if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
|
|
115379
115427
|
clearCache();
|
|
@@ -115456,11 +115504,9 @@ function cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, t
|
|
|
115456
115504
|
});
|
|
115457
115505
|
}
|
|
115458
115506
|
function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {
|
|
115459
|
-
const missingFilePaths = program.getMissingFilePaths();
|
|
115460
|
-
const newMissingFilePathMap = arrayToMap(missingFilePaths, identity, returnTrue);
|
|
115461
115507
|
mutateMap(
|
|
115462
115508
|
missingFileWatches,
|
|
115463
|
-
|
|
115509
|
+
program.getMissingFilePaths(),
|
|
115464
115510
|
{
|
|
115465
115511
|
// Watch the missing files
|
|
115466
115512
|
createNewValue: createMissingFileWatch,
|
|
@@ -116287,7 +116333,8 @@ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion,
|
|
|
116287
116333
|
return false;
|
|
116288
116334
|
if (program.getSourceFiles().some(sourceFileNotUptoDate))
|
|
116289
116335
|
return false;
|
|
116290
|
-
|
|
116336
|
+
const missingPaths = program.getMissingFilePaths();
|
|
116337
|
+
if (missingPaths && forEachEntry(missingPaths, fileExists))
|
|
116291
116338
|
return false;
|
|
116292
116339
|
const currentOptions = program.getCompilerOptions();
|
|
116293
116340
|
if (!compareDataObjects(currentOptions, newOptions))
|
|
@@ -116587,7 +116634,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116587
116634
|
let redirectTargetsMap = createMultiMap();
|
|
116588
116635
|
let usesUriStyleNodeCoreModules = false;
|
|
116589
116636
|
const filesByName = /* @__PURE__ */ new Map();
|
|
116590
|
-
let
|
|
116637
|
+
let missingFileNames = /* @__PURE__ */ new Map();
|
|
116591
116638
|
const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0;
|
|
116592
116639
|
let resolvedProjectReferences;
|
|
116593
116640
|
let projectReferenceRedirects;
|
|
@@ -116706,12 +116753,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116706
116753
|
});
|
|
116707
116754
|
}
|
|
116708
116755
|
}
|
|
116709
|
-
missingFilePaths = arrayFrom(mapDefinedIterator(filesByName.entries(), ([path, file]) => file === void 0 ? path : void 0));
|
|
116710
116756
|
files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
116711
116757
|
processingDefaultLibFiles = void 0;
|
|
116712
116758
|
processingOtherFiles = void 0;
|
|
116713
116759
|
}
|
|
116714
|
-
Debug.assert(!!missingFilePaths);
|
|
116715
116760
|
if (oldProgram && host.onReleaseOldSourceFile) {
|
|
116716
116761
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
116717
116762
|
for (const oldSourceFile of oldSourceFiles) {
|
|
@@ -116756,8 +116801,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116756
116801
|
getSourceFile,
|
|
116757
116802
|
getSourceFileByPath,
|
|
116758
116803
|
getSourceFiles: () => files,
|
|
116759
|
-
getMissingFilePaths: () =>
|
|
116760
|
-
// TODO: GH#18217
|
|
116804
|
+
getMissingFilePaths: () => missingFileNames,
|
|
116761
116805
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
116762
116806
|
getFilesByNameMap: () => filesByName,
|
|
116763
116807
|
getCompilerOptions: () => options,
|
|
@@ -117184,7 +117228,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117184
117228
|
const newSourceFiles = [];
|
|
117185
117229
|
const modifiedSourceFiles = [];
|
|
117186
117230
|
structureIsReused = 2 /* Completely */;
|
|
117187
|
-
if (oldProgram.getMissingFilePaths()
|
|
117231
|
+
if (forEachEntry(oldProgram.getMissingFilePaths(), (missingFilePath) => host.fileExists(missingFilePath))) {
|
|
117188
117232
|
return 0 /* Not */;
|
|
117189
117233
|
}
|
|
117190
117234
|
const oldSourceFiles = oldProgram.getSourceFiles();
|
|
@@ -117324,7 +117368,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117324
117368
|
if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames))
|
|
117325
117369
|
return 1 /* SafeModules */;
|
|
117326
117370
|
}
|
|
117327
|
-
|
|
117371
|
+
missingFileNames = oldProgram.getMissingFilePaths();
|
|
117328
117372
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
117329
117373
|
for (const newSourceFile of newSourceFiles) {
|
|
117330
117374
|
filesByName.set(newSourceFile.path, newSourceFile);
|
|
@@ -117381,7 +117425,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117381
117425
|
const path = toPath3(f);
|
|
117382
117426
|
if (getSourceFileByPath(path))
|
|
117383
117427
|
return true;
|
|
117384
|
-
if (
|
|
117428
|
+
if (missingFileNames.has(path))
|
|
117385
117429
|
return false;
|
|
117386
117430
|
return host.fileExists(f);
|
|
117387
117431
|
},
|
|
@@ -118193,6 +118237,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118193
118237
|
addFileToFilesByName(
|
|
118194
118238
|
file2,
|
|
118195
118239
|
path,
|
|
118240
|
+
fileName,
|
|
118196
118241
|
/*redirectedPath*/
|
|
118197
118242
|
void 0
|
|
118198
118243
|
);
|
|
@@ -118265,7 +118310,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118265
118310
|
if (fileFromPackageId) {
|
|
118266
118311
|
const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path, toPath3(fileName), originalFileName, sourceFileOptions);
|
|
118267
118312
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
118268
|
-
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
118313
|
+
addFileToFilesByName(dupFile, path, fileName, redirectedPath);
|
|
118269
118314
|
addFileIncludeReason(dupFile, reason);
|
|
118270
118315
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
118271
118316
|
processingOtherFiles.push(dupFile);
|
|
@@ -118275,7 +118320,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118275
118320
|
sourceFileToPackageName.set(path, packageIdToPackageName(packageId));
|
|
118276
118321
|
}
|
|
118277
118322
|
}
|
|
118278
|
-
addFileToFilesByName(file, path, redirectedPath);
|
|
118323
|
+
addFileToFilesByName(file, path, fileName, redirectedPath);
|
|
118279
118324
|
if (file) {
|
|
118280
118325
|
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
|
|
118281
118326
|
file.fileName = fileName;
|
|
@@ -118315,14 +118360,21 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118315
118360
|
if (file)
|
|
118316
118361
|
fileReasons.add(file.path, reason);
|
|
118317
118362
|
}
|
|
118318
|
-
function addFileToFilesByName(file, path, redirectedPath) {
|
|
118363
|
+
function addFileToFilesByName(file, path, fileName, redirectedPath) {
|
|
118319
118364
|
if (redirectedPath) {
|
|
118320
|
-
|
|
118321
|
-
|
|
118365
|
+
updateFilesByNameMap(fileName, redirectedPath, file);
|
|
118366
|
+
updateFilesByNameMap(fileName, path, file || false);
|
|
118322
118367
|
} else {
|
|
118323
|
-
|
|
118368
|
+
updateFilesByNameMap(fileName, path, file);
|
|
118324
118369
|
}
|
|
118325
118370
|
}
|
|
118371
|
+
function updateFilesByNameMap(fileName, path, file) {
|
|
118372
|
+
filesByName.set(path, file);
|
|
118373
|
+
if (file !== void 0)
|
|
118374
|
+
missingFileNames.delete(path);
|
|
118375
|
+
else
|
|
118376
|
+
missingFileNames.set(path, fileName);
|
|
118377
|
+
}
|
|
118326
118378
|
function getProjectReferenceRedirect(fileName) {
|
|
118327
118379
|
const referencedProject = getProjectReferenceRedirectProject(fileName);
|
|
118328
118380
|
return referencedProject && getProjectReferenceOutputName(referencedProject, fileName);
|
|
@@ -118643,6 +118695,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118643
118695
|
/*file*/
|
|
118644
118696
|
void 0,
|
|
118645
118697
|
sourceFilePath,
|
|
118698
|
+
refPath,
|
|
118646
118699
|
/*redirectedPath*/
|
|
118647
118700
|
void 0
|
|
118648
118701
|
);
|
|
@@ -118654,6 +118707,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118654
118707
|
addFileToFilesByName(
|
|
118655
118708
|
sourceFile,
|
|
118656
118709
|
sourceFilePath,
|
|
118710
|
+
refPath,
|
|
118657
118711
|
/*redirectedPath*/
|
|
118658
118712
|
void 0
|
|
118659
118713
|
);
|
|
@@ -118663,6 +118717,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118663
118717
|
addFileToFilesByName(
|
|
118664
118718
|
sourceFile,
|
|
118665
118719
|
sourceFilePath,
|
|
118720
|
+
refPath,
|
|
118666
118721
|
/*redirectedPath*/
|
|
118667
118722
|
void 0
|
|
118668
118723
|
);
|
|
@@ -122164,7 +122219,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122164
122219
|
const watcher = {
|
|
122165
122220
|
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
122166
122221
|
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
122167
|
-
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache()
|
|
122222
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache());
|
|
122168
122223
|
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
122169
122224
|
}) : noopFileWatcher,
|
|
122170
122225
|
resolutions: isSymlink ? 0 : resolutions,
|
|
@@ -122204,7 +122259,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122204
122259
|
if (watcher == null ? void 0 : watcher.files)
|
|
122205
122260
|
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
122206
122261
|
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
122207
|
-
packageJsonMap
|
|
122262
|
+
packageJsonMap.deletePackageJsonInfo(path);
|
|
122208
122263
|
}
|
|
122209
122264
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
122210
122265
|
const program = resolutionHost.getCurrentProgram();
|
|
@@ -122389,9 +122444,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122389
122444
|
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
122390
122445
|
}
|
|
122391
122446
|
function invalidatePackageJsonMap() {
|
|
122392
|
-
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().
|
|
122447
|
+
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().entries();
|
|
122393
122448
|
if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) {
|
|
122394
|
-
|
|
122449
|
+
for (const key of packageJsonMap) {
|
|
122450
|
+
const path = resolutionHost.toPath(key[0]);
|
|
122451
|
+
if (isInvalidatedFailedLookup(path)) {
|
|
122452
|
+
moduleResolutionCache.getPackageJsonInfoCache().deletePackageJsonInfo(key[0]);
|
|
122453
|
+
}
|
|
122454
|
+
}
|
|
122395
122455
|
}
|
|
122396
122456
|
}
|
|
122397
122457
|
function invalidateResolutionsOfFailedLookupLocations() {
|
|
@@ -123408,7 +123468,11 @@ function createWatchProgram(host) {
|
|
|
123408
123468
|
const oldProgram = getCurrentProgram();
|
|
123409
123469
|
builderProgram = createProgram2(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
123410
123470
|
resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram);
|
|
123411
|
-
updateMissingFilePathsWatch(
|
|
123471
|
+
updateMissingFilePathsWatch(
|
|
123472
|
+
builderProgram.getProgram(),
|
|
123473
|
+
missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()),
|
|
123474
|
+
watchMissingFilePath
|
|
123475
|
+
);
|
|
123412
123476
|
if (needsUpdateInTypeRootWatch) {
|
|
123413
123477
|
resolutionCache.updateTypeRootsWatch();
|
|
123414
123478
|
}
|
|
@@ -123701,8 +123765,15 @@ function createWatchProgram(host) {
|
|
|
123701
123765
|
cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind);
|
|
123702
123766
|
}
|
|
123703
123767
|
}
|
|
123704
|
-
function watchMissingFilePath(missingFilePath) {
|
|
123705
|
-
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
|
|
123768
|
+
function watchMissingFilePath(missingFilePath, missingFileName) {
|
|
123769
|
+
return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath(
|
|
123770
|
+
missingFilePath,
|
|
123771
|
+
missingFileName,
|
|
123772
|
+
onMissingFileChange,
|
|
123773
|
+
500 /* Medium */,
|
|
123774
|
+
watchOptions,
|
|
123775
|
+
WatchType.MissingFile
|
|
123776
|
+
);
|
|
123706
123777
|
}
|
|
123707
123778
|
function onMissingFileChange(fileName, eventKind, missingFilePath) {
|
|
123708
123779
|
updateCachedSystemWithFile(fileName, missingFilePath, eventKind);
|
|
@@ -124177,6 +124248,7 @@ function createStateBuildOrder(state) {
|
|
|
124177
124248
|
mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete);
|
|
124178
124249
|
mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete);
|
|
124179
124250
|
mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete);
|
|
124251
|
+
mutateMapSkippingNewValues(state.lastCachedPackageJsonLookups, currentProjects, noopOnDelete);
|
|
124180
124252
|
if (state.watch) {
|
|
124181
124253
|
mutateMapSkippingNewValues(
|
|
124182
124254
|
state.allWatchedConfigFiles,
|
|
@@ -124425,7 +124497,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
124425
124497
|
return withProgramOrUndefined(action) || emptyArray;
|
|
124426
124498
|
}
|
|
124427
124499
|
function createProgram2() {
|
|
124428
|
-
var _a, _b;
|
|
124500
|
+
var _a, _b, _c;
|
|
124429
124501
|
Debug.assert(program === void 0);
|
|
124430
124502
|
if (state.options.dry) {
|
|
124431
124503
|
reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project);
|
|
@@ -124454,12 +124526,16 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
124454
124526
|
config.projectReferences
|
|
124455
124527
|
);
|
|
124456
124528
|
if (state.watch) {
|
|
124529
|
+
const entries = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().entries();
|
|
124457
124530
|
state.lastCachedPackageJsonLookups.set(
|
|
124458
124531
|
projectPath,
|
|
124459
|
-
|
|
124460
|
-
|
|
124461
|
-
([path, data]) =>
|
|
124462
|
-
|
|
124532
|
+
entries && new Map(arrayFrom(
|
|
124533
|
+
entries,
|
|
124534
|
+
([path, data]) => {
|
|
124535
|
+
path = state.host.realpath && data ? state.host.realpath(path) : path;
|
|
124536
|
+
return [toPath2(state, path), path];
|
|
124537
|
+
}
|
|
124538
|
+
))
|
|
124463
124539
|
);
|
|
124464
124540
|
state.builderPrograms.set(projectPath, program);
|
|
124465
124541
|
}
|
|
@@ -125192,9 +125268,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
125192
125268
|
const extendedConfigStatus = forEach(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName));
|
|
125193
125269
|
if (extendedConfigStatus)
|
|
125194
125270
|
return extendedConfigStatus;
|
|
125195
|
-
const
|
|
125196
|
-
|
|
125197
|
-
|
|
125271
|
+
const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath);
|
|
125272
|
+
const dependentPackageFileStatus = packageJsonLookups && forEachEntry(
|
|
125273
|
+
packageJsonLookups,
|
|
125274
|
+
(path) => checkConfigFileUpToDateStatus(state, path, oldestOutputFileTime, oldestOutputFileName)
|
|
125198
125275
|
);
|
|
125199
125276
|
if (dependentPackageFileStatus)
|
|
125200
125277
|
return dependentPackageFileStatus;
|
|
@@ -125605,9 +125682,9 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
|
|
|
125605
125682
|
getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath),
|
|
125606
125683
|
new Map(state.lastCachedPackageJsonLookups.get(resolvedPath)),
|
|
125607
125684
|
{
|
|
125608
|
-
createNewValue: (
|
|
125685
|
+
createNewValue: (_path, input) => watchFile(
|
|
125609
125686
|
state,
|
|
125610
|
-
|
|
125687
|
+
input,
|
|
125611
125688
|
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
125612
125689
|
2e3 /* High */,
|
|
125613
125690
|
parsed == null ? void 0 : parsed.watchOptions,
|