vercel 59.11.2 → 59.11.7
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/chunks/{add-BKSHWTPX.js → add-KSJQYR5C.js} +23 -18
- package/dist/chunks/{add-RBW7QITR.js → add-PERLOALD.js} +37 -23
- package/dist/chunks/{add-HPLJZFM2.js → add-WU2QYHYL.js} +23 -18
- package/dist/chunks/{build-V4ZLAJWB.js → build-F3J6FLPD.js} +23 -18
- package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
- package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
- package/dist/chunks/chunk-2TSBB22D.js +14059 -0
- package/dist/chunks/chunk-332LMJLZ.js +16014 -0
- package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
- package/dist/chunks/chunk-4IALDGB7.js +22 -0
- package/dist/chunks/chunk-4IVSM24H.js +522 -0
- package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
- package/dist/chunks/chunk-6E6KPBXY.js +43 -0
- package/dist/chunks/chunk-7KROIXQM.js +59 -0
- package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
- package/dist/chunks/chunk-A5JZS6ZN.js +92 -0
- package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
- package/dist/chunks/{chunk-26XDDLXM.js → chunk-ARU7VBKR.js} +2 -2
- package/dist/chunks/chunk-B5XLQKHI.js +849 -0
- package/dist/chunks/chunk-C762AAVU.js +137 -0
- package/dist/chunks/{chunk-WA2SJE5S.js → chunk-CEDN47PH.js} +4 -4
- package/dist/chunks/{chunk-ONRLTUP2.js → chunk-CNDPIHY5.js} +24 -22
- package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
- package/dist/chunks/chunk-DBYHS3CK.js +257 -0
- package/dist/chunks/{chunk-HDBQPBL6.js → chunk-DSTNNQVV.js} +12 -8
- package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
- package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-EPOLDWRA.js} +2 -2
- package/dist/chunks/{chunk-B4TXCKXE.js → chunk-EZQDYIVB.js} +10 -8
- package/dist/chunks/{chunk-2EAIC3SH.js → chunk-FL4JLNT2.js} +8 -8
- package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
- package/dist/chunks/{chunk-FKDO3CM4.js → chunk-FVNJTRCE.js} +17 -13
- package/dist/chunks/chunk-FVT74RZ5.js +1536 -0
- package/dist/chunks/chunk-G3PXSXIB.js +18188 -0
- package/dist/chunks/chunk-G5FBSUL4.js +822 -0
- package/dist/chunks/{chunk-FRAXI2WT.js → chunk-GCVXKRR5.js} +3 -3
- package/dist/chunks/chunk-GHKJAK5V.js +1288 -0
- package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-GUU4Z2AQ.js} +42 -28
- package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
- package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
- package/dist/chunks/chunk-HRXRELD3.js +338 -0
- package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
- package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
- package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
- package/dist/chunks/{chunk-RSEAADCE.js → chunk-KEKR7OCB.js} +6 -4
- package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
- package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
- package/dist/chunks/{chunk-RO44KX6Y.js → chunk-N4QHMXOO.js} +11 -7
- package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
- package/dist/chunks/{chunk-RSJBU3ON.js → chunk-NSOYO6JQ.js} +35 -27
- package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
- package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
- package/dist/chunks/{chunk-MTWHQEXI.js → chunk-OIH6FP5Y.js} +5 -3
- package/dist/chunks/chunk-P7VSBDR4.js +827 -0
- package/dist/chunks/chunk-PEC3CQSK.js +90 -0
- package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-PFM75KY3.js} +12 -8
- package/dist/chunks/chunk-PJXMXMCO.js +81 -0
- package/dist/chunks/chunk-PNGVSHR3.js +40 -0
- package/dist/chunks/{chunk-TPATD2MM.js → chunk-QHS645AZ.js} +14 -6
- package/dist/chunks/{chunk-OTXE7MHI.js → chunk-QKX7WKIN.js} +8 -6
- package/dist/chunks/chunk-QOPTXV4G.js +417 -0
- package/dist/chunks/chunk-RN6V5ODW.js +114 -0
- package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
- package/dist/chunks/chunk-SHFNEZVI.js +49 -0
- package/dist/chunks/{chunk-OO3OF6MK.js → chunk-TGNEG57M.js} +44 -15
- package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
- package/dist/chunks/chunk-UARGTFCT.js +875 -0
- package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
- package/dist/chunks/chunk-V4RMJKQP.js +36 -0
- package/dist/chunks/chunk-VT3Z7HF6.js +233 -0
- package/dist/chunks/chunk-VUS2JQB2.js +121 -0
- package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-VYC45Q4Z.js} +2 -2
- package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WL6QYSGD.js} +78 -17
- package/dist/chunks/{chunk-FZRBF25Y.js → chunk-X7DBBZQD.js} +4 -4
- package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-XD4DCYMX.js} +6 -6
- package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
- package/dist/chunks/{chunk-6TBDHUXK.js → chunk-XIFATBH5.js} +21 -15
- package/dist/chunks/chunk-XNIZGCN5.js +58 -0
- package/dist/chunks/chunk-XPJLPUKO.js +117 -0
- package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
- package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
- package/dist/chunks/chunk-Z7JWYFOY.js +58 -0
- package/dist/chunks/{chunk-6JPVTPTU.js → chunk-ZBEECGFD.js} +3 -3
- package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
- package/dist/chunks/chunk-ZW6HETRE.js +97 -0
- package/dist/chunks/{clear-IYGWCNXT.js → clear-XUQO4ZTK.js} +23 -18
- package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-D3ARNHTN.js} +8 -11
- package/dist/chunks/{config-6DS6BBR2.js → config-37OAE7QJ.js} +22 -17
- package/dist/chunks/{config-NTB5EMV4.js → config-MEDLXUVM.js} +23 -18
- package/dist/chunks/{delete-LLC2OGHA.js → delete-3N3YZZOF.js} +16 -12
- package/dist/chunks/{delete-LSGID5FV.js → delete-VSWDZ2SW.js} +19 -14
- package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
- package/dist/chunks/detect-services-TESZCQWG.js +40 -0
- package/dist/chunks/{disable-H4EXEQK7.js → disable-A4FLFMC7.js} +17 -13
- package/dist/chunks/{discard-FG6VKHWN.js → discard-CHGFULBZ.js} +17 -13
- package/dist/chunks/{edit-YE7D3CPJ.js → edit-JZ63AJYQ.js} +17 -13
- package/dist/chunks/{edit-BZJSGUHT.js → edit-MHSYAPDR.js} +19 -15
- package/dist/chunks/{enable-6ESD4QTE.js → enable-KD46SEC5.js} +17 -13
- package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
- package/dist/chunks/{export-QWSJROLG.js → export-42QZLBSN.js} +16 -13
- package/dist/chunks/{image-LTHQMKFG.js → image-GP4H73A2.js} +11 -8
- package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-6TBLMPL2.js} +18 -13
- package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-5FMWMY3C.js} +22 -18
- package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-MUVK6MMT.js} +18 -14
- package/dist/chunks/{inspect-F7KCTHIL.js → inspect-Q3DWW7MC.js} +22 -18
- package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-QFXAOUL4.js} +18 -14
- package/dist/chunks/{inspect-ICKNCDMT.js → inspect-RNTSYM6O.js} +18 -14
- package/dist/chunks/{list-NWTIJF3L.js → list-IHHIPXEC.js} +20 -16
- package/dist/chunks/{list-IPGQVBJO.js → list-JRNWLSO5.js} +16 -14
- package/dist/chunks/{list-DS7ZOUXA.js → list-XHD5DLEX.js} +23 -19
- package/dist/chunks/{login-F7A7ONKC.js → login-PCT6KFWY.js} +23 -18
- package/dist/chunks/{ls-NBDX3MKN.js → ls-GPEHEFCF.js} +24 -18
- package/dist/chunks/{ls-RNGO257R.js → ls-PF7F4PP4.js} +27 -23
- package/dist/chunks/{ls-XINES6PL.js → ls-PQZ2RIDX.js} +24 -18
- package/dist/chunks/{ls-D4TUDBIH.js → ls-SVOHC3XW.js} +24 -18
- package/dist/chunks/{ls-2QW3ZSM6.js → ls-TGHCCARZ.js} +24 -18
- package/dist/chunks/{ls-LSJEUPFX.js → ls-VRIH5WA3.js} +22 -15
- package/dist/chunks/{open-VRQDWZAW.js → open-E7DEKYDU.js} +18 -13
- package/dist/chunks/{permissions-6C5C7TEV.js → permissions-JKOONWVL.js} +14 -11
- package/dist/chunks/{publish-GVIZPNLN.js → publish-EDDELDE5.js} +17 -13
- package/dist/chunks/pull-646WEVDE.js +45 -0
- package/dist/chunks/{push-EFZ5P5Z6.js → push-LTNW5OVD.js} +23 -18
- package/dist/chunks/{query-GBS2PIT4.js → query-LU4N6KPO.js} +22 -19
- package/dist/chunks/{reorder-TN65IFRL.js → reorder-22PKJMZP.js} +17 -13
- package/dist/chunks/{reply-DYVEV3PY.js → reply-SF2EZMVZ.js} +17 -13
- package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZCZGXTOT.js} +16 -12
- package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
- package/dist/chunks/{restore-TJVMHUBQ.js → restore-VJAWZXB4.js} +17 -13
- package/dist/chunks/{rm-7XACNZ2U.js → rm-KN2QFCKO.js} +23 -18
- package/dist/chunks/{rm-REJVXALW.js → rm-KVEAJPRE.js} +23 -18
- package/dist/chunks/{rm-CBPNMSRP.js → rm-OSZ5FZUM.js} +23 -16
- package/dist/chunks/{rm-5B5VHWWN.js → rm-W722Q2AO.js} +21 -18
- package/dist/chunks/{rm-HQ5CYNJA.js → rm-WNPGTUBH.js} +23 -18
- package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
- package/dist/chunks/{rule-inspect-ZSTDDFID.js → rule-inspect-25Z6SNX3.js} +28 -24
- package/dist/chunks/{rules-VGV4M4KY.js → rules-65LKAQ35.js} +15 -12
- package/dist/chunks/{schema-45SJNY5L.js → schema-7D6IGJEJ.js} +9 -7
- package/dist/chunks/{schema-GMTQOQCV.js → schema-NXCW4M75.js} +19 -17
- package/dist/chunks/{set-Z5FO2FCC.js → set-FYJVKMPV.js} +20 -13
- package/dist/chunks/setup-and-link-KXPZE32P.js +65 -0
- package/dist/chunks/{tags-SDRXWJ63.js → tags-ANIRP5E3.js} +10 -7
- package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
- package/dist/chunks/{update-JBQBC3IV.js → update-UT6CTKVG.js} +32 -19
- package/dist/commands/build/index.js +86 -49
- package/dist/commands/deploy/index.js +75 -66
- package/dist/commands/dev/index.js +98 -52
- package/dist/commands/env/index.js +67 -43
- package/dist/commands/link/index.js +48 -27
- package/dist/commands/list/index.js +33 -22
- package/dist/commands-bulk.js +1659 -1287
- package/dist/index.js +62 -40
- package/dist/version.mjs +1 -1
- package/package.json +46 -46
- package/dist/chunks/chunk-WYU64FLP.js +0 -62123
- package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import {
|
|
8
|
+
require_dist as require_dist2,
|
|
9
|
+
require_dist2 as require_dist3
|
|
10
|
+
} from "./chunk-332LMJLZ.js";
|
|
11
|
+
import {
|
|
12
|
+
require_dist
|
|
13
|
+
} from "./chunk-G3PXSXIB.js";
|
|
14
|
+
import {
|
|
15
|
+
__commonJS,
|
|
16
|
+
__toESM
|
|
17
|
+
} from "./chunk-TZ2YI2VH.js";
|
|
18
|
+
|
|
19
|
+
// ../../internals/service-topology/dist/index.js
|
|
20
|
+
var require_dist4 = __commonJS({
|
|
21
|
+
"../../internals/service-topology/dist/index.js"(exports, module) {
|
|
22
|
+
"use strict";
|
|
23
|
+
var __defProp = Object.defineProperty;
|
|
24
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
25
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
26
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
27
|
+
var __export = (target, all) => {
|
|
28
|
+
for (var name in all)
|
|
29
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
30
|
+
};
|
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
+
for (let key of __getOwnPropNames(from))
|
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
};
|
|
39
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
|
+
var src_exports = {};
|
|
41
|
+
__export(src_exports, {
|
|
42
|
+
INTERNAL_SERVICE_PREFIX: () => import_fs_detectors2.INTERNAL_SERVICE_PREFIX,
|
|
43
|
+
autoDetectServices: () => import_fs_detectors2.autoDetectServices,
|
|
44
|
+
detectServices: () => import_fs_detectors2.detectServices,
|
|
45
|
+
generateServiceRewrites: () => import_fs_detectors2.generateServiceRewrites,
|
|
46
|
+
generateServicesRoutes: () => import_fs_detectors2.generateServicesRoutes,
|
|
47
|
+
getInternalServiceCronPath: () => import_fs_detectors2.getInternalServiceCronPath,
|
|
48
|
+
getInternalServiceCronPathPrefix: () => import_fs_detectors2.getInternalServiceCronPathPrefix,
|
|
49
|
+
getInternalServiceFunctionPath: () => import_fs_detectors2.getInternalServiceFunctionPath,
|
|
50
|
+
getInternalServiceWorkerPath: () => import_fs_detectors2.getInternalServiceWorkerPath,
|
|
51
|
+
getInternalServiceWorkerPathPrefix: () => import_fs_detectors2.getInternalServiceWorkerPathPrefix,
|
|
52
|
+
isExperimentalService: () => import_fs_detectors2.isExperimentalService,
|
|
53
|
+
isExperimentalServiceV2: () => import_fs_detectors2.isExperimentalServiceV2,
|
|
54
|
+
isRouteOwningBuilder: () => import_fs_detectors2.isRouteOwningBuilder,
|
|
55
|
+
isStaticBuild: () => import_fs_detectors2.isStaticBuild,
|
|
56
|
+
resolveAllConfiguredServicesV2: () => import_fs_detectors2.resolveAllConfiguredServicesV2,
|
|
57
|
+
resolveConfiguredServiceV2: () => import_fs_detectors2.resolveConfiguredServiceV2,
|
|
58
|
+
validateServiceConfigV2: () => import_fs_detectors2.validateServiceConfigV2
|
|
59
|
+
});
|
|
60
|
+
module.exports = __toCommonJS(src_exports);
|
|
61
|
+
var import_fs_detectors2 = require_dist3();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// src/util/validate-config.ts
|
|
66
|
+
var import_routing_utils = __toESM(require_dist2(), 1);
|
|
67
|
+
var import_client = __toESM(require_dist(), 1);
|
|
68
|
+
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
69
|
+
import {
|
|
70
|
+
getFunctionsSchema,
|
|
71
|
+
buildsSchema,
|
|
72
|
+
getMaxDurationSchema,
|
|
73
|
+
NowBuildError,
|
|
74
|
+
getPrettyError
|
|
75
|
+
} from "@vercel/build-utils";
|
|
76
|
+
import { getConfigValidator } from "./config-validator.mjs";
|
|
77
|
+
var imagesSchema = {
|
|
78
|
+
type: "object",
|
|
79
|
+
additionalProperties: false,
|
|
80
|
+
required: ["sizes"],
|
|
81
|
+
properties: {
|
|
82
|
+
contentDispositionType: {
|
|
83
|
+
enum: ["inline", "attachment"]
|
|
84
|
+
},
|
|
85
|
+
contentSecurityPolicy: {
|
|
86
|
+
type: "string",
|
|
87
|
+
minLength: 1,
|
|
88
|
+
maxLength: 256
|
|
89
|
+
},
|
|
90
|
+
dangerouslyAllowSVG: {
|
|
91
|
+
type: "boolean"
|
|
92
|
+
},
|
|
93
|
+
domains: {
|
|
94
|
+
type: "array",
|
|
95
|
+
minItems: 0,
|
|
96
|
+
maxItems: 50,
|
|
97
|
+
items: {
|
|
98
|
+
type: "string",
|
|
99
|
+
minLength: 1,
|
|
100
|
+
maxLength: 256
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
formats: {
|
|
104
|
+
type: "array",
|
|
105
|
+
minItems: 1,
|
|
106
|
+
maxItems: 4,
|
|
107
|
+
items: {
|
|
108
|
+
enum: ["image/avif", "image/webp", "image/jpeg", "image/png"]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
localPatterns: {
|
|
112
|
+
type: "array",
|
|
113
|
+
minItems: 0,
|
|
114
|
+
maxItems: 25,
|
|
115
|
+
items: {
|
|
116
|
+
type: "object",
|
|
117
|
+
additionalProperties: false,
|
|
118
|
+
properties: {
|
|
119
|
+
pathname: {
|
|
120
|
+
type: "string",
|
|
121
|
+
minLength: 1,
|
|
122
|
+
maxLength: 256
|
|
123
|
+
},
|
|
124
|
+
search: {
|
|
125
|
+
type: "string",
|
|
126
|
+
minLength: 0,
|
|
127
|
+
maxLength: 256
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
minimumCacheTTL: {
|
|
133
|
+
type: "integer",
|
|
134
|
+
minimum: 1,
|
|
135
|
+
maximum: 31536e4
|
|
136
|
+
},
|
|
137
|
+
qualities: {
|
|
138
|
+
type: "array",
|
|
139
|
+
minItems: 1,
|
|
140
|
+
maxItems: 20,
|
|
141
|
+
items: {
|
|
142
|
+
type: "integer",
|
|
143
|
+
minimum: 1,
|
|
144
|
+
maximum: 100
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
remotePatterns: {
|
|
148
|
+
type: "array",
|
|
149
|
+
minItems: 0,
|
|
150
|
+
maxItems: 50,
|
|
151
|
+
items: {
|
|
152
|
+
type: "object",
|
|
153
|
+
additionalProperties: false,
|
|
154
|
+
required: ["hostname"],
|
|
155
|
+
properties: {
|
|
156
|
+
protocol: {
|
|
157
|
+
enum: ["http", "https"]
|
|
158
|
+
},
|
|
159
|
+
hostname: {
|
|
160
|
+
type: "string",
|
|
161
|
+
minLength: 1,
|
|
162
|
+
maxLength: 256
|
|
163
|
+
},
|
|
164
|
+
port: {
|
|
165
|
+
type: "string",
|
|
166
|
+
minLength: 0,
|
|
167
|
+
maxLength: 5
|
|
168
|
+
},
|
|
169
|
+
pathname: {
|
|
170
|
+
type: "string",
|
|
171
|
+
minLength: 1,
|
|
172
|
+
maxLength: 256
|
|
173
|
+
},
|
|
174
|
+
search: {
|
|
175
|
+
type: "string",
|
|
176
|
+
minLength: 0,
|
|
177
|
+
maxLength: 256
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
sizes: {
|
|
183
|
+
type: "array",
|
|
184
|
+
minItems: 1,
|
|
185
|
+
maxItems: 50,
|
|
186
|
+
items: {
|
|
187
|
+
type: "number"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
var cronsSchema = {
|
|
193
|
+
type: "array",
|
|
194
|
+
minItems: 0,
|
|
195
|
+
items: {
|
|
196
|
+
type: "object",
|
|
197
|
+
additionalProperties: false,
|
|
198
|
+
required: ["path", "schedule"],
|
|
199
|
+
properties: {
|
|
200
|
+
path: {
|
|
201
|
+
type: "string",
|
|
202
|
+
minLength: 1,
|
|
203
|
+
maxLength: 512,
|
|
204
|
+
pattern: "^/.*"
|
|
205
|
+
},
|
|
206
|
+
schedule: {
|
|
207
|
+
type: "string",
|
|
208
|
+
minLength: 9,
|
|
209
|
+
maxLength: 256
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var schedulesSchema = {
|
|
215
|
+
type: "array",
|
|
216
|
+
minItems: 0,
|
|
217
|
+
maxItems: 100,
|
|
218
|
+
items: {
|
|
219
|
+
type: "object",
|
|
220
|
+
additionalProperties: false,
|
|
221
|
+
required: ["expression", "target", "name"],
|
|
222
|
+
properties: {
|
|
223
|
+
expression: {
|
|
224
|
+
type: "object",
|
|
225
|
+
additionalProperties: false,
|
|
226
|
+
required: ["cron"],
|
|
227
|
+
properties: {
|
|
228
|
+
cron: {
|
|
229
|
+
type: "string"
|
|
230
|
+
},
|
|
231
|
+
jitter: {
|
|
232
|
+
type: "string",
|
|
233
|
+
minLength: 1,
|
|
234
|
+
maxLength: 256
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
target: {
|
|
239
|
+
oneOf: [
|
|
240
|
+
{
|
|
241
|
+
type: "object",
|
|
242
|
+
additionalProperties: false,
|
|
243
|
+
required: ["function"],
|
|
244
|
+
properties: {
|
|
245
|
+
function: {
|
|
246
|
+
type: "string",
|
|
247
|
+
minLength: 1
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: "object",
|
|
253
|
+
additionalProperties: false,
|
|
254
|
+
required: ["topic"],
|
|
255
|
+
properties: {
|
|
256
|
+
topic: {
|
|
257
|
+
type: "string",
|
|
258
|
+
minLength: 1,
|
|
259
|
+
maxLength: 256
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
name: {
|
|
266
|
+
type: "string",
|
|
267
|
+
minLength: 1,
|
|
268
|
+
maxLength: 256
|
|
269
|
+
},
|
|
270
|
+
payload: {}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
var experimentalServicesMountSchema = {
|
|
275
|
+
oneOf: [
|
|
276
|
+
{
|
|
277
|
+
type: "string",
|
|
278
|
+
minLength: 1,
|
|
279
|
+
maxLength: 512
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: "object",
|
|
283
|
+
additionalProperties: false,
|
|
284
|
+
properties: {
|
|
285
|
+
path: {
|
|
286
|
+
type: "string",
|
|
287
|
+
minLength: 1,
|
|
288
|
+
maxLength: 512
|
|
289
|
+
},
|
|
290
|
+
subdomain: {
|
|
291
|
+
type: "string",
|
|
292
|
+
minLength: 1,
|
|
293
|
+
maxLength: 63
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
anyOf: [{ required: ["path"] }, { required: ["subdomain"] }]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
};
|
|
300
|
+
var staticExperimentalServiceScheduleSchema = {
|
|
301
|
+
type: "string",
|
|
302
|
+
minLength: 9,
|
|
303
|
+
maxLength: 256,
|
|
304
|
+
not: { const: "<dynamic>" }
|
|
305
|
+
};
|
|
306
|
+
var experimentalServiceScheduleSchema = {
|
|
307
|
+
oneOf: [
|
|
308
|
+
{
|
|
309
|
+
type: "string",
|
|
310
|
+
minLength: 9,
|
|
311
|
+
maxLength: 256
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
type: "array",
|
|
315
|
+
minItems: 1,
|
|
316
|
+
items: staticExperimentalServiceScheduleSchema
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
};
|
|
320
|
+
var experimentalServiceQueueTopicSchema = {
|
|
321
|
+
type: "object",
|
|
322
|
+
additionalProperties: false,
|
|
323
|
+
required: ["topic"],
|
|
324
|
+
properties: {
|
|
325
|
+
topic: {
|
|
326
|
+
type: "string",
|
|
327
|
+
minLength: 1,
|
|
328
|
+
maxLength: 256
|
|
329
|
+
},
|
|
330
|
+
retryAfterSeconds: {
|
|
331
|
+
type: "integer",
|
|
332
|
+
minimum: 1,
|
|
333
|
+
maximum: 86400
|
|
334
|
+
},
|
|
335
|
+
initialDelaySeconds: {
|
|
336
|
+
type: "integer",
|
|
337
|
+
minimum: 0,
|
|
338
|
+
maximum: 86400
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
var experimentalServiceTopicsSchema = {
|
|
343
|
+
oneOf: [
|
|
344
|
+
{
|
|
345
|
+
type: "array",
|
|
346
|
+
minItems: 1,
|
|
347
|
+
items: {
|
|
348
|
+
type: "string",
|
|
349
|
+
minLength: 1,
|
|
350
|
+
maxLength: 256
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
type: "array",
|
|
355
|
+
minItems: 1,
|
|
356
|
+
items: experimentalServiceQueueTopicSchema
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
};
|
|
360
|
+
var envVarNamesSchema = {
|
|
361
|
+
pattern: "^[A-Za-z_][A-Za-z0-9_]*$",
|
|
362
|
+
maxLength: 256
|
|
363
|
+
};
|
|
364
|
+
var getExperimentalServicesCommonProperties = () => ({
|
|
365
|
+
entrypoint: {
|
|
366
|
+
type: "string",
|
|
367
|
+
minLength: 1,
|
|
368
|
+
maxLength: 512
|
|
369
|
+
},
|
|
370
|
+
root: {
|
|
371
|
+
type: "string",
|
|
372
|
+
minLength: 1,
|
|
373
|
+
maxLength: 512
|
|
374
|
+
},
|
|
375
|
+
workspace: {
|
|
376
|
+
type: "string",
|
|
377
|
+
minLength: 1,
|
|
378
|
+
maxLength: 512
|
|
379
|
+
},
|
|
380
|
+
framework: {
|
|
381
|
+
type: "string",
|
|
382
|
+
minLength: 1,
|
|
383
|
+
maxLength: 256
|
|
384
|
+
},
|
|
385
|
+
builder: {
|
|
386
|
+
type: "string",
|
|
387
|
+
minLength: 1,
|
|
388
|
+
maxLength: 256
|
|
389
|
+
},
|
|
390
|
+
runtime: {
|
|
391
|
+
type: "string",
|
|
392
|
+
minLength: 1,
|
|
393
|
+
maxLength: 256
|
|
394
|
+
},
|
|
395
|
+
buildCommand: {
|
|
396
|
+
type: "string",
|
|
397
|
+
minLength: 1,
|
|
398
|
+
maxLength: 2048
|
|
399
|
+
},
|
|
400
|
+
installCommand: {
|
|
401
|
+
type: "string",
|
|
402
|
+
minLength: 1,
|
|
403
|
+
maxLength: 2048
|
|
404
|
+
},
|
|
405
|
+
preDeployCommand: {
|
|
406
|
+
type: "string",
|
|
407
|
+
minLength: 1,
|
|
408
|
+
maxLength: 2048
|
|
409
|
+
},
|
|
410
|
+
command: {
|
|
411
|
+
oneOf: [
|
|
412
|
+
{ type: "string", minLength: 1, maxLength: 2048 },
|
|
413
|
+
{
|
|
414
|
+
type: "array",
|
|
415
|
+
minItems: 1,
|
|
416
|
+
items: { type: "string", minLength: 1, maxLength: 2048 }
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
memory: {
|
|
421
|
+
type: "integer",
|
|
422
|
+
minimum: 128,
|
|
423
|
+
maximum: 10240
|
|
424
|
+
},
|
|
425
|
+
maxDuration: getMaxDurationSchema(),
|
|
426
|
+
includeFiles: {
|
|
427
|
+
oneOf: [
|
|
428
|
+
{ type: "string", minLength: 1 },
|
|
429
|
+
{
|
|
430
|
+
type: "array",
|
|
431
|
+
items: { type: "string", minLength: 1 }
|
|
432
|
+
}
|
|
433
|
+
]
|
|
434
|
+
},
|
|
435
|
+
excludeFiles: {
|
|
436
|
+
oneOf: [
|
|
437
|
+
{ type: "string", minLength: 1 },
|
|
438
|
+
{
|
|
439
|
+
type: "array",
|
|
440
|
+
items: { type: "string", minLength: 1 }
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
var experimentalServicesRoutableProperties = {
|
|
446
|
+
mount: experimentalServicesMountSchema,
|
|
447
|
+
routePrefix: {
|
|
448
|
+
type: "string",
|
|
449
|
+
minLength: 1,
|
|
450
|
+
maxLength: 512
|
|
451
|
+
},
|
|
452
|
+
subdomain: {
|
|
453
|
+
type: "string",
|
|
454
|
+
minLength: 1,
|
|
455
|
+
maxLength: 63
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var getExperimentalServicesServiceConfigSchema = () => ({
|
|
459
|
+
oneOf: [
|
|
460
|
+
{
|
|
461
|
+
type: "object",
|
|
462
|
+
additionalProperties: false,
|
|
463
|
+
properties: {
|
|
464
|
+
...getExperimentalServicesCommonProperties(),
|
|
465
|
+
...experimentalServicesRoutableProperties,
|
|
466
|
+
type: {
|
|
467
|
+
enum: ["web"]
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
type: "object",
|
|
473
|
+
additionalProperties: false,
|
|
474
|
+
required: ["type", "trigger", "schedule"],
|
|
475
|
+
properties: {
|
|
476
|
+
...getExperimentalServicesCommonProperties(),
|
|
477
|
+
type: {
|
|
478
|
+
const: "job"
|
|
479
|
+
},
|
|
480
|
+
trigger: {
|
|
481
|
+
const: "schedule"
|
|
482
|
+
},
|
|
483
|
+
schedule: experimentalServiceScheduleSchema
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
type: "object",
|
|
488
|
+
additionalProperties: false,
|
|
489
|
+
required: ["type", "trigger", "topics"],
|
|
490
|
+
properties: {
|
|
491
|
+
...getExperimentalServicesCommonProperties(),
|
|
492
|
+
type: {
|
|
493
|
+
const: "job"
|
|
494
|
+
},
|
|
495
|
+
trigger: {
|
|
496
|
+
const: "queue"
|
|
497
|
+
},
|
|
498
|
+
topics: experimentalServiceTopicsSchema,
|
|
499
|
+
consumer: {
|
|
500
|
+
type: "string",
|
|
501
|
+
minLength: 1,
|
|
502
|
+
maxLength: 256
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
type: "object",
|
|
508
|
+
additionalProperties: false,
|
|
509
|
+
required: ["type", "trigger", "entrypoint"],
|
|
510
|
+
properties: {
|
|
511
|
+
...getExperimentalServicesCommonProperties(),
|
|
512
|
+
type: {
|
|
513
|
+
const: "job"
|
|
514
|
+
},
|
|
515
|
+
trigger: {
|
|
516
|
+
const: "workflow"
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
type: "object",
|
|
522
|
+
additionalProperties: false,
|
|
523
|
+
required: ["type"],
|
|
524
|
+
properties: {
|
|
525
|
+
...getExperimentalServicesCommonProperties(),
|
|
526
|
+
type: {
|
|
527
|
+
const: "worker"
|
|
528
|
+
},
|
|
529
|
+
topics: {
|
|
530
|
+
type: "array",
|
|
531
|
+
items: {
|
|
532
|
+
type: "string",
|
|
533
|
+
minLength: 1,
|
|
534
|
+
maxLength: 256
|
|
535
|
+
},
|
|
536
|
+
minItems: 1
|
|
537
|
+
},
|
|
538
|
+
consumer: {
|
|
539
|
+
type: "string",
|
|
540
|
+
minLength: 1,
|
|
541
|
+
maxLength: 256
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
type: "object",
|
|
547
|
+
additionalProperties: false,
|
|
548
|
+
required: ["type", "schedule"],
|
|
549
|
+
properties: {
|
|
550
|
+
...getExperimentalServicesCommonProperties(),
|
|
551
|
+
type: {
|
|
552
|
+
const: "cron"
|
|
553
|
+
},
|
|
554
|
+
schedule: experimentalServiceScheduleSchema
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
]
|
|
558
|
+
});
|
|
559
|
+
var getExperimentalServicesSchema = () => ({
|
|
560
|
+
type: "object",
|
|
561
|
+
propertyNames: {
|
|
562
|
+
pattern: "^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",
|
|
563
|
+
maxLength: 64
|
|
564
|
+
},
|
|
565
|
+
additionalProperties: getExperimentalServicesServiceConfigSchema()
|
|
566
|
+
});
|
|
567
|
+
var experimentalServiceGroupsSchema = {
|
|
568
|
+
type: "object",
|
|
569
|
+
propertyNames: {
|
|
570
|
+
pattern: "^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",
|
|
571
|
+
maxLength: 64
|
|
572
|
+
},
|
|
573
|
+
additionalProperties: {
|
|
574
|
+
type: "array",
|
|
575
|
+
items: {
|
|
576
|
+
type: "string",
|
|
577
|
+
minLength: 1,
|
|
578
|
+
maxLength: 256
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
var servicesPathSchema = {
|
|
583
|
+
type: "string",
|
|
584
|
+
minLength: 1,
|
|
585
|
+
maxLength: 512
|
|
586
|
+
};
|
|
587
|
+
var servicesCommandSchema = {
|
|
588
|
+
type: "string",
|
|
589
|
+
minLength: 1,
|
|
590
|
+
maxLength: 2048
|
|
591
|
+
};
|
|
592
|
+
var servicesServiceNamePattern = "^[a-z]([a-z_-]*[a-z])?$";
|
|
593
|
+
var servicesBindingSchema = {
|
|
594
|
+
type: "object",
|
|
595
|
+
additionalProperties: false,
|
|
596
|
+
required: ["service", "format", "env"],
|
|
597
|
+
properties: {
|
|
598
|
+
type: {
|
|
599
|
+
description: "Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",
|
|
600
|
+
const: "service"
|
|
601
|
+
},
|
|
602
|
+
service: {
|
|
603
|
+
type: "string",
|
|
604
|
+
minLength: 1,
|
|
605
|
+
maxLength: 64,
|
|
606
|
+
pattern: servicesServiceNamePattern
|
|
607
|
+
},
|
|
608
|
+
format: { const: "url" },
|
|
609
|
+
env: {
|
|
610
|
+
type: "string",
|
|
611
|
+
...envVarNamesSchema
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
var servicesBindingsSchema = {
|
|
616
|
+
type: "array",
|
|
617
|
+
maxItems: 100,
|
|
618
|
+
items: servicesBindingSchema
|
|
619
|
+
};
|
|
620
|
+
var getServicesServiceConfigSchema = () => ({
|
|
621
|
+
type: "object",
|
|
622
|
+
additionalProperties: false,
|
|
623
|
+
required: ["root"],
|
|
624
|
+
properties: {
|
|
625
|
+
root: servicesPathSchema,
|
|
626
|
+
framework: {
|
|
627
|
+
type: "string",
|
|
628
|
+
minLength: 1,
|
|
629
|
+
maxLength: 256
|
|
630
|
+
},
|
|
631
|
+
runtime: {
|
|
632
|
+
type: "string",
|
|
633
|
+
minLength: 1,
|
|
634
|
+
maxLength: 256
|
|
635
|
+
},
|
|
636
|
+
entrypoint: servicesPathSchema,
|
|
637
|
+
command: {
|
|
638
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
639
|
+
},
|
|
640
|
+
installCommand: servicesCommandSchema,
|
|
641
|
+
buildCommand: servicesCommandSchema,
|
|
642
|
+
devCommand: servicesCommandSchema,
|
|
643
|
+
ignoreCommand: servicesCommandSchema,
|
|
644
|
+
outputDirectory: servicesPathSchema,
|
|
645
|
+
bindings: servicesBindingsSchema,
|
|
646
|
+
functions: getFunctionsSchema(),
|
|
647
|
+
headers: import_routing_utils.headersSchema,
|
|
648
|
+
redirects: import_routing_utils.redirectsSchema,
|
|
649
|
+
rewrites: import_routing_utils.rewritesSchema,
|
|
650
|
+
routes: import_routing_utils.routesSchema,
|
|
651
|
+
cleanUrls: import_routing_utils.cleanUrlsSchema,
|
|
652
|
+
trailingSlash: import_routing_utils.trailingSlashSchema
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
var getServicesSchema = () => ({
|
|
656
|
+
type: "object",
|
|
657
|
+
propertyNames: {
|
|
658
|
+
pattern: servicesServiceNamePattern,
|
|
659
|
+
maxLength: 64
|
|
660
|
+
},
|
|
661
|
+
additionalProperties: getServicesServiceConfigSchema()
|
|
662
|
+
});
|
|
663
|
+
var proxySchema = {
|
|
664
|
+
type: "object",
|
|
665
|
+
additionalProperties: false,
|
|
666
|
+
required: ["entrypoint"],
|
|
667
|
+
properties: {
|
|
668
|
+
entrypoint: {
|
|
669
|
+
type: "string",
|
|
670
|
+
minLength: 1
|
|
671
|
+
},
|
|
672
|
+
matcher: {
|
|
673
|
+
oneOf: [
|
|
674
|
+
{
|
|
675
|
+
type: "string",
|
|
676
|
+
minLength: 1
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
type: "array",
|
|
680
|
+
minItems: 1,
|
|
681
|
+
items: {
|
|
682
|
+
type: "string",
|
|
683
|
+
minLength: 1
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
]
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
function buildVercelConfigSchema() {
|
|
691
|
+
return {
|
|
692
|
+
type: "object",
|
|
693
|
+
// These are not all possibilities because `vc dev`
|
|
694
|
+
// doesn't need to know about `regions`, `public`, etc.
|
|
695
|
+
additionalProperties: true,
|
|
696
|
+
properties: {
|
|
697
|
+
builds: buildsSchema,
|
|
698
|
+
routes: import_routing_utils.routesSchema,
|
|
699
|
+
cleanUrls: import_routing_utils.cleanUrlsSchema,
|
|
700
|
+
headers: import_routing_utils.headersSchema,
|
|
701
|
+
redirects: import_routing_utils.redirectsSchema,
|
|
702
|
+
rewrites: import_routing_utils.rewritesSchema,
|
|
703
|
+
trailingSlash: import_routing_utils.trailingSlashSchema,
|
|
704
|
+
functions: getFunctionsSchema(),
|
|
705
|
+
images: imagesSchema,
|
|
706
|
+
crons: cronsSchema,
|
|
707
|
+
schedules: schedulesSchema,
|
|
708
|
+
bunVersion: { type: "string" },
|
|
709
|
+
proxy: proxySchema,
|
|
710
|
+
experimentalServices: getExperimentalServicesSchema(),
|
|
711
|
+
experimentalServiceGroups: experimentalServiceGroupsSchema,
|
|
712
|
+
services: getServicesSchema(),
|
|
713
|
+
experimentalServicesV2: getServicesSchema()
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
function validateConfig(config) {
|
|
718
|
+
const validate = getConfigValidator(buildVercelConfigSchema);
|
|
719
|
+
if (!validate(config)) {
|
|
720
|
+
if (validate.errors && validate.errors[0]) {
|
|
721
|
+
const error = validate.errors[0];
|
|
722
|
+
const fileName = config[import_client.fileNameSymbol] || "vercel.json";
|
|
723
|
+
const niceError = getPrettyError(error);
|
|
724
|
+
niceError.message = `Invalid ${fileName} - ${niceError.message}`;
|
|
725
|
+
return niceError;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
for (const [pattern, fn] of Object.entries(config.functions ?? {})) {
|
|
729
|
+
if (fn.affinity !== void 0) {
|
|
730
|
+
return new NowBuildError({
|
|
731
|
+
code: "FUNCTION_AFFINITY_REQUIRES_SERVICE",
|
|
732
|
+
message: `Function affinity can only be configured under a service. Move functions[${JSON.stringify(
|
|
733
|
+
pattern
|
|
734
|
+
)}].affinity into the relevant service's functions configuration.`,
|
|
735
|
+
link: "https://vercel.com/docs/concepts/projects/project-configuration#functions"
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
const functionMaps = [
|
|
740
|
+
config.functions,
|
|
741
|
+
...Object.values(config.services ?? {}).map((service) => service.functions),
|
|
742
|
+
...Object.values(config.experimentalServicesV2 ?? {}).map(
|
|
743
|
+
(service) => service.functions
|
|
744
|
+
)
|
|
745
|
+
];
|
|
746
|
+
for (const functions of functionMaps) {
|
|
747
|
+
for (const [pattern, fn] of Object.entries(functions ?? {})) {
|
|
748
|
+
const regions = [...new Set(fn.regions)];
|
|
749
|
+
if (fn.affinity?.mode === "strict" && (regions.includes("all") || regions.length > 1)) {
|
|
750
|
+
return new NowBuildError({
|
|
751
|
+
code: "INVALID_FUNCTION_AFFINITY_REGIONS",
|
|
752
|
+
message: `Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(
|
|
753
|
+
pattern
|
|
754
|
+
)}].regions\` to contain a single region.`,
|
|
755
|
+
link: "https://vercel.com/docs/concepts/projects/project-configuration#functions"
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
if (config.proxy) {
|
|
761
|
+
const proxyError = (0, import_fs_detectors.validateProxyConfig)(config.proxy);
|
|
762
|
+
if (proxyError) {
|
|
763
|
+
return new NowBuildError({
|
|
764
|
+
code: proxyError.code.toUpperCase(),
|
|
765
|
+
message: proxyError.message
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
if (config.functions && config.builds) {
|
|
770
|
+
return new NowBuildError({
|
|
771
|
+
code: "FUNCTIONS_AND_BUILDS",
|
|
772
|
+
message: "The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",
|
|
773
|
+
link: "https://vercel.link/functions-and-builds"
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
if (config.proxy && config.builds) {
|
|
777
|
+
return new NowBuildError({
|
|
778
|
+
code: "PROXY_AND_BUILDS",
|
|
779
|
+
message: "The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
const hasExperimentalServices = Boolean(config.experimentalServices);
|
|
783
|
+
if (hasExperimentalServices && config.builds) {
|
|
784
|
+
return new NowBuildError({
|
|
785
|
+
code: "EXPERIMENTAL_SERVICES_AND_BUILDS",
|
|
786
|
+
message: "The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
if (hasExperimentalServices && config.functions) {
|
|
790
|
+
return new NowBuildError({
|
|
791
|
+
code: "EXPERIMENTAL_SERVICES_AND_FUNCTIONS",
|
|
792
|
+
message: "The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
if (config.experimentalServiceGroups && !config.experimentalServices) {
|
|
796
|
+
return new NowBuildError({
|
|
797
|
+
code: "SERVICE_GROUPS_WITHOUT_SERVICES",
|
|
798
|
+
message: "The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
const hasServices = config.services != null;
|
|
802
|
+
const hasExperimentalServicesV2 = config.experimentalServicesV2 != null;
|
|
803
|
+
if (hasServices && hasExperimentalServicesV2) {
|
|
804
|
+
return new NowBuildError({
|
|
805
|
+
code: "SERVICES_AND_EXPERIMENTAL_SERVICES_V2",
|
|
806
|
+
message: "The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
const servicesConfig = config.services ?? config.experimentalServicesV2;
|
|
810
|
+
const servicesConfigKey = hasServices ? "services" : "experimentalServicesV2";
|
|
811
|
+
const servicesErrorCodePrefix = hasServices ? "SERVICES" : "EXPERIMENTAL_SERVICES_V2";
|
|
812
|
+
if (servicesConfig && hasExperimentalServices) {
|
|
813
|
+
return new NowBuildError({
|
|
814
|
+
code: `${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,
|
|
815
|
+
message: `The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
if (servicesConfig && config.builds) {
|
|
819
|
+
return new NowBuildError({
|
|
820
|
+
code: `${servicesErrorCodePrefix}_AND_BUILDS`,
|
|
821
|
+
message: `The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
if (servicesConfig) {
|
|
825
|
+
const ambiguousTopLevel = [];
|
|
826
|
+
if (config.functions != null) {
|
|
827
|
+
ambiguousTopLevel.push("functions");
|
|
828
|
+
}
|
|
829
|
+
if (config.installCommand != null) {
|
|
830
|
+
ambiguousTopLevel.push("installCommand");
|
|
831
|
+
}
|
|
832
|
+
if (config.buildCommand != null) {
|
|
833
|
+
ambiguousTopLevel.push("buildCommand");
|
|
834
|
+
}
|
|
835
|
+
if (config.devCommand != null) {
|
|
836
|
+
ambiguousTopLevel.push("devCommand");
|
|
837
|
+
}
|
|
838
|
+
if (config.ignoreCommand != null) {
|
|
839
|
+
ambiguousTopLevel.push("ignoreCommand");
|
|
840
|
+
}
|
|
841
|
+
if (config.outputDirectory != null) {
|
|
842
|
+
ambiguousTopLevel.push("outputDirectory");
|
|
843
|
+
}
|
|
844
|
+
if (config.framework != null) {
|
|
845
|
+
ambiguousTopLevel.push("framework");
|
|
846
|
+
}
|
|
847
|
+
if (ambiguousTopLevel.length > 0) {
|
|
848
|
+
const count = ambiguousTopLevel.length;
|
|
849
|
+
const fields = ambiguousTopLevel.map((field) => `\`${field}\``).join(", ");
|
|
850
|
+
return new NowBuildError({
|
|
851
|
+
code: `${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,
|
|
852
|
+
message: `The top-level ${count > 1 ? "properties" : "property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count > 1 ? "them" : "it"} under the relevant service in \`${servicesConfigKey}\`.`
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (servicesConfig) {
|
|
857
|
+
const serviceNames = new Set(Object.keys(servicesConfig));
|
|
858
|
+
for (const [serviceName, serviceConfig] of Object.entries(servicesConfig)) {
|
|
859
|
+
for (const binding of serviceConfig.bindings ?? []) {
|
|
860
|
+
if (!serviceNames.has(binding.service)) {
|
|
861
|
+
return new NowBuildError({
|
|
862
|
+
code: `${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,
|
|
863
|
+
message: `Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export {
|
|
873
|
+
require_dist4 as require_dist,
|
|
874
|
+
validateConfig
|
|
875
|
+
};
|