@vercel/build-utils 13.31.0 → 13.32.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 +47 -0
- package/dist/container-image.d.ts +22 -0
- package/dist/container-image.js +37 -0
- package/dist/deserialize/serialized-types.d.ts +4 -0
- package/dist/fs/node-version.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -1
- package/dist/types.d.ts +26 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 13.32.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9fb2976: Add `services` as the canonical multi-service project configuration and keep `experimentalServicesV2` as a deprecated backwards-compatible alias.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 186014d: Add an experimental container service runtime. A service with
|
|
12
|
+
`runtime: "container"` either builds its `Dockerfile`/`Containerfile` and pushes
|
|
13
|
+
the resulting OCI image to the Vercel Container Registry (VCR), or passes a
|
|
14
|
+
prebuilt image reference through as build output.
|
|
15
|
+
|
|
16
|
+
- **`@vercel/container`** (new builder): authenticates to VCR with the project's
|
|
17
|
+
`VERCEL_OIDC_TOKEN`, ensures the repository exists, builds and pushes the
|
|
18
|
+
image, and emits a digest-pinned reference in `handler` (container functions
|
|
19
|
+
are `type: "Lambda"` with `runtime: "container"`; the platform surfaces
|
|
20
|
+
`handler` as the image downstream). Uses `docker` on developer machines and
|
|
21
|
+
`buildah` (daemonless) in the Vercel build container behind a shared
|
|
22
|
+
`ContainerEngine` interface. Supports `vc dev` via `startDevServer` (local
|
|
23
|
+
build/run, env parity, log forwarding) and `prepareCache` for buildah layer
|
|
24
|
+
reuse between builds. Build flow is instrumented with tracing spans
|
|
25
|
+
(non-secret diagnostics) and debug logging gated on `BUILDER_DEBUG`.
|
|
26
|
+
- **`@vercel/build-utils`**: add the `ContainerImage` build-output type.
|
|
27
|
+
- **`@vercel/fs-detectors`**: resolve container services from `vercel.json`
|
|
28
|
+
(the `services` config and its deprecated `experimentalServices` /
|
|
29
|
+
`experimentalServicesV2` aliases). A `Dockerfile`, `Containerfile`, or
|
|
30
|
+
`*.dockerfile` entrypoint triggers a build; any other entrypoint is treated as
|
|
31
|
+
a prebuilt OCI image reference.
|
|
32
|
+
- **`vercel`**: wire container output into `vercel build` result writing and
|
|
33
|
+
config validation.
|
|
34
|
+
|
|
35
|
+
Buildah specifics in the build container: host networking for `RUN` steps,
|
|
36
|
+
native `overlay` storage on the XFS `/vercel` volume (deferring to the image's
|
|
37
|
+
`storage.conf`), zstd push compression, and registry credentials read from the
|
|
38
|
+
provisioned auth file when present. Several knobs are available for debugging:
|
|
39
|
+
`VERCEL_CONTAINER_ENGINE`, `VERCEL_VCR_STRICT_STORAGE`,
|
|
40
|
+
`VERCEL_VCR_DISABLE_LAYER_CACHE`, and `VERCEL_VCR_FORCE_LOGIN`.
|
|
41
|
+
|
|
42
|
+
- cb0988f: Set the Node.js 20 discontinuation date to October 1, 2026.
|
|
43
|
+
|
|
44
|
+
## 13.31.1
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 2158ab6: [vc dev] Add support to `experimentalServicesV2` for bindings in `vc dev`
|
|
49
|
+
|
|
3
50
|
## 13.31.0
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Env, Files } from './types';
|
|
2
|
+
export interface ContainerImageConfig {
|
|
3
|
+
/**
|
|
4
|
+
* The OCI image reference (e.g. `vcr.vercel.com/team/project/svc@sha256:...`).
|
|
5
|
+
* Carried in `handler` per the build-output contract; api-builds surfaces it
|
|
6
|
+
* as `image` downstream (see vercel/api#76729).
|
|
7
|
+
*/
|
|
8
|
+
handler: string;
|
|
9
|
+
runtime: 'container';
|
|
10
|
+
command?: string[];
|
|
11
|
+
environment?: Env;
|
|
12
|
+
}
|
|
13
|
+
export declare class ContainerImage {
|
|
14
|
+
type: 'ContainerImage';
|
|
15
|
+
files: Files;
|
|
16
|
+
/** The OCI image reference, carried in `handler` (see ContainerImageConfig). */
|
|
17
|
+
handler: string;
|
|
18
|
+
runtime: 'container';
|
|
19
|
+
command?: string[];
|
|
20
|
+
environment: Env;
|
|
21
|
+
constructor(params: Omit<ContainerImage, 'type'>);
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var container_image_exports = {};
|
|
20
|
+
__export(container_image_exports, {
|
|
21
|
+
ContainerImage: () => ContainerImage
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(container_image_exports);
|
|
24
|
+
class ContainerImage {
|
|
25
|
+
constructor(params) {
|
|
26
|
+
this.type = "ContainerImage";
|
|
27
|
+
this.files = params.files;
|
|
28
|
+
this.handler = params.handler;
|
|
29
|
+
this.runtime = params.runtime;
|
|
30
|
+
this.command = params.command;
|
|
31
|
+
this.environment = params.environment;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
ContainerImage
|
|
37
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Lambda } from '../lambda';
|
|
2
2
|
import type { NodejsLambda } from '../nodejs-lambda';
|
|
3
3
|
import type { EdgeFunction } from '../edge-function';
|
|
4
|
+
import type { ContainerImage } from '../container-image';
|
|
4
5
|
import type FileFsRef from '../file-fs-ref';
|
|
5
6
|
import type { Prerender } from '../prerender';
|
|
6
7
|
/**
|
|
@@ -25,4 +26,7 @@ export type SerializedPrerender = Properties<Omit<Prerender, 'lambda' | 'fallbac
|
|
|
25
26
|
fallback: SerializedFileFsRef | null;
|
|
26
27
|
};
|
|
27
28
|
export type SerializedEdgeFunction = Properties<Omit<EdgeFunction, 'name' | 'files' | 'deploymentTarget'>> & FilesMapProp;
|
|
29
|
+
export type SerializedContainerImage = Omit<Properties<ContainerImage>, 'files' | 'type'> & {
|
|
30
|
+
type?: 'ContainerImage';
|
|
31
|
+
} & FilesMapProp;
|
|
28
32
|
export {};
|
package/dist/fs/node-version.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { validateNpmrc } from './validate-npmrc';
|
|
|
22
22
|
export type { NodejsLambdaOptions };
|
|
23
23
|
export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, getNodeBinPaths, getSupportedNodeVersion, isBunVersion, getSupportedBunVersion, detectPackageManager, runNpmInstall, NpmInstallOutput, runBundleInstall, runPipInstall, PipInstallResult, runShellScript, runCustomInstallCommand, resetCustomInstallCommandSet, getEnvForPackageManager, getNodeVersion, getPathForPackageManager, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, getServiceUrlEnvVars, getExperimentalServiceUrlEnvVars, streamToBuffer, streamToBufferChunks, debug, isSymbolicLink, isDirectory, isExternalSymlink, isExternalSymlinkTarget, getSymlinkTarget, getLambdaOptionsFromFunction, sanitizeConsumerName, scanParentDirs, findPackageJson, getIgnoreFilter, cloneEnv, hardLinkDir, traverseUpDirectories, validateNpmrc, type CliType, };
|
|
24
24
|
export { EdgeFunction } from './edge-function';
|
|
25
|
+
export { ContainerImage } from './container-image';
|
|
26
|
+
export type { ContainerImageConfig } from './container-image';
|
|
25
27
|
export { readConfigFile, getPackageJson } from './fs/read-config-file';
|
|
26
28
|
export { normalizePath } from './fs/normalize-path';
|
|
27
29
|
export { getOsRelease, getProvidedRuntime } from './os';
|
package/dist/index.js
CHANGED
|
@@ -34510,6 +34510,7 @@ __export(src_exports, {
|
|
|
34510
34510
|
BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP,
|
|
34511
34511
|
BUILDER_PRE_DEPLOY_STEP: () => BUILDER_PRE_DEPLOY_STEP,
|
|
34512
34512
|
BunVersion: () => BunVersion,
|
|
34513
|
+
ContainerImage: () => ContainerImage,
|
|
34513
34514
|
DEFAULT_MAX_DURATION_LIMIT: () => DEFAULT_MAX_DURATION_LIMIT,
|
|
34514
34515
|
ENV_WRAPPER_SUPPORTED_FAMILIES: () => ENV_WRAPPER_SUPPORTED_FAMILIES,
|
|
34515
34516
|
EdgeFunction: () => EdgeFunction,
|
|
@@ -35953,7 +35954,8 @@ var NODE_VERSIONS = [
|
|
|
35953
35954
|
new NodeVersion({
|
|
35954
35955
|
major: 20,
|
|
35955
35956
|
range: "20.x",
|
|
35956
|
-
runtime: "nodejs20.x"
|
|
35957
|
+
runtime: "nodejs20.x",
|
|
35958
|
+
discontinueDate: /* @__PURE__ */ new Date("2026-10-01")
|
|
35957
35959
|
}),
|
|
35958
35960
|
new NodeVersion({
|
|
35959
35961
|
major: 18,
|
|
@@ -38259,6 +38261,18 @@ var EdgeFunction = class {
|
|
|
38259
38261
|
}
|
|
38260
38262
|
};
|
|
38261
38263
|
|
|
38264
|
+
// src/container-image.ts
|
|
38265
|
+
var ContainerImage = class {
|
|
38266
|
+
constructor(params) {
|
|
38267
|
+
this.type = "ContainerImage";
|
|
38268
|
+
this.files = params.files;
|
|
38269
|
+
this.handler = params.handler;
|
|
38270
|
+
this.runtime = params.runtime;
|
|
38271
|
+
this.command = params.command;
|
|
38272
|
+
this.environment = params.environment;
|
|
38273
|
+
}
|
|
38274
|
+
};
|
|
38275
|
+
|
|
38262
38276
|
// src/os.ts
|
|
38263
38277
|
var import_fs_extra9 = __toESM(require_lib());
|
|
38264
38278
|
var import_error_utils2 = __toESM(require_dist());
|
|
@@ -40796,6 +40810,7 @@ function getExtendedPayload({
|
|
|
40796
40810
|
BUILDER_INSTALLER_STEP,
|
|
40797
40811
|
BUILDER_PRE_DEPLOY_STEP,
|
|
40798
40812
|
BunVersion,
|
|
40813
|
+
ContainerImage,
|
|
40799
40814
|
DEFAULT_MAX_DURATION_LIMIT,
|
|
40800
40815
|
ENV_WRAPPER_SUPPORTED_FAMILIES,
|
|
40801
40816
|
EdgeFunction,
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type FileBlob from './file-blob';
|
|
|
4
4
|
import type { Lambda, LambdaArchitecture } from './lambda';
|
|
5
5
|
import type { Prerender } from './prerender';
|
|
6
6
|
import type { EdgeFunction } from './edge-function';
|
|
7
|
+
import type { ContainerImage } from './container-image';
|
|
7
8
|
import type { Span } from './trace';
|
|
8
9
|
import type { HasField, Route, Rewrite, Redirect, Header } from '@vercel/routing-utils';
|
|
9
10
|
export interface Env {
|
|
@@ -55,6 +56,7 @@ export interface Meta {
|
|
|
55
56
|
filesRemoved?: string[];
|
|
56
57
|
env?: Env;
|
|
57
58
|
buildEnv?: Env;
|
|
59
|
+
port?: number;
|
|
58
60
|
[key: string]: unknown;
|
|
59
61
|
}
|
|
60
62
|
export interface BuildOptions {
|
|
@@ -545,6 +547,8 @@ export interface ExperimentalServiceV2 {
|
|
|
545
547
|
runtime?: string;
|
|
546
548
|
/** Resolved entrypoint, relative to the service root. */
|
|
547
549
|
entrypoint?: string;
|
|
550
|
+
/** Command override for `runtime: "container"` services. */
|
|
551
|
+
command?: string[];
|
|
548
552
|
/** Builder selected by the resolver. */
|
|
549
553
|
builder: Builder;
|
|
550
554
|
installCommand?: string;
|
|
@@ -609,7 +613,7 @@ export interface BuildResultV2Typical {
|
|
|
609
613
|
routes?: any[];
|
|
610
614
|
images?: Images;
|
|
611
615
|
output: {
|
|
612
|
-
[key: string]: File | Lambda | Prerender | EdgeFunction;
|
|
616
|
+
[key: string]: File | Lambda | Prerender | EdgeFunction | ContainerImage;
|
|
613
617
|
};
|
|
614
618
|
wildcard?: Array<{
|
|
615
619
|
domain: string;
|
|
@@ -743,7 +747,7 @@ export interface TriggerEvent extends TriggerEventBase {
|
|
|
743
747
|
/** Name of the consumer group for this trigger (always present in processed output) */
|
|
744
748
|
consumer: string;
|
|
745
749
|
}
|
|
746
|
-
export type ServiceRuntime = 'node' | 'python' | 'go' | 'rust' | 'ruby';
|
|
750
|
+
export type ServiceRuntime = 'node' | 'python' | 'go' | 'rust' | 'ruby' | 'container';
|
|
747
751
|
export type ServiceType = 'web' | 'cron' | 'worker' | 'job';
|
|
748
752
|
export interface ExperimentalServiceMount {
|
|
749
753
|
/** URL path prefix where the service is mounted. */
|
|
@@ -779,8 +783,10 @@ export interface ExperimentalServiceConfig {
|
|
|
779
783
|
framework?: string;
|
|
780
784
|
/** Builder to use, e.g. @vercel/node, @vercel/python */
|
|
781
785
|
builder?: string;
|
|
782
|
-
/** Specific lambda runtime to use, e.g. nodejs24.x, python3.14 */
|
|
786
|
+
/** Specific lambda runtime to use, e.g. nodejs24.x, python3.14, container */
|
|
783
787
|
runtime?: string;
|
|
788
|
+
/** Optional command override for container image services. */
|
|
789
|
+
command?: string | string[];
|
|
784
790
|
workspace?: string;
|
|
785
791
|
buildCommand?: string;
|
|
786
792
|
installCommand?: string;
|
|
@@ -816,22 +822,18 @@ export type ExperimentalServices = Record<string, ExperimentalServiceConfig>;
|
|
|
816
822
|
* }
|
|
817
823
|
*/
|
|
818
824
|
export type ExperimentalServiceGroups = Record<string, string[]>;
|
|
819
|
-
export interface
|
|
825
|
+
export interface ServiceBinding {
|
|
820
826
|
/** Must be `"service"` for Service-to-Service HTTP bindings. */
|
|
821
827
|
type: 'service';
|
|
822
|
-
/** Target service name from `
|
|
828
|
+
/** Target service name from `services`. */
|
|
823
829
|
service: string;
|
|
824
830
|
/** Generated value shape, must be `"url"`. */
|
|
825
831
|
format: 'url';
|
|
826
832
|
/** Environment variable name that will store the generated value */
|
|
827
833
|
env: string;
|
|
828
834
|
}
|
|
829
|
-
/**
|
|
830
|
-
|
|
831
|
-
*
|
|
832
|
-
* @experimental This feature is experimental and may change.
|
|
833
|
-
*/
|
|
834
|
-
export interface ExperimentalServiceV2Config {
|
|
835
|
+
/** Configuration for a service in `vercel.json#services`. */
|
|
836
|
+
export interface ServiceConfig {
|
|
835
837
|
/** Path to the service root, relative to `vercel.json`. */
|
|
836
838
|
root: string;
|
|
837
839
|
/** Framework for this service. */
|
|
@@ -841,15 +843,19 @@ export interface ExperimentalServiceV2Config {
|
|
|
841
843
|
/**
|
|
842
844
|
* Service entrypoint, relative to the service root directory.
|
|
843
845
|
* Can be a file path or a module specification (for Python).
|
|
846
|
+
* For `runtime: "container"`, a Dockerfile path (built & pushed) or a
|
|
847
|
+
* prebuilt OCI image reference.
|
|
844
848
|
*/
|
|
845
849
|
entrypoint?: string;
|
|
850
|
+
/** Command override for `runtime: "container"` services. */
|
|
851
|
+
command?: string | string[];
|
|
846
852
|
installCommand?: string;
|
|
847
853
|
buildCommand?: string;
|
|
848
854
|
devCommand?: string;
|
|
849
855
|
ignoreCommand?: string;
|
|
850
856
|
outputDirectory?: string;
|
|
851
857
|
/** Caller-side bindings that grant this service access to another service. */
|
|
852
|
-
bindings?:
|
|
858
|
+
bindings?: ServiceBinding[];
|
|
853
859
|
/** Function configuration scoped to this service root. */
|
|
854
860
|
functions?: BuilderFunctions;
|
|
855
861
|
headers?: Header[];
|
|
@@ -859,12 +865,14 @@ export interface ExperimentalServiceV2Config {
|
|
|
859
865
|
cleanUrls?: boolean;
|
|
860
866
|
trailingSlash?: boolean;
|
|
861
867
|
}
|
|
862
|
-
/**
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
*/
|
|
867
|
-
export type
|
|
868
|
+
/** Map of service name to service configuration for `vercel.json#services`. */
|
|
869
|
+
export type Services = Record<string, ServiceConfig>;
|
|
870
|
+
/** @deprecated Use `ServiceBinding` instead. */
|
|
871
|
+
export type ExperimentalServiceV2Binding = ServiceBinding;
|
|
872
|
+
/** @deprecated Use `ServiceConfig` instead. */
|
|
873
|
+
export type ExperimentalServiceV2Config = ServiceConfig;
|
|
874
|
+
/** @deprecated Use `Services` instead. */
|
|
875
|
+
export type ExperimentalServicesV2 = Services;
|
|
868
876
|
/**
|
|
869
877
|
* Result of a runtime builder's normalized entrypoint detection.
|
|
870
878
|
*
|