typescript 5.3.0-dev.20230911 → 5.3.0-dev.20230913
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 +40 -8
- package/lib/tsserver.js +52 -13
- package/lib/typescript.js +52 -13
- package/lib/typingsInstaller.js +2 -1
- package/package.json +3 -3
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.20230913`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3704,6 +3704,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3704
3704
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
3705
3705
|
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
3706
3706
|
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
3707
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
3707
3708
|
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
3708
3709
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3709
3710
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
@@ -36690,7 +36691,7 @@ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, e
|
|
|
36690
36691
|
return false;
|
|
36691
36692
|
}
|
|
36692
36693
|
for (const ext of extensionGroup) {
|
|
36693
|
-
if (fileExtensionIs(file, ext)) {
|
|
36694
|
+
if (fileExtensionIs(file, ext) && (ext !== ".ts" /* Ts */ || !fileExtensionIs(file, ".d.ts" /* Dts */))) {
|
|
36694
36695
|
return false;
|
|
36695
36696
|
}
|
|
36696
36697
|
const higherPriorityPath = keyMapper(changeExtension(file, ext));
|
|
@@ -56265,8 +56266,7 @@ function createTypeChecker(host) {
|
|
|
56265
56266
|
if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {
|
|
56266
56267
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
56267
56268
|
}
|
|
56268
|
-
const
|
|
56269
|
-
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (memberIds.length ? "," + memberIds.join(",") : "");
|
|
56269
|
+
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : "");
|
|
56270
56270
|
let type = tupleTypes.get(key);
|
|
56271
56271
|
if (!type) {
|
|
56272
56272
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));
|
|
@@ -62406,8 +62406,13 @@ function createTypeChecker(host) {
|
|
|
62406
62406
|
if (getObjectFlags(type) & 4 /* Reference */ && type.node) {
|
|
62407
62407
|
return type.node;
|
|
62408
62408
|
}
|
|
62409
|
-
if (type.symbol
|
|
62410
|
-
|
|
62409
|
+
if (type.symbol) {
|
|
62410
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
62411
|
+
type = getMappedTargetWithSymbol(type);
|
|
62412
|
+
}
|
|
62413
|
+
if (!(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {
|
|
62414
|
+
return type.symbol;
|
|
62415
|
+
}
|
|
62411
62416
|
}
|
|
62412
62417
|
if (isTupleType(type)) {
|
|
62413
62418
|
return type.target;
|
|
@@ -62427,6 +62432,13 @@ function createTypeChecker(host) {
|
|
|
62427
62432
|
}
|
|
62428
62433
|
return type;
|
|
62429
62434
|
}
|
|
62435
|
+
function getMappedTargetWithSymbol(type) {
|
|
62436
|
+
let target = type;
|
|
62437
|
+
while ((getObjectFlags(target) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && isMappedTypeWithKeyofConstraintDeclaration(target)) {
|
|
62438
|
+
target = getModifiersTypeFromMappedType(target);
|
|
62439
|
+
}
|
|
62440
|
+
return target.symbol ? target : type;
|
|
62441
|
+
}
|
|
62430
62442
|
function isPropertyIdenticalTo(sourceProp, targetProp) {
|
|
62431
62443
|
return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */;
|
|
62432
62444
|
}
|
|
@@ -114456,7 +114468,8 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
114456
114468
|
currentDirectory,
|
|
114457
114469
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
114458
114470
|
writeLog,
|
|
114459
|
-
toPath: toPath3
|
|
114471
|
+
toPath: toPath3,
|
|
114472
|
+
getScriptKind
|
|
114460
114473
|
}) {
|
|
114461
114474
|
const newPath = removeIgnoredPath(fileOrDirectoryPath);
|
|
114462
114475
|
if (!newPath) {
|
|
@@ -114466,7 +114479,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
114466
114479
|
fileOrDirectoryPath = newPath;
|
|
114467
114480
|
if (fileOrDirectoryPath === watchedDirPath)
|
|
114468
114481
|
return false;
|
|
114469
|
-
if (hasExtension(fileOrDirectoryPath) && !isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
114482
|
+
if (hasExtension(fileOrDirectoryPath) && !(isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions) || isSupportedScriptKind())) {
|
|
114470
114483
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
114471
114484
|
return true;
|
|
114472
114485
|
}
|
|
@@ -114495,6 +114508,25 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
114495
114508
|
function hasSourceFile(file) {
|
|
114496
114509
|
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
114497
114510
|
}
|
|
114511
|
+
function isSupportedScriptKind() {
|
|
114512
|
+
if (!getScriptKind)
|
|
114513
|
+
return false;
|
|
114514
|
+
const scriptKind = getScriptKind(fileOrDirectory);
|
|
114515
|
+
switch (scriptKind) {
|
|
114516
|
+
case 3 /* TS */:
|
|
114517
|
+
case 4 /* TSX */:
|
|
114518
|
+
case 7 /* Deferred */:
|
|
114519
|
+
case 5 /* External */:
|
|
114520
|
+
return true;
|
|
114521
|
+
case 1 /* JS */:
|
|
114522
|
+
case 2 /* JSX */:
|
|
114523
|
+
return getAllowJSCompilerOption(options);
|
|
114524
|
+
case 6 /* JSON */:
|
|
114525
|
+
return getResolveJsonModule(options);
|
|
114526
|
+
case 0 /* Unknown */:
|
|
114527
|
+
return false;
|
|
114528
|
+
}
|
|
114529
|
+
}
|
|
114498
114530
|
}
|
|
114499
114531
|
function isBuilderProgram(program) {
|
|
114500
114532
|
return !!program.getState;
|
package/lib/tsserver.js
CHANGED
|
@@ -2327,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2327
2327
|
|
|
2328
2328
|
// src/compiler/corePublic.ts
|
|
2329
2329
|
var versionMajorMinor = "5.3";
|
|
2330
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2330
|
+
var version = `${versionMajorMinor}.0-dev.20230913`;
|
|
2331
2331
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2332
2332
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2333
2333
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6695,6 +6695,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6695
6695
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
6696
6696
|
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
6697
6697
|
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
6698
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
6698
6699
|
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
6699
6700
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
6700
6701
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
@@ -41121,7 +41122,7 @@ function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, e
|
|
|
41121
41122
|
return false;
|
|
41122
41123
|
}
|
|
41123
41124
|
for (const ext of extensionGroup) {
|
|
41124
|
-
if (fileExtensionIs(file, ext)) {
|
|
41125
|
+
if (fileExtensionIs(file, ext) && (ext !== ".ts" /* Ts */ || !fileExtensionIs(file, ".d.ts" /* Dts */))) {
|
|
41125
41126
|
return false;
|
|
41126
41127
|
}
|
|
41127
41128
|
const higherPriorityPath = keyMapper(changeExtension(file, ext));
|
|
@@ -60967,8 +60968,7 @@ function createTypeChecker(host) {
|
|
|
60967
60968
|
if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {
|
|
60968
60969
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
60969
60970
|
}
|
|
60970
|
-
const
|
|
60971
|
-
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (memberIds.length ? "," + memberIds.join(",") : "");
|
|
60971
|
+
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : "");
|
|
60972
60972
|
let type = tupleTypes.get(key);
|
|
60973
60973
|
if (!type) {
|
|
60974
60974
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));
|
|
@@ -67108,8 +67108,13 @@ function createTypeChecker(host) {
|
|
|
67108
67108
|
if (getObjectFlags(type) & 4 /* Reference */ && type.node) {
|
|
67109
67109
|
return type.node;
|
|
67110
67110
|
}
|
|
67111
|
-
if (type.symbol
|
|
67112
|
-
|
|
67111
|
+
if (type.symbol) {
|
|
67112
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
67113
|
+
type = getMappedTargetWithSymbol(type);
|
|
67114
|
+
}
|
|
67115
|
+
if (!(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {
|
|
67116
|
+
return type.symbol;
|
|
67117
|
+
}
|
|
67113
67118
|
}
|
|
67114
67119
|
if (isTupleType(type)) {
|
|
67115
67120
|
return type.target;
|
|
@@ -67129,6 +67134,13 @@ function createTypeChecker(host) {
|
|
|
67129
67134
|
}
|
|
67130
67135
|
return type;
|
|
67131
67136
|
}
|
|
67137
|
+
function getMappedTargetWithSymbol(type) {
|
|
67138
|
+
let target = type;
|
|
67139
|
+
while ((getObjectFlags(target) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && isMappedTypeWithKeyofConstraintDeclaration(target)) {
|
|
67140
|
+
target = getModifiersTypeFromMappedType(target);
|
|
67141
|
+
}
|
|
67142
|
+
return target.symbol ? target : type;
|
|
67143
|
+
}
|
|
67132
67144
|
function isPropertyIdenticalTo(sourceProp, targetProp) {
|
|
67133
67145
|
return compareProperties2(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */;
|
|
67134
67146
|
}
|
|
@@ -119357,7 +119369,8 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119357
119369
|
currentDirectory,
|
|
119358
119370
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
119359
119371
|
writeLog,
|
|
119360
|
-
toPath: toPath3
|
|
119372
|
+
toPath: toPath3,
|
|
119373
|
+
getScriptKind: getScriptKind2
|
|
119361
119374
|
}) {
|
|
119362
119375
|
const newPath = removeIgnoredPath(fileOrDirectoryPath);
|
|
119363
119376
|
if (!newPath) {
|
|
@@ -119367,7 +119380,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119367
119380
|
fileOrDirectoryPath = newPath;
|
|
119368
119381
|
if (fileOrDirectoryPath === watchedDirPath)
|
|
119369
119382
|
return false;
|
|
119370
|
-
if (hasExtension(fileOrDirectoryPath) && !isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
119383
|
+
if (hasExtension(fileOrDirectoryPath) && !(isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions) || isSupportedScriptKind())) {
|
|
119371
119384
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
119372
119385
|
return true;
|
|
119373
119386
|
}
|
|
@@ -119396,6 +119409,25 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119396
119409
|
function hasSourceFile(file) {
|
|
119397
119410
|
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
119398
119411
|
}
|
|
119412
|
+
function isSupportedScriptKind() {
|
|
119413
|
+
if (!getScriptKind2)
|
|
119414
|
+
return false;
|
|
119415
|
+
const scriptKind = getScriptKind2(fileOrDirectory);
|
|
119416
|
+
switch (scriptKind) {
|
|
119417
|
+
case 3 /* TS */:
|
|
119418
|
+
case 4 /* TSX */:
|
|
119419
|
+
case 7 /* Deferred */:
|
|
119420
|
+
case 5 /* External */:
|
|
119421
|
+
return true;
|
|
119422
|
+
case 1 /* JS */:
|
|
119423
|
+
case 2 /* JSX */:
|
|
119424
|
+
return getAllowJSCompilerOption(options);
|
|
119425
|
+
case 6 /* JSON */:
|
|
119426
|
+
return getResolveJsonModule(options);
|
|
119427
|
+
case 0 /* Unknown */:
|
|
119428
|
+
return false;
|
|
119429
|
+
}
|
|
119430
|
+
}
|
|
119399
119431
|
}
|
|
119400
119432
|
function isBuilderProgram(program) {
|
|
119401
119433
|
return !!program.getState;
|
|
@@ -161154,10 +161186,10 @@ function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)
|
|
|
161154
161186
|
return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions;
|
|
161155
161187
|
}
|
|
161156
161188
|
function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) {
|
|
161157
|
-
rootDirs = rootDirs.map((rootDirectory) => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory)));
|
|
161189
|
+
rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))));
|
|
161158
161190
|
const relativeDirectory = firstDefined(rootDirs, (rootDirectory) => containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : void 0);
|
|
161159
161191
|
return deduplicate(
|
|
161160
|
-
[...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory],
|
|
161192
|
+
[...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory].map((baseDir) => removeTrailingDirectorySeparator(baseDir)),
|
|
161161
161193
|
equateStringsCaseSensitive,
|
|
161162
161194
|
compareStringsCaseSensitive
|
|
161163
161195
|
);
|
|
@@ -169682,7 +169714,7 @@ function getAllRules() {
|
|
|
169682
169714
|
// insert space after '?' only when it is used in conditional operator
|
|
169683
169715
|
rule("SpaceAfterQuestionMarkInConditionalOperator", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* InsertSpace */),
|
|
169684
169716
|
// in other cases there should be no space between '?' and next token
|
|
169685
|
-
rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
|
|
169717
|
+
rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isNonOptionalPropertyContext], 16 /* DeleteSpace */),
|
|
169686
169718
|
rule("NoSpaceBeforeDot", anyToken, [25 /* DotToken */, 29 /* QuestionDotToken */], [isNonJsxSameLineTokenContext, isNotPropertyAccessOnIntegerLiteral], 16 /* DeleteSpace */),
|
|
169687
169719
|
rule("NoSpaceAfterDot", [25 /* DotToken */, 29 /* QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
|
|
169688
169720
|
rule("NoSpaceBetweenImportParenInImportType", 102 /* ImportKeyword */, 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* DeleteSpace */),
|
|
@@ -170027,6 +170059,12 @@ function isTypeAnnotationContext(context) {
|
|
|
170027
170059
|
const contextKind = context.contextNode.kind;
|
|
170028
170060
|
return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
|
|
170029
170061
|
}
|
|
170062
|
+
function isOptionalPropertyContext(context) {
|
|
170063
|
+
return isPropertyDeclaration(context.contextNode) && context.contextNode.questionToken;
|
|
170064
|
+
}
|
|
170065
|
+
function isNonOptionalPropertyContext(context) {
|
|
170066
|
+
return !isOptionalPropertyContext(context);
|
|
170067
|
+
}
|
|
170030
170068
|
function isConditionalOperatorContext(context) {
|
|
170031
170069
|
return context.contextNode.kind === 227 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */;
|
|
170032
170070
|
}
|
|
@@ -176174,7 +176212,7 @@ var Project3 = class _Project {
|
|
|
176174
176212
|
return scriptInfo;
|
|
176175
176213
|
}
|
|
176176
176214
|
getScriptKind(fileName) {
|
|
176177
|
-
const info = this.
|
|
176215
|
+
const info = this.projectService.getScriptInfoForPath(this.toPath(fileName));
|
|
176178
176216
|
return info && info.scriptKind;
|
|
176179
176217
|
}
|
|
176180
176218
|
getScriptVersion(filename) {
|
|
@@ -178991,7 +179029,8 @@ var _ProjectService = class _ProjectService {
|
|
|
178991
179029
|
program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames,
|
|
178992
179030
|
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
|
|
178993
179031
|
writeLog: (s) => this.logger.info(s),
|
|
178994
|
-
toPath: (s) => this.toPath(s)
|
|
179032
|
+
toPath: (s) => this.toPath(s),
|
|
179033
|
+
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
178995
179034
|
}))
|
|
178996
179035
|
return;
|
|
178997
179036
|
if (config.reloadLevel !== 2 /* Full */)
|
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.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230913`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4461,6 +4461,7 @@ ${lanes.join("\n")}
|
|
|
4461
4461
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
4462
4462
|
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
4463
4463
|
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
4464
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
4464
4465
|
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
4465
4466
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
4466
4467
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
@@ -37442,7 +37443,7 @@ ${lanes.join("\n")}
|
|
|
37442
37443
|
return false;
|
|
37443
37444
|
}
|
|
37444
37445
|
for (const ext of extensionGroup) {
|
|
37445
|
-
if (fileExtensionIs(file, ext)) {
|
|
37446
|
+
if (fileExtensionIs(file, ext) && (ext !== ".ts" /* Ts */ || !fileExtensionIs(file, ".d.ts" /* Dts */))) {
|
|
37446
37447
|
return false;
|
|
37447
37448
|
}
|
|
37448
37449
|
const higherPriorityPath = keyMapper(changeExtension(file, ext));
|
|
@@ -58734,8 +58735,7 @@ ${lanes.join("\n")}
|
|
|
58734
58735
|
if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {
|
|
58735
58736
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
58736
58737
|
}
|
|
58737
|
-
const
|
|
58738
|
-
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (memberIds.length ? "," + memberIds.join(",") : "");
|
|
58738
|
+
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (some(namedMemberDeclarations, (node) => !!node) ? "," + map(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : "");
|
|
58739
58739
|
let type = tupleTypes.get(key);
|
|
58740
58740
|
if (!type) {
|
|
58741
58741
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));
|
|
@@ -64875,8 +64875,13 @@ ${lanes.join("\n")}
|
|
|
64875
64875
|
if (getObjectFlags(type) & 4 /* Reference */ && type.node) {
|
|
64876
64876
|
return type.node;
|
|
64877
64877
|
}
|
|
64878
|
-
if (type.symbol
|
|
64879
|
-
|
|
64878
|
+
if (type.symbol) {
|
|
64879
|
+
if (getObjectFlags(type) & 32 /* Mapped */) {
|
|
64880
|
+
type = getMappedTargetWithSymbol(type);
|
|
64881
|
+
}
|
|
64882
|
+
if (!(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {
|
|
64883
|
+
return type.symbol;
|
|
64884
|
+
}
|
|
64880
64885
|
}
|
|
64881
64886
|
if (isTupleType(type)) {
|
|
64882
64887
|
return type.target;
|
|
@@ -64896,6 +64901,13 @@ ${lanes.join("\n")}
|
|
|
64896
64901
|
}
|
|
64897
64902
|
return type;
|
|
64898
64903
|
}
|
|
64904
|
+
function getMappedTargetWithSymbol(type) {
|
|
64905
|
+
let target = type;
|
|
64906
|
+
while ((getObjectFlags(target) & 96 /* InstantiatedMapped */) === 96 /* InstantiatedMapped */ && isMappedTypeWithKeyofConstraintDeclaration(target)) {
|
|
64907
|
+
target = getModifiersTypeFromMappedType(target);
|
|
64908
|
+
}
|
|
64909
|
+
return target.symbol ? target : type;
|
|
64910
|
+
}
|
|
64899
64911
|
function isPropertyIdenticalTo(sourceProp, targetProp) {
|
|
64900
64912
|
return compareProperties2(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */;
|
|
64901
64913
|
}
|
|
@@ -117454,7 +117466,8 @@ ${lanes.join("\n")}
|
|
|
117454
117466
|
currentDirectory,
|
|
117455
117467
|
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
117456
117468
|
writeLog,
|
|
117457
|
-
toPath: toPath3
|
|
117469
|
+
toPath: toPath3,
|
|
117470
|
+
getScriptKind: getScriptKind2
|
|
117458
117471
|
}) {
|
|
117459
117472
|
const newPath = removeIgnoredPath(fileOrDirectoryPath);
|
|
117460
117473
|
if (!newPath) {
|
|
@@ -117464,7 +117477,7 @@ ${lanes.join("\n")}
|
|
|
117464
117477
|
fileOrDirectoryPath = newPath;
|
|
117465
117478
|
if (fileOrDirectoryPath === watchedDirPath)
|
|
117466
117479
|
return false;
|
|
117467
|
-
if (hasExtension(fileOrDirectoryPath) && !isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
117480
|
+
if (hasExtension(fileOrDirectoryPath) && !(isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions) || isSupportedScriptKind())) {
|
|
117468
117481
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
117469
117482
|
return true;
|
|
117470
117483
|
}
|
|
@@ -117493,6 +117506,25 @@ ${lanes.join("\n")}
|
|
|
117493
117506
|
function hasSourceFile(file) {
|
|
117494
117507
|
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
117495
117508
|
}
|
|
117509
|
+
function isSupportedScriptKind() {
|
|
117510
|
+
if (!getScriptKind2)
|
|
117511
|
+
return false;
|
|
117512
|
+
const scriptKind = getScriptKind2(fileOrDirectory);
|
|
117513
|
+
switch (scriptKind) {
|
|
117514
|
+
case 3 /* TS */:
|
|
117515
|
+
case 4 /* TSX */:
|
|
117516
|
+
case 7 /* Deferred */:
|
|
117517
|
+
case 5 /* External */:
|
|
117518
|
+
return true;
|
|
117519
|
+
case 1 /* JS */:
|
|
117520
|
+
case 2 /* JSX */:
|
|
117521
|
+
return getAllowJSCompilerOption(options);
|
|
117522
|
+
case 6 /* JSON */:
|
|
117523
|
+
return getResolveJsonModule(options);
|
|
117524
|
+
case 0 /* Unknown */:
|
|
117525
|
+
return false;
|
|
117526
|
+
}
|
|
117527
|
+
}
|
|
117496
117528
|
}
|
|
117497
117529
|
function isBuilderProgram(program) {
|
|
117498
117530
|
return !!program.getState;
|
|
@@ -160430,10 +160462,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160430
160462
|
return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) : extensions;
|
|
160431
160463
|
}
|
|
160432
160464
|
function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) {
|
|
160433
|
-
rootDirs = rootDirs.map((rootDirectory) => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory)));
|
|
160465
|
+
rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))));
|
|
160434
160466
|
const relativeDirectory = firstDefined(rootDirs, (rootDirectory) => containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : void 0);
|
|
160435
160467
|
return deduplicate(
|
|
160436
|
-
[...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory],
|
|
160468
|
+
[...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory].map((baseDir) => removeTrailingDirectorySeparator(baseDir)),
|
|
160437
160469
|
equateStringsCaseSensitive,
|
|
160438
160470
|
compareStringsCaseSensitive
|
|
160439
160471
|
);
|
|
@@ -169154,7 +169186,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169154
169186
|
// insert space after '?' only when it is used in conditional operator
|
|
169155
169187
|
rule("SpaceAfterQuestionMarkInConditionalOperator", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 4 /* InsertSpace */),
|
|
169156
169188
|
// in other cases there should be no space between '?' and next token
|
|
169157
|
-
rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
|
|
169189
|
+
rule("NoSpaceAfterQuestionMark", 58 /* QuestionToken */, anyToken, [isNonJsxSameLineTokenContext, isNonOptionalPropertyContext], 16 /* DeleteSpace */),
|
|
169158
169190
|
rule("NoSpaceBeforeDot", anyToken, [25 /* DotToken */, 29 /* QuestionDotToken */], [isNonJsxSameLineTokenContext, isNotPropertyAccessOnIntegerLiteral], 16 /* DeleteSpace */),
|
|
169159
169191
|
rule("NoSpaceAfterDot", [25 /* DotToken */, 29 /* QuestionDotToken */], anyToken, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */),
|
|
169160
169192
|
rule("NoSpaceBetweenImportParenInImportType", 102 /* ImportKeyword */, 21 /* OpenParenToken */, [isNonJsxSameLineTokenContext, isImportTypeContext], 16 /* DeleteSpace */),
|
|
@@ -169499,6 +169531,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169499
169531
|
const contextKind = context.contextNode.kind;
|
|
169500
169532
|
return contextKind === 172 /* PropertyDeclaration */ || contextKind === 171 /* PropertySignature */ || contextKind === 169 /* Parameter */ || contextKind === 260 /* VariableDeclaration */ || isFunctionLikeKind(contextKind);
|
|
169501
169533
|
}
|
|
169534
|
+
function isOptionalPropertyContext(context) {
|
|
169535
|
+
return isPropertyDeclaration(context.contextNode) && context.contextNode.questionToken;
|
|
169536
|
+
}
|
|
169537
|
+
function isNonOptionalPropertyContext(context) {
|
|
169538
|
+
return !isOptionalPropertyContext(context);
|
|
169539
|
+
}
|
|
169502
169540
|
function isConditionalOperatorContext(context) {
|
|
169503
169541
|
return context.contextNode.kind === 227 /* ConditionalExpression */ || context.contextNode.kind === 194 /* ConditionalType */;
|
|
169504
169542
|
}
|
|
@@ -173516,7 +173554,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
173516
173554
|
return scriptInfo;
|
|
173517
173555
|
}
|
|
173518
173556
|
getScriptKind(fileName) {
|
|
173519
|
-
const info = this.
|
|
173557
|
+
const info = this.projectService.getScriptInfoForPath(this.toPath(fileName));
|
|
173520
173558
|
return info && info.scriptKind;
|
|
173521
173559
|
}
|
|
173522
173560
|
getScriptVersion(filename) {
|
|
@@ -176337,7 +176375,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
176337
176375
|
program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames,
|
|
176338
176376
|
useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
|
|
176339
176377
|
writeLog: (s) => this.logger.info(s),
|
|
176340
|
-
toPath: (s) => this.toPath(s)
|
|
176378
|
+
toPath: (s) => this.toPath(s),
|
|
176379
|
+
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
176341
176380
|
}))
|
|
176342
176381
|
return;
|
|
176343
176382
|
if (config.reloadLevel !== 2 /* Full */)
|
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.20230913`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3138,6 +3138,7 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3138
3138
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
3139
3139
|
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening";
|
|
3140
3140
|
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags";
|
|
3141
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped";
|
|
3141
3142
|
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask";
|
|
3142
3143
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3143
3144
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
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.20230913",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"chalk": "^4.1.2",
|
|
60
60
|
"chokidar": "^3.5.3",
|
|
61
61
|
"diff": "^5.1.0",
|
|
62
|
-
"dprint": "^0.
|
|
62
|
+
"dprint": "^0.41.0",
|
|
63
63
|
"esbuild": "^0.19.0",
|
|
64
64
|
"eslint": "^8.22.0",
|
|
65
65
|
"eslint-formatter-autolinkable-stylish": "^1.2.0",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "20.1.0",
|
|
113
113
|
"npm": "8.19.4"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "3ade5022d7f287fdaf61c9e6deed32a3ffb60bc4"
|
|
116
116
|
}
|