typescript 5.3.0-dev.20230825 → 5.3.0-dev.20230826
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/cancellationToken.js +1 -1
- package/lib/tsc.js +44 -47
- package/lib/tsserver.js +65 -71
- package/lib/typescript.js +65 -70
- package/lib/typingsInstaller.js +19 -22
- package/package.json +2 -2
package/lib/cancellationToken.js
CHANGED
|
@@ -60,7 +60,7 @@ function createCancellationToken(args) {
|
|
|
60
60
|
}
|
|
61
61
|
if (cancellationPipeName.charAt(cancellationPipeName.length - 1) === "*") {
|
|
62
62
|
const namePrefix = cancellationPipeName.slice(0, -1);
|
|
63
|
-
if (namePrefix.length === 0 || namePrefix.
|
|
63
|
+
if (namePrefix.length === 0 || namePrefix.includes("*")) {
|
|
64
64
|
throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");
|
|
65
65
|
}
|
|
66
66
|
let perRequestPipeName;
|
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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230826`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1111,9 +1111,6 @@ function endsWith(str, suffix) {
|
|
|
1111
1111
|
function removeSuffix(str, suffix) {
|
|
1112
1112
|
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
|
|
1113
1113
|
}
|
|
1114
|
-
function stringContains(str, substring) {
|
|
1115
|
-
return str.indexOf(substring) !== -1;
|
|
1116
|
-
}
|
|
1117
1114
|
function orderedRemoveItem(array, item) {
|
|
1118
1115
|
for (let i = 0; i < array.length; i++) {
|
|
1119
1116
|
if (array[i] === item) {
|
|
@@ -4517,11 +4514,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
4517
4514
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
4518
4515
|
}
|
|
4519
4516
|
function isInPath(path, searchPath) {
|
|
4520
|
-
if (
|
|
4517
|
+
if (path.includes(searchPath))
|
|
4521
4518
|
return true;
|
|
4522
4519
|
if (useCaseSensitiveFileNames2)
|
|
4523
4520
|
return false;
|
|
4524
|
-
return
|
|
4521
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
4525
4522
|
}
|
|
4526
4523
|
}
|
|
4527
4524
|
function createFileWatcherCallback(callback) {
|
|
@@ -5358,7 +5355,7 @@ function pathIsBareSpecifier(path) {
|
|
|
5358
5355
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
5359
5356
|
}
|
|
5360
5357
|
function hasExtension(fileName) {
|
|
5361
|
-
return
|
|
5358
|
+
return getBaseFileName(fileName).includes(".");
|
|
5362
5359
|
}
|
|
5363
5360
|
function fileExtensionIs(path, extension) {
|
|
5364
5361
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -5503,7 +5500,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
5503
5500
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
5504
5501
|
}
|
|
5505
5502
|
function normalizeSlashes(path) {
|
|
5506
|
-
return path.
|
|
5503
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
5507
5504
|
}
|
|
5508
5505
|
function reducePathComponents(components) {
|
|
5509
5506
|
if (!some(components))
|
|
@@ -11523,7 +11520,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
11523
11520
|
void 0,
|
|
11524
11521
|
Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
|
|
11525
11522
|
node10Result,
|
|
11526
|
-
node10Result.
|
|
11523
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
11527
11524
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
11528
11525
|
/*details*/
|
|
11529
11526
|
void 0,
|
|
@@ -14780,7 +14777,7 @@ function isQuoteOrBacktick(charCode) {
|
|
|
14780
14777
|
}
|
|
14781
14778
|
function isIntrinsicJsxName(name) {
|
|
14782
14779
|
const ch = name.charCodeAt(0);
|
|
14783
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
14780
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
14784
14781
|
}
|
|
14785
14782
|
var indentStrings = ["", " "];
|
|
14786
14783
|
function getIndentString(level) {
|
|
@@ -14794,7 +14791,7 @@ function getIndentSize() {
|
|
|
14794
14791
|
return indentStrings[1].length;
|
|
14795
14792
|
}
|
|
14796
14793
|
function isNightly() {
|
|
14797
|
-
return
|
|
14794
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
14798
14795
|
}
|
|
14799
14796
|
function createTextWriter(newLine) {
|
|
14800
14797
|
var output;
|
|
@@ -14984,7 +14981,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
|
|
|
14984
14981
|
return void 0;
|
|
14985
14982
|
}
|
|
14986
14983
|
const specifier = getExternalModuleName(declaration);
|
|
14987
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
14984
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
14988
14985
|
return void 0;
|
|
14989
14986
|
}
|
|
14990
14987
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -16792,7 +16789,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
|
|
|
16792
16789
|
const flatBuiltins = flatten(builtins);
|
|
16793
16790
|
const extensions = [
|
|
16794
16791
|
...builtins,
|
|
16795
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
16792
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
16796
16793
|
];
|
|
16797
16794
|
return extensions;
|
|
16798
16795
|
}
|
|
@@ -17234,7 +17231,7 @@ function expressionResultIsUnused(node) {
|
|
|
17234
17231
|
}
|
|
17235
17232
|
}
|
|
17236
17233
|
function containsIgnoredPath(path) {
|
|
17237
|
-
return some(ignoredPaths, (p) =>
|
|
17234
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
17238
17235
|
}
|
|
17239
17236
|
function getContainingNodeArray(node) {
|
|
17240
17237
|
if (!node.parent)
|
|
@@ -33483,7 +33480,7 @@ var IncrementalParser;
|
|
|
33483
33480
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
33484
33481
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
33485
33482
|
function isDeclarationFileName(fileName) {
|
|
33486
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
33483
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
33487
33484
|
}
|
|
33488
33485
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
33489
33486
|
if (!mode) {
|
|
@@ -35198,7 +35195,7 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
35198
35195
|
if (startsWith(value, "-")) {
|
|
35199
35196
|
return void 0;
|
|
35200
35197
|
}
|
|
35201
|
-
if (opt.type === "listOrElement" && !
|
|
35198
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
35202
35199
|
return validateJsonOptionValue(opt, value, errors);
|
|
35203
35200
|
}
|
|
35204
35201
|
if (value === "") {
|
|
@@ -36222,7 +36219,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
36222
36219
|
var _a;
|
|
36223
36220
|
basePath = normalizeSlashes(basePath);
|
|
36224
36221
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
36225
|
-
if (resolutionStack.
|
|
36222
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
36226
36223
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
36227
36224
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
36228
36225
|
}
|
|
@@ -37956,7 +37953,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
37956
37953
|
result = tryResolve(extensions, state);
|
|
37957
37954
|
}
|
|
37958
37955
|
let legacyResult;
|
|
37959
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.
|
|
37956
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
|
|
37960
37957
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
37961
37958
|
const diagnosticState = {
|
|
37962
37959
|
...state,
|
|
@@ -38000,7 +37997,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
38000
37997
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
38001
37998
|
}
|
|
38002
37999
|
if (!resolved2) {
|
|
38003
|
-
if (moduleName.
|
|
38000
|
+
if (moduleName.includes(":")) {
|
|
38004
38001
|
if (traceEnabled) {
|
|
38005
38002
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
38006
38003
|
}
|
|
@@ -38090,7 +38087,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
38090
38087
|
}
|
|
38091
38088
|
var nodeModulesPathPart = "/node_modules/";
|
|
38092
38089
|
function pathContainsNodeModules(path) {
|
|
38093
|
-
return
|
|
38090
|
+
return path.includes(nodeModulesPathPart);
|
|
38094
38091
|
}
|
|
38095
38092
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
38096
38093
|
const path = normalizePath(resolved);
|
|
@@ -38126,7 +38123,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
38126
38123
|
}
|
|
38127
38124
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
38128
38125
|
const filename = getBaseFileName(candidate);
|
|
38129
|
-
if (filename.
|
|
38126
|
+
if (!filename.includes(".")) {
|
|
38130
38127
|
return void 0;
|
|
38131
38128
|
}
|
|
38132
38129
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -38550,7 +38547,7 @@ function comparePatternKeys(a, b) {
|
|
|
38550
38547
|
}
|
|
38551
38548
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
38552
38549
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
38553
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
38550
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
38554
38551
|
const target = lookupTable[moduleName];
|
|
38555
38552
|
return loadModuleFromTargetImportOrExport(
|
|
38556
38553
|
target,
|
|
@@ -38561,7 +38558,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
38561
38558
|
moduleName
|
|
38562
38559
|
);
|
|
38563
38560
|
}
|
|
38564
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
38561
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
38565
38562
|
for (const potentialTarget of expandingKeys) {
|
|
38566
38563
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
38567
38564
|
const target = lookupTable[potentialTarget];
|
|
@@ -38655,7 +38652,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38655
38652
|
}
|
|
38656
38653
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
38657
38654
|
const partsAfterFirst = parts.slice(1);
|
|
38658
|
-
if (partsAfterFirst.
|
|
38655
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
38659
38656
|
if (state.traceEnabled) {
|
|
38660
38657
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
38661
38658
|
}
|
|
@@ -38666,7 +38663,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38666
38663
|
}
|
|
38667
38664
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
38668
38665
|
const subpathParts = getPathComponents(subpath);
|
|
38669
|
-
if (subpathParts.
|
|
38666
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
38670
38667
|
if (state.traceEnabled) {
|
|
38671
38668
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
38672
38669
|
}
|
|
@@ -38693,7 +38690,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38693
38690
|
if (!Array.isArray(target)) {
|
|
38694
38691
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
38695
38692
|
for (const condition of getOwnKeys(target)) {
|
|
38696
|
-
if (condition === "default" || state.conditions.
|
|
38693
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
38697
38694
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
38698
38695
|
const subTarget = target[condition];
|
|
38699
38696
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -38754,7 +38751,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38754
38751
|
}
|
|
38755
38752
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
38756
38753
|
var _a, _b, _c, _d;
|
|
38757
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
38754
|
+
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
38758
38755
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
38759
38756
|
const commonSourceDirGuesses = [];
|
|
38760
38757
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -38828,7 +38825,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38828
38825
|
}
|
|
38829
38826
|
}
|
|
38830
38827
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
38831
|
-
if (conditions.
|
|
38828
|
+
if (!conditions.includes("types"))
|
|
38832
38829
|
return false;
|
|
38833
38830
|
if (!startsWith(key, "types@"))
|
|
38834
38831
|
return false;
|
|
@@ -39033,7 +39030,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
39033
39030
|
return mangledName;
|
|
39034
39031
|
}
|
|
39035
39032
|
function unmangleScopedPackageName(typesPackageName) {
|
|
39036
|
-
return
|
|
39033
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
39037
39034
|
}
|
|
39038
39035
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
39039
39036
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -42663,12 +42660,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42663
42660
|
/*currentDirectory*/
|
|
42664
42661
|
void 0
|
|
42665
42662
|
);
|
|
42666
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
42663
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
42667
42664
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
42668
42665
|
});
|
|
42669
42666
|
} else {
|
|
42670
42667
|
for (const key of getOwnKeys(exports)) {
|
|
42671
|
-
if (key === "default" || conditions.
|
|
42668
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
42672
42669
|
const subTarget = exports[key];
|
|
42673
42670
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
42674
42671
|
if (result) {
|
|
@@ -42834,7 +42831,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
42834
42831
|
return fileName;
|
|
42835
42832
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
42836
42833
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
42837
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
42834
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
42838
42835
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
42839
42836
|
}
|
|
42840
42837
|
switch (allowedEndings[0]) {
|
|
@@ -42860,7 +42857,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
42860
42857
|
}
|
|
42861
42858
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
42862
42859
|
const baseName = getBaseFileName(fileName);
|
|
42863
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
42860
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
42864
42861
|
return void 0;
|
|
42865
42862
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
42866
42863
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -48921,12 +48918,12 @@ function createTypeChecker(host) {
|
|
|
48921
48918
|
if (!specifier) {
|
|
48922
48919
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
48923
48920
|
}
|
|
48924
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
48921
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
48925
48922
|
const oldSpecifier = specifier;
|
|
48926
48923
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
48927
48924
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
48928
48925
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
48929
|
-
if (specifier.
|
|
48926
|
+
if (specifier.includes("/node_modules/")) {
|
|
48930
48927
|
specifier = oldSpecifier;
|
|
48931
48928
|
} else {
|
|
48932
48929
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -49632,7 +49629,7 @@ function createTypeChecker(host) {
|
|
|
49632
49629
|
for (const group2 of groups) {
|
|
49633
49630
|
if (group2.length > 1) {
|
|
49634
49631
|
statements = [
|
|
49635
|
-
...filter(statements, (s) => group2.
|
|
49632
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
49636
49633
|
factory.createExportDeclaration(
|
|
49637
49634
|
/*modifiers*/
|
|
49638
49635
|
void 0,
|
|
@@ -63009,7 +63006,7 @@ function createTypeChecker(host) {
|
|
|
63009
63006
|
const param = declaration;
|
|
63010
63007
|
if (isIdentifier(param.name)) {
|
|
63011
63008
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
63012
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
63009
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
63013
63010
|
param,
|
|
63014
63011
|
param.name.escapedText,
|
|
63015
63012
|
788968 /* Type */,
|
|
@@ -68397,7 +68394,7 @@ function createTypeChecker(host) {
|
|
|
68397
68394
|
return getJsxElementTypeAt(node) || anyType;
|
|
68398
68395
|
}
|
|
68399
68396
|
function isHyphenatedJsxName(name) {
|
|
68400
|
-
return
|
|
68397
|
+
return name.includes("-");
|
|
68401
68398
|
}
|
|
68402
68399
|
function isJsxIntrinsicTagName(tagName) {
|
|
68403
68400
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -83560,7 +83557,7 @@ function createTypeChecker(host) {
|
|
|
83560
83557
|
return false;
|
|
83561
83558
|
}
|
|
83562
83559
|
function checkGrammarNumericLiteral(node) {
|
|
83563
|
-
const isFractional = getTextOfNode(node).
|
|
83560
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
83564
83561
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
83565
83562
|
if (isFractional || isScientific) {
|
|
83566
83563
|
return;
|
|
@@ -106535,7 +106532,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
106535
106532
|
}
|
|
106536
106533
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
106537
106534
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
106538
|
-
return
|
|
106535
|
+
return comment.includes("@internal");
|
|
106539
106536
|
}
|
|
106540
106537
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
106541
106538
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -111014,7 +111011,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111014
111011
|
/*jsxAttributeEscape*/
|
|
111015
111012
|
false
|
|
111016
111013
|
);
|
|
111017
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
111014
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
111018
111015
|
} else if (isAccessExpression(expression)) {
|
|
111019
111016
|
const constantValue = getConstantValue(expression);
|
|
111020
111017
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -115847,7 +115844,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115847
115844
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
115848
115845
|
if (resultFromDts)
|
|
115849
115846
|
return resultFromDts;
|
|
115850
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
115847
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
115851
115848
|
return void 0;
|
|
115852
115849
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
115853
115850
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -117105,7 +117102,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117105
117102
|
const path = toPath3(fileName);
|
|
117106
117103
|
if (useSourceOfProjectReferenceRedirect) {
|
|
117107
117104
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
117108
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
117105
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
117109
117106
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
117110
117107
|
if (realPath2 !== path)
|
|
117111
117108
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -118465,7 +118462,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
118465
118462
|
var _a;
|
|
118466
118463
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
118467
118464
|
return;
|
|
118468
|
-
if (!originalRealpath || !
|
|
118465
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
118469
118466
|
return;
|
|
118470
118467
|
const symlinkCache = host.getSymlinkCache();
|
|
118471
118468
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -118493,7 +118490,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
118493
118490
|
if (!symlinkedDirectories)
|
|
118494
118491
|
return false;
|
|
118495
118492
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
118496
|
-
if (!
|
|
118493
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
118497
118494
|
return false;
|
|
118498
118495
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
118499
118496
|
return true;
|
|
@@ -120351,7 +120348,7 @@ function removeIgnoredPath(path) {
|
|
|
120351
120348
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
120352
120349
|
return removeSuffix(path, "/.staging");
|
|
120353
120350
|
}
|
|
120354
|
-
return some(ignoredPaths, (searchPath) =>
|
|
120351
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
120355
120352
|
}
|
|
120356
120353
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
120357
120354
|
if (length2 <= 1)
|
|
@@ -124767,7 +124764,7 @@ function createColors(sys2) {
|
|
|
124767
124764
|
function bold(str) {
|
|
124768
124765
|
return `\x1B[1m${str}\x1B[22m`;
|
|
124769
124766
|
}
|
|
124770
|
-
const isWindows = sys2.getEnvironmentVariable("OS") &&
|
|
124767
|
+
const isWindows = sys2.getEnvironmentVariable("OS") && sys2.getEnvironmentVariable("OS").toLowerCase().includes("windows");
|
|
124771
124768
|
const isWindowsTerminal = sys2.getEnvironmentVariable("WT_SESSION");
|
|
124772
124769
|
const isVSCode = sys2.getEnvironmentVariable("TERM_PROGRAM") && sys2.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
|
|
124773
124770
|
function blue(str) {
|