@typescript-deploys/pr-build 5.0.0-pr-52180-7 → 5.0.0-pr-52180-17
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 +41 -11
- package/lib/tsserver.js +44 -11
- package/lib/tsserverlibrary.js +43 -11
- package/lib/typescript.js +42 -11
- package/lib/typingsInstaller.js +14 -5
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230111`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -6763,6 +6763,7 @@ var Diagnostics = {
|
|
|
6763
6763
|
Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
|
|
6764
6764
|
Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
|
|
6765
6765
|
Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
|
|
6766
|
+
Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
|
|
6766
6767
|
Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
|
|
6767
6768
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
|
|
6768
6769
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
|
|
@@ -16637,6 +16638,10 @@ function isOptionalDeclaration(declaration) {
|
|
|
16637
16638
|
return false;
|
|
16638
16639
|
}
|
|
16639
16640
|
}
|
|
16641
|
+
function isNonNullAccess(node) {
|
|
16642
|
+
const kind = node.kind;
|
|
16643
|
+
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
16644
|
+
}
|
|
16640
16645
|
|
|
16641
16646
|
// src/compiler/factory/baseNodeFactory.ts
|
|
16642
16647
|
function createBaseNodeFactory() {
|
|
@@ -35772,7 +35777,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
35772
35777
|
conditions,
|
|
35773
35778
|
requestContainingDirectory: containingDirectory,
|
|
35774
35779
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
35775
|
-
isConfigLookup: false
|
|
35780
|
+
isConfigLookup: false,
|
|
35781
|
+
candidateIsFromPackageJsonField: false
|
|
35776
35782
|
};
|
|
35777
35783
|
let resolved = primaryLookup();
|
|
35778
35784
|
let primary = true;
|
|
@@ -36618,7 +36624,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
36618
36624
|
conditions,
|
|
36619
36625
|
requestContainingDirectory: containingDirectory,
|
|
36620
36626
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
36621
|
-
isConfigLookup
|
|
36627
|
+
isConfigLookup,
|
|
36628
|
+
candidateIsFromPackageJsonField: false
|
|
36622
36629
|
};
|
|
36623
36630
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
36624
36631
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -36842,7 +36849,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
36842
36849
|
}
|
|
36843
36850
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
36844
36851
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
36845
|
-
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
|
|
36852
|
+
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
36846
36853
|
}
|
|
36847
36854
|
}
|
|
36848
36855
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -36888,7 +36895,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
|
|
|
36888
36895
|
conditions: emptyArray,
|
|
36889
36896
|
requestContainingDirectory: void 0,
|
|
36890
36897
|
reportDiagnostic: noop,
|
|
36891
|
-
isConfigLookup: false
|
|
36898
|
+
isConfigLookup: false,
|
|
36899
|
+
candidateIsFromPackageJsonField: false
|
|
36892
36900
|
};
|
|
36893
36901
|
}
|
|
36894
36902
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -36976,6 +36984,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
36976
36984
|
}
|
|
36977
36985
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
36978
36986
|
const features = state2.features;
|
|
36987
|
+
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
36988
|
+
state2.candidateIsFromPackageJsonField = true;
|
|
36979
36989
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
36980
36990
|
state2.features &= ~32 /* EsmMode */;
|
|
36981
36991
|
}
|
|
@@ -36988,6 +36998,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
36988
36998
|
false
|
|
36989
36999
|
);
|
|
36990
37000
|
state2.features = features;
|
|
37001
|
+
state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
|
|
36991
37002
|
return result;
|
|
36992
37003
|
};
|
|
36993
37004
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
@@ -37061,7 +37072,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
|
|
|
37061
37072
|
return void 0;
|
|
37062
37073
|
}
|
|
37063
37074
|
const trailingParts = parts.slice(nameParts.length);
|
|
37064
|
-
|
|
37075
|
+
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
37076
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
37077
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
37078
|
+
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
37065
37079
|
}
|
|
37066
37080
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
37067
37081
|
if (!scope.contents.packageJsonContent.exports) {
|
|
@@ -37720,7 +37734,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
37720
37734
|
conditions: [],
|
|
37721
37735
|
requestContainingDirectory: containingDirectory,
|
|
37722
37736
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
37723
|
-
isConfigLookup: false
|
|
37737
|
+
isConfigLookup: false,
|
|
37738
|
+
candidateIsFromPackageJsonField: false
|
|
37724
37739
|
};
|
|
37725
37740
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
37726
37741
|
return createResolvedModuleWithFailedLookupLocations(
|
|
@@ -37799,7 +37814,8 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
37799
37814
|
conditions: [],
|
|
37800
37815
|
requestContainingDirectory: void 0,
|
|
37801
37816
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
37802
|
-
isConfigLookup: false
|
|
37817
|
+
isConfigLookup: false,
|
|
37818
|
+
candidateIsFromPackageJsonField: false
|
|
37803
37819
|
};
|
|
37804
37820
|
const resolved = loadModuleFromImmediateNodeModulesDirectory(
|
|
37805
37821
|
4 /* Declaration */,
|
|
@@ -50715,7 +50731,17 @@ function createTypeChecker(host) {
|
|
|
50715
50731
|
}
|
|
50716
50732
|
}
|
|
50717
50733
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
50718
|
-
|
|
50734
|
+
var _a2;
|
|
50735
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
50736
|
+
if (decl.kind === 261 /* InterfaceDeclaration */) {
|
|
50737
|
+
return true;
|
|
50738
|
+
}
|
|
50739
|
+
if (decl.kind !== 257 /* VariableDeclaration */) {
|
|
50740
|
+
return false;
|
|
50741
|
+
}
|
|
50742
|
+
const initializer = decl.initializer;
|
|
50743
|
+
return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
|
|
50744
|
+
});
|
|
50719
50745
|
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
|
|
50720
50746
|
return getOuterTypeParameters(declaration);
|
|
50721
50747
|
}
|
|
@@ -63536,12 +63562,13 @@ function createTypeChecker(host) {
|
|
|
63536
63562
|
if (propName === void 0) {
|
|
63537
63563
|
return type;
|
|
63538
63564
|
}
|
|
63539
|
-
const
|
|
63565
|
+
const optionalChain = isOptionalChain(access);
|
|
63566
|
+
const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
|
|
63540
63567
|
let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
|
|
63541
63568
|
if (!propType) {
|
|
63542
63569
|
return type;
|
|
63543
63570
|
}
|
|
63544
|
-
propType = removeNullable ? getOptionalType(propType) : propType;
|
|
63571
|
+
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
63545
63572
|
const narrowedPropType = narrowType2(propType);
|
|
63546
63573
|
return filterType(type, (t) => {
|
|
63547
63574
|
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
@@ -99965,6 +99992,9 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
99965
99992
|
case 259 /* FunctionDeclaration */:
|
|
99966
99993
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
|
|
99967
99994
|
break;
|
|
99995
|
+
case 192 /* InferType */:
|
|
99996
|
+
diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
|
|
99997
|
+
break;
|
|
99968
99998
|
case 262 /* TypeAliasDeclaration */:
|
|
99969
99999
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
|
|
99970
100000
|
break;
|
package/lib/tsserver.js
CHANGED
|
@@ -1735,6 +1735,7 @@ __export(server_exports, {
|
|
|
1735
1735
|
isNonContextualKeyword: () => isNonContextualKeyword,
|
|
1736
1736
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
1737
1737
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
1738
|
+
isNonNullAccess: () => isNonNullAccess,
|
|
1738
1739
|
isNonNullChain: () => isNonNullChain,
|
|
1739
1740
|
isNonNullExpression: () => isNonNullExpression,
|
|
1740
1741
|
isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
|
|
@@ -2661,7 +2662,7 @@ __export(ts_server_exports3, {
|
|
|
2661
2662
|
|
|
2662
2663
|
// src/compiler/corePublic.ts
|
|
2663
2664
|
var versionMajorMinor = "5.0";
|
|
2664
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2665
|
+
var version = `${versionMajorMinor}.0-insiders.20230111`;
|
|
2665
2666
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2666
2667
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2667
2668
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10567,6 +10568,7 @@ var Diagnostics = {
|
|
|
10567
10568
|
Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
|
|
10568
10569
|
Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
|
|
10569
10570
|
Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
|
|
10571
|
+
Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
|
|
10570
10572
|
Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
|
|
10571
10573
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
|
|
10572
10574
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
|
|
@@ -21102,6 +21104,10 @@ function isOptionalDeclaration(declaration) {
|
|
|
21102
21104
|
return false;
|
|
21103
21105
|
}
|
|
21104
21106
|
}
|
|
21107
|
+
function isNonNullAccess(node) {
|
|
21108
|
+
const kind = node.kind;
|
|
21109
|
+
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
21110
|
+
}
|
|
21105
21111
|
|
|
21106
21112
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21107
21113
|
function createBaseNodeFactory() {
|
|
@@ -40498,7 +40504,8 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
40498
40504
|
conditions,
|
|
40499
40505
|
requestContainingDirectory: containingDirectory,
|
|
40500
40506
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40501
|
-
isConfigLookup: false
|
|
40507
|
+
isConfigLookup: false,
|
|
40508
|
+
candidateIsFromPackageJsonField: false
|
|
40502
40509
|
};
|
|
40503
40510
|
let resolved = primaryLookup();
|
|
40504
40511
|
let primary = true;
|
|
@@ -41369,7 +41376,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
41369
41376
|
conditions,
|
|
41370
41377
|
requestContainingDirectory: containingDirectory,
|
|
41371
41378
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
41372
|
-
isConfigLookup
|
|
41379
|
+
isConfigLookup,
|
|
41380
|
+
candidateIsFromPackageJsonField: false
|
|
41373
41381
|
};
|
|
41374
41382
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
41375
41383
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -41593,7 +41601,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
41593
41601
|
}
|
|
41594
41602
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
41595
41603
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
41596
|
-
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
|
|
41604
|
+
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
41597
41605
|
}
|
|
41598
41606
|
}
|
|
41599
41607
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -41740,7 +41748,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
|
|
|
41740
41748
|
conditions: emptyArray,
|
|
41741
41749
|
requestContainingDirectory: void 0,
|
|
41742
41750
|
reportDiagnostic: noop,
|
|
41743
|
-
isConfigLookup: false
|
|
41751
|
+
isConfigLookup: false,
|
|
41752
|
+
candidateIsFromPackageJsonField: false
|
|
41744
41753
|
};
|
|
41745
41754
|
}
|
|
41746
41755
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -41828,6 +41837,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
41828
41837
|
}
|
|
41829
41838
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
41830
41839
|
const features = state2.features;
|
|
41840
|
+
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
41841
|
+
state2.candidateIsFromPackageJsonField = true;
|
|
41831
41842
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
41832
41843
|
state2.features &= ~32 /* EsmMode */;
|
|
41833
41844
|
}
|
|
@@ -41840,6 +41851,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
41840
41851
|
false
|
|
41841
41852
|
);
|
|
41842
41853
|
state2.features = features;
|
|
41854
|
+
state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
|
|
41843
41855
|
return result;
|
|
41844
41856
|
};
|
|
41845
41857
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
@@ -41913,7 +41925,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
|
|
|
41913
41925
|
return void 0;
|
|
41914
41926
|
}
|
|
41915
41927
|
const trailingParts = parts.slice(nameParts.length);
|
|
41916
|
-
|
|
41928
|
+
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
41929
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
41930
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
41931
|
+
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
41917
41932
|
}
|
|
41918
41933
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
41919
41934
|
if (!scope.contents.packageJsonContent.exports) {
|
|
@@ -42572,7 +42587,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
42572
42587
|
conditions: [],
|
|
42573
42588
|
requestContainingDirectory: containingDirectory,
|
|
42574
42589
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42575
|
-
isConfigLookup: false
|
|
42590
|
+
isConfigLookup: false,
|
|
42591
|
+
candidateIsFromPackageJsonField: false
|
|
42576
42592
|
};
|
|
42577
42593
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
42578
42594
|
return createResolvedModuleWithFailedLookupLocations(
|
|
@@ -42651,7 +42667,8 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
42651
42667
|
conditions: [],
|
|
42652
42668
|
requestContainingDirectory: void 0,
|
|
42653
42669
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
42654
|
-
isConfigLookup: false
|
|
42670
|
+
isConfigLookup: false,
|
|
42671
|
+
candidateIsFromPackageJsonField: false
|
|
42655
42672
|
};
|
|
42656
42673
|
const resolved = loadModuleFromImmediateNodeModulesDirectory(
|
|
42657
42674
|
4 /* Declaration */,
|
|
@@ -55621,7 +55638,17 @@ function createTypeChecker(host) {
|
|
|
55621
55638
|
}
|
|
55622
55639
|
}
|
|
55623
55640
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
55624
|
-
|
|
55641
|
+
var _a2;
|
|
55642
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
55643
|
+
if (decl.kind === 261 /* InterfaceDeclaration */) {
|
|
55644
|
+
return true;
|
|
55645
|
+
}
|
|
55646
|
+
if (decl.kind !== 257 /* VariableDeclaration */) {
|
|
55647
|
+
return false;
|
|
55648
|
+
}
|
|
55649
|
+
const initializer = decl.initializer;
|
|
55650
|
+
return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
|
|
55651
|
+
});
|
|
55625
55652
|
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
|
|
55626
55653
|
return getOuterTypeParameters(declaration);
|
|
55627
55654
|
}
|
|
@@ -68442,12 +68469,13 @@ function createTypeChecker(host) {
|
|
|
68442
68469
|
if (propName === void 0) {
|
|
68443
68470
|
return type;
|
|
68444
68471
|
}
|
|
68445
|
-
const
|
|
68472
|
+
const optionalChain = isOptionalChain(access);
|
|
68473
|
+
const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
|
|
68446
68474
|
let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
|
|
68447
68475
|
if (!propType) {
|
|
68448
68476
|
return type;
|
|
68449
68477
|
}
|
|
68450
|
-
propType = removeNullable ? getOptionalType(propType) : propType;
|
|
68478
|
+
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
68451
68479
|
const narrowedPropType = narrowType2(propType);
|
|
68452
68480
|
return filterType(type, (t) => {
|
|
68453
68481
|
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
@@ -105048,6 +105076,9 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
105048
105076
|
case 259 /* FunctionDeclaration */:
|
|
105049
105077
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
|
|
105050
105078
|
break;
|
|
105079
|
+
case 192 /* InferType */:
|
|
105080
|
+
diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
|
|
105081
|
+
break;
|
|
105051
105082
|
case 262 /* TypeAliasDeclaration */:
|
|
105052
105083
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
|
|
105053
105084
|
break;
|
|
@@ -124875,6 +124906,7 @@ __export(ts_exports3, {
|
|
|
124875
124906
|
isNonContextualKeyword: () => isNonContextualKeyword,
|
|
124876
124907
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
124877
124908
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
124909
|
+
isNonNullAccess: () => isNonNullAccess,
|
|
124878
124910
|
isNonNullChain: () => isNonNullChain,
|
|
124879
124911
|
isNonNullExpression: () => isNonNullExpression,
|
|
124880
124912
|
isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
|
|
@@ -180453,6 +180485,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
180453
180485
|
isNonContextualKeyword,
|
|
180454
180486
|
isNonGlobalAmbientModule,
|
|
180455
180487
|
isNonGlobalDeclaration,
|
|
180488
|
+
isNonNullAccess,
|
|
180456
180489
|
isNonNullChain,
|
|
180457
180490
|
isNonNullExpression,
|
|
180458
180491
|
isNonStaticMethodOrAccessorWithPrivateName,
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
45
|
+
version = `${versionMajorMinor}.0-insiders.20230111`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8023,6 +8023,7 @@ ${lanes.join("\n")}
|
|
|
8023
8023
|
Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
|
|
8024
8024
|
Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
|
|
8025
8025
|
Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
|
|
8026
|
+
Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
|
|
8026
8027
|
Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
|
|
8027
8028
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
|
|
8028
8029
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
|
|
@@ -18397,6 +18398,10 @@ ${lanes.join("\n")}
|
|
|
18397
18398
|
return false;
|
|
18398
18399
|
}
|
|
18399
18400
|
}
|
|
18401
|
+
function isNonNullAccess(node) {
|
|
18402
|
+
const kind = node.kind;
|
|
18403
|
+
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
18404
|
+
}
|
|
18400
18405
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
|
|
18401
18406
|
var init_utilities = __esm({
|
|
18402
18407
|
"src/compiler/utilities.ts"() {
|
|
@@ -38031,7 +38036,8 @@ ${lanes.join("\n")}
|
|
|
38031
38036
|
conditions,
|
|
38032
38037
|
requestContainingDirectory: containingDirectory,
|
|
38033
38038
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
38034
|
-
isConfigLookup: false
|
|
38039
|
+
isConfigLookup: false,
|
|
38040
|
+
candidateIsFromPackageJsonField: false
|
|
38035
38041
|
};
|
|
38036
38042
|
let resolved = primaryLookup();
|
|
38037
38043
|
let primary = true;
|
|
@@ -38889,7 +38895,8 @@ ${lanes.join("\n")}
|
|
|
38889
38895
|
conditions,
|
|
38890
38896
|
requestContainingDirectory: containingDirectory,
|
|
38891
38897
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
38892
|
-
isConfigLookup
|
|
38898
|
+
isConfigLookup,
|
|
38899
|
+
candidateIsFromPackageJsonField: false
|
|
38893
38900
|
};
|
|
38894
38901
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
38895
38902
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -39112,7 +39119,7 @@ ${lanes.join("\n")}
|
|
|
39112
39119
|
}
|
|
39113
39120
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
39114
39121
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
39115
|
-
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
|
|
39122
|
+
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
39116
39123
|
}
|
|
39117
39124
|
}
|
|
39118
39125
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -39259,7 +39266,8 @@ ${lanes.join("\n")}
|
|
|
39259
39266
|
conditions: emptyArray,
|
|
39260
39267
|
requestContainingDirectory: void 0,
|
|
39261
39268
|
reportDiagnostic: noop,
|
|
39262
|
-
isConfigLookup: false
|
|
39269
|
+
isConfigLookup: false,
|
|
39270
|
+
candidateIsFromPackageJsonField: false
|
|
39263
39271
|
};
|
|
39264
39272
|
}
|
|
39265
39273
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -39347,6 +39355,8 @@ ${lanes.join("\n")}
|
|
|
39347
39355
|
}
|
|
39348
39356
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
39349
39357
|
const features = state2.features;
|
|
39358
|
+
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
39359
|
+
state2.candidateIsFromPackageJsonField = true;
|
|
39350
39360
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
39351
39361
|
state2.features &= ~32 /* EsmMode */;
|
|
39352
39362
|
}
|
|
@@ -39359,6 +39369,7 @@ ${lanes.join("\n")}
|
|
|
39359
39369
|
false
|
|
39360
39370
|
);
|
|
39361
39371
|
state2.features = features;
|
|
39372
|
+
state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
|
|
39362
39373
|
return result;
|
|
39363
39374
|
};
|
|
39364
39375
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
@@ -39432,7 +39443,10 @@ ${lanes.join("\n")}
|
|
|
39432
39443
|
return void 0;
|
|
39433
39444
|
}
|
|
39434
39445
|
const trailingParts = parts.slice(nameParts.length);
|
|
39435
|
-
|
|
39446
|
+
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
39447
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
39448
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
39449
|
+
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
39436
39450
|
}
|
|
39437
39451
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
39438
39452
|
if (!scope.contents.packageJsonContent.exports) {
|
|
@@ -40090,7 +40104,8 @@ ${lanes.join("\n")}
|
|
|
40090
40104
|
conditions: [],
|
|
40091
40105
|
requestContainingDirectory: containingDirectory,
|
|
40092
40106
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40093
|
-
isConfigLookup: false
|
|
40107
|
+
isConfigLookup: false,
|
|
40108
|
+
candidateIsFromPackageJsonField: false
|
|
40094
40109
|
};
|
|
40095
40110
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
40096
40111
|
return createResolvedModuleWithFailedLookupLocations(
|
|
@@ -40169,7 +40184,8 @@ ${lanes.join("\n")}
|
|
|
40169
40184
|
conditions: [],
|
|
40170
40185
|
requestContainingDirectory: void 0,
|
|
40171
40186
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40172
|
-
isConfigLookup: false
|
|
40187
|
+
isConfigLookup: false,
|
|
40188
|
+
candidateIsFromPackageJsonField: false
|
|
40173
40189
|
};
|
|
40174
40190
|
const resolved = loadModuleFromImmediateNodeModulesDirectory(
|
|
40175
40191
|
4 /* Declaration */,
|
|
@@ -53064,7 +53080,17 @@ ${lanes.join("\n")}
|
|
|
53064
53080
|
}
|
|
53065
53081
|
}
|
|
53066
53082
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
53067
|
-
|
|
53083
|
+
var _a2;
|
|
53084
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
53085
|
+
if (decl.kind === 261 /* InterfaceDeclaration */) {
|
|
53086
|
+
return true;
|
|
53087
|
+
}
|
|
53088
|
+
if (decl.kind !== 257 /* VariableDeclaration */) {
|
|
53089
|
+
return false;
|
|
53090
|
+
}
|
|
53091
|
+
const initializer = decl.initializer;
|
|
53092
|
+
return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
|
|
53093
|
+
});
|
|
53068
53094
|
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
|
|
53069
53095
|
return getOuterTypeParameters(declaration);
|
|
53070
53096
|
}
|
|
@@ -65885,12 +65911,13 @@ ${lanes.join("\n")}
|
|
|
65885
65911
|
if (propName === void 0) {
|
|
65886
65912
|
return type;
|
|
65887
65913
|
}
|
|
65888
|
-
const
|
|
65914
|
+
const optionalChain = isOptionalChain(access);
|
|
65915
|
+
const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
|
|
65889
65916
|
let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
|
|
65890
65917
|
if (!propType) {
|
|
65891
65918
|
return type;
|
|
65892
65919
|
}
|
|
65893
|
-
propType = removeNullable ? getOptionalType(propType) : propType;
|
|
65920
|
+
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
65894
65921
|
const narrowedPropType = narrowType2(propType);
|
|
65895
65922
|
return filterType(type, (t) => {
|
|
65896
65923
|
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
@@ -102777,6 +102804,9 @@ ${lanes.join("\n")}
|
|
|
102777
102804
|
case 259 /* FunctionDeclaration */:
|
|
102778
102805
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
|
|
102779
102806
|
break;
|
|
102807
|
+
case 192 /* InferType */:
|
|
102808
|
+
diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
|
|
102809
|
+
break;
|
|
102780
102810
|
case 262 /* TypeAliasDeclaration */:
|
|
102781
102811
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
|
|
102782
102812
|
break;
|
|
@@ -176584,6 +176614,7 @@ ${e.message}`;
|
|
|
176584
176614
|
isNonContextualKeyword: () => isNonContextualKeyword,
|
|
176585
176615
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
176586
176616
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
176617
|
+
isNonNullAccess: () => isNonNullAccess,
|
|
176587
176618
|
isNonNullChain: () => isNonNullChain,
|
|
176588
176619
|
isNonNullExpression: () => isNonNullExpression,
|
|
176589
176620
|
isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
|
|
@@ -179224,6 +179255,7 @@ ${e.message}`;
|
|
|
179224
179255
|
isNonContextualKeyword: () => isNonContextualKeyword,
|
|
179225
179256
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
179226
179257
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
179258
|
+
isNonNullAccess: () => isNonNullAccess,
|
|
179227
179259
|
isNonNullChain: () => isNonNullChain,
|
|
179228
179260
|
isNonNullExpression: () => isNonNullExpression,
|
|
179229
179261
|
isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
|
package/lib/typescript.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
45
|
+
version = `${versionMajorMinor}.0-insiders.20230111`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8023,6 +8023,7 @@ ${lanes.join("\n")}
|
|
|
8023
8023
|
Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
|
|
8024
8024
|
Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
|
|
8025
8025
|
Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
|
|
8026
|
+
Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
|
|
8026
8027
|
Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
|
|
8027
8028
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
|
|
8028
8029
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
|
|
@@ -18397,6 +18398,10 @@ ${lanes.join("\n")}
|
|
|
18397
18398
|
return false;
|
|
18398
18399
|
}
|
|
18399
18400
|
}
|
|
18401
|
+
function isNonNullAccess(node) {
|
|
18402
|
+
const kind = node.kind;
|
|
18403
|
+
return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
|
|
18404
|
+
}
|
|
18400
18405
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
|
|
18401
18406
|
var init_utilities = __esm({
|
|
18402
18407
|
"src/compiler/utilities.ts"() {
|
|
@@ -38031,7 +38036,8 @@ ${lanes.join("\n")}
|
|
|
38031
38036
|
conditions,
|
|
38032
38037
|
requestContainingDirectory: containingDirectory,
|
|
38033
38038
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
38034
|
-
isConfigLookup: false
|
|
38039
|
+
isConfigLookup: false,
|
|
38040
|
+
candidateIsFromPackageJsonField: false
|
|
38035
38041
|
};
|
|
38036
38042
|
let resolved = primaryLookup();
|
|
38037
38043
|
let primary = true;
|
|
@@ -38889,7 +38895,8 @@ ${lanes.join("\n")}
|
|
|
38889
38895
|
conditions,
|
|
38890
38896
|
requestContainingDirectory: containingDirectory,
|
|
38891
38897
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
38892
|
-
isConfigLookup
|
|
38898
|
+
isConfigLookup,
|
|
38899
|
+
candidateIsFromPackageJsonField: false
|
|
38893
38900
|
};
|
|
38894
38901
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
38895
38902
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -39112,7 +39119,7 @@ ${lanes.join("\n")}
|
|
|
39112
39119
|
}
|
|
39113
39120
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
39114
39121
|
const path = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
39115
|
-
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension };
|
|
39122
|
+
return path === void 0 ? void 0 : { path, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
39116
39123
|
}
|
|
39117
39124
|
}
|
|
39118
39125
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -39259,7 +39266,8 @@ ${lanes.join("\n")}
|
|
|
39259
39266
|
conditions: emptyArray,
|
|
39260
39267
|
requestContainingDirectory: void 0,
|
|
39261
39268
|
reportDiagnostic: noop,
|
|
39262
|
-
isConfigLookup: false
|
|
39269
|
+
isConfigLookup: false,
|
|
39270
|
+
candidateIsFromPackageJsonField: false
|
|
39263
39271
|
};
|
|
39264
39272
|
}
|
|
39265
39273
|
function getPackageScopeForPath(fileName, state) {
|
|
@@ -39347,6 +39355,8 @@ ${lanes.join("\n")}
|
|
|
39347
39355
|
}
|
|
39348
39356
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
39349
39357
|
const features = state2.features;
|
|
39358
|
+
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
39359
|
+
state2.candidateIsFromPackageJsonField = true;
|
|
39350
39360
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
39351
39361
|
state2.features &= ~32 /* EsmMode */;
|
|
39352
39362
|
}
|
|
@@ -39359,6 +39369,7 @@ ${lanes.join("\n")}
|
|
|
39359
39369
|
false
|
|
39360
39370
|
);
|
|
39361
39371
|
state2.features = features;
|
|
39372
|
+
state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
|
|
39362
39373
|
return result;
|
|
39363
39374
|
};
|
|
39364
39375
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
@@ -39432,7 +39443,10 @@ ${lanes.join("\n")}
|
|
|
39432
39443
|
return void 0;
|
|
39433
39444
|
}
|
|
39434
39445
|
const trailingParts = parts.slice(nameParts.length);
|
|
39435
|
-
|
|
39446
|
+
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
39447
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
39448
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
39449
|
+
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
39436
39450
|
}
|
|
39437
39451
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
39438
39452
|
if (!scope.contents.packageJsonContent.exports) {
|
|
@@ -40090,7 +40104,8 @@ ${lanes.join("\n")}
|
|
|
40090
40104
|
conditions: [],
|
|
40091
40105
|
requestContainingDirectory: containingDirectory,
|
|
40092
40106
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40093
|
-
isConfigLookup: false
|
|
40107
|
+
isConfigLookup: false,
|
|
40108
|
+
candidateIsFromPackageJsonField: false
|
|
40094
40109
|
};
|
|
40095
40110
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
40096
40111
|
return createResolvedModuleWithFailedLookupLocations(
|
|
@@ -40169,7 +40184,8 @@ ${lanes.join("\n")}
|
|
|
40169
40184
|
conditions: [],
|
|
40170
40185
|
requestContainingDirectory: void 0,
|
|
40171
40186
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40172
|
-
isConfigLookup: false
|
|
40187
|
+
isConfigLookup: false,
|
|
40188
|
+
candidateIsFromPackageJsonField: false
|
|
40173
40189
|
};
|
|
40174
40190
|
const resolved = loadModuleFromImmediateNodeModulesDirectory(
|
|
40175
40191
|
4 /* Declaration */,
|
|
@@ -53064,7 +53080,17 @@ ${lanes.join("\n")}
|
|
|
53064
53080
|
}
|
|
53065
53081
|
}
|
|
53066
53082
|
function getOuterTypeParametersOfClassOrInterface(symbol) {
|
|
53067
|
-
|
|
53083
|
+
var _a2;
|
|
53084
|
+
const declaration = symbol.flags & 32 /* Class */ || symbol.flags & 16 /* Function */ ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => {
|
|
53085
|
+
if (decl.kind === 261 /* InterfaceDeclaration */) {
|
|
53086
|
+
return true;
|
|
53087
|
+
}
|
|
53088
|
+
if (decl.kind !== 257 /* VariableDeclaration */) {
|
|
53089
|
+
return false;
|
|
53090
|
+
}
|
|
53091
|
+
const initializer = decl.initializer;
|
|
53092
|
+
return !!initializer && (initializer.kind === 215 /* FunctionExpression */ || initializer.kind === 216 /* ArrowFunction */);
|
|
53093
|
+
});
|
|
53068
53094
|
Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations");
|
|
53069
53095
|
return getOuterTypeParameters(declaration);
|
|
53070
53096
|
}
|
|
@@ -65885,12 +65911,13 @@ ${lanes.join("\n")}
|
|
|
65885
65911
|
if (propName === void 0) {
|
|
65886
65912
|
return type;
|
|
65887
65913
|
}
|
|
65888
|
-
const
|
|
65914
|
+
const optionalChain = isOptionalChain(access);
|
|
65915
|
+
const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access)) && maybeTypeOfKind(type, 98304 /* Nullable */);
|
|
65889
65916
|
let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */) : type, propName);
|
|
65890
65917
|
if (!propType) {
|
|
65891
65918
|
return type;
|
|
65892
65919
|
}
|
|
65893
|
-
propType = removeNullable ? getOptionalType(propType) : propType;
|
|
65920
|
+
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
65894
65921
|
const narrowedPropType = narrowType2(propType);
|
|
65895
65922
|
return filterType(type, (t) => {
|
|
65896
65923
|
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
@@ -102777,6 +102804,9 @@ ${lanes.join("\n")}
|
|
|
102777
102804
|
case 259 /* FunctionDeclaration */:
|
|
102778
102805
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
|
|
102779
102806
|
break;
|
|
102807
|
+
case 192 /* InferType */:
|
|
102808
|
+
diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1;
|
|
102809
|
+
break;
|
|
102780
102810
|
case 262 /* TypeAliasDeclaration */:
|
|
102781
102811
|
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
|
|
102782
102812
|
break;
|
|
@@ -165751,6 +165781,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165751
165781
|
isNonContextualKeyword: () => isNonContextualKeyword,
|
|
165752
165782
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
165753
165783
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
165784
|
+
isNonNullAccess: () => isNonNullAccess,
|
|
165754
165785
|
isNonNullChain: () => isNonNullChain,
|
|
165755
165786
|
isNonNullExpression: () => isNonNullExpression,
|
|
165756
165787
|
isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName,
|
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.0";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230111`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -6207,6 +6207,7 @@ var Diagnostics = {
|
|
|
6207
6207
|
Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."),
|
|
6208
6208
|
Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."),
|
|
6209
6209
|
Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."),
|
|
6210
|
+
Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1 /* Error */, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."),
|
|
6210
6211
|
Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),
|
|
6211
6212
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),
|
|
6212
6213
|
Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),
|
|
@@ -28484,7 +28485,8 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
28484
28485
|
conditions,
|
|
28485
28486
|
requestContainingDirectory: containingDirectory,
|
|
28486
28487
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
28487
|
-
isConfigLookup
|
|
28488
|
+
isConfigLookup,
|
|
28489
|
+
candidateIsFromPackageJsonField: false
|
|
28488
28490
|
};
|
|
28489
28491
|
if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) {
|
|
28490
28492
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
@@ -28708,7 +28710,7 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
28708
28710
|
}
|
|
28709
28711
|
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
28710
28712
|
const path2 = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
28711
|
-
return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension };
|
|
28713
|
+
return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension };
|
|
28712
28714
|
}
|
|
28713
28715
|
}
|
|
28714
28716
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -28827,6 +28829,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
28827
28829
|
}
|
|
28828
28830
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
28829
28831
|
const features = state2.features;
|
|
28832
|
+
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
28833
|
+
state2.candidateIsFromPackageJsonField = true;
|
|
28830
28834
|
if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
|
|
28831
28835
|
state2.features &= ~32 /* EsmMode */;
|
|
28832
28836
|
}
|
|
@@ -28839,6 +28843,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
28839
28843
|
false
|
|
28840
28844
|
);
|
|
28841
28845
|
state2.features = features;
|
|
28846
|
+
state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField;
|
|
28842
28847
|
return result;
|
|
28843
28848
|
};
|
|
28844
28849
|
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0;
|
|
@@ -28912,7 +28917,10 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
|
|
|
28912
28917
|
return void 0;
|
|
28913
28918
|
}
|
|
28914
28919
|
const trailingParts = parts.slice(nameParts.length);
|
|
28915
|
-
|
|
28920
|
+
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
28921
|
+
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
28922
|
+
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
28923
|
+
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
28916
28924
|
}
|
|
28917
28925
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
28918
28926
|
if (!scope.contents.packageJsonContent.exports) {
|
|
@@ -29558,7 +29566,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
29558
29566
|
conditions: [],
|
|
29559
29567
|
requestContainingDirectory: containingDirectory,
|
|
29560
29568
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
29561
|
-
isConfigLookup: false
|
|
29569
|
+
isConfigLookup: false,
|
|
29570
|
+
candidateIsFromPackageJsonField: false
|
|
29562
29571
|
};
|
|
29563
29572
|
const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
|
|
29564
29573
|
return createResolvedModuleWithFailedLookupLocations(
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-pr-52180-
|
|
5
|
+
"version": "5.0.0-pr-52180-17",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|