@vercel/build-utils 6.5.0 → 6.7.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/run-user-scripts.js +10 -1
- package/dist/get-prefixed-env-vars.js +2 -1
- package/dist/index.js +24 -4
- package/dist/lambda.d.ts +10 -1
- package/dist/lambda.js +12 -2
- package/package.json +2 -2
@@ -332,6 +332,7 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
332
332
|
const oldPath = env.PATH + '';
|
333
333
|
const npm7 = '/node16/bin-npm7';
|
334
334
|
const pnpm7 = '/pnpm7/node_modules/.bin';
|
335
|
+
const pnpm8 = '/pnpm8/node_modules/.bin';
|
335
336
|
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
|
336
337
|
if (cliType === 'npm') {
|
337
338
|
if (typeof lockfileVersion === 'number' &&
|
@@ -351,7 +352,15 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
351
352
|
!corepackEnabled) {
|
352
353
|
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
353
354
|
newEnv.PATH = `${pnpm7}${path_1.default.delimiter}${oldPath}`;
|
354
|
-
console.log(
|
355
|
+
console.log(`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7...`);
|
356
|
+
}
|
357
|
+
else if (typeof lockfileVersion === 'number' &&
|
358
|
+
lockfileVersion >= 6 &&
|
359
|
+
!oldPath.includes(pnpm8) &&
|
360
|
+
!corepackEnabled) {
|
361
|
+
// Ensure that pnpm 8 is at the beginning of the `$PATH`
|
362
|
+
newEnv.PATH = `${pnpm8}${path_1.default.delimiter}${oldPath}`;
|
363
|
+
console.log(`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8...`);
|
355
364
|
}
|
356
365
|
}
|
357
366
|
else {
|
@@ -9,10 +9,11 @@ exports.getPrefixedEnvVars = void 0;
|
|
9
9
|
*/
|
10
10
|
function getPrefixedEnvVars({ envPrefix, envs, }) {
|
11
11
|
const vercelSystemEnvPrefix = 'VERCEL_';
|
12
|
+
const allowed = ['VERCEL_URL', 'VERCEL_ENV', 'VERCEL_REGION'];
|
12
13
|
const newEnvs = {};
|
13
14
|
if (envPrefix && envs.VERCEL_URL) {
|
14
15
|
Object.keys(envs)
|
15
|
-
.filter(key => key.startsWith(
|
16
|
+
.filter(key => allowed.includes(key) || key.startsWith('VERCEL_GIT_'))
|
16
17
|
.forEach(key => {
|
17
18
|
const newKey = `${envPrefix}${key}`;
|
18
19
|
if (!(newKey in envs)) {
|
package/dist/index.js
CHANGED
@@ -31329,6 +31329,7 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
31329
31329
|
const oldPath = env.PATH + '';
|
31330
31330
|
const npm7 = '/node16/bin-npm7';
|
31331
31331
|
const pnpm7 = '/pnpm7/node_modules/.bin';
|
31332
|
+
const pnpm8 = '/pnpm8/node_modules/.bin';
|
31332
31333
|
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
|
31333
31334
|
if (cliType === 'npm') {
|
31334
31335
|
if (typeof lockfileVersion === 'number' &&
|
@@ -31348,7 +31349,15 @@ function getEnvForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }
|
|
31348
31349
|
!corepackEnabled) {
|
31349
31350
|
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
31350
31351
|
newEnv.PATH = `${pnpm7}${path_1.default.delimiter}${oldPath}`;
|
31351
|
-
console.log(
|
31352
|
+
console.log(`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 7...`);
|
31353
|
+
}
|
31354
|
+
else if (typeof lockfileVersion === 'number' &&
|
31355
|
+
lockfileVersion >= 6 &&
|
31356
|
+
!oldPath.includes(pnpm8) &&
|
31357
|
+
!corepackEnabled) {
|
31358
|
+
// Ensure that pnpm 8 is at the beginning of the `$PATH`
|
31359
|
+
newEnv.PATH = `${pnpm8}${path_1.default.delimiter}${oldPath}`;
|
31360
|
+
console.log(`Detected \`pnpm-lock.yaml\` version ${lockfileVersion} generated by pnpm 8...`);
|
31352
31361
|
}
|
31353
31362
|
}
|
31354
31363
|
else {
|
@@ -31603,10 +31612,11 @@ exports.getPrefixedEnvVars = void 0;
|
|
31603
31612
|
*/
|
31604
31613
|
function getPrefixedEnvVars({ envPrefix, envs, }) {
|
31605
31614
|
const vercelSystemEnvPrefix = 'VERCEL_';
|
31615
|
+
const allowed = ['VERCEL_URL', 'VERCEL_ENV', 'VERCEL_REGION'];
|
31606
31616
|
const newEnvs = {};
|
31607
31617
|
if (envPrefix && envs.VERCEL_URL) {
|
31608
31618
|
Object.keys(envs)
|
31609
|
-
.filter(key => key.startsWith(
|
31619
|
+
.filter(key => allowed.includes(key) || key.startsWith('VERCEL_GIT_'))
|
31610
31620
|
.forEach(key => {
|
31611
31621
|
const newKey = `${envPrefix}${key}`;
|
31612
31622
|
if (!(newKey in envs)) {
|
@@ -31841,7 +31851,7 @@ const download_1 = __webpack_require__(3166);
|
|
31841
31851
|
const stream_to_buffer_1 = __importDefault(__webpack_require__(9688));
|
31842
31852
|
class Lambda {
|
31843
31853
|
constructor(opts) {
|
31844
|
-
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, experimentalResponseStreaming, operationType, framework, } = opts;
|
31854
|
+
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, experimentalResponseStreaming, operationType, framework, } = opts;
|
31845
31855
|
if ('files' in opts) {
|
31846
31856
|
assert_1.default(typeof opts.files === 'object', '"files" must be an object');
|
31847
31857
|
}
|
@@ -31891,7 +31901,8 @@ class Lambda {
|
|
31891
31901
|
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
31892
31902
|
this.supportsMultiPayloads = supportsMultiPayloads;
|
31893
31903
|
this.supportsWrapper = supportsWrapper;
|
31894
|
-
this.
|
31904
|
+
this.supportsResponseStreaming =
|
31905
|
+
supportsResponseStreaming ?? experimentalResponseStreaming;
|
31895
31906
|
this.framework = framework;
|
31896
31907
|
}
|
31897
31908
|
async createZip() {
|
@@ -31910,6 +31921,15 @@ class Lambda {
|
|
31910
31921
|
}
|
31911
31922
|
return zipBuffer;
|
31912
31923
|
}
|
31924
|
+
/**
|
31925
|
+
* @deprecated Use the `supportsResponseStreaming` property instead.
|
31926
|
+
*/
|
31927
|
+
get experimentalResponseStreaming() {
|
31928
|
+
return this.supportsResponseStreaming;
|
31929
|
+
}
|
31930
|
+
set experimentalResponseStreaming(v) {
|
31931
|
+
this.supportsResponseStreaming = v;
|
31932
|
+
}
|
31913
31933
|
}
|
31914
31934
|
exports.Lambda = Lambda;
|
31915
31935
|
const sema = new async_sema_1.default(10);
|
package/dist/lambda.d.ts
CHANGED
@@ -14,6 +14,10 @@ export interface LambdaOptionsBase {
|
|
14
14
|
regions?: string[];
|
15
15
|
supportsMultiPayloads?: boolean;
|
16
16
|
supportsWrapper?: boolean;
|
17
|
+
supportsResponseStreaming?: boolean;
|
18
|
+
/**
|
19
|
+
* @deprecated Use the `supportsResponseStreaming` property instead.
|
20
|
+
*/
|
17
21
|
experimentalResponseStreaming?: boolean;
|
18
22
|
operationType?: string;
|
19
23
|
framework?: FunctionFramework;
|
@@ -56,10 +60,15 @@ export declare class Lambda {
|
|
56
60
|
zipBuffer?: Buffer;
|
57
61
|
supportsMultiPayloads?: boolean;
|
58
62
|
supportsWrapper?: boolean;
|
59
|
-
|
63
|
+
supportsResponseStreaming?: boolean;
|
60
64
|
framework?: FunctionFramework;
|
61
65
|
constructor(opts: LambdaOptions);
|
62
66
|
createZip(): Promise<Buffer>;
|
67
|
+
/**
|
68
|
+
* @deprecated Use the `supportsResponseStreaming` property instead.
|
69
|
+
*/
|
70
|
+
get experimentalResponseStreaming(): boolean | undefined;
|
71
|
+
set experimentalResponseStreaming(v: boolean | undefined);
|
63
72
|
}
|
64
73
|
/**
|
65
74
|
* @deprecated Use `new Lambda()` instead.
|
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, operationType, framework, } = opts;
|
16
|
+
const { handler, runtime, maxDuration, memory, environment = {}, allowQuery, regions, supportsMultiPayloads, supportsWrapper, supportsResponseStreaming, 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
|
}
|
@@ -63,7 +63,8 @@ class Lambda {
|
|
63
63
|
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
|
64
64
|
this.supportsMultiPayloads = supportsMultiPayloads;
|
65
65
|
this.supportsWrapper = supportsWrapper;
|
66
|
-
this.
|
66
|
+
this.supportsResponseStreaming =
|
67
|
+
supportsResponseStreaming ?? experimentalResponseStreaming;
|
67
68
|
this.framework = framework;
|
68
69
|
}
|
69
70
|
async createZip() {
|
@@ -82,6 +83,15 @@ class Lambda {
|
|
82
83
|
}
|
83
84
|
return zipBuffer;
|
84
85
|
}
|
86
|
+
/**
|
87
|
+
* @deprecated Use the `supportsResponseStreaming` property instead.
|
88
|
+
*/
|
89
|
+
get experimentalResponseStreaming() {
|
90
|
+
return this.supportsResponseStreaming;
|
91
|
+
}
|
92
|
+
set experimentalResponseStreaming(v) {
|
93
|
+
this.supportsResponseStreaming = v;
|
94
|
+
}
|
85
95
|
}
|
86
96
|
exports.Lambda = Lambda;
|
87
97
|
const sema = new async_sema_1.default(10);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/build-utils",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.7.0",
|
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": "46348201b4eadb03b403f99dc5574c31d2b3926e"
|
55
55
|
}
|