pnpm 11.0.0-rc.4 → 11.0.0

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 (3) hide show
  1. package/README.md +1 -0
  2. package/dist/pnpm.mjs +57 -25
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -235,6 +235,7 @@ Benchmarks on an app with lots of dependencies:
235
235
  - [Frequently Asked Questions](https://pnpm.io/faq)
236
236
  - [X](https://x.com/pnpmjs)
237
237
  - [Bluesky](https://bsky.app/profile/pnpm.io)
238
+ - [Discord](https://r.pnpm.io/chat)
238
239
 
239
240
  ## License
240
241
 
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.0-rc.4" : "0.0.0"
1003
+ version: true ? "11.0.0" : "0.0.0"
1004
1004
  };
1005
1005
  pkgJson = defaultManifest;
1006
1006
  packageManager = {
@@ -2090,11 +2090,12 @@ If you think that this is the case, then run "pnpm store prune" and rerun the co
2090
2090
  });
2091
2091
 
2092
2092
  // ../pkg-manifest/utils/lib/getAllDependenciesFromManifest.js
2093
- function getAllDependenciesFromManifest(pkg) {
2093
+ function getAllDependenciesFromManifest(pkg, opts2) {
2094
2094
  return {
2095
2095
  ...pkg.devDependencies,
2096
2096
  ...pkg.dependencies,
2097
- ...pkg.optionalDependencies
2097
+ ...pkg.optionalDependencies,
2098
+ ...opts2?.autoInstallPeers ? pkg.peerDependencies : {}
2098
2099
  };
2099
2100
  }
2100
2101
  var init_getAllDependenciesFromManifest = __esm({
@@ -4294,11 +4295,12 @@ function filterDependenciesByType(manifest, include) {
4294
4295
  ...include.optionalDependencies ? manifest.optionalDependencies : {}
4295
4296
  };
4296
4297
  }
4297
- function getAllDependenciesFromManifest2(manifest) {
4298
+ function getAllDependenciesFromManifest2(manifest, opts2) {
4298
4299
  return {
4299
4300
  ...manifest.devDependencies,
4300
4301
  ...manifest.dependencies,
4301
- ...manifest.optionalDependencies
4302
+ ...manifest.optionalDependencies,
4303
+ ...opts2?.autoInstallPeers ? manifest.peerDependencies : {}
4302
4304
  };
4303
4305
  }
4304
4306
  var init_lib9 = __esm({
@@ -46193,6 +46195,8 @@ async function extractZipToTarget(zipPath, basename2, targetDir, ignoreEntry) {
46193
46195
  const basenamePrefix = basename2 === "" ? "" : `${basename2}/`;
46194
46196
  const testEntry = toStatelessTester(ignoreEntry);
46195
46197
  for (const entry of zip.getEntries()) {
46198
+ if (entry.isDirectory)
46199
+ continue;
46196
46200
  const entryPath = entry.entryName;
46197
46201
  validatePathSecurity(nodeDir, entryPath);
46198
46202
  if (testEntry) {
@@ -156803,7 +156807,7 @@ async function mutateModules(projects, maybeOpts) {
156803
156807
  });
156804
156808
  }
156805
156809
  async function installSome(project) {
156806
- const currentBareSpecifiers = opts2.ignoreCurrentSpecifiers ? {} : getAllDependenciesFromManifest2(project.manifest);
156810
+ const currentBareSpecifiers = opts2.ignoreCurrentSpecifiers ? {} : getAllDependenciesFromManifest2(project.manifest, { autoInstallPeers: opts2.autoInstallPeers });
156807
156811
  const optionalDependencies = project.targetDependenciesField ? {} : project.manifest.optionalDependencies ?? {};
156808
156812
  const devDependencies = project.targetDependenciesField ? {} : project.manifest.devDependencies ?? {};
156809
156813
  if (preferredSpecs == null) {
@@ -201647,6 +201651,7 @@ async function handler31(opts2, params) {
201647
201651
  if (isExecutedByCorepack()) {
201648
201652
  throw new PnpmError("CANT_SELF_UPDATE_IN_COREPACK", "You should update pnpm with corepack");
201649
201653
  }
201654
+ globalInfo("Checking for updates...");
201650
201655
  const { resolve: resolve3 } = createResolver2({ ...opts2, configByUri: opts2.configByUri });
201651
201656
  const pkgName = "pnpm";
201652
201657
  const bareSpecifier = params[0] ?? "latest";
@@ -201658,6 +201663,22 @@ async function handler31(opts2, params) {
201658
201663
  if (!resolution?.manifest) {
201659
201664
  throw new PnpmError("CANNOT_RESOLVE_PNPM", `Cannot find "${bareSpecifier}" version of pnpm`);
201660
201665
  }
201666
+ const targetVersion = resolution.manifest.version;
201667
+ let previousVersion;
201668
+ if (opts2.wantedPackageManager?.name === packageManager.name) {
201669
+ if (opts2.wantedPackageManager.version !== targetVersion) {
201670
+ previousVersion = opts2.wantedPackageManager.version;
201671
+ }
201672
+ } else if (packageManager.version !== targetVersion) {
201673
+ previousVersion = packageManager.version;
201674
+ }
201675
+ const previousMajor = previousVersion != null ? import_semver43.default.coerce(previousVersion)?.major : void 0;
201676
+ const targetMajor = import_semver43.default.major(targetVersion);
201677
+ if (previousMajor != null && targetMajor > previousMajor) {
201678
+ const hint = MAJOR_UPGRADE_HINTS[targetMajor];
201679
+ if (hint)
201680
+ globalWarn(hint);
201681
+ }
201661
201682
  if (opts2.wantedPackageManager?.name === packageManager.name) {
201662
201683
  if (opts2.wantedPackageManager?.version !== resolution.manifest.version) {
201663
201684
  const { manifest, writeProjectManifest: writeProjectManifest2 } = await readProjectManifest(opts2.rootProjectManifestDir);
@@ -201697,6 +201718,7 @@ async function handler31(opts2, params) {
201697
201718
  if (resolution.manifest.version === packageManager.version) {
201698
201719
  return `The currently active ${packageManager.name} v${packageManager.version} is already "${bareSpecifier}" and doesn't need an update`;
201699
201720
  }
201721
+ globalInfo(`Updating pnpm from v${packageManager.version} to v${resolution.manifest.version}...`);
201700
201722
  const store = await createStoreController(opts2);
201701
201723
  const envLockfile = await resolvePackageManagerIntegrities(resolution.manifest.version, {
201702
201724
  registries: opts2.registries,
@@ -201714,7 +201736,7 @@ async function handler31(opts2, params) {
201714
201736
  if (alreadyExisted) {
201715
201737
  return `The ${bareSpecifier} version, v${resolution.manifest.version}, is already present on the system. It was activated by linking it from ${baseDir}.`;
201716
201738
  }
201717
- return void 0;
201739
+ return `Successfully updated pnpm to v${resolution.manifest.version}`;
201718
201740
  }
201719
201741
  function updateVersionConstraint(current, newVersion) {
201720
201742
  if (current == null)
@@ -201738,7 +201760,7 @@ function versionSpecFromPinned(version2, pinnedVersion) {
201738
201760
  return version2;
201739
201761
  }
201740
201762
  }
201741
- var import_semver43, commandNames31, skipPackageManagerCheck2;
201763
+ var import_semver43, commandNames31, MAJOR_UPGRADE_HINTS, skipPackageManagerCheck2;
201742
201764
  var init_selfUpdate = __esm({
201743
201765
  "../engine/pm/commands/lib/self-updater/selfUpdate.js"() {
201744
201766
  "use strict";
@@ -201758,6 +201780,9 @@ var init_selfUpdate = __esm({
201758
201780
  import_semver43 = __toESM(require_semver2(), 1);
201759
201781
  init_installPnpm();
201760
201782
  commandNames31 = ["self-update"];
201783
+ MAJOR_UPGRADE_HINTS = {
201784
+ 11: "pnpm v11 removed or renamed several v10 settings. See https://pnpm.io/11.x/migration for migration instructions."
201785
+ };
201761
201786
  skipPackageManagerCheck2 = true;
201762
201787
  }
201763
201788
  });
@@ -208116,17 +208141,17 @@ function help34() {
208116
208141
  ],
208117
208142
  url: docsUrl("env"),
208118
208143
  usages: [
208119
- "pnpm env use --global 18",
208144
+ "pnpm env use --global 24",
208120
208145
  "pnpm env use --global lts",
208121
- "pnpm env use --global argon",
208146
+ "pnpm env use --global krypton",
208122
208147
  "pnpm env use --global latest",
208123
- "pnpm env use --global rc/18",
208148
+ "pnpm env use --global rc/24",
208124
208149
  "pnpm env list",
208125
- "pnpm env list 18",
208150
+ "pnpm env list 24",
208126
208151
  "pnpm env list lts",
208127
- "pnpm env list argon",
208152
+ "pnpm env list krypton",
208128
208153
  "pnpm env list latest",
208129
- "pnpm env list rc/18"
208154
+ "pnpm env list rc/24"
208130
208155
  ]
208131
208156
  });
208132
208157
  }
@@ -214095,13 +214120,13 @@ function help55() {
214095
214120
  description: `Pack a CommonJS entry file into a standalone executable for one or more target platforms.
214096
214121
 
214097
214122
  The executable embeds a Node.js binary via the Node.js Single Executable Applications API.
214098
- Requires Node.js v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}+ to perform the injection. The running Node.js is used when it is new enough; otherwise, the latest Node.js v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}+ in the v${MIN_BUILDER_VERSION.major}.x line is downloaded automatically.
214123
+ Requires Node.js v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}+ to perform the injection. SEA blobs are not compatible across Node.js minor releases, so the builder Node.js must match the embedded runtime version exactly. The running Node.js is used when it already matches; otherwise a host-arch Node.js of the embedded runtime version is downloaded automatically.
214099
214124
 
214100
214125
  Defaults for --entry, --target, --runtime, --output-dir, and --output-name can be set in the package.json under "pnpm.app". CLI flags override the config; --target entirely replaces the configured list so you can narrow it at invocation time.`,
214101
214126
  url: docsUrl("pack-app"),
214102
214127
  usages: [
214103
214128
  "pnpm pack-app --entry dist/index.cjs --target linux-x64 --target win32-x64",
214104
- "pnpm pack-app --entry dist/index.cjs --target linux-x64-musl --runtime node@22"
214129
+ `pnpm pack-app --entry dist/index.cjs --target linux-x64-musl --runtime node@${MIN_BUILDER_VERSION.major}`
214105
214130
  ],
214106
214131
  descriptionLists: [
214107
214132
  {
@@ -214117,7 +214142,7 @@ Defaults for --entry, --target, --runtime, --output-dir, and --output-name can b
214117
214142
  shortAlias: "-t"
214118
214143
  },
214119
214144
  {
214120
- description: 'Runtime to embed in the output executables, as a "<name>@<version>" spec (e.g. "node@22", "node@22.0.0", "node@lts"). Only "node" is supported today. Defaults to the running Node.js version.',
214145
+ description: `Runtime to embed in the output executables, as a "<name>@<version>" spec (e.g. "node@${MIN_BUILDER_VERSION.major}", "node@${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}.0"). Only "node" is supported today, and the version must be >= v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor} (the minimum that supports --build-sea). Defaults to the running Node.js version.`,
214121
214146
  name: "--runtime"
214122
214147
  },
214123
214148
  {
@@ -214163,8 +214188,11 @@ async function handler55(opts2, params) {
214163
214188
  const outputName = validateOutputName(opts2.outputName ?? project.app?.outputName ?? deriveOutputNameFromPackage(project, opts2.dir));
214164
214189
  const fetch2 = createFetchFromRegistry(opts2);
214165
214190
  const buildRoot = path187.join(opts2.pnpmHomeDir, "pack-app");
214166
- const builderBin = await resolveBuilderBinary({ fetch: fetch2, nodeDownloadMirrors: opts2.nodeDownloadMirrors, buildRoot });
214167
214191
  const resolvedTargetVersion = await resolveVersion(fetch2, requestedNodeSpec, opts2.nodeDownloadMirrors);
214192
+ const builderBin = await resolveBuilderBinary({
214193
+ buildRoot,
214194
+ targetVersion: resolvedTargetVersion
214195
+ });
214168
214196
  const results = [];
214169
214197
  for (const target2 of targets) {
214170
214198
  const embeddedNodeBin = await ensureNodeRuntime({
@@ -214201,13 +214229,15 @@ async function handler55(opts2, params) {
214201
214229
  ${results.join("\n")}`;
214202
214230
  }
214203
214231
  async function resolveBuilderBinary(ctx) {
214204
- if (runningNodeCanBuildSea()) {
214232
+ if (runningNodeCanBuildSea() && process.version === `v${ctx.targetVersion}`) {
214205
214233
  return process.execPath;
214206
214234
  }
214207
- const version2 = await resolveVersion(ctx.fetch, DEFAULT_BUILDER_SPEC, ctx.nodeDownloadMirrors);
214235
+ if (!builderVersionCanBuildSea(ctx.targetVersion)) {
214236
+ throw new PnpmError("PACK_APP_RUNTIME_TOO_OLD", `The embedded runtime "node@${ctx.targetVersion}" is older than Node.js v${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}, which is the minimum version that supports --build-sea.`, { hint: `Pass --runtime node@${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}.0 (or newer) or set "pnpm.app.runtime" in package.json.` });
214237
+ }
214208
214238
  return ensureNodeRuntime({
214209
214239
  buildRoot: ctx.buildRoot,
214210
- version: version2,
214240
+ version: ctx.targetVersion,
214211
214241
  platform: process.platform,
214212
214242
  arch: process.arch,
214213
214243
  // Pin libc to the host's. Otherwise a caller that had set
@@ -214223,7 +214253,10 @@ function hostLinuxLibc() {
214223
214253
  return family === "musl" ? "musl" : "glibc";
214224
214254
  }
214225
214255
  function runningNodeCanBuildSea() {
214226
- const [majorStr, minorStr] = process.version.slice(1).split(".");
214256
+ return builderVersionCanBuildSea(process.version.slice(1));
214257
+ }
214258
+ function builderVersionCanBuildSea(version2) {
214259
+ const [majorStr, minorStr] = version2.split(".");
214227
214260
  const major = Number(majorStr);
214228
214261
  const minor = Number(minorStr);
214229
214262
  return major > MIN_BUILDER_VERSION.major || major === MIN_BUILDER_VERSION.major && minor >= MIN_BUILDER_VERSION.minor;
@@ -214282,7 +214315,7 @@ function parseTarget(raw) {
214282
214315
  function parseRuntime(spec) {
214283
214316
  const match = RUNTIME_PATTERN.exec(spec);
214284
214317
  if (!match) {
214285
- throw new PnpmError("PACK_APP_INVALID_RUNTIME", `Invalid runtime "${spec}". Expected format: <name>@<version> (supported runtimes: ${SUPPORTED_RUNTIMES.join(", ")}; e.g. "node@22.0.0", "node@lts").`);
214318
+ throw new PnpmError("PACK_APP_INVALID_RUNTIME", `Invalid runtime "${spec}". Expected format: <name>@<version> (supported runtimes: ${SUPPORTED_RUNTIMES.join(", ")}; e.g. "node@${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}.0").`);
214286
214319
  }
214287
214320
  return { name: match[1], version: match[2] };
214288
214321
  }
@@ -214380,7 +214413,7 @@ async function adHocSignMacBinary(target2, outputFile) {
214380
214413
  }
214381
214414
  throw new PnpmError("PACK_APP_MACOS_SIGN_UNSUPPORTED_HOST", `Cannot ad-hoc sign the macOS binary at ${outputFile} on a ${process.platform} host.`, { hint: 'Build macOS targets on a macOS or Linux host, or re-sign the produced binary yourself with "codesign --sign -" on macOS.' });
214382
214415
  }
214383
- var import_detect_libc5, MIN_BUILDER_VERSION, DEFAULT_BUILDER_SPEC, SUPPORTED_OS, SUPPORTED_TARGETS, commandNames55, shorthands17, TARGET_PATTERN, SUPPORTED_RUNTIMES, RUNTIME_PATTERN, INVALID_FILENAME_CHARS, RESERVED_WINDOWS_NAME;
214416
+ var import_detect_libc5, MIN_BUILDER_VERSION, SUPPORTED_OS, SUPPORTED_TARGETS, commandNames55, shorthands17, TARGET_PATTERN, SUPPORTED_RUNTIMES, RUNTIME_PATTERN, INVALID_FILENAME_CHARS, RESERVED_WINDOWS_NAME;
214384
214417
  var init_packApp = __esm({
214385
214418
  "../releasing/commands/lib/pack-app/packApp.js"() {
214386
214419
  "use strict";
@@ -214393,7 +214426,6 @@ var init_packApp = __esm({
214393
214426
  init_lib24();
214394
214427
  init_lib61();
214395
214428
  MIN_BUILDER_VERSION = { major: 25, minor: 5 };
214396
- DEFAULT_BUILDER_SPEC = `>=${MIN_BUILDER_VERSION.major}.${MIN_BUILDER_VERSION.minor}.0 <${MIN_BUILDER_VERSION.major + 1}.0.0`;
214397
214429
  SUPPORTED_OS = ["linux", "darwin", "win32"];
214398
214430
  SUPPORTED_TARGETS = "linux-x64, linux-x64-musl, linux-arm64, linux-arm64-musl, darwin-x64, darwin-arm64, win32-x64, win32-arm64";
214399
214431
  commandNames55 = ["pack-app"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pnpm",
3
- "version": "11.0.0-rc.4",
3
+ "version": "11.0.0",
4
4
  "description": "Fast, disk space efficient package manager",
5
5
  "keywords": [
6
6
  "pnpm",