pnpm 11.2.0 → 11.2.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.
Files changed (2) hide show
  1. package/dist/pnpm.mjs +28 -8
  2. 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.0" : "0.0.0"
1803
+ version: true ? "11.2.1" : "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
- bareSpecifier = bareSpecifier.slice(4);
12544
- if (bareSpecifier[0] === "@") {
12545
- return bareSpecifier.substring(0, bareSpecifier.indexOf("/"));
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
- await Promise.all(existingSiblings.filter((name) => !expectedSiblings.has(name)).map((name) => rimraf(path142.join(opts2.parentNodeModulesDir, name))));
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
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pnpm",
3
- "version": "11.2.0",
3
+ "version": "11.2.1",
4
4
  "description": "Fast, disk space efficient package manager",
5
5
  "keywords": [
6
6
  "pnpm",