@typescript-deploys/pr-build 5.4.0-pr-57114-8 → 5.4.0-pr-57029-27
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 +65 -19
- package/lib/tsserver.js +70 -19
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +70 -19
- package/lib/typingsInstaller.js +58 -13
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240122`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3960,6 +3960,9 @@ var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 };
|
|
|
3960
3960
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
3961
3961
|
var unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
3962
3962
|
function setCustomPollingValues(system) {
|
|
3963
|
+
if (!system.getEnvironmentVariable) {
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3963
3966
|
const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval);
|
|
3964
3967
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
3965
3968
|
unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds;
|
|
@@ -7142,6 +7145,9 @@ var Diagnostics = {
|
|
|
7142
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.`),
|
|
7143
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."),
|
|
7144
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}'."),
|
|
7145
7151
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
7146
7152
|
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."),
|
|
7147
7153
|
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}'."),
|
|
@@ -11576,13 +11582,13 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
11576
11582
|
return result;
|
|
11577
11583
|
}
|
|
11578
11584
|
function packageIdIsEqual(a, b) {
|
|
11579
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
11585
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies;
|
|
11580
11586
|
}
|
|
11581
11587
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
11582
11588
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
11583
11589
|
}
|
|
11584
11590
|
function packageIdToString(packageId) {
|
|
11585
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
11591
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
11586
11592
|
}
|
|
11587
11593
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11588
11594
|
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;
|
|
@@ -37160,7 +37166,7 @@ function trace(host, message, ...args) {
|
|
|
37160
37166
|
function isTraceEnabled(compilerOptions, host) {
|
|
37161
37167
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
37162
37168
|
}
|
|
37163
|
-
function withPackageId(packageInfo, r) {
|
|
37169
|
+
function withPackageId(packageInfo, r, state) {
|
|
37164
37170
|
let packageId;
|
|
37165
37171
|
if (r && packageInfo) {
|
|
37166
37172
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -37168,7 +37174,8 @@ function withPackageId(packageInfo, r) {
|
|
|
37168
37174
|
packageId = {
|
|
37169
37175
|
name: packageJsonContent.name,
|
|
37170
37176
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
37171
|
-
version: packageJsonContent.version
|
|
37177
|
+
version: packageJsonContent.version,
|
|
37178
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
37172
37179
|
};
|
|
37173
37180
|
}
|
|
37174
37181
|
}
|
|
@@ -37178,7 +37185,9 @@ function noPackageId(r) {
|
|
|
37178
37185
|
return withPackageId(
|
|
37179
37186
|
/*packageInfo*/
|
|
37180
37187
|
void 0,
|
|
37181
|
-
r
|
|
37188
|
+
r,
|
|
37189
|
+
/*state*/
|
|
37190
|
+
void 0
|
|
37182
37191
|
);
|
|
37183
37192
|
}
|
|
37184
37193
|
function removeIgnoredPackageId(r) {
|
|
@@ -37544,7 +37553,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
37544
37553
|
false,
|
|
37545
37554
|
moduleResolutionState
|
|
37546
37555
|
) : void 0;
|
|
37547
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
37556
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState));
|
|
37548
37557
|
}
|
|
37549
37558
|
}
|
|
37550
37559
|
return resolvedTypeScriptOnly(
|
|
@@ -38480,7 +38489,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
38480
38489
|
false,
|
|
38481
38490
|
state
|
|
38482
38491
|
) : void 0;
|
|
38483
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
38492
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
38484
38493
|
}
|
|
38485
38494
|
}
|
|
38486
38495
|
if (!onlyRecordFailures) {
|
|
@@ -38623,7 +38632,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
38623
38632
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
38624
38633
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
38625
38634
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
38626
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
38635
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
38627
38636
|
}
|
|
38628
38637
|
function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) {
|
|
38629
38638
|
return {
|
|
@@ -38665,6 +38674,42 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
38665
38674
|
}
|
|
38666
38675
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
38667
38676
|
}
|
|
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
|
+
}
|
|
38668
38713
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
38669
38714
|
var _a, _b, _c, _d, _e, _f;
|
|
38670
38715
|
const { host, traceEnabled } = state;
|
|
@@ -38693,7 +38738,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
38693
38738
|
if (traceEnabled) {
|
|
38694
38739
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
38695
38740
|
}
|
|
38696
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
38741
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
38697
38742
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
38698
38743
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
38699
38744
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -39101,7 +39146,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
39101
39146
|
/*onlyRecordFailures*/
|
|
39102
39147
|
false,
|
|
39103
39148
|
state
|
|
39104
|
-
)));
|
|
39149
|
+
), state));
|
|
39105
39150
|
} else if (typeof target === "object" && target !== null) {
|
|
39106
39151
|
if (!Array.isArray(target)) {
|
|
39107
39152
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -39215,7 +39260,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
39215
39260
|
/*onlyRecordFailures*/
|
|
39216
39261
|
false,
|
|
39217
39262
|
state
|
|
39218
|
-
)));
|
|
39263
|
+
), state));
|
|
39219
39264
|
}
|
|
39220
39265
|
}
|
|
39221
39266
|
}
|
|
@@ -39346,7 +39391,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
39346
39391
|
packageInfo.contents.packageJsonContent,
|
|
39347
39392
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
39348
39393
|
);
|
|
39349
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
39394
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
39350
39395
|
}
|
|
39351
39396
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
39352
39397
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -39360,7 +39405,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
39360
39405
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
39361
39406
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
39362
39407
|
}
|
|
39363
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
39408
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
39364
39409
|
};
|
|
39365
39410
|
if (rest !== "") {
|
|
39366
39411
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -39567,7 +39612,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
39567
39612
|
false,
|
|
39568
39613
|
state
|
|
39569
39614
|
) : void 0;
|
|
39570
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
39615
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
39571
39616
|
}
|
|
39572
39617
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
39573
39618
|
if (resolved)
|
|
@@ -43248,7 +43293,7 @@ function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory,
|
|
|
43248
43293
|
return processEnding(shortest, allowedEndings, compilerOptions);
|
|
43249
43294
|
}
|
|
43250
43295
|
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
43251
|
-
if (!host.readFile) {
|
|
43296
|
+
if (!host.fileExists || !host.readFile) {
|
|
43252
43297
|
return void 0;
|
|
43253
43298
|
}
|
|
43254
43299
|
const parts = getNodeModulePathParts(path);
|
|
@@ -43355,6 +43400,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
43355
43400
|
}
|
|
43356
43401
|
}
|
|
43357
43402
|
function tryGetAnyFileFromPath(host, path) {
|
|
43403
|
+
if (!host.fileExists)
|
|
43404
|
+
return;
|
|
43358
43405
|
const extensions = flatten(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]));
|
|
43359
43406
|
for (const e of extensions) {
|
|
43360
43407
|
const fullPath = path + e;
|
|
@@ -78792,7 +78839,7 @@ function createTypeChecker(host) {
|
|
|
78792
78839
|
}
|
|
78793
78840
|
}
|
|
78794
78841
|
function helper(condExpr2, body2) {
|
|
78795
|
-
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) :
|
|
78842
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
78796
78843
|
if (isModuleExportsAccessExpression(location)) {
|
|
78797
78844
|
return;
|
|
78798
78845
|
}
|
|
@@ -78804,8 +78851,7 @@ function createTypeChecker(host) {
|
|
|
78804
78851
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
78805
78852
|
if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
78806
78853
|
return;
|
|
78807
|
-
const
|
|
78808
|
-
const callSignatures = getSignaturesOfType(testedType, 0 /* Call */);
|
|
78854
|
+
const callSignatures = getSignaturesOfType(type, 0 /* Call */);
|
|
78809
78855
|
const isPromise = !!getAwaitedTypeOfPromise(type);
|
|
78810
78856
|
if (callSignatures.length === 0 && !isPromise) {
|
|
78811
78857
|
return;
|
package/lib/tsserver.js
CHANGED
|
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2340
2340
|
|
|
2341
2341
|
// src/compiler/corePublic.ts
|
|
2342
2342
|
var versionMajorMinor = "5.4";
|
|
2343
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var version = `${versionMajorMinor}.0-insiders.20240122`;
|
|
2344
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2345
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2346
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7503,6 +7503,9 @@ var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 };
|
|
|
7503
7503
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
7504
7504
|
var unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
7505
7505
|
function setCustomPollingValues(system) {
|
|
7506
|
+
if (!system.getEnvironmentVariable) {
|
|
7507
|
+
return;
|
|
7508
|
+
}
|
|
7506
7509
|
const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval);
|
|
7507
7510
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
7508
7511
|
unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds;
|
|
@@ -10709,6 +10712,9 @@ var Diagnostics = {
|
|
|
10709
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.`),
|
|
10710
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."),
|
|
10711
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}'."),
|
|
10712
10718
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
10713
10719
|
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."),
|
|
10714
10720
|
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}'."),
|
|
@@ -15346,13 +15352,13 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15346
15352
|
return result;
|
|
15347
15353
|
}
|
|
15348
15354
|
function packageIdIsEqual(a, b) {
|
|
15349
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
15355
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies;
|
|
15350
15356
|
}
|
|
15351
15357
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
15352
15358
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
15353
15359
|
}
|
|
15354
15360
|
function packageIdToString(packageId) {
|
|
15355
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
15361
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
15356
15362
|
}
|
|
15357
15363
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
15358
15364
|
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;
|
|
@@ -41668,7 +41674,7 @@ function trace(host, message, ...args) {
|
|
|
41668
41674
|
function isTraceEnabled(compilerOptions, host) {
|
|
41669
41675
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
41670
41676
|
}
|
|
41671
|
-
function withPackageId(packageInfo, r) {
|
|
41677
|
+
function withPackageId(packageInfo, r, state) {
|
|
41672
41678
|
let packageId;
|
|
41673
41679
|
if (r && packageInfo) {
|
|
41674
41680
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -41676,7 +41682,8 @@ function withPackageId(packageInfo, r) {
|
|
|
41676
41682
|
packageId = {
|
|
41677
41683
|
name: packageJsonContent.name,
|
|
41678
41684
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
41679
|
-
version: packageJsonContent.version
|
|
41685
|
+
version: packageJsonContent.version,
|
|
41686
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
41680
41687
|
};
|
|
41681
41688
|
}
|
|
41682
41689
|
}
|
|
@@ -41686,7 +41693,9 @@ function noPackageId(r) {
|
|
|
41686
41693
|
return withPackageId(
|
|
41687
41694
|
/*packageInfo*/
|
|
41688
41695
|
void 0,
|
|
41689
|
-
r
|
|
41696
|
+
r,
|
|
41697
|
+
/*state*/
|
|
41698
|
+
void 0
|
|
41690
41699
|
);
|
|
41691
41700
|
}
|
|
41692
41701
|
function removeIgnoredPackageId(r) {
|
|
@@ -42064,7 +42073,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
42064
42073
|
false,
|
|
42065
42074
|
moduleResolutionState
|
|
42066
42075
|
) : void 0;
|
|
42067
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
42076
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState));
|
|
42068
42077
|
}
|
|
42069
42078
|
}
|
|
42070
42079
|
return resolvedTypeScriptOnly(
|
|
@@ -43038,7 +43047,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
43038
43047
|
false,
|
|
43039
43048
|
state
|
|
43040
43049
|
) : void 0;
|
|
43041
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
43050
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
43042
43051
|
}
|
|
43043
43052
|
}
|
|
43044
43053
|
if (!onlyRecordFailures) {
|
|
@@ -43181,7 +43190,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
43181
43190
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
43182
43191
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
43183
43192
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
43184
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
43193
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
43185
43194
|
}
|
|
43186
43195
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
43187
43196
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -43337,6 +43346,42 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
43337
43346
|
}
|
|
43338
43347
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
43339
43348
|
}
|
|
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
|
+
}
|
|
43340
43385
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
43341
43386
|
var _a, _b, _c, _d, _e, _f;
|
|
43342
43387
|
const { host, traceEnabled } = state;
|
|
@@ -43365,7 +43410,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
43365
43410
|
if (traceEnabled) {
|
|
43366
43411
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
43367
43412
|
}
|
|
43368
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
43413
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
43369
43414
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
43370
43415
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
43371
43416
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -43773,7 +43818,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43773
43818
|
/*onlyRecordFailures*/
|
|
43774
43819
|
false,
|
|
43775
43820
|
state
|
|
43776
|
-
)));
|
|
43821
|
+
), state));
|
|
43777
43822
|
} else if (typeof target === "object" && target !== null) {
|
|
43778
43823
|
if (!Array.isArray(target)) {
|
|
43779
43824
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -43887,7 +43932,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43887
43932
|
/*onlyRecordFailures*/
|
|
43888
43933
|
false,
|
|
43889
43934
|
state
|
|
43890
|
-
)));
|
|
43935
|
+
), state));
|
|
43891
43936
|
}
|
|
43892
43937
|
}
|
|
43893
43938
|
}
|
|
@@ -44018,7 +44063,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
44018
44063
|
packageInfo.contents.packageJsonContent,
|
|
44019
44064
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
44020
44065
|
);
|
|
44021
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
44066
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
44022
44067
|
}
|
|
44023
44068
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
44024
44069
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -44032,7 +44077,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
44032
44077
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
44033
44078
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
44034
44079
|
}
|
|
44035
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
44080
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
44036
44081
|
};
|
|
44037
44082
|
if (rest !== "") {
|
|
44038
44083
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -44239,7 +44284,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
44239
44284
|
false,
|
|
44240
44285
|
state
|
|
44241
44286
|
) : void 0;
|
|
44242
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
44287
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
44243
44288
|
}
|
|
44244
44289
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
44245
44290
|
if (resolved)
|
|
@@ -47983,7 +48028,7 @@ function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory,
|
|
|
47983
48028
|
return processEnding(shortest, allowedEndings, compilerOptions);
|
|
47984
48029
|
}
|
|
47985
48030
|
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
47986
|
-
if (!host.readFile) {
|
|
48031
|
+
if (!host.fileExists || !host.readFile) {
|
|
47987
48032
|
return void 0;
|
|
47988
48033
|
}
|
|
47989
48034
|
const parts = getNodeModulePathParts(path);
|
|
@@ -48090,6 +48135,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
48090
48135
|
}
|
|
48091
48136
|
}
|
|
48092
48137
|
function tryGetAnyFileFromPath(host, path) {
|
|
48138
|
+
if (!host.fileExists)
|
|
48139
|
+
return;
|
|
48093
48140
|
const extensions = flatten(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]));
|
|
48094
48141
|
for (const e of extensions) {
|
|
48095
48142
|
const fullPath = path + e;
|
|
@@ -83527,7 +83574,7 @@ function createTypeChecker(host) {
|
|
|
83527
83574
|
}
|
|
83528
83575
|
}
|
|
83529
83576
|
function helper(condExpr2, body2) {
|
|
83530
|
-
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) :
|
|
83577
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
83531
83578
|
if (isModuleExportsAccessExpression(location)) {
|
|
83532
83579
|
return;
|
|
83533
83580
|
}
|
|
@@ -83539,8 +83586,7 @@ function createTypeChecker(host) {
|
|
|
83539
83586
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
83540
83587
|
if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
83541
83588
|
return;
|
|
83542
|
-
const
|
|
83543
|
-
const callSignatures = getSignaturesOfType(testedType, 0 /* Call */);
|
|
83589
|
+
const callSignatures = getSignaturesOfType(type, 0 /* Call */);
|
|
83544
83590
|
const isPromise = !!getAwaitedTypeOfPromise(type);
|
|
83545
83591
|
if (callSignatures.length === 0 && !isPromise) {
|
|
83546
83592
|
return;
|
|
@@ -134970,6 +135016,9 @@ function findPackageJson(directory, host) {
|
|
|
134970
135016
|
return packageJson;
|
|
134971
135017
|
}
|
|
134972
135018
|
function getPackageJsonsVisibleToFile(fileName, host) {
|
|
135019
|
+
if (!host.fileExists) {
|
|
135020
|
+
return [];
|
|
135021
|
+
}
|
|
134973
135022
|
const packageJsons = [];
|
|
134974
135023
|
forEachAncestorDirectory(getDirectoryPath(fileName), (ancestor) => {
|
|
134975
135024
|
const packageJsonFileName = combinePaths(ancestor, "package.json");
|
|
@@ -163399,6 +163448,8 @@ function getCompletionEntriesFromTypings(host, options, scriptPath, fragmentDire
|
|
|
163399
163448
|
}
|
|
163400
163449
|
}
|
|
163401
163450
|
function enumerateNodeModulesVisibleToScript(host, scriptPath) {
|
|
163451
|
+
if (!host.readFile || !host.fileExists)
|
|
163452
|
+
return emptyArray;
|
|
163402
163453
|
const result = [];
|
|
163403
163454
|
for (const packageJson of findPackageJsons(scriptPath, host)) {
|
|
163404
163455
|
const contents = readJson(packageJson, host);
|
package/lib/typescript.d.ts
CHANGED
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240122`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5238,6 +5238,9 @@ ${lanes.join("\n")}
|
|
|
5238
5238
|
};
|
|
5239
5239
|
}
|
|
5240
5240
|
function setCustomPollingValues(system) {
|
|
5241
|
+
if (!system.getEnvironmentVariable) {
|
|
5242
|
+
return;
|
|
5243
|
+
}
|
|
5241
5244
|
const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval);
|
|
5242
5245
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
5243
5246
|
unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds;
|
|
@@ -8479,6 +8482,9 @@ ${lanes.join("\n")}
|
|
|
8479
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.`),
|
|
8480
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."),
|
|
8481
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}'."),
|
|
8482
8488
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
8483
8489
|
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."),
|
|
8484
8490
|
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}'."),
|
|
@@ -13127,13 +13133,13 @@ ${lanes.join("\n")}
|
|
|
13127
13133
|
return result;
|
|
13128
13134
|
}
|
|
13129
13135
|
function packageIdIsEqual(a, b) {
|
|
13130
|
-
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
13136
|
+
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version && a.peerDependencies === b.peerDependencies;
|
|
13131
13137
|
}
|
|
13132
13138
|
function packageIdToPackageName({ name, subModuleName }) {
|
|
13133
13139
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
13134
13140
|
}
|
|
13135
13141
|
function packageIdToString(packageId) {
|
|
13136
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
13142
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
13137
13143
|
}
|
|
13138
13144
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
13139
13145
|
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;
|
|
@@ -39516,7 +39522,7 @@ ${lanes.join("\n")}
|
|
|
39516
39522
|
function isTraceEnabled(compilerOptions, host) {
|
|
39517
39523
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
39518
39524
|
}
|
|
39519
|
-
function withPackageId(packageInfo, r) {
|
|
39525
|
+
function withPackageId(packageInfo, r, state) {
|
|
39520
39526
|
let packageId;
|
|
39521
39527
|
if (r && packageInfo) {
|
|
39522
39528
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -39524,7 +39530,8 @@ ${lanes.join("\n")}
|
|
|
39524
39530
|
packageId = {
|
|
39525
39531
|
name: packageJsonContent.name,
|
|
39526
39532
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
39527
|
-
version: packageJsonContent.version
|
|
39533
|
+
version: packageJsonContent.version,
|
|
39534
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
39528
39535
|
};
|
|
39529
39536
|
}
|
|
39530
39537
|
}
|
|
@@ -39534,7 +39541,9 @@ ${lanes.join("\n")}
|
|
|
39534
39541
|
return withPackageId(
|
|
39535
39542
|
/*packageInfo*/
|
|
39536
39543
|
void 0,
|
|
39537
|
-
r
|
|
39544
|
+
r,
|
|
39545
|
+
/*state*/
|
|
39546
|
+
void 0
|
|
39538
39547
|
);
|
|
39539
39548
|
}
|
|
39540
39549
|
function removeIgnoredPackageId(r) {
|
|
@@ -39910,7 +39919,7 @@ ${lanes.join("\n")}
|
|
|
39910
39919
|
false,
|
|
39911
39920
|
moduleResolutionState
|
|
39912
39921
|
) : void 0;
|
|
39913
|
-
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile));
|
|
39922
|
+
return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile, moduleResolutionState));
|
|
39914
39923
|
}
|
|
39915
39924
|
}
|
|
39916
39925
|
return resolvedTypeScriptOnly(
|
|
@@ -40871,7 +40880,7 @@ ${lanes.join("\n")}
|
|
|
40871
40880
|
false,
|
|
40872
40881
|
state
|
|
40873
40882
|
) : void 0;
|
|
40874
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
40883
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
40875
40884
|
}
|
|
40876
40885
|
}
|
|
40877
40886
|
if (!onlyRecordFailures) {
|
|
@@ -41013,7 +41022,7 @@ ${lanes.join("\n")}
|
|
|
41013
41022
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
41014
41023
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
41015
41024
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
41016
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
41025
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
41017
41026
|
}
|
|
41018
41027
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
41019
41028
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -41169,6 +41178,42 @@ ${lanes.join("\n")}
|
|
|
41169
41178
|
}
|
|
41170
41179
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
41171
41180
|
}
|
|
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
|
+
}
|
|
41172
41217
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
41173
41218
|
var _a, _b, _c, _d, _e, _f;
|
|
41174
41219
|
const { host, traceEnabled } = state;
|
|
@@ -41197,7 +41242,7 @@ ${lanes.join("\n")}
|
|
|
41197
41242
|
if (traceEnabled) {
|
|
41198
41243
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
41199
41244
|
}
|
|
41200
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
41245
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
41201
41246
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
41202
41247
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
41203
41248
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -41605,7 +41650,7 @@ ${lanes.join("\n")}
|
|
|
41605
41650
|
/*onlyRecordFailures*/
|
|
41606
41651
|
false,
|
|
41607
41652
|
state
|
|
41608
|
-
)));
|
|
41653
|
+
), state));
|
|
41609
41654
|
} else if (typeof target === "object" && target !== null) {
|
|
41610
41655
|
if (!Array.isArray(target)) {
|
|
41611
41656
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -41719,7 +41764,7 @@ ${lanes.join("\n")}
|
|
|
41719
41764
|
/*onlyRecordFailures*/
|
|
41720
41765
|
false,
|
|
41721
41766
|
state
|
|
41722
|
-
)));
|
|
41767
|
+
), state));
|
|
41723
41768
|
}
|
|
41724
41769
|
}
|
|
41725
41770
|
}
|
|
@@ -41850,7 +41895,7 @@ ${lanes.join("\n")}
|
|
|
41850
41895
|
packageInfo.contents.packageJsonContent,
|
|
41851
41896
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
41852
41897
|
);
|
|
41853
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
41898
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
41854
41899
|
}
|
|
41855
41900
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
41856
41901
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -41864,7 +41909,7 @@ ${lanes.join("\n")}
|
|
|
41864
41909
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
41865
41910
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
41866
41911
|
}
|
|
41867
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
41912
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
41868
41913
|
};
|
|
41869
41914
|
if (rest !== "") {
|
|
41870
41915
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -42070,7 +42115,7 @@ ${lanes.join("\n")}
|
|
|
42070
42115
|
false,
|
|
42071
42116
|
state
|
|
42072
42117
|
) : void 0;
|
|
42073
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
42118
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
42074
42119
|
}
|
|
42075
42120
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
42076
42121
|
if (resolved)
|
|
@@ -45836,7 +45881,7 @@ ${lanes.join("\n")}
|
|
|
45836
45881
|
return processEnding(shortest, allowedEndings, compilerOptions);
|
|
45837
45882
|
}
|
|
45838
45883
|
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
45839
|
-
if (!host.readFile) {
|
|
45884
|
+
if (!host.fileExists || !host.readFile) {
|
|
45840
45885
|
return void 0;
|
|
45841
45886
|
}
|
|
45842
45887
|
const parts = getNodeModulePathParts(path);
|
|
@@ -45943,6 +45988,8 @@ ${lanes.join("\n")}
|
|
|
45943
45988
|
}
|
|
45944
45989
|
}
|
|
45945
45990
|
function tryGetAnyFileFromPath(host, path) {
|
|
45991
|
+
if (!host.fileExists)
|
|
45992
|
+
return;
|
|
45946
45993
|
const extensions = flatten(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { extension: "json", isMixedContent: false, scriptKind: 6 /* JSON */ }]));
|
|
45947
45994
|
for (const e of extensions) {
|
|
45948
45995
|
const fullPath = path + e;
|
|
@@ -81281,7 +81328,7 @@ ${lanes.join("\n")}
|
|
|
81281
81328
|
}
|
|
81282
81329
|
}
|
|
81283
81330
|
function helper(condExpr2, body2) {
|
|
81284
|
-
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) :
|
|
81331
|
+
const location = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2;
|
|
81285
81332
|
if (isModuleExportsAccessExpression(location)) {
|
|
81286
81333
|
return;
|
|
81287
81334
|
}
|
|
@@ -81293,8 +81340,7 @@ ${lanes.join("\n")}
|
|
|
81293
81340
|
const isPropertyExpressionCast = isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
81294
81341
|
if (!hasTypeFacts(type, 4194304 /* Truthy */) || isPropertyExpressionCast)
|
|
81295
81342
|
return;
|
|
81296
|
-
const
|
|
81297
|
-
const callSignatures = getSignaturesOfType(testedType, 0 /* Call */);
|
|
81343
|
+
const callSignatures = getSignaturesOfType(type, 0 /* Call */);
|
|
81298
81344
|
const isPromise = !!getAwaitedTypeOfPromise(type);
|
|
81299
81345
|
if (callSignatures.length === 0 && !isPromise) {
|
|
81300
81346
|
return;
|
|
@@ -133216,6 +133262,9 @@ ${lanes.join("\n")}
|
|
|
133216
133262
|
return packageJson;
|
|
133217
133263
|
}
|
|
133218
133264
|
function getPackageJsonsVisibleToFile(fileName, host) {
|
|
133265
|
+
if (!host.fileExists) {
|
|
133266
|
+
return [];
|
|
133267
|
+
}
|
|
133219
133268
|
const packageJsons = [];
|
|
133220
133269
|
forEachAncestorDirectory(getDirectoryPath(fileName), (ancestor) => {
|
|
133221
133270
|
const packageJsonFileName = combinePaths(ancestor, "package.json");
|
|
@@ -162665,6 +162714,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162665
162714
|
}
|
|
162666
162715
|
}
|
|
162667
162716
|
function enumerateNodeModulesVisibleToScript(host, scriptPath) {
|
|
162717
|
+
if (!host.readFile || !host.fileExists)
|
|
162718
|
+
return emptyArray;
|
|
162668
162719
|
const result = [];
|
|
162669
162720
|
for (const packageJson of findPackageJsons(scriptPath, host)) {
|
|
162670
162721
|
const contents = readJson(packageJson, host);
|
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.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240122`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3375,6 +3375,9 @@ var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 };
|
|
|
3375
3375
|
var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
3376
3376
|
var unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels);
|
|
3377
3377
|
function setCustomPollingValues(system) {
|
|
3378
|
+
if (!system.getEnvironmentVariable) {
|
|
3379
|
+
return;
|
|
3380
|
+
}
|
|
3378
3381
|
const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval);
|
|
3379
3382
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
3380
3383
|
unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds;
|
|
@@ -6518,6 +6521,9 @@ var Diagnostics = {
|
|
|
6518
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.`),
|
|
6519
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."),
|
|
6520
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}'."),
|
|
6521
6527
|
Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
|
|
6522
6528
|
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."),
|
|
6523
6529
|
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}'."),
|
|
@@ -10098,7 +10104,7 @@ function packageIdToPackageName({ name, subModuleName }) {
|
|
|
10098
10104
|
return subModuleName ? `${name}/${subModuleName}` : name;
|
|
10099
10105
|
}
|
|
10100
10106
|
function packageIdToString(packageId) {
|
|
10101
|
-
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
10107
|
+
return `${packageIdToPackageName(packageId)}@${packageId.version}${packageId.peerDependencies ?? ""}`;
|
|
10102
10108
|
}
|
|
10103
10109
|
function containsParseError(node) {
|
|
10104
10110
|
aggregateChildData(node);
|
|
@@ -27626,7 +27632,7 @@ function trace(host, message, ...args) {
|
|
|
27626
27632
|
function isTraceEnabled(compilerOptions, host) {
|
|
27627
27633
|
return !!compilerOptions.traceResolution && host.trace !== void 0;
|
|
27628
27634
|
}
|
|
27629
|
-
function withPackageId(packageInfo, r) {
|
|
27635
|
+
function withPackageId(packageInfo, r, state) {
|
|
27630
27636
|
let packageId;
|
|
27631
27637
|
if (r && packageInfo) {
|
|
27632
27638
|
const packageJsonContent = packageInfo.contents.packageJsonContent;
|
|
@@ -27634,7 +27640,8 @@ function withPackageId(packageInfo, r) {
|
|
|
27634
27640
|
packageId = {
|
|
27635
27641
|
name: packageJsonContent.name,
|
|
27636
27642
|
subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length),
|
|
27637
|
-
version: packageJsonContent.version
|
|
27643
|
+
version: packageJsonContent.version,
|
|
27644
|
+
peerDependencies: getPeerDependenciesOfPackageJsonInfo(packageInfo, state)
|
|
27638
27645
|
};
|
|
27639
27646
|
}
|
|
27640
27647
|
}
|
|
@@ -27644,7 +27651,9 @@ function noPackageId(r) {
|
|
|
27644
27651
|
return withPackageId(
|
|
27645
27652
|
/*packageInfo*/
|
|
27646
27653
|
void 0,
|
|
27647
|
-
r
|
|
27654
|
+
r,
|
|
27655
|
+
/*state*/
|
|
27656
|
+
void 0
|
|
27648
27657
|
);
|
|
27649
27658
|
}
|
|
27650
27659
|
function removeIgnoredPackageId(r) {
|
|
@@ -28343,7 +28352,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
28343
28352
|
false,
|
|
28344
28353
|
state
|
|
28345
28354
|
) : void 0;
|
|
28346
|
-
return withPackageId(packageInfo, resolvedFromFile);
|
|
28355
|
+
return withPackageId(packageInfo, resolvedFromFile, state);
|
|
28347
28356
|
}
|
|
28348
28357
|
}
|
|
28349
28358
|
if (!onlyRecordFailures) {
|
|
@@ -28486,7 +28495,7 @@ function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures,
|
|
|
28486
28495
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
28487
28496
|
const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
|
|
28488
28497
|
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
28489
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
28498
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
28490
28499
|
}
|
|
28491
28500
|
function getPackageScopeForPath(fileName, state) {
|
|
28492
28501
|
const parts = getPathComponents(fileName);
|
|
@@ -28511,6 +28520,42 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
28511
28520
|
}
|
|
28512
28521
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
28513
28522
|
}
|
|
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
|
+
}
|
|
28514
28559
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
28515
28560
|
var _a, _b, _c, _d, _e, _f;
|
|
28516
28561
|
const { host, traceEnabled } = state;
|
|
@@ -28539,7 +28584,7 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
28539
28584
|
if (traceEnabled) {
|
|
28540
28585
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
28541
28586
|
}
|
|
28542
|
-
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
28587
|
+
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0, peerDependencies: void 0 } };
|
|
28543
28588
|
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
28544
28589
|
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
28545
28590
|
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
@@ -28947,7 +28992,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
28947
28992
|
/*onlyRecordFailures*/
|
|
28948
28993
|
false,
|
|
28949
28994
|
state
|
|
28950
|
-
)));
|
|
28995
|
+
), state));
|
|
28951
28996
|
} else if (typeof target === "object" && target !== null) {
|
|
28952
28997
|
if (!Array.isArray(target)) {
|
|
28953
28998
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
@@ -29061,7 +29106,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
29061
29106
|
/*onlyRecordFailures*/
|
|
29062
29107
|
false,
|
|
29063
29108
|
state
|
|
29064
|
-
)));
|
|
29109
|
+
), state));
|
|
29065
29110
|
}
|
|
29066
29111
|
}
|
|
29067
29112
|
}
|
|
@@ -29192,7 +29237,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
29192
29237
|
packageInfo.contents.packageJsonContent,
|
|
29193
29238
|
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
29194
29239
|
);
|
|
29195
|
-
return withPackageId(packageInfo, fromDirectory);
|
|
29240
|
+
return withPackageId(packageInfo, fromDirectory, state);
|
|
29196
29241
|
}
|
|
29197
29242
|
const loader = (extensions2, candidate2, onlyRecordFailures, state2) => {
|
|
29198
29243
|
let pathAndExtension = (rest || !(state2.features & 32 /* EsmMode */)) && loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(
|
|
@@ -29206,7 +29251,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
|
|
|
29206
29251
|
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
|
|
29207
29252
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
29208
29253
|
}
|
|
29209
|
-
return withPackageId(packageInfo, pathAndExtension);
|
|
29254
|
+
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
29210
29255
|
};
|
|
29211
29256
|
if (rest !== "") {
|
|
29212
29257
|
packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
@@ -29400,7 +29445,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
29400
29445
|
false,
|
|
29401
29446
|
state
|
|
29402
29447
|
) : void 0;
|
|
29403
|
-
return toSearchResult(withPackageId(packageInfo, resolvedFromFile));
|
|
29448
|
+
return toSearchResult(withPackageId(packageInfo, resolvedFromFile, state));
|
|
29404
29449
|
}
|
|
29405
29450
|
const resolved = loadNodeModuleFromDirectory(4 /* Declaration */, candidate, !directoryExists, state);
|
|
29406
29451
|
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-57029-27",
|
|
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": "d0460957e0e295c121385410699b539cba29e155"
|
|
118
118
|
}
|