pnpm 11.0.0 → 11.0.1
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/dist/pnpm.mjs +118 -56
- package/package.json +1 -1
package/dist/pnpm.mjs
CHANGED
|
@@ -1000,7 +1000,7 @@ var init_lib2 = __esm({
|
|
|
1000
1000
|
"use strict";
|
|
1001
1001
|
defaultManifest = {
|
|
1002
1002
|
name: true ? "pnpm" : "pnpm",
|
|
1003
|
-
version: true ? "11.0.
|
|
1003
|
+
version: true ? "11.0.1" : "0.0.0"
|
|
1004
1004
|
};
|
|
1005
1005
|
pkgJson = defaultManifest;
|
|
1006
1006
|
packageManager = {
|
|
@@ -12178,7 +12178,7 @@ var require_npa = __commonJS({
|
|
|
12178
12178
|
module2.exports.resolve = resolve3;
|
|
12179
12179
|
module2.exports.Result = Result;
|
|
12180
12180
|
var HostedGit2;
|
|
12181
|
-
var
|
|
12181
|
+
var semver51;
|
|
12182
12182
|
var path208;
|
|
12183
12183
|
var validatePackageName2;
|
|
12184
12184
|
var os15;
|
|
@@ -12433,9 +12433,9 @@ var require_npa = __commonJS({
|
|
|
12433
12433
|
const spec = res.rawSpec === "" ? "latest" : res.rawSpec;
|
|
12434
12434
|
res.saveSpec = null;
|
|
12435
12435
|
res.fetchSpec = spec;
|
|
12436
|
-
if (!
|
|
12437
|
-
const version2 =
|
|
12438
|
-
const range =
|
|
12436
|
+
if (!semver51) semver51 = require_semver2();
|
|
12437
|
+
const version2 = semver51.valid(spec, true);
|
|
12438
|
+
const range = semver51.validRange(spec, true);
|
|
12439
12439
|
if (version2) {
|
|
12440
12440
|
res.type = "version";
|
|
12441
12441
|
} else if (range) {
|
|
@@ -22828,7 +22828,7 @@ var require_lib6 = __commonJS({
|
|
|
22828
22828
|
var require_version_selector_type = __commonJS({
|
|
22829
22829
|
"../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/version-selector-type/3.0.0/bb5374a17b8844b39694ff4483fb613e6fef31ded46a26ae6d88676a1b27fe57/node_modules/version-selector-type/index.js"(exports2, module2) {
|
|
22830
22830
|
"use strict";
|
|
22831
|
-
var
|
|
22831
|
+
var semver51 = require_semver2();
|
|
22832
22832
|
module2.exports = (selector) => versionSelectorType3(true, selector);
|
|
22833
22833
|
module2.exports.strict = (selector) => versionSelectorType3(false, selector);
|
|
22834
22834
|
function versionSelectorType3(loose, selector) {
|
|
@@ -22836,13 +22836,13 @@ var require_version_selector_type = __commonJS({
|
|
|
22836
22836
|
throw new TypeError("`selector` should be a string");
|
|
22837
22837
|
}
|
|
22838
22838
|
let normalizedSelector;
|
|
22839
|
-
if (normalizedSelector =
|
|
22839
|
+
if (normalizedSelector = semver51.valid(selector, loose)) {
|
|
22840
22840
|
return {
|
|
22841
22841
|
normalized: normalizedSelector,
|
|
22842
22842
|
type: "version"
|
|
22843
22843
|
};
|
|
22844
22844
|
}
|
|
22845
|
-
if (normalizedSelector =
|
|
22845
|
+
if (normalizedSelector = semver51.validRange(selector, loose)) {
|
|
22846
22846
|
return {
|
|
22847
22847
|
normalized: normalizedSelector,
|
|
22848
22848
|
type: "range"
|
|
@@ -42166,6 +42166,9 @@ function assertValidWorkspaceManifestCatalogs(manifest) {
|
|
|
42166
42166
|
if (Array.isArray(catalog)) {
|
|
42167
42167
|
throw new InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - array`);
|
|
42168
42168
|
}
|
|
42169
|
+
if (catalog === null) {
|
|
42170
|
+
throw new InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - null`);
|
|
42171
|
+
}
|
|
42169
42172
|
if (typeof catalog !== "object") {
|
|
42170
42173
|
throw new InvalidWorkspaceManifestError(`Expected named catalog ${catalogName} to be an object, but found - ${typeof catalog}`);
|
|
42171
42174
|
}
|
|
@@ -193979,7 +193982,7 @@ function createOverrides(advisories) {
|
|
|
193979
193982
|
continue;
|
|
193980
193983
|
entries.push([`${advisory.module_name}@${advisory.vulnerable_versions}`, caretRangeForPatched(advisory.patched_versions)]);
|
|
193981
193984
|
}
|
|
193982
|
-
return Object.fromEntries(entries);
|
|
193985
|
+
return sortDirectKeys(Object.fromEntries(entries));
|
|
193983
193986
|
}
|
|
193984
193987
|
function caretRangeForPatched(patchedRange) {
|
|
193985
193988
|
const min = import_semver36.default.minVersion(patchedRange);
|
|
@@ -194004,6 +194007,7 @@ var init_fix = __esm({
|
|
|
194004
194007
|
"use strict";
|
|
194005
194008
|
init_lib99();
|
|
194006
194009
|
init_lib140();
|
|
194010
|
+
init_lib76();
|
|
194007
194011
|
import_semver36 = __toESM(require_semver2(), 1);
|
|
194008
194012
|
}
|
|
194009
194013
|
});
|
|
@@ -195668,7 +195672,7 @@ async function walkStep(step2, parentPurl, depTypes, componentsMap, relationship
|
|
|
195668
195672
|
return;
|
|
195669
195673
|
const integrity = pkgSnapshot.resolution.integrity;
|
|
195670
195674
|
const resolution = pkgSnapshotToResolution(depPath, pkgSnapshot, opts2.registries);
|
|
195671
|
-
const tarballUrl = resolution.tarball;
|
|
195675
|
+
const tarballUrl = resolution.tarball ?? gitDownloadUrl(resolution);
|
|
195672
195676
|
let metadata = {};
|
|
195673
195677
|
if (metadataOpts) {
|
|
195674
195678
|
metadata = await getPkgMetadata(depPath, pkgSnapshot, opts2.registries, metadataOpts);
|
|
@@ -195688,6 +195692,13 @@ async function walkStep(step2, parentPurl, depTypes, componentsMap, relationship
|
|
|
195688
195692
|
await walkStep(subStep, purl, depTypes, componentsMap, relationships, opts2, metadataOpts);
|
|
195689
195693
|
}));
|
|
195690
195694
|
}
|
|
195695
|
+
function gitDownloadUrl(resolution) {
|
|
195696
|
+
if (resolution.type !== "git")
|
|
195697
|
+
return void 0;
|
|
195698
|
+
const needsGitPlusPrefix = resolution.repo.includes("://") && !resolution.repo.startsWith("git+");
|
|
195699
|
+
const prefix = needsGitPlusPrefix ? "git+" : "";
|
|
195700
|
+
return `${prefix}${resolution.repo}#${resolution.commit}`;
|
|
195701
|
+
}
|
|
195691
195702
|
var init_collectComponents = __esm({
|
|
195692
195703
|
"../deps/compliance/sbom/lib/collectComponents.js"() {
|
|
195693
195704
|
"use strict";
|
|
@@ -201683,22 +201694,27 @@ async function handler31(opts2, params) {
|
|
|
201683
201694
|
if (opts2.wantedPackageManager?.version !== resolution.manifest.version) {
|
|
201684
201695
|
const { manifest, writeProjectManifest: writeProjectManifest2 } = await readProjectManifest(opts2.rootProjectManifestDir);
|
|
201685
201696
|
if (manifest.devEngines?.packageManager) {
|
|
201686
|
-
|
|
201687
|
-
|
|
201688
|
-
|
|
201689
|
-
|
|
201690
|
-
|
|
201691
|
-
|
|
201692
|
-
|
|
201693
|
-
|
|
201694
|
-
|
|
201695
|
-
|
|
201696
|
-
|
|
201697
|
-
|
|
201698
|
-
|
|
201699
|
-
|
|
201700
|
-
|
|
201701
|
-
|
|
201697
|
+
let manifestChanged = false;
|
|
201698
|
+
const legacyPm = manifest.packageManager != null ? parsePackageManager(manifest.packageManager) : void 0;
|
|
201699
|
+
const legacyPinsPnpm = legacyPm?.name === "pnpm" && legacyPm.version != null;
|
|
201700
|
+
const devEnginesPm = manifest.devEngines.packageManager;
|
|
201701
|
+
const pnpmEntry = Array.isArray(devEnginesPm) ? devEnginesPm.find((e) => e.name === "pnpm") : devEnginesPm.name === "pnpm" ? devEnginesPm : void 0;
|
|
201702
|
+
if (pnpmEntry) {
|
|
201703
|
+
const updated = legacyPinsPnpm ? resolution.manifest.version : updateVersionConstraint(pnpmEntry.version, resolution.manifest.version);
|
|
201704
|
+
if (updated !== pnpmEntry.version) {
|
|
201705
|
+
pnpmEntry.version = updated;
|
|
201706
|
+
manifestChanged = true;
|
|
201707
|
+
}
|
|
201708
|
+
}
|
|
201709
|
+
if (legacyPinsPnpm) {
|
|
201710
|
+
const newLegacy = `pnpm@${resolution.manifest.version}`;
|
|
201711
|
+
if (manifest.packageManager !== newLegacy) {
|
|
201712
|
+
manifest.packageManager = newLegacy;
|
|
201713
|
+
manifestChanged = true;
|
|
201714
|
+
}
|
|
201715
|
+
}
|
|
201716
|
+
if (manifestChanged)
|
|
201717
|
+
await writeProjectManifest2(manifest);
|
|
201702
201718
|
const store2 = await createStoreController(opts2);
|
|
201703
201719
|
await resolvePackageManagerIntegrities(resolution.manifest.version, {
|
|
201704
201720
|
registries: opts2.registries,
|
|
@@ -223326,7 +223342,7 @@ var require_npa2 = __commonJS({
|
|
|
223326
223342
|
var path208 = isWindows15 ? __require("node:path/win32") : __require("node:path");
|
|
223327
223343
|
var { homedir } = __require("node:os");
|
|
223328
223344
|
var HostedGit2 = require_lib12();
|
|
223329
|
-
var
|
|
223345
|
+
var semver51 = require_semver2();
|
|
223330
223346
|
var validatePackageName2 = require_lib22();
|
|
223331
223347
|
var { log: log3 } = require_lib10();
|
|
223332
223348
|
var hasSlashes = isWindows15 ? /\\|[/]/ : /[/]/;
|
|
@@ -223691,8 +223707,8 @@ var require_npa2 = __commonJS({
|
|
|
223691
223707
|
const spec = res.rawSpec.trim();
|
|
223692
223708
|
res.saveSpec = null;
|
|
223693
223709
|
res.fetchSpec = spec;
|
|
223694
|
-
const version2 =
|
|
223695
|
-
const range =
|
|
223710
|
+
const version2 = semver51.valid(spec, true);
|
|
223711
|
+
const range = semver51.validRange(spec, true);
|
|
223696
223712
|
if (version2) {
|
|
223697
223713
|
res.type = "version";
|
|
223698
223714
|
} else if (range) {
|
|
@@ -225970,9 +225986,9 @@ var require_get_options = __commonJS({
|
|
|
225970
225986
|
// ../../../../setup-pnpm/node_modules/.bin/store/v11/links/@npmcli/fs/5.0.0/4cafda806c7bf4ef531e7305fbcb8288c728be229f52fd03536e072af5fe3626/node_modules/@npmcli/fs/lib/common/node.js
|
|
225971
225987
|
var require_node2 = __commonJS({
|
|
225972
225988
|
"../../../../setup-pnpm/node_modules/.bin/store/v11/links/@npmcli/fs/5.0.0/4cafda806c7bf4ef531e7305fbcb8288c728be229f52fd03536e072af5fe3626/node_modules/@npmcli/fs/lib/common/node.js"(exports2, module2) {
|
|
225973
|
-
var
|
|
225989
|
+
var semver51 = require_semver2();
|
|
225974
225990
|
var satisfies3 = (range) => {
|
|
225975
|
-
return
|
|
225991
|
+
return semver51.satisfies(process.version, range, { includePrerelease: true });
|
|
225976
225992
|
};
|
|
225977
225993
|
module2.exports = {
|
|
225978
225994
|
satisfies: satisfies3
|
|
@@ -235698,7 +235714,7 @@ var require_spawn = __commonJS({
|
|
|
235698
235714
|
// ../../../../setup-pnpm/node_modules/.bin/store/v11/links/@npmcli/git/7.0.2/fcff604bc4ab9d779aa0cb3b1a89e49c8a830d5da2b6bf098a38c578a421b59e/node_modules/@npmcli/git/lib/lines-to-revs.js
|
|
235699
235715
|
var require_lines_to_revs = __commonJS({
|
|
235700
235716
|
"../../../../setup-pnpm/node_modules/.bin/store/v11/links/@npmcli/git/7.0.2/fcff604bc4ab9d779aa0cb3b1a89e49c8a830d5da2b6bf098a38c578a421b59e/node_modules/@npmcli/git/lib/lines-to-revs.js"(exports2, module2) {
|
|
235701
|
-
var
|
|
235717
|
+
var semver51 = require_semver2();
|
|
235702
235718
|
module2.exports = (lines) => finish(lines.reduce(linesToRevsReducer, {
|
|
235703
235719
|
versions: {},
|
|
235704
235720
|
"dist-tags": {},
|
|
@@ -235795,8 +235811,8 @@ var require_lines_to_revs = __commonJS({
|
|
|
235795
235811
|
revs.refs[doc.rawRef] = doc;
|
|
235796
235812
|
if (doc.type === "tag") {
|
|
235797
235813
|
const match = !doc.ref.endsWith("^{}") && doc.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);
|
|
235798
|
-
if (match &&
|
|
235799
|
-
revs.versions[
|
|
235814
|
+
if (match && semver51.valid(match[1], true)) {
|
|
235815
|
+
revs.versions[semver51.clean(match[1], true)] = doc;
|
|
235800
235816
|
}
|
|
235801
235817
|
}
|
|
235802
235818
|
return revs;
|
|
@@ -236054,7 +236070,7 @@ var require_dev_engines = __commonJS({
|
|
|
236054
236070
|
// ../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/npm-install-checks/8.0.0/8ae449895bd2a6446a641a7633b6e675f92cb82df40fe4e25fb59f55325ac30c/node_modules/npm-install-checks/lib/index.js
|
|
236055
236071
|
var require_lib43 = __commonJS({
|
|
236056
236072
|
"../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/npm-install-checks/8.0.0/8ae449895bd2a6446a641a7633b6e675f92cb82df40fe4e25fb59f55325ac30c/node_modules/npm-install-checks/lib/index.js"(exports2, module2) {
|
|
236057
|
-
var
|
|
236073
|
+
var semver51 = require_semver2();
|
|
236058
236074
|
var currentEnv = require_current_env();
|
|
236059
236075
|
var { checkDevEngines } = require_dev_engines();
|
|
236060
236076
|
var checkEngine2 = (target2, npmVer, nodeVer, force = false) => {
|
|
@@ -236064,8 +236080,8 @@ var require_lib43 = __commonJS({
|
|
|
236064
236080
|
if (!eng) {
|
|
236065
236081
|
return;
|
|
236066
236082
|
}
|
|
236067
|
-
const nodeFail = nodev && eng.node && !
|
|
236068
|
-
const npmFail = npmVer && eng.npm && !
|
|
236083
|
+
const nodeFail = nodev && eng.node && !semver51.satisfies(nodev, eng.node, opt);
|
|
236084
|
+
const npmFail = npmVer && eng.npm && !semver51.satisfies(npmVer, eng.npm, opt);
|
|
236069
236085
|
if (nodeFail || npmFail) {
|
|
236070
236086
|
throw Object.assign(new Error("Unsupported engine"), {
|
|
236071
236087
|
pkgid: target2._id,
|
|
@@ -236192,7 +236208,7 @@ var require_lib45 = __commonJS({
|
|
|
236192
236208
|
"../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/npm-pick-manifest/11.0.3/5ad64713f08c0dadca6f376eb2187b2fbcbe9469fdf3dfe99e5f5010003b82c0/node_modules/npm-pick-manifest/lib/index.js"(exports2, module2) {
|
|
236193
236209
|
"use strict";
|
|
236194
236210
|
var npa11 = require_npa2();
|
|
236195
|
-
var
|
|
236211
|
+
var semver51 = require_semver2();
|
|
236196
236212
|
var { checkEngine: checkEngine2 } = require_lib43();
|
|
236197
236213
|
var normalizeBin = require_lib44();
|
|
236198
236214
|
var engineOk = (manifest, npmVersion, nodeVersion) => {
|
|
@@ -236205,7 +236221,7 @@ var require_lib45 = __commonJS({
|
|
|
236205
236221
|
};
|
|
236206
236222
|
var isBefore = (verTimes, ver, time) => !verTimes || !verTimes[ver] || Date.parse(verTimes[ver]) <= time;
|
|
236207
236223
|
var avoidSemverOpt = { includePrerelease: true, loose: true };
|
|
236208
|
-
var shouldAvoid = (ver, avoid) => avoid &&
|
|
236224
|
+
var shouldAvoid = (ver, avoid) => avoid && semver51.satisfies(ver, avoid, avoidSemverOpt);
|
|
236209
236225
|
var decorateAvoid = (result2, avoid) => result2 && shouldAvoid(result2.version, avoid) ? { ...result2, _shouldAvoid: true } : result2;
|
|
236210
236226
|
var pickManifest = (packument, wanted, opts2) => {
|
|
236211
236227
|
const {
|
|
@@ -236271,13 +236287,13 @@ var require_lib45 = __commonJS({
|
|
|
236271
236287
|
}
|
|
236272
236288
|
}
|
|
236273
236289
|
if (wanted && type4 === "version") {
|
|
236274
|
-
const ver =
|
|
236290
|
+
const ver = semver51.clean(wanted, { loose: true });
|
|
236275
236291
|
const mani = versions[ver] || staged[ver] || restricted[ver];
|
|
236276
236292
|
return isBefore(verTimes, ver, time) ? decorateAvoid(mani, avoid) : null;
|
|
236277
236293
|
}
|
|
236278
236294
|
const range = type4 === "range" ? wanted : "*";
|
|
236279
236295
|
const defaultVer = distTags[defaultTag];
|
|
236280
|
-
if (defaultVer && (range === "*" ||
|
|
236296
|
+
if (defaultVer && (range === "*" || semver51.satisfies(defaultVer, range, { loose: true })) && !restricted[defaultVer] && !shouldAvoid(defaultVer, avoid)) {
|
|
236281
236297
|
const mani = versions[defaultVer];
|
|
236282
236298
|
const ok = mani && isBefore(verTimes, defaultVer, time) && engineOk(mani, npmVersion, nodeVersion) && !mani.deprecated && !staged[defaultVer];
|
|
236283
236299
|
if (ok) {
|
|
@@ -236296,7 +236312,7 @@ var require_lib45 = __commonJS({
|
|
|
236296
236312
|
});
|
|
236297
236313
|
}
|
|
236298
236314
|
const sortSemverOpt = { loose: true };
|
|
236299
|
-
const entries = allEntries.filter(([ver]) =>
|
|
236315
|
+
const entries = allEntries.filter(([ver]) => semver51.satisfies(ver, range, { loose: true })).sort((a2, b) => {
|
|
236300
236316
|
const [vera, mania] = a2;
|
|
236301
236317
|
const [verb, manib] = b;
|
|
236302
236318
|
const notavoida = !shouldAvoid(vera, avoid);
|
|
@@ -236309,7 +236325,7 @@ var require_lib45 = __commonJS({
|
|
|
236309
236325
|
const notdeprb = !manib.deprecated;
|
|
236310
236326
|
const enginea = engineOk(mania, npmVersion, nodeVersion);
|
|
236311
236327
|
const engineb = engineOk(manib, npmVersion, nodeVersion);
|
|
236312
|
-
return notavoidb - notavoida || notrestrb - notrestra || notstageb - notstagea || (notdeprb && engineb) - (notdepra && enginea) || engineb - enginea || notdeprb - notdepra ||
|
|
236328
|
+
return notavoidb - notavoida || notrestrb - notrestra || notstageb - notstagea || (notdeprb && engineb) - (notdepra && enginea) || engineb - enginea || notdeprb - notdepra || semver51.rcompare(vera, verb, sortSemverOpt);
|
|
236313
236329
|
});
|
|
236314
236330
|
return decorateAvoid(entries[0] && entries[0][1], avoid);
|
|
236315
236331
|
};
|
|
@@ -246879,7 +246895,7 @@ var require_publish = __commonJS({
|
|
|
246879
246895
|
var npa11 = require_npa2();
|
|
246880
246896
|
var PackageJson = require_lib47();
|
|
246881
246897
|
var { log: log3 } = require_lib10();
|
|
246882
|
-
var
|
|
246898
|
+
var semver51 = require_semver2();
|
|
246883
246899
|
var { URL: URL7 } = __require("node:url");
|
|
246884
246900
|
var ssri6 = require_lib6();
|
|
246885
246901
|
var ciInfo2 = require_ci_info();
|
|
@@ -246935,7 +246951,7 @@ Remove the 'private' field from the package.json to publish it.`),
|
|
|
246935
246951
|
manifestInput._npmVersion = npmVersion;
|
|
246936
246952
|
}
|
|
246937
246953
|
const manifest = await new PackageJson().fromContent(manifestInput).normalize({ steps }).then((p) => p.content);
|
|
246938
|
-
const version2 =
|
|
246954
|
+
const version2 = semver51.clean(manifest.version);
|
|
246939
246955
|
if (!version2) {
|
|
246940
246956
|
throw Object.assign(
|
|
246941
246957
|
new Error("invalid semver: " + manifest.version),
|
|
@@ -247062,7 +247078,7 @@ var require_unpublish = __commonJS({
|
|
|
247062
247078
|
var { URL: URL7 } = __require("node:url");
|
|
247063
247079
|
var npa11 = require_npa2();
|
|
247064
247080
|
var npmFetch = require_lib39();
|
|
247065
|
-
var
|
|
247081
|
+
var semver51 = require_semver2();
|
|
247066
247082
|
var getPathname = (tarball, registry) => {
|
|
247067
247083
|
const registryUrl = new URL7(registry).pathname.slice(1);
|
|
247068
247084
|
let tarballUrl = new URL7(tarball).pathname.slice(1);
|
|
@@ -247112,7 +247128,7 @@ var require_unpublish = __commonJS({
|
|
|
247112
247128
|
if (latestVer === version2) {
|
|
247113
247129
|
pkg["dist-tags"].latest = Object.keys(
|
|
247114
247130
|
allVersions
|
|
247115
|
-
).sort(
|
|
247131
|
+
).sort(semver51.compareLoose).pop();
|
|
247116
247132
|
}
|
|
247117
247133
|
delete pkg._revisions;
|
|
247118
247134
|
delete pkg._attachments;
|
|
@@ -250409,7 +250425,7 @@ var init_clean = __esm({
|
|
|
250409
250425
|
shorthands19 = {
|
|
250410
250426
|
l: "--lockfile"
|
|
250411
250427
|
};
|
|
250412
|
-
PNPM_HIDDEN_ENTRIES = /* @__PURE__ */ new Set([".bin", ".modules.yaml", ".pnpm"]);
|
|
250428
|
+
PNPM_HIDDEN_ENTRIES = /* @__PURE__ */ new Set([".bin", ".modules.yaml", ".pnpm", ".pnpm-workspace-state-v1.json"]);
|
|
250413
250429
|
}
|
|
250414
250430
|
});
|
|
250415
250431
|
|
|
@@ -268571,6 +268587,50 @@ var init_switchCliVersion = __esm({
|
|
|
268571
268587
|
}
|
|
268572
268588
|
});
|
|
268573
268589
|
|
|
268590
|
+
// lib/syncEnvLockfile.js
|
|
268591
|
+
async function syncEnvLockfile(config, context) {
|
|
268592
|
+
const pm2 = context.wantedPackageManager;
|
|
268593
|
+
if (pm2 == null || pm2.name !== "pnpm" || pm2.version == null)
|
|
268594
|
+
return;
|
|
268595
|
+
if (!shouldPersistLockfile(pm2))
|
|
268596
|
+
return;
|
|
268597
|
+
if (!import_semver53.default.satisfies(packageManager.version, pm2.version, { includePrerelease: true }))
|
|
268598
|
+
return;
|
|
268599
|
+
const envLockfile = await readEnvLockfile(context.rootProjectManifestDir);
|
|
268600
|
+
if (envLockfile == null)
|
|
268601
|
+
return;
|
|
268602
|
+
const lockedVersion = envLockfile.importers["."].packageManagerDependencies?.["pnpm"]?.version;
|
|
268603
|
+
if (lockedVersion == null)
|
|
268604
|
+
return;
|
|
268605
|
+
if (import_semver53.default.satisfies(lockedVersion, pm2.version, { includePrerelease: true }))
|
|
268606
|
+
return;
|
|
268607
|
+
const store = await createStoreController({ ...config, ...context });
|
|
268608
|
+
try {
|
|
268609
|
+
await resolvePackageManagerIntegrities(packageManager.version, {
|
|
268610
|
+
envLockfile,
|
|
268611
|
+
registries: config.registries,
|
|
268612
|
+
rootDir: context.rootProjectManifestDir,
|
|
268613
|
+
storeController: store.ctrl,
|
|
268614
|
+
storeDir: store.dir,
|
|
268615
|
+
save: true
|
|
268616
|
+
});
|
|
268617
|
+
} finally {
|
|
268618
|
+
await store.ctrl.close();
|
|
268619
|
+
}
|
|
268620
|
+
}
|
|
268621
|
+
var import_semver53;
|
|
268622
|
+
var init_syncEnvLockfile = __esm({
|
|
268623
|
+
"lib/syncEnvLockfile.js"() {
|
|
268624
|
+
"use strict";
|
|
268625
|
+
init_lib2();
|
|
268626
|
+
init_lib125();
|
|
268627
|
+
init_lib78();
|
|
268628
|
+
init_lib89();
|
|
268629
|
+
import_semver53 = __toESM(require_semver2(), 1);
|
|
268630
|
+
init_shouldPersistLockfile();
|
|
268631
|
+
}
|
|
268632
|
+
});
|
|
268633
|
+
|
|
268574
268634
|
// lib/main.js
|
|
268575
268635
|
var main_exports = {};
|
|
268576
268636
|
__export(main_exports, {
|
|
@@ -268597,7 +268657,7 @@ async function main4(inputArgv) {
|
|
|
268597
268657
|
process.exitCode = 1;
|
|
268598
268658
|
return;
|
|
268599
268659
|
}
|
|
268600
|
-
if (unknownOptions.size > 0 && !
|
|
268660
|
+
if (unknownOptions.size > 0 && !(cmd && NOT_IMPLEMENTED_COMMAND_SET.has(cmd))) {
|
|
268601
268661
|
printError(formatUnknownOptionsError(unknownOptions), `For help, run: pnpm help${cmd ? ` ${cmd}` : ""}`);
|
|
268602
268662
|
process.exitCode = 1;
|
|
268603
268663
|
return;
|
|
@@ -268619,13 +268679,14 @@ async function main4(inputArgv) {
|
|
|
268619
268679
|
}));
|
|
268620
268680
|
if (!isExecutedByCorepack() && cmd !== "setup" && context.wantedPackageManager != null && !shouldSkipPmHandling(cmd, cliParams)) {
|
|
268621
268681
|
const pm2 = context.wantedPackageManager;
|
|
268622
|
-
if (pm2.onFail
|
|
268623
|
-
|
|
268624
|
-
|
|
268625
|
-
if (cliOptions.global) {
|
|
268682
|
+
if (pm2.onFail !== "ignore") {
|
|
268683
|
+
if (pm2.name === "pnpm" && pm2.onFail === "download") {
|
|
268684
|
+
await switchCliVersion(config, context);
|
|
268685
|
+
} else if (cliOptions.global) {
|
|
268626
268686
|
globalWarn("Using --global skips the package manager check for this project");
|
|
268627
268687
|
} else {
|
|
268628
268688
|
checkPackageManager(pm2);
|
|
268689
|
+
await syncEnvLockfile(config, context);
|
|
268629
268690
|
}
|
|
268630
268691
|
}
|
|
268631
268692
|
}
|
|
@@ -268849,7 +268910,7 @@ function checkPackageManager(pm2) {
|
|
|
268849
268910
|
globalWarn(msg);
|
|
268850
268911
|
} else if (pm2.version) {
|
|
268851
268912
|
const currentPnpmVersion = packageManager.name === "pnpm" ? packageManager.version : void 0;
|
|
268852
|
-
if (currentPnpmVersion && !
|
|
268913
|
+
if (currentPnpmVersion && !import_semver54.default.satisfies(currentPnpmVersion, pm2.version, { includePrerelease: true })) {
|
|
268853
268914
|
const msg = `This project is configured to use ${pm2.version} of pnpm. Your current pnpm is v${currentPnpmVersion}`;
|
|
268854
268915
|
if (shouldError) {
|
|
268855
268916
|
throw new PnpmError("BAD_PM_VERSION", msg, {
|
|
@@ -268861,7 +268922,7 @@ function checkPackageManager(pm2) {
|
|
|
268861
268922
|
}
|
|
268862
268923
|
}
|
|
268863
268924
|
}
|
|
268864
|
-
var import_loud_rejection,
|
|
268925
|
+
var import_loud_rejection, import_semver54, REPORTER_INITIALIZED;
|
|
268865
268926
|
var init_main2 = __esm({
|
|
268866
268927
|
"lib/main.js"() {
|
|
268867
268928
|
"use strict";
|
|
@@ -268875,7 +268936,7 @@ var init_main2 = __esm({
|
|
|
268875
268936
|
init_source2();
|
|
268876
268937
|
import_loud_rejection = __toESM(require_loud_rejection(), 1);
|
|
268877
268938
|
init_es();
|
|
268878
|
-
|
|
268939
|
+
import_semver54 = __toESM(require_semver2(), 1);
|
|
268879
268940
|
init_checkForUpdates();
|
|
268880
268941
|
init_cmd();
|
|
268881
268942
|
init_formatError();
|
|
@@ -268883,6 +268944,7 @@ var init_main2 = __esm({
|
|
|
268883
268944
|
init_parseCliArgs();
|
|
268884
268945
|
init_reporter();
|
|
268885
268946
|
init_switchCliVersion();
|
|
268947
|
+
init_syncEnvLockfile();
|
|
268886
268948
|
if (!global["pnpm__startedAt"]) {
|
|
268887
268949
|
global["pnpm__startedAt"] = Date.now();
|
|
268888
268950
|
}
|