pnpm 11.2.0 → 11.2.2
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 +83 -20
- package/package.json +1 -1
package/dist/pnpm.mjs
CHANGED
|
@@ -1800,7 +1800,7 @@ var init_lib5 = __esm({
|
|
|
1800
1800
|
"use strict";
|
|
1801
1801
|
defaultManifest = {
|
|
1802
1802
|
name: true ? "pnpm" : "pnpm",
|
|
1803
|
-
version: true ? "11.2.
|
|
1803
|
+
version: true ? "11.2.2" : "0.0.0"
|
|
1804
1804
|
};
|
|
1805
1805
|
pkgJson = defaultManifest;
|
|
1806
1806
|
packageManager = {
|
|
@@ -12540,10 +12540,11 @@ function pickRegistryForPackage(registries, packageName, bareSpecifier) {
|
|
|
12540
12540
|
}
|
|
12541
12541
|
function getScope(pkgName, bareSpecifier) {
|
|
12542
12542
|
if (bareSpecifier?.startsWith("npm:")) {
|
|
12543
|
-
|
|
12544
|
-
if (
|
|
12545
|
-
return
|
|
12543
|
+
const target2 = bareSpecifier.slice(4);
|
|
12544
|
+
if (target2[0] === "@") {
|
|
12545
|
+
return target2.substring(0, target2.indexOf("/"));
|
|
12546
12546
|
}
|
|
12547
|
+
return null;
|
|
12547
12548
|
}
|
|
12548
12549
|
if (pkgName[0] === "@") {
|
|
12549
12550
|
return pkgName.substring(0, pkgName.indexOf("/"));
|
|
@@ -164265,8 +164266,16 @@ async function installConfigDeps(configDepsOrLockfile, opts2) {
|
|
|
164265
164266
|
const globalVirtualStoreDir = path142.join(opts2.storeDir, "links");
|
|
164266
164267
|
const configModulesDir = path142.join(opts2.rootDir, "node_modules/.pnpm-config");
|
|
164267
164268
|
const existingConfigDeps = await readModulesDir(configModulesDir) ?? [];
|
|
164269
|
+
let startedEmitted = false;
|
|
164270
|
+
const reportStarted = () => {
|
|
164271
|
+
if (startedEmitted)
|
|
164272
|
+
return;
|
|
164273
|
+
startedEmitted = true;
|
|
164274
|
+
installingConfigDepsLogger.debug({ status: "started" });
|
|
164275
|
+
};
|
|
164268
164276
|
await Promise.all(existingConfigDeps.map(async (existingConfigDep) => {
|
|
164269
164277
|
if (!normalizedDeps[existingConfigDep]) {
|
|
164278
|
+
reportStarted();
|
|
164270
164279
|
await rimraf(path142.join(configModulesDir, existingConfigDep));
|
|
164271
164280
|
}
|
|
164272
164281
|
}));
|
|
@@ -164281,8 +164290,8 @@ async function installConfigDeps(configDepsOrLockfile, opts2) {
|
|
|
164281
164290
|
const relPath = calcGlobalVirtualStorePathWithSubdeps(fullPkgId, pkgName, pkg.version, optionalSubdepIds);
|
|
164282
164291
|
const pkgDirInGlobalVirtualStore = path142.join(globalVirtualStoreDir, relPath, "node_modules", pkgName);
|
|
164283
164292
|
const parentSymlinkAlreadyCorrect = existingConfigDeps.includes(pkgName) && await symlinkPointsTo(configDepPath, pkgDirInGlobalVirtualStore);
|
|
164284
|
-
installingConfigDepsLogger.debug({ status: "started" });
|
|
164285
164293
|
if (!fs75.existsSync(path142.join(pkgDirInGlobalVirtualStore, "package.json"))) {
|
|
164294
|
+
reportStarted();
|
|
164286
164295
|
const { fetching } = await opts2.store.fetchPackage({
|
|
164287
164296
|
force: true,
|
|
164288
164297
|
lockfileDir: opts2.rootDir,
|
|
@@ -164308,12 +164317,14 @@ async function installConfigDeps(configDepsOrLockfile, opts2) {
|
|
|
164308
164317
|
parentNodeModulesDir: path142.join(globalVirtualStoreDir, relPath, "node_modules"),
|
|
164309
164318
|
globalVirtualStoreDir,
|
|
164310
164319
|
rootDir: opts2.rootDir,
|
|
164311
|
-
store: opts2.store
|
|
164320
|
+
store: opts2.store,
|
|
164321
|
+
reportStarted
|
|
164312
164322
|
});
|
|
164313
164323
|
}
|
|
164314
164324
|
if (parentSymlinkAlreadyCorrect) {
|
|
164315
164325
|
return;
|
|
164316
164326
|
}
|
|
164327
|
+
reportStarted();
|
|
164317
164328
|
if (existingConfigDeps.includes(pkgName)) {
|
|
164318
164329
|
await rimraf(configDepPath);
|
|
164319
164330
|
}
|
|
@@ -164417,12 +164428,17 @@ async function installOptionalSubdeps(opts2) {
|
|
|
164417
164428
|
});
|
|
164418
164429
|
const expectedSiblings = /* @__PURE__ */ new Set([opts2.parentName, ...compatibleSubdeps.map((s) => s.name)]);
|
|
164419
164430
|
const existingSiblings = await readModulesDir(opts2.parentNodeModulesDir) ?? [];
|
|
164420
|
-
|
|
164431
|
+
const orphanSiblings = existingSiblings.filter((name) => !expectedSiblings.has(name));
|
|
164432
|
+
if (orphanSiblings.length > 0) {
|
|
164433
|
+
opts2.reportStarted();
|
|
164434
|
+
}
|
|
164435
|
+
await Promise.all(orphanSiblings.map((name) => rimraf(path142.join(opts2.parentNodeModulesDir, name))));
|
|
164421
164436
|
await Promise.all(compatibleSubdeps.map(async (subdep) => {
|
|
164422
164437
|
const subdepFullPkgId = `${subdep.name}@${subdep.version}:${subdep.resolution.integrity}`;
|
|
164423
164438
|
const subdepRelPath = calcLeafGlobalVirtualStorePath(subdepFullPkgId, subdep.name, subdep.version);
|
|
164424
164439
|
const subdepDirInGlobalVirtualStore = path142.join(opts2.globalVirtualStoreDir, subdepRelPath, "node_modules", subdep.name);
|
|
164425
164440
|
if (!fs75.existsSync(path142.join(subdepDirInGlobalVirtualStore, "package.json"))) {
|
|
164441
|
+
opts2.reportStarted();
|
|
164426
164442
|
const { fetching } = await opts2.store.fetchPackage({
|
|
164427
164443
|
force: true,
|
|
164428
164444
|
lockfileDir: opts2.rootDir,
|
|
@@ -164439,6 +164455,10 @@ async function installOptionalSubdeps(opts2) {
|
|
|
164439
164455
|
});
|
|
164440
164456
|
}
|
|
164441
164457
|
const linkPath = path142.join(opts2.parentNodeModulesDir, subdep.name);
|
|
164458
|
+
if (await symlinkPointsTo(linkPath, subdepDirInGlobalVirtualStore)) {
|
|
164459
|
+
return;
|
|
164460
|
+
}
|
|
164461
|
+
opts2.reportStarted();
|
|
164442
164462
|
await fs75.promises.mkdir(path142.dirname(linkPath), { recursive: true });
|
|
164443
164463
|
await symlinkDir(subdepDirInGlobalVirtualStore, linkPath);
|
|
164444
164464
|
}));
|
|
@@ -164551,7 +164571,7 @@ async function resolveOptionalSubdeps(parentName, parentManifest, opts2) {
|
|
|
164551
164571
|
...pickPlatformFields(resolution.manifest)
|
|
164552
164572
|
};
|
|
164553
164573
|
if (opts2.envLockfile.snapshots[subdepKey] == null) {
|
|
164554
|
-
opts2.envLockfile.snapshots[subdepKey] = {};
|
|
164574
|
+
opts2.envLockfile.snapshots[subdepKey] = { optional: true };
|
|
164555
164575
|
}
|
|
164556
164576
|
resolved[subdepName] = subdepVersion;
|
|
164557
164577
|
}));
|
|
@@ -166497,8 +166517,9 @@ import readline2 from "node:readline";
|
|
|
166497
166517
|
function makeRunPacquet(opts2) {
|
|
166498
166518
|
return async (callOpts) => {
|
|
166499
166519
|
const pacquetBin = resolvePacquetBin(opts2.lockfileDir, opts2.packageName);
|
|
166500
|
-
const
|
|
166501
|
-
const
|
|
166520
|
+
const forwardedFlags = opts2.isInstallCommand ? collectForwardedFlags(opts2.argv) : [];
|
|
166521
|
+
const args = ["--reporter=ndjson", "install", "--frozen-lockfile", "--ignore-manifest-check", ...forwardedFlags];
|
|
166522
|
+
const droppedFlags = opts2.isInstallCommand ? [] : collectDroppedFlags(opts2.argv);
|
|
166502
166523
|
if (droppedFlags.length > 0) {
|
|
166503
166524
|
logger.warn({
|
|
166504
166525
|
message: `The following CLI flags are not forwarded to pacquet and may not be honored: ${droppedFlags.join(" ")}. Move the equivalent settings into pnpm-workspace.yaml (or .npmrc for auth/registry) if pacquet needs them.`,
|
|
@@ -166551,18 +166572,57 @@ function resolvePacquetBin(lockfileDir, packageName) {
|
|
|
166551
166572
|
const pacquetPkg = fs82.realpathSync(path150.join(lockfileDir, "node_modules/.pnpm-config", packageName, "package.json"));
|
|
166552
166573
|
return createRequire7(pacquetPkg).resolve(`@pacquet/${process.platform}-${process.arch}/pacquet${ext}`);
|
|
166553
166574
|
}
|
|
166575
|
+
function collectForwardedFlags(argv2) {
|
|
166576
|
+
const result2 = [];
|
|
166577
|
+
let positionalIdx = 0;
|
|
166578
|
+
for (let i2 = 0; i2 < argv2.original.length; i2++) {
|
|
166579
|
+
const arg = argv2.original[i2];
|
|
166580
|
+
if (positionalIdx < argv2.remain.length && arg === argv2.remain[positionalIdx]) {
|
|
166581
|
+
positionalIdx++;
|
|
166582
|
+
continue;
|
|
166583
|
+
}
|
|
166584
|
+
if (isAlwaysInjected(arg))
|
|
166585
|
+
continue;
|
|
166586
|
+
if (arg.startsWith("--reporter="))
|
|
166587
|
+
continue;
|
|
166588
|
+
if (arg === "--reporter") {
|
|
166589
|
+
i2++;
|
|
166590
|
+
continue;
|
|
166591
|
+
}
|
|
166592
|
+
result2.push(arg);
|
|
166593
|
+
}
|
|
166594
|
+
return result2;
|
|
166595
|
+
}
|
|
166596
|
+
function isAlwaysInjected(arg) {
|
|
166597
|
+
for (const name of ALWAYS_INJECTED_FLAGS) {
|
|
166598
|
+
if (arg === `--${name}` || arg === `--no-${name}`)
|
|
166599
|
+
return true;
|
|
166600
|
+
if (arg.startsWith(`--${name}=`) || arg.startsWith(`--no-${name}=`))
|
|
166601
|
+
return true;
|
|
166602
|
+
}
|
|
166603
|
+
return false;
|
|
166604
|
+
}
|
|
166554
166605
|
function collectDroppedFlags(argv2) {
|
|
166555
|
-
|
|
166606
|
+
const result2 = [];
|
|
166607
|
+
for (let i2 = 0; i2 < argv2.original.length; i2++) {
|
|
166608
|
+
const arg = argv2.original[i2];
|
|
166556
166609
|
if (!arg.startsWith("-"))
|
|
166557
|
-
|
|
166558
|
-
if (arg
|
|
166559
|
-
|
|
166610
|
+
continue;
|
|
166611
|
+
if (isAlwaysInjected(arg))
|
|
166612
|
+
continue;
|
|
166560
166613
|
if (arg.startsWith("--config."))
|
|
166561
|
-
|
|
166562
|
-
|
|
166563
|
-
|
|
166614
|
+
continue;
|
|
166615
|
+
if (arg.startsWith("--reporter="))
|
|
166616
|
+
continue;
|
|
166617
|
+
if (arg === "--reporter") {
|
|
166618
|
+
i2++;
|
|
166619
|
+
continue;
|
|
166620
|
+
}
|
|
166621
|
+
result2.push(arg);
|
|
166622
|
+
}
|
|
166623
|
+
return result2;
|
|
166564
166624
|
}
|
|
166565
|
-
var streamParserWritable;
|
|
166625
|
+
var streamParserWritable, ALWAYS_INJECTED_FLAGS;
|
|
166566
166626
|
var init_runPacquet = __esm({
|
|
166567
166627
|
"../installing/commands/lib/runPacquet.js"() {
|
|
166568
166628
|
"use strict";
|
|
@@ -166570,6 +166630,7 @@ var init_runPacquet = __esm({
|
|
|
166570
166630
|
init_lib3();
|
|
166571
166631
|
init_source2();
|
|
166572
166632
|
streamParserWritable = streamParser;
|
|
166633
|
+
ALWAYS_INJECTED_FLAGS = ["frozen-lockfile", "ignore-manifest-check"];
|
|
166573
166634
|
}
|
|
166574
166635
|
});
|
|
166575
166636
|
|
|
@@ -166609,7 +166670,8 @@ async function installDeps(opts2, params) {
|
|
|
166609
166670
|
const runPacquet = pacquetConfigDepName != null ? makeRunPacquet({
|
|
166610
166671
|
lockfileDir: opts2.lockfileDir ?? opts2.dir,
|
|
166611
166672
|
packageName: pacquetConfigDepName,
|
|
166612
|
-
argv: opts2.argv.original
|
|
166673
|
+
argv: { original: opts2.argv.original, remain: opts2.argv.remain ?? [] },
|
|
166674
|
+
isInstallCommand: opts2.isInstallCommand === true
|
|
166613
166675
|
}) : void 0;
|
|
166614
166676
|
const includeDirect = opts2.includeDirect ?? {
|
|
166615
166677
|
dependencies: true,
|
|
@@ -167606,7 +167668,8 @@ async function handler5(opts2, _params, commands2) {
|
|
|
167606
167668
|
frozenLockfileIfExists: opts2.frozenLockfileIfExists ?? (opts2.ci && !opts2.lockfileOnly && typeof opts2.frozenLockfile === "undefined" && typeof opts2.preferFrozenLockfile === "undefined"),
|
|
167607
167669
|
include,
|
|
167608
167670
|
includeDirect: include,
|
|
167609
|
-
fetchFullMetadata: getFetchFullMetadata(opts2)
|
|
167671
|
+
fetchFullMetadata: getFetchFullMetadata(opts2),
|
|
167672
|
+
isInstallCommand: true
|
|
167610
167673
|
};
|
|
167611
167674
|
if (opts2.resolutionOnly) {
|
|
167612
167675
|
installDepsOptions.lockfileOnly = true;
|