@vercel/build-utils 13.28.0 → 13.29.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,15 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8d8e871: Evaluate the `maxDuration` upper bound at validation time so `VERCEL_CLI_SKIP_MAX_DURATION_LIMIT` works regardless of import order.
8
+
9
+ The gate was read when `@vercel/build-utils`' `functionsSchema` was constructed and when the CLI compiled its `vercel.json` validator — both at module load. Any process that imports these modules before setting the env var baked in the default 900-second maximum and ignored the flag, failing with `Invalid vercel.json - functions[...].maxDuration should be <= 900`.
10
+
11
+ `@vercel/build-utils` now exposes `getFunctionsSchema()`, which reads the limit at call time (the existing `functionsSchema` const is kept but deprecated). The CLI builds and compiles its config validator lazily, caching one validator per resolved limit, so setting the variable after import takes effect. Default behavior is unchanged — the 900s maximum, the lower bound, and the integer check are all still enforced when the variable is unset.
12
+
3
13
  ## 13.28.0
4
14
 
5
15
  ### Minor Changes
package/dist/index.js CHANGED
@@ -34562,6 +34562,7 @@ __export(src_exports, {
34562
34562
  getEncryptedEnv: () => getEncryptedEnv,
34563
34563
  getEnvForPackageManager: () => getEnvForPackageManager,
34564
34564
  getExperimentalServiceUrlEnvVars: () => getExperimentalServiceUrlEnvVars,
34565
+ getFunctionsSchema: () => getFunctionsSchema,
34565
34566
  getIgnoreFilter: () => get_ignore_filter_default,
34566
34567
  getInstalledPackageVersion: () => getInstalledPackageVersion,
34567
34568
  getInternalServiceCronPath: () => getInternalServiceCronPath,
@@ -38351,7 +38352,7 @@ var triggerEventSchemaV2 = {
38351
38352
  var triggerEventSchema = {
38352
38353
  oneOf: [triggerEventSchemaV1, triggerEventSchemaV2]
38353
38354
  };
38354
- var functionsSchema = {
38355
+ var getFunctionsSchema = () => ({
38355
38356
  type: "object",
38356
38357
  minProperties: 1,
38357
38358
  maxProperties: 50,
@@ -38404,7 +38405,8 @@ var functionsSchema = {
38404
38405
  }
38405
38406
  }
38406
38407
  }
38407
- };
38408
+ });
38409
+ var functionsSchema = getFunctionsSchema();
38408
38410
  var buildsSchema = {
38409
38411
  type: "array",
38410
38412
  minItems: 0,
@@ -40616,6 +40618,7 @@ function getExtendedPayload({
40616
40618
  getEncryptedEnv,
40617
40619
  getEnvForPackageManager,
40618
40620
  getExperimentalServiceUrlEnvVars,
40621
+ getFunctionsSchema,
40619
40622
  getIgnoreFilter,
40620
40623
  getInstalledPackageVersion,
40621
40624
  getInternalServiceCronPath,
package/dist/schemas.d.ts CHANGED
@@ -1,3 +1,105 @@
1
+ export declare const getFunctionsSchema: () => {
2
+ type: string;
3
+ minProperties: number;
4
+ maxProperties: number;
5
+ additionalProperties: boolean;
6
+ patternProperties: {
7
+ '^.{1,256}$': {
8
+ type: string;
9
+ additionalProperties: boolean;
10
+ properties: {
11
+ architecture: {
12
+ type: string;
13
+ enum: string[];
14
+ };
15
+ runtime: {
16
+ type: string;
17
+ maxLength: number;
18
+ };
19
+ memory: {
20
+ minimum: number;
21
+ maximum: number;
22
+ };
23
+ maxDuration: {
24
+ oneOf: ({
25
+ maximum?: number | undefined;
26
+ type: string;
27
+ minimum: number;
28
+ enum?: undefined;
29
+ } | {
30
+ type: string;
31
+ enum: string[];
32
+ })[];
33
+ };
34
+ regions: {
35
+ type: string;
36
+ items: {
37
+ type: string;
38
+ };
39
+ };
40
+ functionFailoverRegions: {
41
+ type: string;
42
+ items: {
43
+ type: string;
44
+ };
45
+ };
46
+ includeFiles: {
47
+ type: string;
48
+ maxLength: number;
49
+ };
50
+ excludeFiles: {
51
+ type: string;
52
+ maxLength: number;
53
+ };
54
+ experimentalTriggers: {
55
+ type: string;
56
+ items: {
57
+ oneOf: {
58
+ type: string;
59
+ properties: {
60
+ type: {
61
+ type: string;
62
+ const: string;
63
+ };
64
+ topic: {
65
+ type: string;
66
+ minLength: number;
67
+ };
68
+ maxDeliveries: {
69
+ type: string;
70
+ minimum: number;
71
+ };
72
+ retryAfterSeconds: {
73
+ type: string;
74
+ exclusiveMinimum: number;
75
+ };
76
+ initialDelaySeconds: {
77
+ type: string;
78
+ minimum: number;
79
+ };
80
+ maxConcurrency: {
81
+ type: string;
82
+ minimum: number;
83
+ };
84
+ };
85
+ required: string[];
86
+ additionalProperties: boolean;
87
+ }[];
88
+ };
89
+ };
90
+ supportsCancellation: {
91
+ type: string;
92
+ };
93
+ };
94
+ };
95
+ };
96
+ };
97
+ /**
98
+ * @deprecated Evaluated once at module load, so it does not reflect
99
+ * `VERCEL_CLI_SKIP_MAX_DURATION_LIMIT` when the variable is set after this
100
+ * module is first imported. Prefer {@link getFunctionsSchema}, which reads the
101
+ * limit at call time.
102
+ */
1
103
  export declare const functionsSchema: {
2
104
  type: string;
3
105
  minProperties: number;
package/dist/schemas.js CHANGED
@@ -20,6 +20,7 @@ var schemas_exports = {};
20
20
  __export(schemas_exports, {
21
21
  buildsSchema: () => buildsSchema,
22
22
  functionsSchema: () => functionsSchema,
23
+ getFunctionsSchema: () => getFunctionsSchema,
23
24
  packageManifestSchema: () => packageManifestSchema
24
25
  });
25
26
  module.exports = __toCommonJS(schemas_exports);
@@ -93,7 +94,7 @@ const triggerEventSchemaV2 = {
93
94
  const triggerEventSchema = {
94
95
  oneOf: [triggerEventSchemaV1, triggerEventSchemaV2]
95
96
  };
96
- const functionsSchema = {
97
+ const getFunctionsSchema = () => ({
97
98
  type: "object",
98
99
  minProperties: 1,
99
100
  maxProperties: 50,
@@ -146,7 +147,8 @@ const functionsSchema = {
146
147
  }
147
148
  }
148
149
  }
149
- };
150
+ });
151
+ const functionsSchema = getFunctionsSchema();
150
152
  const buildsSchema = {
151
153
  type: "array",
152
154
  minItems: 0,
@@ -249,5 +251,6 @@ const packageManifestSchema = {
249
251
  0 && (module.exports = {
250
252
  buildsSchema,
251
253
  functionsSchema,
254
+ getFunctionsSchema,
252
255
  packageManifestSchema
253
256
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.28.0",
3
+ "version": "13.29.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -55,7 +55,7 @@
55
55
  "vitest": "2.0.1",
56
56
  "typescript": "4.9.5",
57
57
  "yazl": "2.5.1",
58
- "@vercel/routing-utils": "6.2.0",
58
+ "@vercel/routing-utils": "6.3.0",
59
59
  "@vercel/error-utils": "2.2.0"
60
60
  },
61
61
  "scripts": {