@vercel/build-utils 13.36.2 → 13.36.3
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 +7 -0
- package/dist/container-image.d.ts +17 -8
- package/dist/container-image.js +9 -1
- package/dist/index.js +22 -1
- package/dist/lambda.d.ts +4 -1
- package/dist/lambda.js +9 -0
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.js +4 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 13.36.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a69c714: Propagate per-function `maxConcurrency` configuration into build outputs and keep every configured Next.js route in its own Lambda group, including routes with the same limit.
|
|
8
|
+
- 654e898: Type shared function settings in container image build outputs.
|
|
9
|
+
|
|
3
10
|
## 13.36.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import type { LambdaOptionsBase } from './lambda';
|
|
1
2
|
import type { Env, Files } from './types';
|
|
2
|
-
export interface ContainerImageConfig {
|
|
3
|
+
export interface ContainerImageConfig extends Pick<LambdaOptionsBase, 'handler' | 'architecture' | 'memory' | 'maxDuration' | 'maxConcurrency' | 'environment' | 'regions' | 'functionFailoverRegions' | 'experimentalTriggers' | 'supportsCancellation'> {
|
|
3
4
|
/**
|
|
4
|
-
* The OCI image reference
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* The OCI image reference, for example
|
|
6
|
+
* `vcr.vercel.com/team/project/svc@sha256:...`.
|
|
7
|
+
* The build output contract carries this value in `handler`.
|
|
7
8
|
*/
|
|
8
|
-
handler: string;
|
|
9
9
|
runtime: 'container';
|
|
10
10
|
command?: string[];
|
|
11
|
-
environment?: Env;
|
|
12
11
|
}
|
|
13
|
-
export declare class ContainerImage {
|
|
12
|
+
export declare class ContainerImage implements ContainerImageConfig {
|
|
14
13
|
type: 'ContainerImage';
|
|
15
14
|
files: Files;
|
|
16
15
|
/** The OCI image reference, carried in `handler` (see ContainerImageConfig). */
|
|
@@ -18,5 +17,15 @@ export declare class ContainerImage {
|
|
|
18
17
|
runtime: 'container';
|
|
19
18
|
command?: string[];
|
|
20
19
|
environment: Env;
|
|
21
|
-
|
|
20
|
+
architecture?: ContainerImageConfig['architecture'];
|
|
21
|
+
memory?: ContainerImageConfig['memory'];
|
|
22
|
+
maxDuration?: ContainerImageConfig['maxDuration'];
|
|
23
|
+
maxConcurrency?: ContainerImageConfig['maxConcurrency'];
|
|
24
|
+
regions?: ContainerImageConfig['regions'];
|
|
25
|
+
functionFailoverRegions?: ContainerImageConfig['functionFailoverRegions'];
|
|
26
|
+
experimentalTriggers?: ContainerImageConfig['experimentalTriggers'];
|
|
27
|
+
supportsCancellation?: ContainerImageConfig['supportsCancellation'];
|
|
28
|
+
constructor(params: ContainerImageConfig & {
|
|
29
|
+
files: Files;
|
|
30
|
+
});
|
|
22
31
|
}
|
package/dist/container-image.js
CHANGED
|
@@ -28,7 +28,15 @@ class ContainerImage {
|
|
|
28
28
|
this.handler = params.handler;
|
|
29
29
|
this.runtime = params.runtime;
|
|
30
30
|
this.command = params.command;
|
|
31
|
-
this.environment = params.environment;
|
|
31
|
+
this.environment = params.environment ?? {};
|
|
32
|
+
this.architecture = params.architecture;
|
|
33
|
+
this.memory = params.memory;
|
|
34
|
+
this.maxDuration = params.maxDuration;
|
|
35
|
+
this.maxConcurrency = params.maxConcurrency;
|
|
36
|
+
this.regions = params.regions;
|
|
37
|
+
this.functionFailoverRegions = params.functionFailoverRegions;
|
|
38
|
+
this.experimentalTriggers = params.experimentalTriggers;
|
|
39
|
+
this.supportsCancellation = params.supportsCancellation;
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js
CHANGED
|
@@ -32282,6 +32282,7 @@ var Lambda = class {
|
|
|
32282
32282
|
runtime,
|
|
32283
32283
|
runtimeLanguage,
|
|
32284
32284
|
maxDuration,
|
|
32285
|
+
maxConcurrency,
|
|
32285
32286
|
architecture,
|
|
32286
32287
|
memory,
|
|
32287
32288
|
environment = {},
|
|
@@ -32334,6 +32335,12 @@ var Lambda = class {
|
|
|
32334
32335
|
'"maxDuration" is not a number or "max"'
|
|
32335
32336
|
);
|
|
32336
32337
|
}
|
|
32338
|
+
if (maxConcurrency !== void 0) {
|
|
32339
|
+
(0, import_assert4.default)(
|
|
32340
|
+
Number.isInteger(maxConcurrency) && maxConcurrency >= 1,
|
|
32341
|
+
'"maxConcurrency" must be an integer greater than or equal to 1'
|
|
32342
|
+
);
|
|
32343
|
+
}
|
|
32337
32344
|
if (allowQuery !== void 0) {
|
|
32338
32345
|
(0, import_assert4.default)(Array.isArray(allowQuery), '"allowQuery" is not an Array');
|
|
32339
32346
|
(0, import_assert4.default)(
|
|
@@ -32469,6 +32476,7 @@ var Lambda = class {
|
|
|
32469
32476
|
this.architecture = getDefaultLambdaArchitecture(architecture);
|
|
32470
32477
|
this.memory = memory;
|
|
32471
32478
|
this.maxDuration = maxDuration;
|
|
32479
|
+
this.maxConcurrency = maxConcurrency;
|
|
32472
32480
|
this.environment = environment;
|
|
32473
32481
|
this.allowQuery = allowQuery;
|
|
32474
32482
|
this.regions = regions;
|
|
@@ -32577,6 +32585,7 @@ async function getLambdaOptionsFromFunction({
|
|
|
32577
32585
|
architecture: fn.architecture,
|
|
32578
32586
|
memory: fn.memory,
|
|
32579
32587
|
maxDuration: fn.maxDuration,
|
|
32588
|
+
maxConcurrency: fn.maxConcurrency,
|
|
32580
32589
|
regions: fn.regions,
|
|
32581
32590
|
functionFailoverRegions: fn.functionFailoverRegions,
|
|
32582
32591
|
experimentalTriggers,
|
|
@@ -35313,7 +35322,15 @@ var ContainerImage = class {
|
|
|
35313
35322
|
this.handler = params.handler;
|
|
35314
35323
|
this.runtime = params.runtime;
|
|
35315
35324
|
this.command = params.command;
|
|
35316
|
-
this.environment = params.environment;
|
|
35325
|
+
this.environment = params.environment ?? {};
|
|
35326
|
+
this.architecture = params.architecture;
|
|
35327
|
+
this.memory = params.memory;
|
|
35328
|
+
this.maxDuration = params.maxDuration;
|
|
35329
|
+
this.maxConcurrency = params.maxConcurrency;
|
|
35330
|
+
this.regions = params.regions;
|
|
35331
|
+
this.functionFailoverRegions = params.functionFailoverRegions;
|
|
35332
|
+
this.experimentalTriggers = params.experimentalTriggers;
|
|
35333
|
+
this.supportsCancellation = params.supportsCancellation;
|
|
35317
35334
|
}
|
|
35318
35335
|
};
|
|
35319
35336
|
|
|
@@ -35488,6 +35505,10 @@ var getFunctionsSchema = () => ({
|
|
|
35488
35505
|
maximum: 10240
|
|
35489
35506
|
},
|
|
35490
35507
|
maxDuration: getMaxDurationSchema(),
|
|
35508
|
+
maxConcurrency: {
|
|
35509
|
+
type: "integer",
|
|
35510
|
+
minimum: 1
|
|
35511
|
+
},
|
|
35491
35512
|
regions: {
|
|
35492
35513
|
type: "array",
|
|
35493
35514
|
items: {
|
package/dist/lambda.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface LambdaOptionsBase {
|
|
|
27
27
|
architecture?: LambdaArchitecture;
|
|
28
28
|
memory?: number;
|
|
29
29
|
maxDuration?: MaxDuration;
|
|
30
|
+
maxConcurrency?: number;
|
|
30
31
|
environment?: Env;
|
|
31
32
|
allowQuery?: string[];
|
|
32
33
|
regions?: string[];
|
|
@@ -102,6 +103,8 @@ export declare class Lambda {
|
|
|
102
103
|
architecture: LambdaArchitecture;
|
|
103
104
|
memory?: number;
|
|
104
105
|
maxDuration?: MaxDuration;
|
|
106
|
+
/** Maximum number of requests that one function instance can process concurrently. */
|
|
107
|
+
maxConcurrency?: number;
|
|
105
108
|
environment: Env;
|
|
106
109
|
allowQuery?: string[];
|
|
107
110
|
regions?: string[];
|
|
@@ -153,4 +156,4 @@ export declare class Lambda {
|
|
|
153
156
|
*/
|
|
154
157
|
export declare function createLambda(opts: LambdaOptions): Promise<Lambda>;
|
|
155
158
|
export declare function createZip(files: Files): Promise<Buffer>;
|
|
156
|
-
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'regions' | 'functionFailoverRegions' | 'experimentalTriggers' | 'supportsCancellation'>>;
|
|
159
|
+
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'maxConcurrency' | 'regions' | 'functionFailoverRegions' | 'experimentalTriggers' | 'supportsCancellation'>>;
|
package/dist/lambda.js
CHANGED
|
@@ -80,6 +80,7 @@ class Lambda {
|
|
|
80
80
|
runtime,
|
|
81
81
|
runtimeLanguage,
|
|
82
82
|
maxDuration,
|
|
83
|
+
maxConcurrency,
|
|
83
84
|
architecture,
|
|
84
85
|
memory,
|
|
85
86
|
environment = {},
|
|
@@ -132,6 +133,12 @@ class Lambda {
|
|
|
132
133
|
'"maxDuration" is not a number or "max"'
|
|
133
134
|
);
|
|
134
135
|
}
|
|
136
|
+
if (maxConcurrency !== void 0) {
|
|
137
|
+
(0, import_assert.default)(
|
|
138
|
+
Number.isInteger(maxConcurrency) && maxConcurrency >= 1,
|
|
139
|
+
'"maxConcurrency" must be an integer greater than or equal to 1'
|
|
140
|
+
);
|
|
141
|
+
}
|
|
135
142
|
if (allowQuery !== void 0) {
|
|
136
143
|
(0, import_assert.default)(Array.isArray(allowQuery), '"allowQuery" is not an Array');
|
|
137
144
|
(0, import_assert.default)(
|
|
@@ -267,6 +274,7 @@ class Lambda {
|
|
|
267
274
|
this.architecture = getDefaultLambdaArchitecture(architecture);
|
|
268
275
|
this.memory = memory;
|
|
269
276
|
this.maxDuration = maxDuration;
|
|
277
|
+
this.maxConcurrency = maxConcurrency;
|
|
270
278
|
this.environment = environment;
|
|
271
279
|
this.allowQuery = allowQuery;
|
|
272
280
|
this.regions = regions;
|
|
@@ -375,6 +383,7 @@ async function getLambdaOptionsFromFunction({
|
|
|
375
383
|
architecture: fn.architecture,
|
|
376
384
|
memory: fn.memory,
|
|
377
385
|
maxDuration: fn.maxDuration,
|
|
386
|
+
maxConcurrency: fn.maxConcurrency,
|
|
378
387
|
regions: fn.regions,
|
|
379
388
|
functionFailoverRegions: fn.functionFailoverRegions,
|
|
380
389
|
experimentalTriggers,
|
package/dist/schemas.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export declare const getFunctionsSchema: () => {
|
|
|
31
31
|
enum: string[];
|
|
32
32
|
})[];
|
|
33
33
|
};
|
|
34
|
+
maxConcurrency: {
|
|
35
|
+
type: string;
|
|
36
|
+
minimum: number;
|
|
37
|
+
};
|
|
34
38
|
regions: {
|
|
35
39
|
type: string;
|
|
36
40
|
items: {
|
|
@@ -133,6 +137,10 @@ export declare const functionsSchema: {
|
|
|
133
137
|
enum: string[];
|
|
134
138
|
})[];
|
|
135
139
|
};
|
|
140
|
+
maxConcurrency: {
|
|
141
|
+
type: string;
|
|
142
|
+
minimum: number;
|
|
143
|
+
};
|
|
136
144
|
regions: {
|
|
137
145
|
type: string;
|
|
138
146
|
items: {
|
package/dist/schemas.js
CHANGED
package/dist/types.d.ts
CHANGED