@vercel/build-utils 5.5.9 → 5.6.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/dist/index.js CHANGED
@@ -31661,7 +31661,7 @@ const download_1 = __webpack_require__(1611);
31661
31661
  const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
31662
31662
  class Lambda {
31663
31663
  constructor(opts) {
31664
- const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, } = opts;
31664
+ const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, } = opts;
31665
31665
  if ('files' in opts) {
31666
31666
  assert_1.default(typeof opts.files === 'object', '"files" must be an object');
31667
31667
  }
@@ -31692,6 +31692,7 @@ class Lambda {
31692
31692
  assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
31693
31693
  }
31694
31694
  this.type = 'Lambda';
31695
+ this.operationType = operationType;
31695
31696
  this.files = 'files' in opts ? opts.files : undefined;
31696
31697
  this.handler = handler;
31697
31698
  this.runtime = runtime;
@@ -31818,6 +31819,10 @@ class Prerender {
31818
31819
  this.type = 'Prerender';
31819
31820
  this.expiration = expiration;
31820
31821
  this.lambda = lambda;
31822
+ if (this.lambda) {
31823
+ // "ISR" is the platform default lambda label for prerender functions
31824
+ this.lambda.operationType = this.lambda.operationType || 'ISR';
31825
+ }
31821
31826
  if (typeof group !== 'undefined' &&
31822
31827
  (group <= 0 || !Number.isInteger(group))) {
31823
31828
  throw new Error('The `group` argument for `Prerender` needs to be a natural number.');
package/dist/lambda.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface LambdaOptionsBase {
15
15
  supportsMultiPayloads?: boolean;
16
16
  supportsWrapper?: boolean;
17
17
  experimentalResponseStreaming?: boolean;
18
+ operationType?: string;
18
19
  }
19
20
  export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
20
21
  files: Files;
@@ -34,6 +35,12 @@ interface GetLambdaOptionsFromFunctionOptions {
34
35
  }
35
36
  export declare class Lambda {
36
37
  type: 'Lambda';
38
+ /**
39
+ * This is a label for the type of Lambda a framework is producing.
40
+ * The value can be any string that makes sense for a given framework.
41
+ * Examples: "API", "ISR", "SSR", "SSG", "Render", "Resource"
42
+ */
43
+ operationType?: string;
37
44
  files?: Files;
38
45
  handler: string;
39
46
  runtime: string;
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, experimentalResponseStreaming, } = opts;
16
+ const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, } = opts;
17
17
  if ('files' in opts) {
18
18
  assert_1.default(typeof opts.files === 'object', '"files" must be an object');
19
19
  }
@@ -44,6 +44,7 @@ class Lambda {
44
44
  assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
45
45
  }
46
46
  this.type = 'Lambda';
47
+ this.operationType = operationType;
47
48
  this.files = 'files' in opts ? opts.files : undefined;
48
49
  this.handler = handler;
49
50
  this.runtime = runtime;
@@ -2,7 +2,7 @@ import { File } from './types';
2
2
  import { Lambda } from './lambda';
3
3
  interface PrerenderOptions {
4
4
  expiration: number | false;
5
- lambda: Lambda;
5
+ lambda?: Lambda;
6
6
  fallback: File | null;
7
7
  group?: number;
8
8
  bypassToken?: string | null;
@@ -13,7 +13,7 @@ interface PrerenderOptions {
13
13
  export declare class Prerender {
14
14
  type: 'Prerender';
15
15
  expiration: number | false;
16
- lambda: Lambda;
16
+ lambda?: Lambda;
17
17
  fallback: File | null;
18
18
  group?: number;
19
19
  bypassToken: string | null;
package/dist/prerender.js CHANGED
@@ -6,6 +6,10 @@ class Prerender {
6
6
  this.type = 'Prerender';
7
7
  this.expiration = expiration;
8
8
  this.lambda = lambda;
9
+ if (this.lambda) {
10
+ // "ISR" is the platform default lambda label for prerender functions
11
+ this.lambda.operationType = this.lambda.operationType || 'ISR';
12
+ }
9
13
  if (typeof group !== 'undefined' &&
10
14
  (group <= 0 || !Number.isInteger(group))) {
11
15
  throw new Error('The `group` argument for `Prerender` needs to be a natural number.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "5.5.9",
3
+ "version": "5.6.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -47,5 +47,5 @@
47
47
  "typescript": "4.3.4",
48
48
  "yazl": "2.5.1"
49
49
  },
50
- "gitHead": "7003531d5db7895fc3b2fa940c2d83b6e75bbd9e"
50
+ "gitHead": "a19447f9cdc8c7be8aa3646dfb441dd9469d2ed3"
51
51
  }