@vercel/build-utils 14.22.0 → 15.0.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/CHANGELOG.md +30 -0
- package/dist/daemon-static-publishing.js +7 -1
- package/dist/daemons.d.ts +4 -0
- package/dist/fs/node-version.js +0 -3
- package/dist/fs/stream-to-digest-async.d.ts +0 -1
- package/dist/fs/stream-to-digest-async.js +3 -8
- package/dist/index.d.ts +1 -28
- package/dist/index.js +12 -38
- package/dist/schedules.d.ts +24 -15
- package/dist/schedules.js +22 -27
- package/dist/types.d.ts +21 -8
- package/package.json +1 -5
- package/dist/collect-build-result/file-to-build-output-file.d.ts +0 -26
- package/dist/collect-build-result/file-to-build-output-file.js +0 -54
- package/dist/collect-build-result/get-build-result-metadata.d.ts +0 -33
- package/dist/collect-build-result/get-build-result-metadata.js +0 -99
- package/dist/collect-build-result/get-content-type.d.ts +0 -1
- package/dist/collect-build-result/get-content-type.js +0 -45
- package/dist/collect-build-result/get-lambda-by-output-path.d.ts +0 -13
- package/dist/collect-build-result/get-lambda-by-output-path.js +0 -31
- package/dist/collect-build-result/get-prerender-chain.d.ts +0 -8
- package/dist/collect-build-result/get-prerender-chain.js +0 -44
- package/dist/collect-build-result/is-route-middleware.d.ts +0 -4
- package/dist/collect-build-result/is-route-middleware.js +0 -30
- package/dist/collect-build-result/prerender-to-build-output-file.d.ts +0 -23
- package/dist/collect-build-result/prerender-to-build-output-file.js +0 -85
- package/dist/collect-build-result/stream-with-extended-payload.d.ts +0 -5
- package/dist/collect-build-result/stream-with-extended-payload.js +0 -49
- package/dist/collect-build-result/validate-build-result.d.ts +0 -19
- package/dist/collect-build-result/validate-build-result.js +0 -139
- package/dist/collect-build-result/validate-prerender.d.ts +0 -8
- package/dist/collect-build-result/validate-prerender.js +0 -32
- package/dist/collect-build-result/validate-regular-file.d.ts +0 -8
- package/dist/collect-build-result/validate-regular-file.js +0 -42
- package/dist/collect-uncompressed-size.d.ts +0 -6
- package/dist/collect-uncompressed-size.js +0 -59
- package/dist/deserialize/create-functions-iterator.d.ts +0 -8
- package/dist/deserialize/create-functions-iterator.js +0 -52
- package/dist/deserialize/deserialize-build-output-types.d.ts +0 -56
- package/dist/deserialize/deserialize-build-output-types.js +0 -16
- package/dist/deserialize/deserialize-build-output.d.ts +0 -4
- package/dist/deserialize/deserialize-build-output.js +0 -296
- package/dist/deserialize/deserialize-edge-function.d.ts +0 -5
- package/dist/deserialize/deserialize-edge-function.js +0 -47
- package/dist/deserialize/deserialize-lambda.d.ts +0 -22
- package/dist/deserialize/deserialize-lambda.js +0 -56
- package/dist/deserialize/hydrate-files-map.d.ts +0 -3
- package/dist/deserialize/hydrate-files-map.js +0 -55
- package/dist/deserialize/maybe-read-json.d.ts +0 -5
- package/dist/deserialize/maybe-read-json.js +0 -37
- package/dist/deserialize/serialized-types.d.ts +0 -32
- package/dist/deserialize/serialized-types.js +0 -16
- package/dist/deserialize/validate-framework-version.d.ts +0 -6
- package/dist/deserialize/validate-framework-version.js +0 -63
- package/dist/finalize-lambda.d.ts +0 -77
- package/dist/finalize-lambda.js +0 -117
- package/dist/process-serverless/get-encrypted-env-file.d.ts +0 -11
- package/dist/process-serverless/get-encrypted-env-file.js +0 -47
- package/dist/process-serverless/get-lambda-environment.d.ts +0 -19
- package/dist/process-serverless/get-lambda-environment.js +0 -53
- package/dist/process-serverless/get-lambda-preload-scripts.d.ts +0 -22
- package/dist/process-serverless/get-lambda-preload-scripts.js +0 -43
- package/dist/process-serverless/get-lambda-supports-streaming.d.ts +0 -22
- package/dist/process-serverless/get-lambda-supports-streaming.js +0 -42
- package/dist/validate-lambda-size.d.ts +0 -45
- package/dist/validate-lambda-size.js +0 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- fec2df1: Remove the legacy BYOC extension's build-output collection and deserialization utilities, Lambda finalization and size validation, and serverless environment/streaming helpers. BYOC function preparation now uses `vercel deploy describe`.
|
|
8
|
+
|
|
9
|
+
The removed exports include `deserializeBuildOutput`, `deserializeLambda`, `deserializeEdgeFunction`, `finalizeLambda`, `collectUncompressedSize`, the `validateBuildResult` and `validateLambdaSize` families, `getEncryptedEnv`, `getLambdaEnvironment`, `getLambdaPreloadScripts`, `getLambdaSupportsStreaming`, and the associated collection/deserialization and serverless types. Also remove the unused standalone `md5` helper. Preserve `streamToDigestAsync`, `sha256`, `FileDigest`, and `ExtendedBodyData`, which still have build-container consumers.
|
|
10
|
+
|
|
11
|
+
Remove the Node builder's outdated reference to the shared streaming helper; its AWS custom-handler streaming behavior is unchanged.
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 9b1b587: Allow explicitly selecting Node.js 26 for local builds without an environment variable.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- d123652: Accept a command argument array and `root` with Dockerfile and Containerfile schedule entrypoints. This adds configuration support; building and executing these schedules will follow separately.
|
|
20
|
+
|
|
21
|
+
## 14.23.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- d39dd61: Require `name` for `schedules` entries in `vercel.json` and Build Output `config.json`. Schedules without a `name` no longer get a derived default name, and `getScheduleName` and `defaultScheduleName` are removed from `@vercel/build-utils`.
|
|
26
|
+
- 5aa1b58: `schedules` in `vercel.json` can now be an object keyed by schedule name, like `"schedules": { "nightly": { "schedule": "0 0 * * *", "path": "/api/cron" } }`. `vercel build` writes `schedules` to Build Output `config.json` in the format it was given, and builders can return it from `getDevManifest`. The array of named schedules still works but is deprecated, and `vercel build` and `vercel dev` warn when it's used.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 9abaa6d: Accept service bindings on daemons in `vercel.json`.
|
|
31
|
+
- 179d4ab: Fix `ENOENT` build failures when daemons are deployed alongside a zero-config server app that has no `public/` directory.
|
|
32
|
+
|
|
3
33
|
## 14.22.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
|
@@ -36,7 +36,13 @@ async function createDaemonStaticFileFilter({
|
|
|
36
36
|
if (!context || Object.keys(context.daemons).length === 0)
|
|
37
37
|
return async () => true;
|
|
38
38
|
const publish = (0, import_path.resolve)(publishPath);
|
|
39
|
-
const realPublish = await (0, import_promises.realpath)(publish)
|
|
39
|
+
const realPublish = await (0, import_promises.realpath)(publish).catch(
|
|
40
|
+
(error) => {
|
|
41
|
+
if (error.code === "ENOENT")
|
|
42
|
+
return publish;
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
);
|
|
40
46
|
const daemons = await Promise.all(
|
|
41
47
|
Object.entries(context.daemons).map(async ([name, daemon]) => {
|
|
42
48
|
const root = (0, import_path.resolve)(context.projectRoot, daemon.root);
|
package/dist/daemons.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ServiceBinding } from './types';
|
|
1
2
|
/** Instance counts by region. */
|
|
2
3
|
export type DaemonInstances = Record<string, number>;
|
|
3
4
|
/** @deprecated Use `DaemonInstances`. */
|
|
@@ -17,6 +18,8 @@ export interface DaemonConfig {
|
|
|
17
18
|
replicas?: DaemonInstances;
|
|
18
19
|
resources?: DaemonResources;
|
|
19
20
|
terminationGracePeriodSeconds?: number;
|
|
21
|
+
/** Bindings to services in the same deployment. */
|
|
22
|
+
bindings?: Array<Required<ServiceBinding>>;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Valid daemon names: service names, minus separator runs that aren't valid
|
|
@@ -34,6 +37,7 @@ export interface DaemonOutput {
|
|
|
34
37
|
instances: DaemonInstances;
|
|
35
38
|
resources?: DaemonResources;
|
|
36
39
|
terminationGracePeriodSeconds?: number;
|
|
40
|
+
bindings?: Array<Required<ServiceBinding>>;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
39
43
|
* Names of the daemons in `vercel.json#daemons`. Safe on unvalidated config,
|
package/dist/fs/node-version.js
CHANGED
|
@@ -121,9 +121,6 @@ function getNodeVersionByMajor(major) {
|
|
|
121
121
|
}
|
|
122
122
|
function getOptions() {
|
|
123
123
|
let versions = NODE_VERSIONS;
|
|
124
|
-
if (process.env.VERCEL_ALLOW_NODEJS_26 !== "1") {
|
|
125
|
-
versions = versions.filter((version) => version.major !== 26);
|
|
126
|
-
}
|
|
127
124
|
if (process.env.VERCEL_ALLOW_DISCONTINUED_NODEJS20 === "1") {
|
|
128
125
|
versions = versions.map(
|
|
129
126
|
(version) => version.major === 20 ? new import_types.NodeVersion({
|
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var stream_to_digest_async_exports = {};
|
|
20
20
|
__export(stream_to_digest_async_exports, {
|
|
21
|
-
md5: () => md5,
|
|
22
21
|
sha256: () => sha256,
|
|
23
22
|
streamToDigestAsync: () => streamToDigestAsync
|
|
24
23
|
});
|
|
@@ -29,11 +28,11 @@ async function streamToDigestAsync(stream) {
|
|
|
29
28
|
stream.once("error", reject);
|
|
30
29
|
let count = 0;
|
|
31
30
|
const sha2562 = (0, import_crypto.createHash)("sha256");
|
|
32
|
-
const
|
|
31
|
+
const md5 = (0, import_crypto.createHash)("md5");
|
|
33
32
|
stream.on("end", () => {
|
|
34
33
|
const res = {
|
|
35
34
|
sha256: sha2562.digest("hex"),
|
|
36
|
-
md5:
|
|
35
|
+
md5: md5.digest("hex"),
|
|
37
36
|
size: count
|
|
38
37
|
};
|
|
39
38
|
resolve(res);
|
|
@@ -42,7 +41,7 @@ async function streamToDigestAsync(stream) {
|
|
|
42
41
|
let chunk;
|
|
43
42
|
while (null !== (chunk = stream.read())) {
|
|
44
43
|
const buffer = Buffer.isBuffer(chunk) ? Uint8Array.from(chunk) : Uint8Array.from(Buffer.from(chunk));
|
|
45
|
-
|
|
44
|
+
md5.update(buffer);
|
|
46
45
|
sha2562.update(buffer);
|
|
47
46
|
count += chunk.length;
|
|
48
47
|
}
|
|
@@ -52,12 +51,8 @@ async function streamToDigestAsync(stream) {
|
|
|
52
51
|
function sha256(value) {
|
|
53
52
|
return (0, import_crypto.createHash)("sha256").update(value).digest("hex");
|
|
54
53
|
}
|
|
55
|
-
function md5(value) {
|
|
56
|
-
return (0, import_crypto.createHash)("md5").update(Uint8Array.from(value)).digest("hex");
|
|
57
|
-
}
|
|
58
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
55
|
0 && (module.exports = {
|
|
60
|
-
md5,
|
|
61
56
|
sha256,
|
|
62
57
|
streamToDigestAsync
|
|
63
58
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -54,32 +54,5 @@ export * from './service-path-utils';
|
|
|
54
54
|
export * from './schedule-path-utils';
|
|
55
55
|
export * from './schedules';
|
|
56
56
|
export { DAEMON_NAME_PATTERN, getDaemonImageRepository, getDaemonNames, type DaemonConfig, type DaemonOutput, type DaemonInstances, type DaemonReplicas, type DaemonResources, type Daemons, } from './daemons';
|
|
57
|
-
export {
|
|
58
|
-
export { getLambdaEnvironment } from './process-serverless/get-lambda-environment';
|
|
59
|
-
export { getLambdaPreloadScripts, type BytecodeCachingOptions, } from './process-serverless/get-lambda-preload-scripts';
|
|
60
|
-
export { getLambdaSupportsStreaming } from './process-serverless/get-lambda-supports-streaming';
|
|
61
|
-
export { streamToDigestAsync, sha256, md5, type FileDigest, } from './fs/stream-to-digest-async';
|
|
62
|
-
export { getBuildResultMetadata, type BuildResultMetadata, } from './collect-build-result/get-build-result-metadata';
|
|
63
|
-
export { validateBuildResult, SUPPORTED_AL2023_RUNTIMES, type ValidateBuildResultParams, type ValidateBuildResultResult, } from './collect-build-result/validate-build-result';
|
|
64
|
-
export { getLambdaByOutputPath } from './collect-build-result/get-lambda-by-output-path';
|
|
65
|
-
export { isRouteMiddleware } from './collect-build-result/is-route-middleware';
|
|
66
|
-
export { getPrerenderChain } from './collect-build-result/get-prerender-chain';
|
|
67
|
-
export { streamWithExtendedPayload, type ExtendedBodyData, } from './collect-build-result/stream-with-extended-payload';
|
|
68
|
-
export { collectUncompressedSize } from './collect-uncompressed-size';
|
|
69
|
-
export { finalizeLambda, type CreateZipResult, type CreateZipFn, type FinalizeLambdaParams, type FinalizeLambdaResult, type TraceFn, } from './finalize-lambda';
|
|
70
|
-
export { validateLambdaSize, validateUncompressedLambdaSize, FunctionSizeError, MAX_LAMBDA_SIZE, MAX_LAMBDA_UNCOMPRESSED_SIZE, validateEnvWrapperSupport, ENV_WRAPPER_SUPPORTED_FAMILIES, } from './validate-lambda-size';
|
|
71
|
-
export { validateFrameworkVersion } from './deserialize/validate-framework-version';
|
|
72
|
-
export { hydrateFilesMap } from './deserialize/hydrate-files-map';
|
|
73
|
-
export { createFunctionsIterator } from './deserialize/create-functions-iterator';
|
|
74
|
-
export { maybeReadJSON } from './deserialize/maybe-read-json';
|
|
75
|
-
export { deserializeBuildOutput, validateDeploymentId, } from './deserialize/deserialize-build-output';
|
|
76
|
-
export type { DeserializeBuildOutputConfig, DeserializeBuildOutputResult, DeserializeBuildOutputPathOverride, DeserializeBuildOutputOptions, DeserializeBuildOutputLambdaOptions, GroupLambdasOptions, DeserializeBuildOutputSerializedConfig, DeserializeBuildOutputSerializedPrerender, } from './deserialize/deserialize-build-output-types';
|
|
77
|
-
export { deserializeLambda, type DeserializeLambdaOptions, } from './deserialize/deserialize-lambda';
|
|
78
|
-
export { deserializeEdgeFunction } from './deserialize/deserialize-edge-function';
|
|
79
|
-
export type { Properties, SerializedLambda, SerializedNodejsLambda, SerializedEdgeFunction, SerializedFileFsRef, SerializedPrerender, } from './deserialize/serialized-types';
|
|
80
|
-
export { validateRegularFile } from './collect-build-result/validate-regular-file';
|
|
81
|
-
export { validatePrerender } from './collect-build-result/validate-prerender';
|
|
82
|
-
export { getContentType } from './collect-build-result/get-content-type';
|
|
83
|
-
export { fileToBuildOutputFile, type BuildOutputFile, } from './collect-build-result/file-to-build-output-file';
|
|
84
|
-
export { prerenderToBuildOutputFile, type ExtendedPayload, } from './collect-build-result/prerender-to-build-output-file';
|
|
57
|
+
export { streamToDigestAsync, sha256, type FileDigest, } from './fs/stream-to-digest-async';
|
|
85
58
|
export { EMPTY_DISCOVERY, NAVIGATION_ACCEPT_RE, promoteStaticFiles, staticBundleExclusions, staticDirectoryRedirects, staticFallbackRoutes, staticShadowRoutes, type ShadowRoute, type StaticBundleExclusions, type StaticFallback, type StaticDiscovery, type StaticMount, type StaticPromotionOptions, type StaticPromotionResult, } from './static-files';
|