typescript 5.1.0-dev.20230331 → 5.1.0-dev.20230401
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 +111 -79
- package/lib/tsserver.js +133 -83
- package/lib/tsserverlibrary.js +127 -83
- package/lib/typescript.js +121 -83
- package/lib/typingsInstaller.js +3 -2
- package/package.json +2 -2
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.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230401`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -18055,6 +18055,9 @@ ${lanes.join("\n")}
|
|
|
18055
18055
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
18056
18056
|
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
|
|
18057
18057
|
}
|
|
18058
|
+
function shouldResolveJsRequire(compilerOptions) {
|
|
18059
|
+
return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
|
|
18060
|
+
}
|
|
18058
18061
|
function getResolvePackageJsonExports(compilerOptions) {
|
|
18059
18062
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
18060
18063
|
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
@@ -38030,7 +38033,8 @@ ${lanes.join("\n")}
|
|
|
38030
38033
|
affectsBuildInfo: true,
|
|
38031
38034
|
category: Diagnostics.Modules,
|
|
38032
38035
|
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
|
38033
|
-
defaultValueDescription: false
|
|
38036
|
+
defaultValueDescription: false,
|
|
38037
|
+
transpileOptionValue: void 0
|
|
38034
38038
|
},
|
|
38035
38039
|
{
|
|
38036
38040
|
name: "resolvePackageJsonExports",
|
|
@@ -43786,7 +43790,7 @@ ${lanes.join("\n")}
|
|
|
43786
43790
|
}
|
|
43787
43791
|
if (!isBindingPattern(node.name)) {
|
|
43788
43792
|
const possibleVariableDecl = node.kind === 258 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
43789
|
-
if (isInJSFile(node) &&
|
|
43793
|
+
if (isInJSFile(node) && shouldResolveJsRequire(options) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
|
|
43790
43794
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
43791
43795
|
} else if (isBlockOrCatchScoped(node)) {
|
|
43792
43796
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -47353,7 +47357,7 @@ ${lanes.join("\n")}
|
|
|
47353
47357
|
const hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
47354
47358
|
const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
47355
47359
|
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
47356
|
-
if (hasExportAssignmentSymbol(moduleSymbol) && !
|
|
47360
|
+
if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) {
|
|
47357
47361
|
const compilerOptionName = moduleKind >= 5 /* ES2015 */ ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
47358
47362
|
const exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
47359
47363
|
const exportAssignment = exportEqualsSymbol.valueDeclaration;
|
|
@@ -47521,7 +47525,7 @@ ${lanes.join("\n")}
|
|
|
47521
47525
|
if (!isIdentifier(name)) {
|
|
47522
47526
|
return void 0;
|
|
47523
47527
|
}
|
|
47524
|
-
const suppressInteropError = name.escapedText === "default" /* Default */ &&
|
|
47528
|
+
const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports;
|
|
47525
47529
|
const targetSymbol = resolveESModuleSymbol(
|
|
47526
47530
|
moduleSymbol,
|
|
47527
47531
|
moduleSpecifier,
|
|
@@ -52163,7 +52167,7 @@ ${lanes.join("\n")}
|
|
|
52163
52167
|
return;
|
|
52164
52168
|
}
|
|
52165
52169
|
let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName);
|
|
52166
|
-
if (verbatimTargetName === "export=" /* ExportEquals */ &&
|
|
52170
|
+
if (verbatimTargetName === "export=" /* ExportEquals */ && allowSyntheticDefaultImports) {
|
|
52167
52171
|
verbatimTargetName = "default" /* Default */;
|
|
52168
52172
|
}
|
|
52169
52173
|
const targetName = getInternalSymbolName(target, verbatimTargetName);
|
|
@@ -73386,7 +73390,7 @@ ${lanes.join("\n")}
|
|
|
73386
73390
|
return anyType;
|
|
73387
73391
|
}
|
|
73388
73392
|
}
|
|
73389
|
-
if (isInJSFile(node) &&
|
|
73393
|
+
if (isInJSFile(node) && shouldResolveJsRequire(compilerOptions) && isCommonJsRequire(node)) {
|
|
73390
73394
|
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
|
|
73391
73395
|
}
|
|
73392
73396
|
const returnType = getReturnTypeOfSignature(signature);
|
|
@@ -117571,7 +117575,7 @@ ${lanes.join("\n")}
|
|
|
117571
117575
|
false
|
|
117572
117576
|
);
|
|
117573
117577
|
}
|
|
117574
|
-
const shouldProcessRequires = isJavaScriptFile &&
|
|
117578
|
+
const shouldProcessRequires = isJavaScriptFile && shouldResolveJsRequire(options);
|
|
117575
117579
|
if (file.flags & 2097152 /* PossiblyContainsDynamicImport */ || shouldProcessRequires) {
|
|
117576
117580
|
collectDynamicImportOrRequireCalls(file);
|
|
117577
117581
|
}
|
|
@@ -121171,6 +121175,79 @@ ${lanes.join("\n")}
|
|
|
121171
121175
|
}
|
|
121172
121176
|
return true;
|
|
121173
121177
|
}
|
|
121178
|
+
function canWatchAtTypes(atTypes, rootPath) {
|
|
121179
|
+
const dirPath = getDirectoryPath(getDirectoryPath(atTypes));
|
|
121180
|
+
return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
|
|
121181
|
+
}
|
|
121182
|
+
function isInDirectoryPath(dir, file) {
|
|
121183
|
+
if (dir === void 0 || file.length <= dir.length) {
|
|
121184
|
+
return false;
|
|
121185
|
+
}
|
|
121186
|
+
return startsWith(file, dir) && file[dir.length] === directorySeparator;
|
|
121187
|
+
}
|
|
121188
|
+
function canWatchAffectingLocation(filePath) {
|
|
121189
|
+
return canWatchDirectoryOrFile(filePath);
|
|
121190
|
+
}
|
|
121191
|
+
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootSplitLength, getCurrentDirectory) {
|
|
121192
|
+
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
|
121193
|
+
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
121194
|
+
const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
|
|
121195
|
+
const failedLookupSplit = failedLookupLocation.split(directorySeparator);
|
|
121196
|
+
Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
|
|
121197
|
+
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
121198
|
+
return {
|
|
121199
|
+
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
|
|
121200
|
+
dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
|
|
121201
|
+
};
|
|
121202
|
+
} else {
|
|
121203
|
+
return {
|
|
121204
|
+
dir: rootDir,
|
|
121205
|
+
dirPath: rootPath,
|
|
121206
|
+
nonRecursive: false
|
|
121207
|
+
};
|
|
121208
|
+
}
|
|
121209
|
+
}
|
|
121210
|
+
return getDirectoryToWatchFromFailedLookupLocationDirectory(
|
|
121211
|
+
getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
|
|
121212
|
+
getDirectoryPath(failedLookupLocationPath),
|
|
121213
|
+
rootPath
|
|
121214
|
+
);
|
|
121215
|
+
}
|
|
121216
|
+
function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath, rootPath) {
|
|
121217
|
+
while (pathContainsNodeModules(dirPath)) {
|
|
121218
|
+
dir = getDirectoryPath(dir);
|
|
121219
|
+
dirPath = getDirectoryPath(dirPath);
|
|
121220
|
+
}
|
|
121221
|
+
if (isNodeModulesDirectory(dirPath)) {
|
|
121222
|
+
return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
|
|
121223
|
+
}
|
|
121224
|
+
let nonRecursive = true;
|
|
121225
|
+
let subDirectoryPath, subDirectory;
|
|
121226
|
+
if (rootPath !== void 0) {
|
|
121227
|
+
while (!isInDirectoryPath(dirPath, rootPath)) {
|
|
121228
|
+
const parentPath = getDirectoryPath(dirPath);
|
|
121229
|
+
if (parentPath === dirPath) {
|
|
121230
|
+
break;
|
|
121231
|
+
}
|
|
121232
|
+
nonRecursive = false;
|
|
121233
|
+
subDirectoryPath = dirPath;
|
|
121234
|
+
subDirectory = dir;
|
|
121235
|
+
dirPath = parentPath;
|
|
121236
|
+
dir = getDirectoryPath(dir);
|
|
121237
|
+
}
|
|
121238
|
+
}
|
|
121239
|
+
return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
|
|
121240
|
+
}
|
|
121241
|
+
function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, filterCustomPath) {
|
|
121242
|
+
if (isInDirectoryPath(rootPath, typeRootPath)) {
|
|
121243
|
+
return rootPath;
|
|
121244
|
+
}
|
|
121245
|
+
const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath, rootPath);
|
|
121246
|
+
return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0;
|
|
121247
|
+
}
|
|
121248
|
+
function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) {
|
|
121249
|
+
return rootDirForResolution && removeTrailingDirectorySeparator(getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
|
|
121250
|
+
}
|
|
121174
121251
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
121175
121252
|
let filesWithChangedSetOfUnresolvedImports;
|
|
121176
121253
|
let filesWithInvalidatedResolutions;
|
|
@@ -121205,7 +121282,7 @@ ${lanes.join("\n")}
|
|
|
121205
121282
|
const customFailedLookupPaths = /* @__PURE__ */ new Map();
|
|
121206
121283
|
const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map();
|
|
121207
121284
|
const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map();
|
|
121208
|
-
const rootDir =
|
|
121285
|
+
const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
|
|
121209
121286
|
const rootPath = rootDir && resolutionHost.toPath(rootDir);
|
|
121210
121287
|
const rootSplitLength = rootPath !== void 0 ? rootPath.split(directorySeparator).length : 0;
|
|
121211
121288
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
@@ -121238,12 +121315,6 @@ ${lanes.join("\n")}
|
|
|
121238
121315
|
function getResolvedTypeReferenceDirective2(resolution) {
|
|
121239
121316
|
return resolution.resolvedTypeReferenceDirective;
|
|
121240
121317
|
}
|
|
121241
|
-
function isInDirectoryPath(dir, file) {
|
|
121242
|
-
if (dir === void 0 || file.length <= dir.length) {
|
|
121243
|
-
return false;
|
|
121244
|
-
}
|
|
121245
|
-
return startsWith(file, dir) && file[dir.length] === directorySeparator;
|
|
121246
|
-
}
|
|
121247
121318
|
function clear2() {
|
|
121248
121319
|
clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf);
|
|
121249
121320
|
clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf);
|
|
@@ -121527,55 +121598,6 @@ ${lanes.join("\n")}
|
|
|
121527
121598
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121528
121599
|
return endsWith(dirPath, "/node_modules/@types");
|
|
121529
121600
|
}
|
|
121530
|
-
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) {
|
|
121531
|
-
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
|
121532
|
-
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
121533
|
-
const failedLookupPathSplit = failedLookupLocationPath.split(directorySeparator);
|
|
121534
|
-
const failedLookupSplit = failedLookupLocation.split(directorySeparator);
|
|
121535
|
-
Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
|
|
121536
|
-
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
121537
|
-
return {
|
|
121538
|
-
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(directorySeparator),
|
|
121539
|
-
dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(directorySeparator)
|
|
121540
|
-
};
|
|
121541
|
-
} else {
|
|
121542
|
-
return {
|
|
121543
|
-
dir: rootDir,
|
|
121544
|
-
dirPath: rootPath,
|
|
121545
|
-
nonRecursive: false
|
|
121546
|
-
};
|
|
121547
|
-
}
|
|
121548
|
-
}
|
|
121549
|
-
return getDirectoryToWatchFromFailedLookupLocationDirectory(
|
|
121550
|
-
getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())),
|
|
121551
|
-
getDirectoryPath(failedLookupLocationPath)
|
|
121552
|
-
);
|
|
121553
|
-
}
|
|
121554
|
-
function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) {
|
|
121555
|
-
while (pathContainsNodeModules(dirPath)) {
|
|
121556
|
-
dir = getDirectoryPath(dir);
|
|
121557
|
-
dirPath = getDirectoryPath(dirPath);
|
|
121558
|
-
}
|
|
121559
|
-
if (isNodeModulesDirectory(dirPath)) {
|
|
121560
|
-
return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : void 0;
|
|
121561
|
-
}
|
|
121562
|
-
let nonRecursive = true;
|
|
121563
|
-
let subDirectoryPath, subDirectory;
|
|
121564
|
-
if (rootPath !== void 0) {
|
|
121565
|
-
while (!isInDirectoryPath(dirPath, rootPath)) {
|
|
121566
|
-
const parentPath = getDirectoryPath(dirPath);
|
|
121567
|
-
if (parentPath === dirPath) {
|
|
121568
|
-
break;
|
|
121569
|
-
}
|
|
121570
|
-
nonRecursive = false;
|
|
121571
|
-
subDirectoryPath = dirPath;
|
|
121572
|
-
subDirectory = dir;
|
|
121573
|
-
dirPath = parentPath;
|
|
121574
|
-
dir = getDirectoryPath(dir);
|
|
121575
|
-
}
|
|
121576
|
-
}
|
|
121577
|
-
return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0;
|
|
121578
|
-
}
|
|
121579
121601
|
function isPathWithDefaultFailedLookupExtension(path) {
|
|
121580
121602
|
return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
|
121581
121603
|
}
|
|
@@ -121614,7 +121636,14 @@ ${lanes.join("\n")}
|
|
|
121614
121636
|
if (failedLookupLocations) {
|
|
121615
121637
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121616
121638
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121617
|
-
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121639
|
+
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121640
|
+
failedLookupLocation,
|
|
121641
|
+
failedLookupLocationPath,
|
|
121642
|
+
rootDir,
|
|
121643
|
+
rootPath,
|
|
121644
|
+
rootSplitLength,
|
|
121645
|
+
getCurrentDirectory
|
|
121646
|
+
);
|
|
121618
121647
|
if (toWatch) {
|
|
121619
121648
|
const { dir, dirPath, nonRecursive } = toWatch;
|
|
121620
121649
|
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
|
|
@@ -121682,7 +121711,7 @@ ${lanes.join("\n")}
|
|
|
121682
121711
|
}
|
|
121683
121712
|
const paths = /* @__PURE__ */ new Set();
|
|
121684
121713
|
paths.add(locationToWatch);
|
|
121685
|
-
let actualWatcher =
|
|
121714
|
+
let actualWatcher = canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
121686
121715
|
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
121687
121716
|
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
|
121688
121717
|
paths.forEach((path) => {
|
|
@@ -121750,7 +121779,14 @@ ${lanes.join("\n")}
|
|
|
121750
121779
|
let removeAtRoot = false;
|
|
121751
121780
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121752
121781
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121753
|
-
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121782
|
+
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121783
|
+
failedLookupLocation,
|
|
121784
|
+
failedLookupLocationPath,
|
|
121785
|
+
rootDir,
|
|
121786
|
+
rootPath,
|
|
121787
|
+
rootSplitLength,
|
|
121788
|
+
getCurrentDirectory
|
|
121789
|
+
);
|
|
121754
121790
|
if (toWatch) {
|
|
121755
121791
|
const { dirPath } = toWatch;
|
|
121756
121792
|
const refCount = customFailedLookupPaths.get(failedLookupLocationPath);
|
|
@@ -121918,13 +121954,6 @@ ${lanes.join("\n")}
|
|
|
121918
121954
|
function closeTypeRootsWatch() {
|
|
121919
121955
|
clearMap(typeRootsWatches, closeFileWatcher);
|
|
121920
121956
|
}
|
|
121921
|
-
function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) {
|
|
121922
|
-
if (isInDirectoryPath(rootPath, typeRootPath)) {
|
|
121923
|
-
return rootPath;
|
|
121924
|
-
}
|
|
121925
|
-
const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath);
|
|
121926
|
-
return toWatch && directoryWatchesOfFailedLookups.has(toWatch.dirPath) ? toWatch.dirPath : void 0;
|
|
121927
|
-
}
|
|
121928
121957
|
function createTypeRootsWatch(typeRootPath, typeRoot) {
|
|
121929
121958
|
return canWatchTypeRootPath(typeRootPath) ? resolutionHost.watchTypeRootsDirectory(typeRoot, (fileOrDirectory) => {
|
|
121930
121959
|
const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
|
|
@@ -121933,7 +121962,12 @@ ${lanes.join("\n")}
|
|
|
121933
121962
|
}
|
|
121934
121963
|
hasChangedAutomaticTypeDirectiveNames = true;
|
|
121935
121964
|
resolutionHost.onChangedAutomaticTypeDirectiveNames();
|
|
121936
|
-
const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
|
|
121965
|
+
const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(
|
|
121966
|
+
typeRoot,
|
|
121967
|
+
typeRootPath,
|
|
121968
|
+
rootPath,
|
|
121969
|
+
(dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2)
|
|
121970
|
+
);
|
|
121937
121971
|
if (dirPath) {
|
|
121938
121972
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
121939
121973
|
}
|
|
@@ -121959,12 +121993,10 @@ ${lanes.join("\n")}
|
|
|
121959
121993
|
closeTypeRootsWatch();
|
|
121960
121994
|
}
|
|
121961
121995
|
}
|
|
121962
|
-
function canWatchTypeRootPath(
|
|
121996
|
+
function canWatchTypeRootPath(typeRoot) {
|
|
121963
121997
|
if (resolutionHost.getCompilationSettings().typeRoots)
|
|
121964
121998
|
return true;
|
|
121965
|
-
|
|
121966
|
-
const dirPath = resolutionHost.toPath(dir);
|
|
121967
|
-
return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
|
|
121999
|
+
return canWatchAtTypes(resolutionHost.toPath(typeRoot), rootPath);
|
|
121968
122000
|
}
|
|
121969
122001
|
}
|
|
121970
122002
|
function resolutionIsSymlink(resolution) {
|
|
@@ -129061,7 +129093,7 @@ ${lanes.join("\n")}
|
|
|
129061
129093
|
// Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list.
|
|
129062
129094
|
typeAcquisitionEnabled && consumesNodeCoreModules(oldSourceFile) !== consumesNodeCoreModules(newSourceFile) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported.
|
|
129063
129095
|
// Changes elsewhere in the file can change the *type* of an export in a module augmentation,
|
|
129064
|
-
// but type info is gathered in getCompletionEntryDetails, which doesn
|
|
129096
|
+
// but type info is gathered in getCompletionEntryDetails, which doesn't use the cache.
|
|
129065
129097
|
!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) || !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)) {
|
|
129066
129098
|
cache.clear();
|
|
129067
129099
|
return true;
|
|
@@ -137826,7 +137858,7 @@ ${lanes.join("\n")}
|
|
|
137826
137858
|
function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) {
|
|
137827
137859
|
const errorNode = isPropertyAccessExpression(reference.parent) ? reference.parent.name : isBinaryExpression(reference.parent) ? reference.parent : reference;
|
|
137828
137860
|
const diagnostic = find(diagnostics, (diagnostic2) => diagnostic2.start === errorNode.getStart(sourceFile) && diagnostic2.start + diagnostic2.length === errorNode.getEnd());
|
|
137829
|
-
return diagnostic && contains(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it
|
|
137861
|
+
return diagnostic && contains(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it's not valid
|
|
137830
137862
|
// in an arithmetic expression and an equality comparison seems unusual),
|
|
137831
137863
|
// but if the other side of the binary expression has an error, the side
|
|
137832
137864
|
// is typed `any` which will squash the error that would identify this
|
|
@@ -153783,7 +153815,7 @@ ${lanes.join("\n")}
|
|
|
153783
153815
|
*/
|
|
153784
153816
|
this.markSeenReExportRHS = nodeSeenTracker();
|
|
153785
153817
|
this.symbolIdToReferences = [];
|
|
153786
|
-
// Source file ID
|
|
153818
|
+
// Source file ID -> symbol ID -> Whether the symbol has been searched for in the source file.
|
|
153787
153819
|
this.sourceFileToSeenSymbols = [];
|
|
153788
153820
|
}
|
|
153789
153821
|
includesSourceFile(sourceFile) {
|
|
@@ -162927,7 +162959,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162927
162959
|
if (start !== end) {
|
|
162928
162960
|
const textSpan = createTextSpanFromBounds(start, end);
|
|
162929
162961
|
if (!selectionRange || // Skip ranges that are identical to the parent
|
|
162930
|
-
!textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don
|
|
162962
|
+
!textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don't contain the original position
|
|
162931
162963
|
textSpanIntersectsWithPosition(textSpan, pos)) {
|
|
162932
162964
|
selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } };
|
|
162933
162965
|
}
|
|
@@ -168296,6 +168328,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
168296
168328
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
168297
168329
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
168298
168330
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
168331
|
+
canWatchAffectingLocation: () => canWatchAffectingLocation,
|
|
168332
|
+
canWatchAtTypes: () => canWatchAtTypes,
|
|
168299
168333
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
168300
168334
|
cartesianProduct: () => cartesianProduct,
|
|
168301
168335
|
cast: () => cast,
|
|
@@ -168743,6 +168777,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
168743
168777
|
getDiagnosticText: () => getDiagnosticText,
|
|
168744
168778
|
getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan,
|
|
168745
168779
|
getDirectoryPath: () => getDirectoryPath,
|
|
168780
|
+
getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
|
|
168781
|
+
getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
|
|
168746
168782
|
getDocumentPositionMapper: () => getDocumentPositionMapper,
|
|
168747
168783
|
getESModuleInterop: () => getESModuleInterop,
|
|
168748
168784
|
getEditsForFileRename: () => getEditsForFileRename,
|
|
@@ -169012,6 +169048,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169012
169048
|
getRestParameterElementType: () => getRestParameterElementType,
|
|
169013
169049
|
getRightMostAssignedExpression: () => getRightMostAssignedExpression,
|
|
169014
169050
|
getRootDeclaration: () => getRootDeclaration,
|
|
169051
|
+
getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache,
|
|
169015
169052
|
getRootLength: () => getRootLength,
|
|
169016
169053
|
getScriptKind: () => getScriptKind,
|
|
169017
169054
|
getScriptKindFromFileName: () => getScriptKindFromFileName,
|
|
@@ -170109,6 +170146,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
170109
170146
|
setValueDeclaration: () => setValueDeclaration,
|
|
170110
170147
|
shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension,
|
|
170111
170148
|
shouldPreserveConstEnums: () => shouldPreserveConstEnums,
|
|
170149
|
+
shouldResolveJsRequire: () => shouldResolveJsRequire,
|
|
170112
170150
|
shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules,
|
|
170113
170151
|
showModuleSpecifier: () => showModuleSpecifier,
|
|
170114
170152
|
signatureHasLiteralTypes: () => signatureHasLiteralTypes,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230401`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -26192,7 +26192,8 @@ var commandOptionsWithoutBuild = [
|
|
|
26192
26192
|
affectsBuildInfo: true,
|
|
26193
26193
|
category: Diagnostics.Modules,
|
|
26194
26194
|
description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
|
|
26195
|
-
defaultValueDescription: false
|
|
26195
|
+
defaultValueDescription: false,
|
|
26196
|
+
transpileOptionValue: void 0
|
|
26196
26197
|
},
|
|
26197
26198
|
{
|
|
26198
26199
|
name: "resolvePackageJsonExports",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.1.0-dev.
|
|
5
|
+
"version": "5.1.0-dev.20230401",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "14.21.1",
|
|
114
114
|
"npm": "8.19.3"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "27d3454f07cb41a24275d7f1de07621b8217f739"
|
|
117
117
|
}
|