@vercel/build-utils 13.26.1 → 13.26.2
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 +6 -0
- package/dist/finalize-lambda.d.ts +0 -3
- package/dist/finalize-lambda.js +3 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -10
- package/dist/process-serverless/get-lambda-supports-streaming.d.ts +1 -8
- package/dist/process-serverless/get-lambda-supports-streaming.js +6 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Lambda } from './lambda';
|
|
2
2
|
import type { NodejsLambda } from './nodejs-lambda';
|
|
3
3
|
import type { BytecodeCachingOptions } from './process-serverless/get-lambda-preload-scripts';
|
|
4
|
-
import type { SupportsStreamingResult } from './process-serverless/get-lambda-supports-streaming';
|
|
5
4
|
/**
|
|
6
5
|
* Optional wrapper around async work, allowing callers to inject tracing
|
|
7
6
|
* (e.g. dd-trace spans) without coupling the shared code to a tracer.
|
|
@@ -59,8 +58,6 @@ export interface FinalizeLambdaResult {
|
|
|
59
58
|
/** Compressed size in bytes. */
|
|
60
59
|
size: number;
|
|
61
60
|
uncompressedBytes: number;
|
|
62
|
-
/** Non-fatal streaming detection error, if any. Caller decides how to log. */
|
|
63
|
-
streamingError?: SupportsStreamingResult['error'];
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
66
63
|
* Core Lambda finalization logic shared between BYOF and build-container.
|
package/dist/finalize-lambda.js
CHANGED
|
@@ -98,18 +98,17 @@ async function finalizeLambda(params) {
|
|
|
98
98
|
bytecodeCachingOptions
|
|
99
99
|
)
|
|
100
100
|
};
|
|
101
|
-
const streamingResult =
|
|
101
|
+
const streamingResult = (0, import_get_lambda_supports_streaming.getLambdaSupportsStreaming)(
|
|
102
102
|
lambda,
|
|
103
103
|
forceStreamingRuntime
|
|
104
104
|
);
|
|
105
|
-
lambda.supportsResponseStreaming = streamingResult
|
|
105
|
+
lambda.supportsResponseStreaming = streamingResult;
|
|
106
106
|
return {
|
|
107
107
|
buffer: zipResult.buffer,
|
|
108
108
|
zipPath: zipResult.zipPath ?? null,
|
|
109
109
|
digest: zipResult.digest,
|
|
110
110
|
size: zipResult.size,
|
|
111
|
-
uncompressedBytes
|
|
112
|
-
streamingError: streamingResult.error
|
|
111
|
+
uncompressedBytes
|
|
113
112
|
};
|
|
114
113
|
}
|
|
115
114
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export * from './service-path-utils';
|
|
|
43
43
|
export { getEncryptedEnv, type EncryptedEnvFile, } from './process-serverless/get-encrypted-env-file';
|
|
44
44
|
export { getLambdaEnvironment } from './process-serverless/get-lambda-environment';
|
|
45
45
|
export { getLambdaPreloadScripts, type BytecodeCachingOptions, } from './process-serverless/get-lambda-preload-scripts';
|
|
46
|
-
export { getLambdaSupportsStreaming
|
|
46
|
+
export { getLambdaSupportsStreaming } from './process-serverless/get-lambda-supports-streaming';
|
|
47
47
|
export { streamToDigestAsync, sha256, md5, type FileDigest, } from './fs/stream-to-digest-async';
|
|
48
48
|
export { getBuildResultMetadata, type BuildResultMetadata, } from './collect-build-result/get-build-result-metadata';
|
|
49
49
|
export { validateBuildResult, SUPPORTED_AL2023_RUNTIMES, type ValidateBuildResultParams, type ValidateBuildResultResult, } from './collect-build-result/validate-build-result';
|
package/dist/index.js
CHANGED
|
@@ -39327,20 +39327,20 @@ function getLambdaEnvironment(lambda, buffer, options) {
|
|
|
39327
39327
|
}
|
|
39328
39328
|
|
|
39329
39329
|
// src/process-serverless/get-lambda-supports-streaming.ts
|
|
39330
|
-
|
|
39330
|
+
function getLambdaSupportsStreaming(lambda, forceStreamingRuntime) {
|
|
39331
39331
|
if (lambda.awsLambdaHandler) {
|
|
39332
|
-
return
|
|
39332
|
+
return false;
|
|
39333
39333
|
}
|
|
39334
39334
|
if (forceStreamingRuntime) {
|
|
39335
|
-
return
|
|
39335
|
+
return true;
|
|
39336
39336
|
}
|
|
39337
39337
|
if (typeof lambda.supportsResponseStreaming === "boolean") {
|
|
39338
|
-
return
|
|
39338
|
+
return lambda.supportsResponseStreaming;
|
|
39339
39339
|
}
|
|
39340
39340
|
if ("launcherType" in lambda && lambda.launcherType === "Nodejs") {
|
|
39341
|
-
return
|
|
39341
|
+
return true;
|
|
39342
39342
|
}
|
|
39343
|
-
return
|
|
39343
|
+
return void 0;
|
|
39344
39344
|
}
|
|
39345
39345
|
|
|
39346
39346
|
// src/fs/stream-to-digest-async.ts
|
|
@@ -39710,18 +39710,17 @@ async function finalizeLambda(params) {
|
|
|
39710
39710
|
bytecodeCachingOptions
|
|
39711
39711
|
)
|
|
39712
39712
|
};
|
|
39713
|
-
const streamingResult =
|
|
39713
|
+
const streamingResult = getLambdaSupportsStreaming(
|
|
39714
39714
|
lambda,
|
|
39715
39715
|
forceStreamingRuntime
|
|
39716
39716
|
);
|
|
39717
|
-
lambda.supportsResponseStreaming = streamingResult
|
|
39717
|
+
lambda.supportsResponseStreaming = streamingResult;
|
|
39718
39718
|
return {
|
|
39719
39719
|
buffer: zipResult.buffer,
|
|
39720
39720
|
zipPath: zipResult.zipPath ?? null,
|
|
39721
39721
|
digest: zipResult.digest,
|
|
39722
39722
|
size: zipResult.size,
|
|
39723
|
-
uncompressedBytes
|
|
39724
|
-
streamingError: streamingResult.error
|
|
39723
|
+
uncompressedBytes
|
|
39725
39724
|
};
|
|
39726
39725
|
}
|
|
39727
39726
|
|
|
@@ -5,13 +5,6 @@ interface LambdaLike {
|
|
|
5
5
|
runtime: string;
|
|
6
6
|
supportsResponseStreaming?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export interface SupportsStreamingResult {
|
|
9
|
-
supportsStreaming: boolean | undefined;
|
|
10
|
-
error?: {
|
|
11
|
-
handler: string;
|
|
12
|
-
message: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
8
|
/**
|
|
16
9
|
* Determines if a Lambda should have streaming enabled.
|
|
17
10
|
*
|
|
@@ -25,5 +18,5 @@ export interface SupportsStreamingResult {
|
|
|
25
18
|
* enabled. If the setting is defined it will be honored. Enabled by
|
|
26
19
|
* default for Node.js.
|
|
27
20
|
*/
|
|
28
|
-
export declare function getLambdaSupportsStreaming(lambda: LambdaLike, forceStreamingRuntime: boolean):
|
|
21
|
+
export declare function getLambdaSupportsStreaming(lambda: LambdaLike, forceStreamingRuntime: boolean): boolean | undefined;
|
|
29
22
|
export {};
|
|
@@ -21,20 +21,20 @@ __export(get_lambda_supports_streaming_exports, {
|
|
|
21
21
|
getLambdaSupportsStreaming: () => getLambdaSupportsStreaming
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(get_lambda_supports_streaming_exports);
|
|
24
|
-
|
|
24
|
+
function getLambdaSupportsStreaming(lambda, forceStreamingRuntime) {
|
|
25
25
|
if (lambda.awsLambdaHandler) {
|
|
26
|
-
return
|
|
26
|
+
return false;
|
|
27
27
|
}
|
|
28
28
|
if (forceStreamingRuntime) {
|
|
29
|
-
return
|
|
29
|
+
return true;
|
|
30
30
|
}
|
|
31
31
|
if (typeof lambda.supportsResponseStreaming === "boolean") {
|
|
32
|
-
return
|
|
32
|
+
return lambda.supportsResponseStreaming;
|
|
33
33
|
}
|
|
34
34
|
if ("launcherType" in lambda && lambda.launcherType === "Nodejs") {
|
|
35
|
-
return
|
|
35
|
+
return true;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return void 0;
|
|
38
38
|
}
|
|
39
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
40
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/build-utils",
|
|
3
|
-
"version": "13.26.
|
|
3
|
+
"version": "13.26.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.js",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"vitest": "2.0.1",
|
|
56
56
|
"typescript": "4.9.5",
|
|
57
57
|
"yazl": "2.5.1",
|
|
58
|
-
"@vercel/
|
|
59
|
-
"@vercel/
|
|
58
|
+
"@vercel/error-utils": "2.1.0",
|
|
59
|
+
"@vercel/routing-utils": "6.2.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "node build.mjs",
|