@typescript-deploys/pr-build 5.4.0-pr-57029-27 → 5.4.0-pr-57122-12
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 +23 -61
- package/lib/tsserver.js +23 -61
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +23 -61
- package/lib/typingsInstaller.js +12 -54
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -7145,9 +7145,6 @@ var Diagnostics = {
|
|
|
7145
7145
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
7146
7146
|
Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
|
|
7147
7147
|
There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
|
|
7148
|
-
package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."),
|
|
7149
|
-
Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."),
|
|
7150
|
-
Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."),
|
|
7151
7148
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
7152
7149
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
7153
7150
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -11582,13 +11579,13 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
11582
11579
|
return result;
|
|
11583
11580
|
}
|
|
11584
11581
|
function packageIdIsEqual(a, b) {
|
|
11585
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version
|
|
11582
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
11586
11583
|
}
|
|
11587
11584
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
11588
11585
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
11589
11586
|
}
|
|
11590
11587
|
function packageIdToString(packageId) {
|
|
11591
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}
|
|
11588
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
11592
11589
|
}
|
|
11593
11590
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11594
11591
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
@@ -37166,7 +37163,7 @@ function trace(host, message, ...args) {
|
|
|
37166
37163
|
function isTraceEnabled(compilerOptions, host) {
|
|
37167
37164
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
37168
37165
|
}
|
|
37169
|
-
function withPackageId(packageInfo, r
|
|
37166
|
+
function withPackageId(packageInfo, r) {
|
|
37170
37167
|
let packageId;
|
|
37171
37168
|
if (r && packageInfo) {
|
|
37172
37169
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -37174,8 +37171,7 @@ function withPackageId(packageInfo, r, state) {
|
|
|
37174
37171
|
packageId = {
|
|
37175
37172
|
name: packageJsonContent.name,
|
|
37176
37173
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
37177
|
-
version: packageJsonContent.version
|
|
37178
|
-
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
37174
|
+
version: packageJsonContent.version
|
|
37179
37175
|
};
|
|
37180
37176
|
}
|
|
37181
37177
|
}
|
|
@@ -37185,9 +37181,7 @@ function noPackageId(r) {
|
|
|
37185
37181
|
return withPackageId(
|
|
37186
37182
|
/*packageInfo*/
|
|
37187
37183
|
void 0,
|
|
37188
|
-
r
|
|
37189
|
-
/*state*/
|
|
37190
|
-
void 0
|
|
37184
|
+
r
|
|
37191
37185
|
);
|
|
37192
37186
|
}
|
|
37193
37187
|
function removeIgnoredPackageId(r) {
|
|
@@ -37553,7 +37547,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
37553
37547
|
false,
|
|
37554
37548
|
moduleResolutionState
|
|
37555
37549
|
) : void 0;
|
|
37556
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile
|
|
37550
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
37557
37551
|
}
|
|
37558
37552
|
}
|
|
37559
37553
|
return resolvedTypeScriptOnly(
|
|
@@ -38489,7 +38483,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
38489
38483
|
false,
|
|
38490
38484
|
state
|
|
38491
38485
|
) : void 0;
|
|
38492
|
-
return withPackageId(packageInfo, resolvedFromFile
|
|
38486
|
+
return withPackageId(packageInfo, resolvedFromFile);
|
|
38493
38487
|
}
|
|
38494
38488
|
}
|
|
38495
38489
|
if (!onlyRecordFailures) {
|
|
@@ -38632,7 +38626,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
38632
38626
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
38633
38627
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
38634
38628
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
38635
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)
|
|
38629
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
38636
38630
|
}
|
|
38637
38631
|
function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) {
|
|
38638
38632
|
return {
|
|
@@ -38674,42 +38668,6 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
38674
38668
|
}
|
|
38675
38669
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
38676
38670
|
}
|
|
38677
|
-
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
38678
|
-
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
38679
|
-
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
38680
|
-
}
|
|
38681
|
-
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
38682
|
-
}
|
|
38683
|
-
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
38684
|
-
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
38685
|
-
if (peerDependencies === void 0)
|
|
38686
|
-
return void 0;
|
|
38687
|
-
if (state.traceEnabled)
|
|
38688
|
-
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
38689
|
-
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
38690
|
-
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
38691
|
-
let result = "";
|
|
38692
|
-
for (const key in peerDependencies) {
|
|
38693
|
-
if (hasProperty(peerDependencies, key)) {
|
|
38694
|
-
const peerPackageJson = getPackageJsonInfo(
|
|
38695
|
-
nodeModules + key,
|
|
38696
|
-
/*onlyRecordFailures*/
|
|
38697
|
-
false,
|
|
38698
|
-
state
|
|
38699
|
-
);
|
|
38700
|
-
if (peerPackageJson) {
|
|
38701
|
-
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
38702
|
-
result += `+${key}@${version2}`;
|
|
38703
|
-
if (state.traceEnabled)
|
|
38704
|
-
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
38705
|
-
} else {
|
|
38706
|
-
if (state.traceEnabled)
|
|
38707
|
-
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
38708
|
-
}
|
|
38709
|
-
}
|
|
38710
|
-
}
|
|
38711
|
-
return result;
|
|
38712
|
-
}
|
|
38713
38671
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
38714
38672
|
var _a, _b, _c, _d, _e, _f;
|
|
38715
38673
|
const { host, traceEnabled } = state;
|
|
@@ -38738,7 +38696,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
38738
38696
|
if (traceEnabled) {
|
|
38739
38697
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
38740
38698
|
}
|
|
38741
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0
|
|
38699
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
38742
38700
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
38743
38701
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
38744
38702
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -39146,7 +39104,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
39146
39104
|
/*onlyRecordFailures*/
|
|
39147
39105
|
false,
|
|
39148
39106
|
state
|
|
39149
|
-
)
|
|
39107
|
+
)));
|
|
39150
39108
|
} else if (typeof target === "object" && target !== null) {
|
|
39151
39109
|
if (!Array.isArray(target)) {
|
|
39152
39110
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -39260,7 +39218,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
39260
39218
|
/*onlyRecordFailures*/
|
|
39261
39219
|
false,
|
|
39262
39220
|
state
|
|
39263
|
-
)
|
|
39221
|
+
)));
|
|
39264
39222
|
}
|
|
39265
39223
|
}
|
|
39266
39224
|
}
|
|
@@ -39391,7 +39349,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
39391
39349
|
packageInfo.contents.packageJsonContent,
|
|
39392
39350
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
39393
39351
|
);
|
|
39394
|
-
return withPackageId(packageInfo, fromDirectory
|
|
39352
|
+
return withPackageId(packageInfo, fromDirectory);
|
|
39395
39353
|
}
|
|
39396
39354
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
39397
39355
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -39405,7 +39363,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
39405
39363
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
39406
39364
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
39407
39365
|
}
|
|
39408
|
-
return withPackageId(packageInfo, pathAndExtension
|
|
39366
|
+
return withPackageId(packageInfo, pathAndExtension);
|
|
39409
39367
|
};
|
|
39410
39368
|
if (rest !== "") {
|
|
39411
39369
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -39612,7 +39570,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
39612
39570
|
false,
|
|
39613
39571
|
state
|
|
39614
39572
|
) : void 0;
|
|
39615
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile
|
|
39573
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
39616
39574
|
}
|
|
39617
39575
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
39618
39576
|
if (resolved)
|
|
@@ -55351,11 +55309,15 @@ function createTypeChecker(host) {
|
|
|
55351
55309
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
55352
55310
|
}
|
|
55353
55311
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
55354
|
-
const
|
|
55355
|
-
|
|
55356
|
-
|
|
55357
|
-
|
|
55358
|
-
|
|
55312
|
+
const target = type.target ?? type;
|
|
55313
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
55314
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
55315
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
55316
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
55317
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
55318
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
55319
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
55320
|
+
}
|
|
55359
55321
|
}
|
|
55360
55322
|
}
|
|
55361
55323
|
return type;
|
package/lib/tsserver.js
CHANGED
|
@@ -10712,9 +10712,6 @@ var Diagnostics = {
|
|
|
10712
10712
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
10713
10713
|
Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
|
|
10714
10714
|
There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
|
|
10715
|
-
package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."),
|
|
10716
|
-
Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."),
|
|
10717
|
-
Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."),
|
|
10718
10715
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
10719
10716
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
10720
10717
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -15352,13 +15349,13 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15352
15349
|
return result;
|
|
15353
15350
|
}
|
|
15354
15351
|
function packageIdIsEqual(a, b) {
|
|
15355
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version
|
|
15352
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
15356
15353
|
}
|
|
15357
15354
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
15358
15355
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
15359
15356
|
}
|
|
15360
15357
|
function packageIdToString(packageId) {
|
|
15361
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}
|
|
15358
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
15362
15359
|
}
|
|
15363
15360
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
15364
15361
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
@@ -41674,7 +41671,7 @@ function trace(host, message, ...args) {
|
|
|
41674
41671
|
function isTraceEnabled(compilerOptions, host) {
|
|
41675
41672
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
41676
41673
|
}
|
|
41677
|
-
function withPackageId(packageInfo, r
|
|
41674
|
+
function withPackageId(packageInfo, r) {
|
|
41678
41675
|
let packageId;
|
|
41679
41676
|
if (r && packageInfo) {
|
|
41680
41677
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -41682,8 +41679,7 @@ function withPackageId(packageInfo, r, state) {
|
|
|
41682
41679
|
packageId = {
|
|
41683
41680
|
name: packageJsonContent.name,
|
|
41684
41681
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
41685
|
-
version: packageJsonContent.version
|
|
41686
|
-
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
41682
|
+
version: packageJsonContent.version
|
|
41687
41683
|
};
|
|
41688
41684
|
}
|
|
41689
41685
|
}
|
|
@@ -41693,9 +41689,7 @@ function noPackageId(r) {
|
|
|
41693
41689
|
return withPackageId(
|
|
41694
41690
|
/*packageInfo*/
|
|
41695
41691
|
void 0,
|
|
41696
|
-
r
|
|
41697
|
-
/*state*/
|
|
41698
|
-
void 0
|
|
41692
|
+
r
|
|
41699
41693
|
);
|
|
41700
41694
|
}
|
|
41701
41695
|
function removeIgnoredPackageId(r) {
|
|
@@ -42073,7 +42067,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
42073
42067
|
false,
|
|
42074
42068
|
moduleResolutionState
|
|
42075
42069
|
) : void 0;
|
|
42076
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile
|
|
42070
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
42077
42071
|
}
|
|
42078
42072
|
}
|
|
42079
42073
|
return resolvedTypeScriptOnly(
|
|
@@ -43047,7 +43041,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
43047
43041
|
false,
|
|
43048
43042
|
state
|
|
43049
43043
|
) : void 0;
|
|
43050
|
-
return withPackageId(packageInfo, resolvedFromFile
|
|
43044
|
+
return withPackageId(packageInfo, resolvedFromFile);
|
|
43051
43045
|
}
|
|
43052
43046
|
}
|
|
43053
43047
|
if (!onlyRecordFailures) {
|
|
@@ -43190,7 +43184,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
43190
43184
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
43191
43185
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
43192
43186
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
43193
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)
|
|
43187
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
43194
43188
|
}
|
|
43195
43189
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
43196
43190
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -43346,42 +43340,6 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
43346
43340
|
}
|
|
43347
43341
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
43348
43342
|
}
|
|
43349
|
-
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
43350
|
-
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
43351
|
-
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
43352
|
-
}
|
|
43353
|
-
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
43354
|
-
}
|
|
43355
|
-
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
43356
|
-
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
43357
|
-
if (peerDependencies === void 0)
|
|
43358
|
-
return void 0;
|
|
43359
|
-
if (state.traceEnabled)
|
|
43360
|
-
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
43361
|
-
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
43362
|
-
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
43363
|
-
let result = "";
|
|
43364
|
-
for (const key in peerDependencies) {
|
|
43365
|
-
if (hasProperty(peerDependencies, key)) {
|
|
43366
|
-
const peerPackageJson = getPackageJsonInfo(
|
|
43367
|
-
nodeModules + key,
|
|
43368
|
-
/*onlyRecordFailures*/
|
|
43369
|
-
false,
|
|
43370
|
-
state
|
|
43371
|
-
);
|
|
43372
|
-
if (peerPackageJson) {
|
|
43373
|
-
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
43374
|
-
result += `+${key}@${version2}`;
|
|
43375
|
-
if (state.traceEnabled)
|
|
43376
|
-
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
43377
|
-
} else {
|
|
43378
|
-
if (state.traceEnabled)
|
|
43379
|
-
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
43380
|
-
}
|
|
43381
|
-
}
|
|
43382
|
-
}
|
|
43383
|
-
return result;
|
|
43384
|
-
}
|
|
43385
43343
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
43386
43344
|
var _a, _b, _c, _d, _e, _f;
|
|
43387
43345
|
const { host, traceEnabled } = state;
|
|
@@ -43410,7 +43368,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
43410
43368
|
if (traceEnabled) {
|
|
43411
43369
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
43412
43370
|
}
|
|
43413
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0
|
|
43371
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
43414
43372
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
43415
43373
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
43416
43374
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -43818,7 +43776,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43818
43776
|
/*onlyRecordFailures*/
|
|
43819
43777
|
false,
|
|
43820
43778
|
state
|
|
43821
|
-
)
|
|
43779
|
+
)));
|
|
43822
43780
|
} else if (typeof target === "object" && target !== null) {
|
|
43823
43781
|
if (!Array.isArray(target)) {
|
|
43824
43782
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -43932,7 +43890,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43932
43890
|
/*onlyRecordFailures*/
|
|
43933
43891
|
false,
|
|
43934
43892
|
state
|
|
43935
|
-
)
|
|
43893
|
+
)));
|
|
43936
43894
|
}
|
|
43937
43895
|
}
|
|
43938
43896
|
}
|
|
@@ -44063,7 +44021,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
44063
44021
|
packageInfo.contents.packageJsonContent,
|
|
44064
44022
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
44065
44023
|
);
|
|
44066
|
-
return withPackageId(packageInfo, fromDirectory
|
|
44024
|
+
return withPackageId(packageInfo, fromDirectory);
|
|
44067
44025
|
}
|
|
44068
44026
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
44069
44027
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -44077,7 +44035,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
44077
44035
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
44078
44036
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
44079
44037
|
}
|
|
44080
|
-
return withPackageId(packageInfo, pathAndExtension
|
|
44038
|
+
return withPackageId(packageInfo, pathAndExtension);
|
|
44081
44039
|
};
|
|
44082
44040
|
if (rest !== "") {
|
|
44083
44041
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -44284,7 +44242,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
44284
44242
|
false,
|
|
44285
44243
|
state
|
|
44286
44244
|
) : void 0;
|
|
44287
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile
|
|
44245
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
44288
44246
|
}
|
|
44289
44247
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
44290
44248
|
if (resolved)
|
|
@@ -60086,11 +60044,15 @@ function createTypeChecker(host) {
|
|
|
60086
60044
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
60087
60045
|
}
|
|
60088
60046
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
60089
|
-
const
|
|
60090
|
-
|
|
60091
|
-
|
|
60092
|
-
|
|
60093
|
-
|
|
60047
|
+
const target = type.target ?? type;
|
|
60048
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
60049
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
60050
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
60051
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
60052
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
60053
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
60054
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
60055
|
+
}
|
|
60094
60056
|
}
|
|
60095
60057
|
}
|
|
60096
60058
|
return type;
|
package/lib/typescript.d.ts
CHANGED
package/lib/typescript.js
CHANGED
|
@@ -8482,9 +8482,6 @@ ${lanes.join("\n")}
|
|
|
8482
8482
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
8483
8483
|
Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
|
|
8484
8484
|
There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
|
|
8485
|
-
package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."),
|
|
8486
|
-
Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."),
|
|
8487
|
-
Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."),
|
|
8488
8485
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
8489
8486
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
8490
8487
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -13133,13 +13130,13 @@ ${lanes.join("\n")}
|
|
|
13133
13130
|
return result;
|
|
13134
13131
|
}
|
|
13135
13132
|
function packageIdIsEqual(a, b) {
|
|
13136
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version
|
|
13133
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
13137
13134
|
}
|
|
13138
13135
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
13139
13136
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
13140
13137
|
}
|
|
13141
13138
|
function packageIdToString(packageId) {
|
|
13142
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}
|
|
13139
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
13143
13140
|
}
|
|
13144
13141
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
13145
13142
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
@@ -39522,7 +39519,7 @@ ${lanes.join("\n")}
|
|
|
39522
39519
|
function isTraceEnabled(compilerOptions, host) {
|
|
39523
39520
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
39524
39521
|
}
|
|
39525
|
-
function withPackageId(packageInfo, r
|
|
39522
|
+
function withPackageId(packageInfo, r) {
|
|
39526
39523
|
let packageId;
|
|
39527
39524
|
if (r && packageInfo) {
|
|
39528
39525
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -39530,8 +39527,7 @@ ${lanes.join("\n")}
|
|
|
39530
39527
|
packageId = {
|
|
39531
39528
|
name: packageJsonContent.name,
|
|
39532
39529
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
39533
|
-
version: packageJsonContent.version
|
|
39534
|
-
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
39530
|
+
version: packageJsonContent.version
|
|
39535
39531
|
};
|
|
39536
39532
|
}
|
|
39537
39533
|
}
|
|
@@ -39541,9 +39537,7 @@ ${lanes.join("\n")}
|
|
|
39541
39537
|
return withPackageId(
|
|
39542
39538
|
/*packageInfo*/
|
|
39543
39539
|
void 0,
|
|
39544
|
-
r
|
|
39545
|
-
/*state*/
|
|
39546
|
-
void 0
|
|
39540
|
+
r
|
|
39547
39541
|
);
|
|
39548
39542
|
}
|
|
39549
39543
|
function removeIgnoredPackageId(r) {
|
|
@@ -39919,7 +39913,7 @@ ${lanes.join("\n")}
|
|
|
39919
39913
|
false,
|
|
39920
39914
|
moduleResolutionState
|
|
39921
39915
|
) : void 0;
|
|
39922
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile
|
|
39916
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
39923
39917
|
}
|
|
39924
39918
|
}
|
|
39925
39919
|
return resolvedTypeScriptOnly(
|
|
@@ -40880,7 +40874,7 @@ ${lanes.join("\n")}
|
|
|
40880
40874
|
false,
|
|
40881
40875
|
state
|
|
40882
40876
|
) : void 0;
|
|
40883
|
-
return withPackageId(packageInfo, resolvedFromFile
|
|
40877
|
+
return withPackageId(packageInfo, resolvedFromFile);
|
|
40884
40878
|
}
|
|
40885
40879
|
}
|
|
40886
40880
|
if (!onlyRecordFailures) {
|
|
@@ -41022,7 +41016,7 @@ ${lanes.join("\n")}
|
|
|
41022
41016
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
41023
41017
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
41024
41018
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
41025
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)
|
|
41019
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
41026
41020
|
}
|
|
41027
41021
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
41028
41022
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -41178,42 +41172,6 @@ ${lanes.join("\n")}
|
|
|
41178
41172
|
}
|
|
41179
41173
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
41180
41174
|
}
|
|
41181
|
-
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
41182
|
-
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
41183
|
-
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
41184
|
-
}
|
|
41185
|
-
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
41186
|
-
}
|
|
41187
|
-
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
41188
|
-
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
41189
|
-
if (peerDependencies === void 0)
|
|
41190
|
-
return void 0;
|
|
41191
|
-
if (state.traceEnabled)
|
|
41192
|
-
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
41193
|
-
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
41194
|
-
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
41195
|
-
let result = "";
|
|
41196
|
-
for (const key in peerDependencies) {
|
|
41197
|
-
if (hasProperty(peerDependencies, key)) {
|
|
41198
|
-
const peerPackageJson = getPackageJsonInfo(
|
|
41199
|
-
nodeModules + key,
|
|
41200
|
-
/*onlyRecordFailures*/
|
|
41201
|
-
false,
|
|
41202
|
-
state
|
|
41203
|
-
);
|
|
41204
|
-
if (peerPackageJson) {
|
|
41205
|
-
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
41206
|
-
result += `+${key}@${version2}`;
|
|
41207
|
-
if (state.traceEnabled)
|
|
41208
|
-
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
41209
|
-
} else {
|
|
41210
|
-
if (state.traceEnabled)
|
|
41211
|
-
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
41212
|
-
}
|
|
41213
|
-
}
|
|
41214
|
-
}
|
|
41215
|
-
return result;
|
|
41216
|
-
}
|
|
41217
41175
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
41218
41176
|
var _a, _b, _c, _d, _e, _f;
|
|
41219
41177
|
const { host, traceEnabled } = state;
|
|
@@ -41242,7 +41200,7 @@ ${lanes.join("\n")}
|
|
|
41242
41200
|
if (traceEnabled) {
|
|
41243
41201
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
41244
41202
|
}
|
|
41245
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0
|
|
41203
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
41246
41204
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
41247
41205
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
41248
41206
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -41650,7 +41608,7 @@ ${lanes.join("\n")}
|
|
|
41650
41608
|
/*onlyRecordFailures*/
|
|
41651
41609
|
false,
|
|
41652
41610
|
state
|
|
41653
|
-
)
|
|
41611
|
+
)));
|
|
41654
41612
|
} else if (typeof target === "object" && target !== null) {
|
|
41655
41613
|
if (!Array.isArray(target)) {
|
|
41656
41614
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -41764,7 +41722,7 @@ ${lanes.join("\n")}
|
|
|
41764
41722
|
/*onlyRecordFailures*/
|
|
41765
41723
|
false,
|
|
41766
41724
|
state
|
|
41767
|
-
)
|
|
41725
|
+
)));
|
|
41768
41726
|
}
|
|
41769
41727
|
}
|
|
41770
41728
|
}
|
|
@@ -41895,7 +41853,7 @@ ${lanes.join("\n")}
|
|
|
41895
41853
|
packageInfo.contents.packageJsonContent,
|
|
41896
41854
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
41897
41855
|
);
|
|
41898
|
-
return withPackageId(packageInfo, fromDirectory
|
|
41856
|
+
return withPackageId(packageInfo, fromDirectory);
|
|
41899
41857
|
}
|
|
41900
41858
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
41901
41859
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -41909,7 +41867,7 @@ ${lanes.join("\n")}
|
|
|
41909
41867
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
41910
41868
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
41911
41869
|
}
|
|
41912
|
-
return withPackageId(packageInfo, pathAndExtension
|
|
41870
|
+
return withPackageId(packageInfo, pathAndExtension);
|
|
41913
41871
|
};
|
|
41914
41872
|
if (rest !== "") {
|
|
41915
41873
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -42115,7 +42073,7 @@ ${lanes.join("\n")}
|
|
|
42115
42073
|
false,
|
|
42116
42074
|
state
|
|
42117
42075
|
) : void 0;
|
|
42118
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile
|
|
42076
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
42119
42077
|
}
|
|
42120
42078
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
42121
42079
|
if (resolved)
|
|
@@ -57840,11 +57798,15 @@ ${lanes.join("\n")}
|
|
|
57840
57798
|
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
|
|
57841
57799
|
}
|
|
57842
57800
|
function getResolvedApparentTypeOfMappedType(type) {
|
|
57843
|
-
const
|
|
57844
|
-
|
|
57845
|
-
|
|
57846
|
-
|
|
57847
|
-
|
|
57801
|
+
const target = type.target ?? type;
|
|
57802
|
+
const typeVariable = getHomomorphicTypeVariable(target);
|
|
57803
|
+
if (typeVariable && !target.declaration.nameType) {
|
|
57804
|
+
const constraint = getConstraintTypeFromMappedType(type);
|
|
57805
|
+
if (constraint.flags & 4194304 /* Index */) {
|
|
57806
|
+
const baseConstraint = getBaseConstraintOfType(constraint.type);
|
|
57807
|
+
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
|
|
57808
|
+
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
|
|
57809
|
+
}
|
|
57848
57810
|
}
|
|
57849
57811
|
}
|
|
57850
57812
|
return type;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -6521,9 +6521,6 @@ var Diagnostics = {
|
|
|
6521
6521
|
There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
|
|
6522
6522
|
Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."),
|
|
6523
6523
|
There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."),
|
|
6524
|
-
package_json_has_a_peerDependencies_field: diag(6281, 3 /* Message */, "package_json_has_a_peerDependencies_field_6281", "'package.json' has a 'peerDependencies' field."),
|
|
6525
|
-
Found_peerDependency_0_with_1_version: diag(6282, 3 /* Message */, "Found_peerDependency_0_with_1_version_6282", "Found peerDependency '{0}' with '{1}' version."),
|
|
6526
|
-
Failed_to_find_peerDependency_0: diag(6283, 3 /* Message */, "Failed_to_find_peerDependency_0_6283", "Failed to find peerDependency '{0}'."),
|
|
6527
6524
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
6528
6525
|
Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
|
|
6529
6526
|
Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
|
|
@@ -10104,7 +10101,7 @@ function packageIdToPackageName({ name, subModuleName }) {
|
|
|
10104
10101
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
10105
10102
|
}
|
|
10106
10103
|
function packageIdToString(packageId) {
|
|
10107
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}
|
|
10104
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
10108
10105
|
}
|
|
10109
10106
|
function containsParseError(node) {
|
|
10110
10107
|
aggregateChildData(node);
|
|
@@ -27632,7 +27629,7 @@ function trace(host, message, ...args) {
|
|
|
27632
27629
|
function isTraceEnabled(compilerOptions, host) {
|
|
27633
27630
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
27634
27631
|
}
|
|
27635
|
-
function withPackageId(packageInfo, r
|
|
27632
|
+
function withPackageId(packageInfo, r) {
|
|
27636
27633
|
let packageId;
|
|
27637
27634
|
if (r && packageInfo) {
|
|
27638
27635
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -27640,8 +27637,7 @@ function withPackageId(packageInfo, r, state) {
|
|
|
27640
27637
|
packageId = {
|
|
27641
27638
|
name: packageJsonContent.name,
|
|
27642
27639
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
27643
|
-
version: packageJsonContent.version
|
|
27644
|
-
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
27640
|
+
version: packageJsonContent.version
|
|
27645
27641
|
};
|
|
27646
27642
|
}
|
|
27647
27643
|
}
|
|
@@ -27651,9 +27647,7 @@ function noPackageId(r) {
|
|
|
27651
27647
|
return withPackageId(
|
|
27652
27648
|
/*packageInfo*/
|
|
27653
27649
|
void 0,
|
|
27654
|
-
r
|
|
27655
|
-
/*state*/
|
|
27656
|
-
void 0
|
|
27650
|
+
r
|
|
27657
27651
|
);
|
|
27658
27652
|
}
|
|
27659
27653
|
function removeIgnoredPackageId(r) {
|
|
@@ -28352,7 +28346,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
28352
28346
|
false,
|
|
28353
28347
|
state
|
|
28354
28348
|
) : void 0;
|
|
28355
|
-
return withPackageId(packageInfo, resolvedFromFile
|
|
28349
|
+
return withPackageId(packageInfo, resolvedFromFile);
|
|
28356
28350
|
}
|
|
28357
28351
|
}
|
|
28358
28352
|
if (!onlyRecordFailures) {
|
|
@@ -28495,7 +28489,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
28495
28489
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
28496
28490
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
28497
28491
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
28498
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)
|
|
28492
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
28499
28493
|
}
|
|
28500
28494
|
function getPackageScopeForPath(fileName, state) {
|
|
28501
28495
|
const parts = getPathComponents(fileName);
|
|
@@ -28520,42 +28514,6 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
28520
28514
|
}
|
|
28521
28515
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
28522
28516
|
}
|
|
28523
|
-
function getPeerDependenciesOfPackageJsonInfo(packageJsonInfo, state) {
|
|
28524
|
-
if (packageJsonInfo.contents.peerDependencies === void 0) {
|
|
28525
|
-
packageJsonInfo.contents.peerDependencies = readPackageJsonPeerDependencies(packageJsonInfo, state) || false;
|
|
28526
|
-
}
|
|
28527
|
-
return packageJsonInfo.contents.peerDependencies || void 0;
|
|
28528
|
-
}
|
|
28529
|
-
function readPackageJsonPeerDependencies(packageJsonInfo, state) {
|
|
28530
|
-
const peerDependencies = readPackageJsonField(packageJsonInfo.contents.packageJsonContent, "peerDependencies", "object", state);
|
|
28531
|
-
if (peerDependencies === void 0)
|
|
28532
|
-
return void 0;
|
|
28533
|
-
if (state.traceEnabled)
|
|
28534
|
-
trace(state.host, Diagnostics.package_json_has_a_peerDependencies_field);
|
|
28535
|
-
const packageDirectory = realPath(packageJsonInfo.packageDirectory, state.host, state.traceEnabled);
|
|
28536
|
-
const nodeModules = packageDirectory.substring(0, packageDirectory.lastIndexOf("node_modules") + "node_modules".length) + directorySeparator;
|
|
28537
|
-
let result = "";
|
|
28538
|
-
for (const key in peerDependencies) {
|
|
28539
|
-
if (hasProperty(peerDependencies, key)) {
|
|
28540
|
-
const peerPackageJson = getPackageJsonInfo(
|
|
28541
|
-
nodeModules + key,
|
|
28542
|
-
/*onlyRecordFailures*/
|
|
28543
|
-
false,
|
|
28544
|
-
state
|
|
28545
|
-
);
|
|
28546
|
-
if (peerPackageJson) {
|
|
28547
|
-
const version2 = peerPackageJson.contents.packageJsonContent.version;
|
|
28548
|
-
result += `+${key}@${version2}`;
|
|
28549
|
-
if (state.traceEnabled)
|
|
28550
|
-
trace(state.host, Diagnostics.Found_peerDependency_0_with_1_version, key, version2);
|
|
28551
|
-
} else {
|
|
28552
|
-
if (state.traceEnabled)
|
|
28553
|
-
trace(state.host, Diagnostics.Failed_to_find_peerDependency_0, key);
|
|
28554
|
-
}
|
|
28555
|
-
}
|
|
28556
|
-
}
|
|
28557
|
-
return result;
|
|
28558
|
-
}
|
|
28559
28517
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
28560
28518
|
var _a, _b, _c, _d, _e, _f;
|
|
28561
28519
|
const { host, traceEnabled } = state;
|
|
@@ -28584,7 +28542,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
28584
28542
|
if (traceEnabled) {
|
|
28585
28543
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
28586
28544
|
}
|
|
28587
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0
|
|
28545
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
28588
28546
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
28589
28547
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
28590
28548
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -28992,7 +28950,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28992
28950
|
/*onlyRecordFailures*/
|
|
28993
28951
|
false,
|
|
28994
28952
|
state
|
|
28995
|
-
)
|
|
28953
|
+
)));
|
|
28996
28954
|
} else if (typeof target === "object" && target !== null) {
|
|
28997
28955
|
if (!Array.isArray(target)) {
|
|
28998
28956
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -29106,7 +29064,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
29106
29064
|
/*onlyRecordFailures*/
|
|
29107
29065
|
false,
|
|
29108
29066
|
state
|
|
29109
|
-
)
|
|
29067
|
+
)));
|
|
29110
29068
|
}
|
|
29111
29069
|
}
|
|
29112
29070
|
}
|
|
@@ -29237,7 +29195,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
29237
29195
|
packageInfo.contents.packageJsonContent,
|
|
29238
29196
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
29239
29197
|
);
|
|
29240
|
-
return withPackageId(packageInfo, fromDirectory
|
|
29198
|
+
return withPackageId(packageInfo, fromDirectory);
|
|
29241
29199
|
}
|
|
29242
29200
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
29243
29201
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -29251,7 +29209,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
29251
29209
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
29252
29210
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
29253
29211
|
}
|
|
29254
|
-
return withPackageId(packageInfo, pathAndExtension
|
|
29212
|
+
return withPackageId(packageInfo, pathAndExtension);
|
|
29255
29213
|
};
|
|
29256
29214
|
if (rest !== "") {
|
|
29257
29215
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -29445,7 +29403,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
29445
29403
|
false,
|
|
29446
29404
|
state
|
|
29447
29405
|
) : void 0;
|
|
29448
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile
|
|
29406
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
29449
29407
|
}
|
|
29450
29408
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
29451
29409
|
if (resolved)
|
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.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-57122-12",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "ecb1a62f5afa6d60894c8662f03341cf81c26d6d"
|
|
118
118
|
}
|