@vercel/build-utils 7.0.0 → 7.1.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,11 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 7.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Support serverless function architecture ([#10392](https://github.com/vercel/vercel/pull/10392))
8
+
3
9
  ## 7.0.0
4
10
 
5
11
  ### Major Changes
package/dist/index.js CHANGED
@@ -29826,7 +29826,7 @@ const download_1 = __webpack_require__(3166);
29826
29826
  const stream_to_buffer_1 = __importDefault(__webpack_require__(9688));
29827
29827
  class Lambda {
29828
29828
  constructor(opts) {
29829
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
29829
+ const { handler, runtime, maxDuration, architecture, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
29830
29830
  if ('files' in opts) {
29831
29831
  (0, assert_1.default)(typeof opts.files === 'object', '"files" must be an object');
29832
29832
  }
@@ -29836,6 +29836,9 @@ class Lambda {
29836
29836
  (0, assert_1.default)(typeof handler === 'string', '"handler" is not a string');
29837
29837
  (0, assert_1.default)(typeof runtime === 'string', '"runtime" is not a string');
29838
29838
  (0, assert_1.default)(typeof environment === 'object', '"environment" is not an object');
29839
+ if (architecture !== undefined) {
29840
+ (0, assert_1.default)(architecture === 'x86_64' || architecture === 'arm64', '"architecture" must be either "x86_64" or "arm64"');
29841
+ }
29839
29842
  if (memory !== undefined) {
29840
29843
  (0, assert_1.default)(typeof memory === 'number', '"memory" is not a number');
29841
29844
  }
@@ -29868,6 +29871,7 @@ class Lambda {
29868
29871
  this.files = 'files' in opts ? opts.files : undefined;
29869
29872
  this.handler = handler;
29870
29873
  this.runtime = runtime;
29874
+ this.architecture = architecture;
29871
29875
  this.memory = memory;
29872
29876
  this.maxDuration = maxDuration;
29873
29877
  this.environment = environment;
package/dist/lambda.d.ts CHANGED
@@ -4,9 +4,11 @@ interface Environment {
4
4
  [key: string]: string;
5
5
  }
6
6
  export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
7
+ export type LambdaArchitecture = 'x86_64' | 'arm64';
7
8
  export interface LambdaOptionsBase {
8
9
  handler: string;
9
10
  runtime: string;
11
+ architecture?: LambdaArchitecture;
10
12
  memory?: number;
11
13
  maxDuration?: number;
12
14
  environment?: Environment;
@@ -49,6 +51,7 @@ export declare class Lambda {
49
51
  files?: Files;
50
52
  handler: string;
51
53
  runtime: string;
54
+ architecture?: LambdaArchitecture;
52
55
  memory?: number;
53
56
  maxDuration?: number;
54
57
  environment: Environment;
package/dist/lambda.js CHANGED
@@ -13,7 +13,7 @@ const download_1 = require("./fs/download");
13
13
  const stream_to_buffer_1 = __importDefault(require("./fs/stream-to-buffer"));
14
14
  class Lambda {
15
15
  constructor(opts) {
16
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
16
+ const { handler, runtime, maxDuration, architecture, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
17
17
  if ('files' in opts) {
18
18
  (0, assert_1.default)(typeof opts.files === 'object', '"files" must be an object');
19
19
  }
@@ -23,6 +23,9 @@ class Lambda {
23
23
  (0, assert_1.default)(typeof handler === 'string', '"handler" is not a string');
24
24
  (0, assert_1.default)(typeof runtime === 'string', '"runtime" is not a string');
25
25
  (0, assert_1.default)(typeof environment === 'object', '"environment" is not an object');
26
+ if (architecture !== undefined) {
27
+ (0, assert_1.default)(architecture === 'x86_64' || architecture === 'arm64', '"architecture" must be either "x86_64" or "arm64"');
28
+ }
26
29
  if (memory !== undefined) {
27
30
  (0, assert_1.default)(typeof memory === 'number', '"memory" is not a number');
28
31
  }
@@ -55,6 +58,7 @@ class Lambda {
55
58
  this.files = 'files' in opts ? opts.files : undefined;
56
59
  this.handler = handler;
57
60
  this.runtime = runtime;
61
+ this.architecture = architecture;
58
62
  this.memory = memory;
59
63
  this.maxDuration = maxDuration;
60
64
  this.environment = environment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -26,7 +26,7 @@
26
26
  "@types/node-fetch": "^2.1.6",
27
27
  "@types/semver": "6.0.0",
28
28
  "@types/yazl": "2.4.2",
29
- "@vercel/error-utils": "2.0.0",
29
+ "@vercel/error-utils": "2.0.1",
30
30
  "@vercel/ncc": "0.24.0",
31
31
  "aggregate-error": "3.0.1",
32
32
  "async-retry": "1.2.3",