@vercel/build-utils 5.5.8 → 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/fs/node-version.d.ts +0 -4
- package/dist/fs/node-version.js +1 -6
- package/dist/index.js +7 -7
- package/dist/lambda.d.ts +7 -0
- package/dist/lambda.js +2 -1
- package/dist/prerender.d.ts +2 -2
- package/dist/prerender.js +4 -0
- package/package.json +2 -2
package/dist/fs/node-version.js
CHANGED
@@ -9,6 +9,7 @@ const errors_1 = require("../errors");
|
|
9
9
|
const debug_1 = __importDefault(require("../debug"));
|
10
10
|
function getOptions() {
|
11
11
|
const options = [
|
12
|
+
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
12
13
|
{ major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
13
14
|
{ major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
14
15
|
{
|
@@ -30,12 +31,6 @@ function getOptions() {
|
|
30
31
|
discontinueDate: new Date('2020-01-06'),
|
31
32
|
},
|
32
33
|
];
|
33
|
-
if (process.env.VERCEL_ALLOW_NODEJS18 === '1') {
|
34
|
-
return [
|
35
|
-
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
36
|
-
...options,
|
37
|
-
];
|
38
|
-
}
|
39
34
|
return options;
|
40
35
|
}
|
41
36
|
function getHint(isAuto = false) {
|
package/dist/index.js
CHANGED
@@ -30708,6 +30708,7 @@ const errors_1 = __webpack_require__(3983);
|
|
30708
30708
|
const debug_1 = __importDefault(__webpack_require__(1868));
|
30709
30709
|
function getOptions() {
|
30710
30710
|
const options = [
|
30711
|
+
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
30711
30712
|
{ major: 16, range: '16.x', runtime: 'nodejs16.x' },
|
30712
30713
|
{ major: 14, range: '14.x', runtime: 'nodejs14.x' },
|
30713
30714
|
{
|
@@ -30729,12 +30730,6 @@ function getOptions() {
|
|
30729
30730
|
discontinueDate: new Date('2020-01-06'),
|
30730
30731
|
},
|
30731
30732
|
];
|
30732
|
-
if (process.env.VERCEL_ALLOW_NODEJS18 === '1') {
|
30733
|
-
return [
|
30734
|
-
{ major: 18, range: '18.x', runtime: 'nodejs18.x' },
|
30735
|
-
...options,
|
30736
|
-
];
|
30737
|
-
}
|
30738
30733
|
return options;
|
30739
30734
|
}
|
30740
30735
|
function getHint(isAuto = false) {
|
@@ -31666,7 +31661,7 @@ const download_1 = __webpack_require__(1611);
|
|
31666
31661
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(2560));
|
31667
31662
|
class Lambda {
|
31668
31663
|
constructor(opts) {
|
31669
|
-
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;
|
31670
31665
|
if ('files' in opts) {
|
31671
31666
|
assert_1.default(typeof opts.files === 'object', '"files" must be an object');
|
31672
31667
|
}
|
@@ -31697,6 +31692,7 @@ class Lambda {
|
|
31697
31692
|
assert_1.default(regions.every(r => typeof r === 'string'), '"regions" is not a string Array');
|
31698
31693
|
}
|
31699
31694
|
this.type = 'Lambda';
|
31695
|
+
this.operationType = operationType;
|
31700
31696
|
this.files = 'files' in opts ? opts.files : undefined;
|
31701
31697
|
this.handler = handler;
|
31702
31698
|
this.runtime = runtime;
|
@@ -31823,6 +31819,10 @@ class Prerender {
|
|
31823
31819
|
this.type = 'Prerender';
|
31824
31820
|
this.expiration = expiration;
|
31825
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
|
+
}
|
31826
31826
|
if (typeof group !== 'undefined' &&
|
31827
31827
|
(group <= 0 || !Number.isInteger(group))) {
|
31828
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;
|
package/dist/prerender.d.ts
CHANGED
@@ -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
|
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
|
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.
|
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": "
|
50
|
+
"gitHead": "a19447f9cdc8c7be8aa3646dfb441dd9469d2ed3"
|
51
51
|
}
|