@vercel/build-utils 6.2.3 → 6.2.4
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/edge-function.d.ts +3 -1
- package/dist/edge-function.js +1 -0
- package/dist/index.js +10 -1
- package/dist/lambda.d.ts +3 -1
- package/dist/lambda.js +9 -1
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
package/dist/edge-function.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Cron, Files } from './types';
|
1
|
+
import type { Cron, Files, FunctionFramework } from './types';
|
2
2
|
/**
|
3
3
|
* An Edge Functions output
|
4
4
|
*/
|
@@ -37,5 +37,7 @@ export declare class EdgeFunction {
|
|
37
37
|
regions?: string | string[];
|
38
38
|
/** Cronjob definition for the edge function */
|
39
39
|
cron?: Cron;
|
40
|
+
/** The framework */
|
41
|
+
framework?: FunctionFramework;
|
40
42
|
constructor(params: Omit<EdgeFunction, 'type'>);
|
41
43
|
}
|
package/dist/edge-function.js
CHANGED
package/dist/index.js
CHANGED
@@ -30254,6 +30254,7 @@ class EdgeFunction {
|
|
30254
30254
|
this.assets = params.assets;
|
30255
30255
|
this.regions = params.regions;
|
30256
30256
|
this.cron = params.cron;
|
30257
|
+
this.framework = params.framework;
|
30257
30258
|
}
|
30258
30259
|
}
|
30259
30260
|
exports.EdgeFunction = EdgeFunction;
|
@@ -31742,7 +31743,7 @@ const download_1 = __webpack_require__(3166);
|
|
31742
31743
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(9688));
|
31743
31744
|
class Lambda {
|
31744
31745
|
constructor(opts) {
|
31745
|
-
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, cron, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, } = opts;
|
31746
|
+
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, cron, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, framework, } = opts;
|
31746
31747
|
if ('files' in opts) {
|
31747
31748
|
assert_1.default(typeof opts.files === 'object', '"files" must be an object');
|
31748
31749
|
}
|
@@ -31775,6 +31776,13 @@ class Lambda {
|
|
31775
31776
|
if (cron !== undefined) {
|
31776
31777
|
assert_1.default(typeof cron === 'string', '"cron" is not a string');
|
31777
31778
|
}
|
31779
|
+
if (framework !== undefined) {
|
31780
|
+
assert_1.default(typeof framework === 'object', '"framework" is not an object');
|
31781
|
+
assert_1.default(typeof framework.slug === 'string', '"framework.slug" is not a string');
|
31782
|
+
if (framework.version !== undefined) {
|
31783
|
+
assert_1.default(typeof framework.version === 'string', '"framework.version" is not a string');
|
31784
|
+
}
|
31785
|
+
}
|
31778
31786
|
this.type = 'Lambda';
|
31779
31787
|
this.operationType = operationType;
|
31780
31788
|
this.files = 'files' in opts ? opts.files : undefined;
|
@@ -31790,6 +31798,7 @@ class Lambda {
|
|
31790
31798
|
this.supportsMultiPayloads = supportsMultiPayloads;
|
31791
31799
|
this.supportsWrapper = supportsWrapper;
|
31792
31800
|
this.experimentalResponseStreaming = experimentalResponseStreaming;
|
31801
|
+
this.framework = framework;
|
31793
31802
|
}
|
31794
31803
|
async createZip() {
|
31795
31804
|
let { zipBuffer } = this;
|
package/dist/lambda.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import type { Files, Config, Cron } from './types';
|
2
|
+
import type { Files, Config, Cron, FunctionFramework } from './types';
|
3
3
|
interface Environment {
|
4
4
|
[key: string]: string;
|
5
5
|
}
|
@@ -17,6 +17,7 @@ export interface LambdaOptionsBase {
|
|
17
17
|
experimentalResponseStreaming?: boolean;
|
18
18
|
operationType?: string;
|
19
19
|
cron?: Cron;
|
20
|
+
framework?: FunctionFramework;
|
20
21
|
}
|
21
22
|
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
22
23
|
files: Files;
|
@@ -58,6 +59,7 @@ export declare class Lambda {
|
|
58
59
|
supportsMultiPayloads?: boolean;
|
59
60
|
supportsWrapper?: boolean;
|
60
61
|
experimentalResponseStreaming?: boolean;
|
62
|
+
framework?: FunctionFramework;
|
61
63
|
constructor(opts: LambdaOptions);
|
62
64
|
createZip(): Promise<Buffer>;
|
63
65
|
}
|
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, cron, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, } = opts;
|
16
|
+
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, cron, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, framework, } = opts;
|
17
17
|
if ('files' in opts) {
|
18
18
|
assert_1.default(typeof opts.files === 'object', '"files" must be an object');
|
19
19
|
}
|
@@ -46,6 +46,13 @@ class Lambda {
|
|
46
46
|
if (cron !== undefined) {
|
47
47
|
assert_1.default(typeof cron === 'string', '"cron" is not a string');
|
48
48
|
}
|
49
|
+
if (framework !== undefined) {
|
50
|
+
assert_1.default(typeof framework === 'object', '"framework" is not an object');
|
51
|
+
assert_1.default(typeof framework.slug === 'string', '"framework.slug" is not a string');
|
52
|
+
if (framework.version !== undefined) {
|
53
|
+
assert_1.default(typeof framework.version === 'string', '"framework.version" is not a string');
|
54
|
+
}
|
55
|
+
}
|
49
56
|
this.type = 'Lambda';
|
50
57
|
this.operationType = operationType;
|
51
58
|
this.files = 'files' in opts ? opts.files : undefined;
|
@@ -61,6 +68,7 @@ class Lambda {
|
|
61
68
|
this.supportsMultiPayloads = supportsMultiPayloads;
|
62
69
|
this.supportsWrapper = supportsWrapper;
|
63
70
|
this.experimentalResponseStreaming = experimentalResponseStreaming;
|
71
|
+
this.framework = framework;
|
64
72
|
}
|
65
73
|
async createZip() {
|
66
74
|
let { zipBuffer } = this;
|
package/dist/types.d.ts
CHANGED
@@ -364,6 +364,11 @@ export interface BuildResultBuildOutput {
|
|
364
364
|
buildOutputPath: string;
|
365
365
|
}
|
366
366
|
export declare type Cron = string;
|
367
|
+
/** The framework which created the function */
|
368
|
+
export interface FunctionFramework {
|
369
|
+
slug: string;
|
370
|
+
version?: string;
|
371
|
+
}
|
367
372
|
/**
|
368
373
|
* When a Builder implements `version: 2`, the `build()` function is expected
|
369
374
|
* to return this type.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "6.2.
|
3
|
+
"version": "6.2.4",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.js",
|
@@ -51,5 +51,5 @@
|
|
51
51
|
"typescript": "4.3.4",
|
52
52
|
"yazl": "2.5.1"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "9308a0fda5e14ee8a07b9a3506e4480f5f67d212"
|
55
55
|
}
|