@vercel/build-utils 14.8.0 → 14.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 14.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 392c759: Honor pnpm 12 pins without auto-adopting, and stop passing `--unsafe-perm` to `pnpm install`.
8
+
9
+ When Corepack is off, a lockfile-compatible `packageManager` / `devEngines.packageManager` / `engines.pnpm` pin for 12.x selects `/pnpm12` if that directory exists. Unpinned lockfile `9.0` still defaults to pnpm 9/10/11 by project creation date. `pnpm install` no longer includes `--unsafe-perm`, which pnpm 12's Rust CLI rejects.
10
+
3
11
  ## 14.8.0
4
12
 
5
13
  ### Minor Changes
@@ -556,7 +556,9 @@ function getInstallCommandForPackageManager(packageManager, args) {
556
556
  prettyCommand: "pnpm install",
557
557
  // PNPM's install command is similar to NPM's but without the audit nonsense
558
558
  // @see options https://pnpm.io/cli/install
559
- commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
559
+ // Do not pass `--unsafe-perm`: pnpm 11 treated it as a no-op, but
560
+ // pnpm 12's Rust CLI rejects unknown flags.
561
+ commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install"])
560
562
  };
561
563
  case "bun":
562
564
  return {
@@ -585,7 +587,9 @@ async function runInstallCommand({
585
587
  const { commandArguments, prettyCommand } = getInstallCommandForPackageManager(packageManager, args);
586
588
  opts.prettyCommand = prettyCommand;
587
589
  if (process.env.NPM_ONLY_PRODUCTION) {
588
- commandArguments.push("--production");
590
+ commandArguments.push(
591
+ packageManager === "pnpm" ? "--prod" : "--production"
592
+ );
589
593
  }
590
594
  opts.outputStream = output?.stdout;
591
595
  opts.errorStream = output?.stderr;
@@ -812,7 +816,7 @@ To use a different version, set package.json#packageManager or package.json#devE
812
816
  }
813
817
  const PNPM_10_PREFERRED_AT = /* @__PURE__ */ new Date("2025-02-27T20:00:00Z");
814
818
  const PNPM_11_PREFERRED_AT = /* @__PURE__ */ new Date("2026-08-19T20:00:00Z");
815
- const INSTALLED_PNPM_MAJORS = [11, 10, 9, 8, 7, 6];
819
+ const INSTALLED_PNPM_MAJORS = [12, 11, 10, 9, 8, 7, 6];
816
820
  function pnpmPathOverride(major) {
817
821
  return {
818
822
  path: `/pnpm${major}/node_modules/.bin`,
@@ -882,6 +886,7 @@ function validLockfileForPackageManager(cliType, lockfileVersion, packageManager
882
886
  return true;
883
887
  case "pnpm":
884
888
  switch (packageManagerMajorVersion) {
889
+ case 12:
885
890
  case 11:
886
891
  case 10:
887
892
  return lockfileVersion === 9;
@@ -1035,7 +1040,7 @@ function applyEnginesPnpm({
1035
1040
  if (major !== void 0) {
1036
1041
  return pnpmPathOverride(major);
1037
1042
  }
1038
- if (shouldDeferPnpm11UntilImageHasBinary(enginesPnpm, lockfileVersion)) {
1043
+ if (shouldDeferPnpmMajorUntilImageHasBinary(enginesPnpm, lockfileVersion)) {
1039
1044
  warnEnginesPnpmWithoutPin();
1040
1045
  return selected;
1041
1046
  }
@@ -1054,12 +1059,20 @@ function warnEnginesPnpmWithoutPin() {
1054
1059
  `Using package.json#engines.pnpm without corepack and package.json#packageManager could lead to failed builds with ERR_PNPM_UNSUPPORTED_ENGINE. Learn more: https://vercel.com/docs/errors/error-list#pnpm-engine-unsupported`
1055
1060
  );
1056
1061
  }
1057
- function shouldDeferPnpm11UntilImageHasBinary(enginesPnpm, lockfileVersion) {
1058
- if (isPnpmMajorAvailable(11) || !(0, import_semver.intersects)("11.x", enginesPnpm)) {
1059
- return false;
1062
+ function shouldDeferPnpmMajorUntilImageHasBinary(enginesPnpm, lockfileVersion) {
1063
+ for (const major of INSTALLED_PNPM_MAJORS) {
1064
+ if (major <= 10) {
1065
+ continue;
1066
+ }
1067
+ if (isPnpmMajorAvailable(major) || !(0, import_semver.intersects)(`${major}.x`, enginesPnpm)) {
1068
+ continue;
1069
+ }
1070
+ const version = (0, import_semver.parse)(`${major}.0.0`);
1071
+ if (version && lockfileCompatibleWithPnpm(lockfileVersion, version)) {
1072
+ return true;
1073
+ }
1060
1074
  }
1061
- const pnpm11 = (0, import_semver.parse)("11.0.0");
1062
- return Boolean(pnpm11 && lockfileCompatibleWithPnpm(lockfileVersion, pnpm11));
1075
+ return false;
1063
1076
  }
1064
1077
  function validateCorepackPackageManager(cliType, lockfileVersion, corepackPackageManager, enginesPnpmVersionRange) {
1065
1078
  const validatedCorepackPackageManager = validateVersionSpecifier(
package/dist/index.js CHANGED
@@ -37195,7 +37195,9 @@ function getInstallCommandForPackageManager(packageManager, args) {
37195
37195
  prettyCommand: "pnpm install",
37196
37196
  // PNPM's install command is similar to NPM's but without the audit nonsense
37197
37197
  // @see options https://pnpm.io/cli/install
37198
- commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install", "--unsafe-perm"])
37198
+ // Do not pass `--unsafe-perm`: pnpm 11 treated it as a no-op, but
37199
+ // pnpm 12's Rust CLI rejects unknown flags.
37200
+ commandArguments: args.filter((a) => a !== "--prefer-offline").concat(["install"])
37199
37201
  };
37200
37202
  case "bun":
37201
37203
  return {
@@ -37224,7 +37226,9 @@ async function runInstallCommand({
37224
37226
  const { commandArguments, prettyCommand } = getInstallCommandForPackageManager(packageManager, args);
37225
37227
  opts.prettyCommand = prettyCommand;
37226
37228
  if (process.env.NPM_ONLY_PRODUCTION) {
37227
- commandArguments.push("--production");
37229
+ commandArguments.push(
37230
+ packageManager === "pnpm" ? "--prod" : "--production"
37231
+ );
37228
37232
  }
37229
37233
  opts.outputStream = output?.stdout;
37230
37234
  opts.errorStream = output?.stderr;
@@ -37451,7 +37455,7 @@ To use a different version, set package.json#packageManager or package.json#devE
37451
37455
  }
37452
37456
  var PNPM_10_PREFERRED_AT = /* @__PURE__ */ new Date("2025-02-27T20:00:00Z");
37453
37457
  var PNPM_11_PREFERRED_AT = /* @__PURE__ */ new Date("2026-08-19T20:00:00Z");
37454
- var INSTALLED_PNPM_MAJORS = [11, 10, 9, 8, 7, 6];
37458
+ var INSTALLED_PNPM_MAJORS = [12, 11, 10, 9, 8, 7, 6];
37455
37459
  function pnpmPathOverride(major) {
37456
37460
  return {
37457
37461
  path: `/pnpm${major}/node_modules/.bin`,
@@ -37521,6 +37525,7 @@ function validLockfileForPackageManager(cliType, lockfileVersion, packageManager
37521
37525
  return true;
37522
37526
  case "pnpm":
37523
37527
  switch (packageManagerMajorVersion) {
37528
+ case 12:
37524
37529
  case 11:
37525
37530
  case 10:
37526
37531
  return lockfileVersion === 9;
@@ -37674,7 +37679,7 @@ function applyEnginesPnpm({
37674
37679
  if (major !== void 0) {
37675
37680
  return pnpmPathOverride(major);
37676
37681
  }
37677
- if (shouldDeferPnpm11UntilImageHasBinary(enginesPnpm, lockfileVersion)) {
37682
+ if (shouldDeferPnpmMajorUntilImageHasBinary(enginesPnpm, lockfileVersion)) {
37678
37683
  warnEnginesPnpmWithoutPin();
37679
37684
  return selected;
37680
37685
  }
@@ -37693,12 +37698,20 @@ function warnEnginesPnpmWithoutPin() {
37693
37698
  `Using package.json#engines.pnpm without corepack and package.json#packageManager could lead to failed builds with ERR_PNPM_UNSUPPORTED_ENGINE. Learn more: https://vercel.com/docs/errors/error-list#pnpm-engine-unsupported`
37694
37699
  );
37695
37700
  }
37696
- function shouldDeferPnpm11UntilImageHasBinary(enginesPnpm, lockfileVersion) {
37697
- if (isPnpmMajorAvailable(11) || !(0, import_semver2.intersects)("11.x", enginesPnpm)) {
37698
- return false;
37701
+ function shouldDeferPnpmMajorUntilImageHasBinary(enginesPnpm, lockfileVersion) {
37702
+ for (const major of INSTALLED_PNPM_MAJORS) {
37703
+ if (major <= 10) {
37704
+ continue;
37705
+ }
37706
+ if (isPnpmMajorAvailable(major) || !(0, import_semver2.intersects)(`${major}.x`, enginesPnpm)) {
37707
+ continue;
37708
+ }
37709
+ const version = (0, import_semver2.parse)(`${major}.0.0`);
37710
+ if (version && lockfileCompatibleWithPnpm(lockfileVersion, version)) {
37711
+ return true;
37712
+ }
37699
37713
  }
37700
- const pnpm11 = (0, import_semver2.parse)("11.0.0");
37701
- return Boolean(pnpm11 && lockfileCompatibleWithPnpm(lockfileVersion, pnpm11));
37714
+ return false;
37702
37715
  }
37703
37716
  function validateCorepackPackageManager(cliType, lockfileVersion, corepackPackageManager, enginesPnpmVersionRange) {
37704
37717
  const validatedCorepackPackageManager = validateVersionSpecifier(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "14.8.0",
3
+ "version": "14.9.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -52,8 +52,8 @@
52
52
  "vitest": "4.1.10",
53
53
  "typescript": "4.9.5",
54
54
  "yazl": "2.5.1",
55
- "@vercel/error-utils": "2.2.1",
56
- "@vercel/routing-utils": "6.5.0"
55
+ "@vercel/routing-utils": "6.5.0",
56
+ "@vercel/error-utils": "2.2.1"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "node build.mjs",