@vercel/build-utils 11.0.1 → 12.0.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 +12 -0
- package/dist/index.js +14 -2
- package/dist/lambda.d.ts +11 -1
- package/dist/lambda.js +11 -2
- package/dist/schemas.d.ts +3 -0
- package/dist/schemas.js +3 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Drop Node.js 18, bump minimum to Node.js 20 ([#13856](https://github.com/vercel/vercel/pull/13856))
|
|
8
|
+
|
|
9
|
+
## 11.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Add support for the supportsCancellation function flag ([#13807](https://github.com/vercel/vercel/pull/13807))
|
|
14
|
+
|
|
3
15
|
## 11.0.1
|
|
4
16
|
|
|
5
17
|
### Patch 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
package/dist/schemas.js
CHANGED
package/dist/types.d.ts
CHANGED