typescript 5.3.0-dev.20230824 → 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 +93 -83
- package/lib/tsserver.js +114 -107
- package/lib/typescript.js +114 -106
- package/lib/typingsInstaller.js +22 -23
- package/package.json +2 -2
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.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230826`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -693,9 +693,6 @@ function endsWith(str, suffix) {
|
|
|
693
693
|
const expectedPos = str.length - suffix.length;
|
|
694
694
|
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
|
695
695
|
}
|
|
696
|
-
function stringContains(str, substring) {
|
|
697
|
-
return str.indexOf(substring) !== -1;
|
|
698
|
-
}
|
|
699
696
|
function removeMinAndVersionNumbers(fileName) {
|
|
700
697
|
let end = fileName.length;
|
|
701
698
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -3927,11 +3924,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
3927
3924
|
return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
3928
3925
|
}
|
|
3929
3926
|
function isInPath(path2, searchPath) {
|
|
3930
|
-
if (
|
|
3927
|
+
if (path2.includes(searchPath))
|
|
3931
3928
|
return true;
|
|
3932
3929
|
if (useCaseSensitiveFileNames2)
|
|
3933
3930
|
return false;
|
|
3934
|
-
return
|
|
3931
|
+
return toCanonicalFilePath(path2).includes(searchPath);
|
|
3935
3932
|
}
|
|
3936
3933
|
}
|
|
3937
3934
|
function createFileWatcherCallback(callback) {
|
|
@@ -4761,7 +4758,7 @@ function pathIsRelative(path2) {
|
|
|
4761
4758
|
return /^\.\.?($|[\\/])/.test(path2);
|
|
4762
4759
|
}
|
|
4763
4760
|
function hasExtension(fileName) {
|
|
4764
|
-
return
|
|
4761
|
+
return getBaseFileName(fileName).includes(".");
|
|
4765
4762
|
}
|
|
4766
4763
|
function fileExtensionIs(path2, extension) {
|
|
4767
4764
|
return path2.length > extension.length && endsWith(path2, extension);
|
|
@@ -4906,7 +4903,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
4906
4903
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
4907
4904
|
}
|
|
4908
4905
|
function normalizeSlashes(path2) {
|
|
4909
|
-
return path2.
|
|
4906
|
+
return path2.includes("\\") ? path2.replace(backslashRegExp, directorySeparator) : path2;
|
|
4910
4907
|
}
|
|
4911
4908
|
function reducePathComponents(components) {
|
|
4912
4909
|
if (!some(components))
|
|
@@ -21824,7 +21821,9 @@ var Parser;
|
|
|
21824
21821
|
let dotDotDotToken;
|
|
21825
21822
|
let expression;
|
|
21826
21823
|
if (token() !== 20 /* CloseBraceToken */) {
|
|
21827
|
-
|
|
21824
|
+
if (!inExpressionContext) {
|
|
21825
|
+
dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
|
|
21826
|
+
}
|
|
21828
21827
|
expression = parseExpression();
|
|
21829
21828
|
}
|
|
21830
21829
|
if (inExpressionContext) {
|
|
@@ -25338,7 +25337,7 @@ var IncrementalParser;
|
|
|
25338
25337
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
25339
25338
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
25340
25339
|
function isDeclarationFileName(fileName) {
|
|
25341
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
25340
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
25342
25341
|
}
|
|
25343
25342
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
25344
25343
|
if (!mode) {
|
|
@@ -27863,7 +27862,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27863
27862
|
result = tryResolve(extensions, state);
|
|
27864
27863
|
}
|
|
27865
27864
|
let legacyResult;
|
|
27866
|
-
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.
|
|
27865
|
+
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")) {
|
|
27867
27866
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
27868
27867
|
const diagnosticState = {
|
|
27869
27868
|
...state,
|
|
@@ -27907,7 +27906,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
27907
27906
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
27908
27907
|
}
|
|
27909
27908
|
if (!resolved2) {
|
|
27910
|
-
if (moduleName.
|
|
27909
|
+
if (moduleName.includes(":")) {
|
|
27911
27910
|
if (traceEnabled) {
|
|
27912
27911
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
27913
27912
|
}
|
|
@@ -27997,7 +27996,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
27997
27996
|
}
|
|
27998
27997
|
var nodeModulesPathPart = "/node_modules/";
|
|
27999
27998
|
function pathContainsNodeModules(path2) {
|
|
28000
|
-
return
|
|
27999
|
+
return path2.includes(nodeModulesPathPart);
|
|
28001
28000
|
}
|
|
28002
28001
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
28003
28002
|
const path2 = normalizePath(resolved);
|
|
@@ -28033,7 +28032,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
28033
28032
|
}
|
|
28034
28033
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
28035
28034
|
const filename = getBaseFileName(candidate);
|
|
28036
|
-
if (filename.
|
|
28035
|
+
if (!filename.includes(".")) {
|
|
28037
28036
|
return void 0;
|
|
28038
28037
|
}
|
|
28039
28038
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -28441,7 +28440,7 @@ function comparePatternKeys(a, b) {
|
|
|
28441
28440
|
}
|
|
28442
28441
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
28443
28442
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
28444
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
28443
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
28445
28444
|
const target = lookupTable[moduleName];
|
|
28446
28445
|
return loadModuleFromTargetImportOrExport(
|
|
28447
28446
|
target,
|
|
@@ -28452,7 +28451,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
28452
28451
|
moduleName
|
|
28453
28452
|
);
|
|
28454
28453
|
}
|
|
28455
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
28454
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
28456
28455
|
for (const potentialTarget of expandingKeys) {
|
|
28457
28456
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
28458
28457
|
const target = lookupTable[potentialTarget];
|
|
@@ -28546,7 +28545,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28546
28545
|
}
|
|
28547
28546
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
28548
28547
|
const partsAfterFirst = parts.slice(1);
|
|
28549
|
-
if (partsAfterFirst.
|
|
28548
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
28550
28549
|
if (state.traceEnabled) {
|
|
28551
28550
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
28552
28551
|
}
|
|
@@ -28557,7 +28556,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28557
28556
|
}
|
|
28558
28557
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
28559
28558
|
const subpathParts = getPathComponents(subpath);
|
|
28560
|
-
if (subpathParts.
|
|
28559
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
28561
28560
|
if (state.traceEnabled) {
|
|
28562
28561
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
28563
28562
|
}
|
|
@@ -28584,7 +28583,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28584
28583
|
if (!Array.isArray(target)) {
|
|
28585
28584
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
28586
28585
|
for (const condition of getOwnKeys(target)) {
|
|
28587
|
-
if (condition === "default" || state.conditions.
|
|
28586
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
28588
28587
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
28589
28588
|
const subTarget = target[condition];
|
|
28590
28589
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -28645,7 +28644,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28645
28644
|
}
|
|
28646
28645
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
28647
28646
|
var _a, _b, _c, _d;
|
|
28648
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
28647
|
+
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)) {
|
|
28649
28648
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
28650
28649
|
const commonSourceDirGuesses = [];
|
|
28651
28650
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -28719,7 +28718,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28719
28718
|
}
|
|
28720
28719
|
}
|
|
28721
28720
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
28722
|
-
if (conditions.
|
|
28721
|
+
if (!conditions.includes("types"))
|
|
28723
28722
|
return false;
|
|
28724
28723
|
if (!startsWith(key, "types@"))
|
|
28725
28724
|
return false;
|
|
@@ -31667,7 +31666,7 @@ var Arguments;
|
|
|
31667
31666
|
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
31668
31667
|
})(Arguments || (Arguments = {}));
|
|
31669
31668
|
function hasArgument(argumentName) {
|
|
31670
|
-
return sys.args.
|
|
31669
|
+
return sys.args.includes(argumentName);
|
|
31671
31670
|
}
|
|
31672
31671
|
function findArgument(argumentName) {
|
|
31673
31672
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -32094,7 +32093,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32094
32093
|
log2
|
|
32095
32094
|
);
|
|
32096
32095
|
this.npmPath = npmLocation2 !== void 0 ? npmLocation2 : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation2, this.installTypingHost);
|
|
32097
|
-
if (
|
|
32096
|
+
if (this.npmPath.includes(" ") && this.npmPath[0] !== `"`) {
|
|
32098
32097
|
this.npmPath = `"${this.npmPath}"`;
|
|
32099
32098
|
}
|
|
32100
32099
|
if (this.log.isEnabled()) {
|
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.3.0-dev.
|
|
5
|
+
"version": "5.3.0-dev.20230826",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "20.1.0",
|
|
113
113
|
"npm": "8.19.4"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "51e7a34c2c1557259599d6039c3e20da05d23abe"
|
|
116
116
|
}
|