@vercel/build-utils 11.0.0 → 11.0.2

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,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 11.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Add support for the supportsCancellation function flag ([#13807](https://github.com/vercel/vercel/pull/13807))
8
+
9
+ ## 11.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Fix 404 status for /api routes when using Hono with the vercel dev server ([#13706](https://github.com/vercel/vercel/pull/13706))
14
+
3
15
  ## 11.0.0
4
16
 
5
17
  ### Major Changes
package/dist/index.js CHANGED
@@ -22403,7 +22403,8 @@ var Lambda = class {
22403
22403
  experimentalResponseStreaming,
22404
22404
  operationType,
22405
22405
  framework,
22406
- experimentalTriggers
22406
+ experimentalTriggers,
22407
+ supportsCancellation
22407
22408
  } = opts;
22408
22409
  if ("files" in opts) {
22409
22410
  (0, import_assert4.default)(typeof opts.files === "object", '"files" must be an object');
@@ -22532,6 +22533,12 @@ var Lambda = class {
22532
22533
  }
22533
22534
  }
22534
22535
  }
22536
+ if (supportsCancellation !== void 0) {
22537
+ (0, import_assert4.default)(
22538
+ typeof supportsCancellation === "boolean",
22539
+ '"supportsCancellation" is not a boolean'
22540
+ );
22541
+ }
22535
22542
  this.type = "Lambda";
22536
22543
  this.operationType = operationType;
22537
22544
  this.files = "files" in opts ? opts.files : void 0;
@@ -22550,6 +22557,7 @@ var Lambda = class {
22550
22557
  this.framework = framework;
22551
22558
  this.experimentalAllowBundling = "experimentalAllowBundling" in opts ? opts.experimentalAllowBundling : void 0;
22552
22559
  this.experimentalTriggers = experimentalTriggers;
22560
+ this.supportsCancellation = supportsCancellation;
22553
22561
  }
22554
22562
  async createZip() {
22555
22563
  let { zipBuffer } = this;
@@ -22625,7 +22633,8 @@ async function getLambdaOptionsFromFunction({
22625
22633
  architecture: fn.architecture,
22626
22634
  memory: fn.memory,
22627
22635
  maxDuration: fn.maxDuration,
22628
- experimentalTriggers: fn.experimentalTriggers
22636
+ experimentalTriggers: fn.experimentalTriggers,
22637
+ supportsCancellation: fn.supportsCancellation
22629
22638
  };
22630
22639
  }
22631
22640
  }
@@ -24426,6 +24435,9 @@ var functionsSchema = {
24426
24435
  experimentalTriggers: {
24427
24436
  type: "array",
24428
24437
  items: triggerEventSchema
24438
+ },
24439
+ supportsCancellation: {
24440
+ type: "boolean"
24429
24441
  }
24430
24442
  }
24431
24443
  }
package/dist/lambda.d.ts CHANGED
@@ -36,6 +36,11 @@ export interface LambdaOptionsBase {
36
36
  * @experimental This feature is experimental and may change.
37
37
  */
38
38
  experimentalTriggers?: TriggerEvent[];
39
+ /**
40
+ * Whether this Lambda supports cancellation.
41
+ * When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
42
+ */
43
+ supportsCancellation?: boolean;
39
44
  }
40
45
  export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
41
46
  files: Files;
@@ -95,6 +100,11 @@ export declare class Lambda {
95
100
  * @experimental This feature is experimental and may change.
96
101
  */
97
102
  experimentalTriggers?: TriggerEvent[];
103
+ /**
104
+ * Whether this Lambda supports cancellation.
105
+ * When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
106
+ */
107
+ supportsCancellation?: boolean;
98
108
  constructor(opts: LambdaOptions);
99
109
  createZip(): Promise<Buffer>;
100
110
  /**
@@ -108,4 +118,4 @@ export declare class Lambda {
108
118
  */
109
119
  export declare function createLambda(opts: LambdaOptions): Promise<Lambda>;
110
120
  export declare function createZip(files: Files): Promise<Buffer>;
111
- export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'experimentalTriggers'>>;
121
+ export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'experimentalTriggers' | 'supportsCancellation'>>;
package/dist/lambda.js CHANGED
@@ -72,7 +72,8 @@ class Lambda {
72
72
  experimentalResponseStreaming,
73
73
  operationType,
74
74
  framework,
75
- experimentalTriggers
75
+ experimentalTriggers,
76
+ supportsCancellation
76
77
  } = opts;
77
78
  if ("files" in opts) {
78
79
  (0, import_assert.default)(typeof opts.files === "object", '"files" must be an object');
@@ -201,6 +202,12 @@ class Lambda {
201
202
  }
202
203
  }
203
204
  }
205
+ if (supportsCancellation !== void 0) {
206
+ (0, import_assert.default)(
207
+ typeof supportsCancellation === "boolean",
208
+ '"supportsCancellation" is not a boolean'
209
+ );
210
+ }
204
211
  this.type = "Lambda";
205
212
  this.operationType = operationType;
206
213
  this.files = "files" in opts ? opts.files : void 0;
@@ -219,6 +226,7 @@ class Lambda {
219
226
  this.framework = framework;
220
227
  this.experimentalAllowBundling = "experimentalAllowBundling" in opts ? opts.experimentalAllowBundling : void 0;
221
228
  this.experimentalTriggers = experimentalTriggers;
229
+ this.supportsCancellation = supportsCancellation;
222
230
  }
223
231
  async createZip() {
224
232
  let { zipBuffer } = this;
@@ -294,7 +302,8 @@ async function getLambdaOptionsFromFunction({
294
302
  architecture: fn.architecture,
295
303
  memory: fn.memory,
296
304
  maxDuration: fn.maxDuration,
297
- experimentalTriggers: fn.experimentalTriggers
305
+ experimentalTriggers: fn.experimentalTriggers,
306
+ supportsCancellation: fn.supportsCancellation
298
307
  };
299
308
  }
300
309
  }
package/dist/schemas.d.ts CHANGED
@@ -67,6 +67,9 @@ export declare const functionsSchema: {
67
67
  additionalProperties: boolean;
68
68
  };
69
69
  };
70
+ supportsCancellation: {
71
+ type: string;
72
+ };
70
73
  };
71
74
  };
72
75
  };
package/dist/schemas.js CHANGED
@@ -91,6 +91,9 @@ const functionsSchema = {
91
91
  experimentalTriggers: {
92
92
  type: "array",
93
93
  items: triggerEventSchema
94
+ },
95
+ supportsCancellation: {
96
+ type: "boolean"
94
97
  }
95
98
  }
96
99
  }
package/dist/types.d.ts CHANGED
@@ -159,6 +159,10 @@ export interface ShouldServeOptions {
159
159
  * in `vercel.json`.
160
160
  */
161
161
  config: Config;
162
+ /**
163
+ * Whether another builder has already matched the given request.
164
+ */
165
+ hasMatched?: boolean;
162
166
  }
163
167
  /**
164
168
  * `startDevServer()` is given the same parameters as `build()`.
@@ -323,6 +327,7 @@ export interface BuilderFunctions {
323
327
  includeFiles?: string;
324
328
  excludeFiles?: string;
325
329
  experimentalTriggers?: TriggerEvent[];
330
+ supportsCancellation?: boolean;
326
331
  };
327
332
  }
328
333
  export interface ProjectSettings {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",