@vercel/build-utils 14.7.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 +14 -0
- package/dist/fs/run-user-scripts.js +22 -9
- package/dist/index.js +22 -9
- package/dist/types.d.ts +21 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
11
|
+
## 14.8.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- a652a99: Propagate top-level `schedules` from vercel.json into the Build Output API `config.json` during `vercel build`, and validate the property against the schedules schema
|
|
16
|
+
|
|
3
17
|
## 14.7.0
|
|
4
18
|
|
|
5
19
|
### 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
|
-
|
|
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(
|
|
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 (
|
|
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
|
|
1058
|
-
|
|
1059
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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 (
|
|
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
|
|
37697
|
-
|
|
37698
|
-
|
|
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
|
-
|
|
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/dist/types.d.ts
CHANGED
|
@@ -565,6 +565,27 @@ export interface Cron {
|
|
|
565
565
|
path: string;
|
|
566
566
|
schedule: string;
|
|
567
567
|
}
|
|
568
|
+
export interface ScheduleExpression {
|
|
569
|
+
/** Cron expression describing when the schedule fires (REQUIRED) */
|
|
570
|
+
cron: string;
|
|
571
|
+
/** Maximum random delay applied to each firing, e.g. "5m" (OPTIONAL) */
|
|
572
|
+
jitter?: string;
|
|
573
|
+
}
|
|
574
|
+
export type ScheduleTarget = {
|
|
575
|
+
/** Build output path of the function to invoke, e.g. "api/cron" */
|
|
576
|
+
function: string;
|
|
577
|
+
} | {
|
|
578
|
+
/** Name of the queue topic to publish to */
|
|
579
|
+
topic: string;
|
|
580
|
+
};
|
|
581
|
+
export interface Schedule {
|
|
582
|
+
/** Unique name of the schedule within the deployment (REQUIRED) */
|
|
583
|
+
name: string;
|
|
584
|
+
expression: ScheduleExpression;
|
|
585
|
+
target: ScheduleTarget;
|
|
586
|
+
/** Payload delivered with each firing (OPTIONAL) */
|
|
587
|
+
payload?: unknown;
|
|
588
|
+
}
|
|
568
589
|
export interface ServiceQueueTopic {
|
|
569
590
|
topic: string;
|
|
570
591
|
retryAfterSeconds?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/build-utils",
|
|
3
|
-
"version": "14.
|
|
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/
|
|
56
|
-
"@vercel/
|
|
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",
|