@vercel/build-utils 13.8.2 → 13.11.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.
@@ -0,0 +1,11 @@
1
+ import FileBlob from '../file-blob';
2
+ /**
3
+ * A type to represent the encrypted environment file that needs to be
4
+ * attached to Lambdas with ENV > 4kb
5
+ */
6
+ export type EncryptedEnvFile = [string, FileBlob];
7
+ /**
8
+ * Get the encrypted environment file from the environment variables if it
9
+ * exists and it is supported by the runtime.
10
+ */
11
+ export declare function getEncryptedEnv(envFilename: string | undefined, envContent: string | undefined): EncryptedEnvFile | undefined;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var get_encrypted_env_file_exports = {};
30
+ __export(get_encrypted_env_file_exports, {
31
+ getEncryptedEnv: () => getEncryptedEnv
32
+ });
33
+ module.exports = __toCommonJS(get_encrypted_env_file_exports);
34
+ var import_file_blob = __toESM(require("../file-blob"));
35
+ function getEncryptedEnv(envFilename, envContent) {
36
+ if (!envFilename || !envContent) {
37
+ return;
38
+ }
39
+ return [
40
+ envFilename,
41
+ new import_file_blob.default({ data: Buffer.from(envContent, "base64") })
42
+ ];
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ getEncryptedEnv
47
+ });
@@ -0,0 +1,18 @@
1
+ /// <reference types="node" />
2
+ import { type BytecodeCachingOptions } from './get-lambda-preload-scripts';
3
+ interface LambdaLike {
4
+ awsLambdaHandler?: string;
5
+ launcherType?: string;
6
+ runtime: string;
7
+ shouldAddHelpers?: boolean;
8
+ shouldAddSourcemapSupport?: boolean;
9
+ useWebApi?: boolean;
10
+ shouldDisableAutomaticFetchInstrumentation?: boolean;
11
+ }
12
+ /**
13
+ * Extract system environment variables that need to be injected in the Lambda.
14
+ * Buffer is required just to determine if Bytecode Caching should be enabled
15
+ * but it doesn't need to be super precise.
16
+ */
17
+ export declare function getLambdaEnvironment(lambda: LambdaLike, buffer: Buffer, options: BytecodeCachingOptions): Record<string, string>;
18
+ export {};
@@ -0,0 +1,53 @@
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 get_lambda_environment_exports = {};
20
+ __export(get_lambda_environment_exports, {
21
+ getLambdaEnvironment: () => getLambdaEnvironment
22
+ });
23
+ module.exports = __toCommonJS(get_lambda_environment_exports);
24
+ var import_get_lambda_preload_scripts = require("./get-lambda-preload-scripts");
25
+ function getLambdaEnvironment(lambda, buffer, options) {
26
+ const environment = {};
27
+ if ("launcherType" in lambda && lambda.launcherType === "Nodejs") {
28
+ if (lambda.awsLambdaHandler) {
29
+ environment.AWS_LAMBDA_HANDLER = lambda.awsLambdaHandler;
30
+ }
31
+ if (lambda.shouldAddHelpers) {
32
+ environment.VERCEL_SHOULD_ADD_HELPERS = "1";
33
+ }
34
+ if (lambda.useWebApi === true) {
35
+ environment.VERCEL_USE_WEB_API = "1";
36
+ }
37
+ if (lambda.shouldAddSourcemapSupport) {
38
+ environment.VERCEL_SOURCE_MAP = "1";
39
+ }
40
+ if (lambda.shouldDisableAutomaticFetchInstrumentation) {
41
+ environment.VERCEL_TRACING_DISABLE_AUTOMATIC_FETCH_INSTRUMENTATION = "1";
42
+ }
43
+ const scripts = (0, import_get_lambda_preload_scripts.getLambdaPreloadScripts)(lambda, buffer, options);
44
+ if (scripts.length > 0) {
45
+ environment.VERCEL_NODE_PRELOAD_SCRIPTS = scripts.join(",");
46
+ }
47
+ }
48
+ return environment;
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ getLambdaEnvironment
53
+ });
@@ -0,0 +1,21 @@
1
+ /// <reference types="node" />
2
+ export interface BytecodeCachingOptions {
3
+ vercelEnv: string | undefined;
4
+ useBytecodeCaching: string | undefined;
5
+ useNativeBytecodeCaching: string | undefined;
6
+ bytecodeCachingThreshold: string | undefined;
7
+ }
8
+ interface LambdaLike {
9
+ framework?: {
10
+ slug: string;
11
+ };
12
+ runtime: string;
13
+ shouldAddSourcemapSupport?: boolean;
14
+ }
15
+ /**
16
+ * Returns an array of scripts that should be preloaded in Node.js Lambdas.
17
+ * The `buffer` parameter is needed to decide wether or not to enable Bytecode
18
+ * Caching so it doesn't **need** to be exact (we can leave out the env layer)
19
+ */
20
+ export declare function getLambdaPreloadScripts(lambda: LambdaLike, buffer: Buffer, options: BytecodeCachingOptions): string[];
21
+ export {};
@@ -0,0 +1,43 @@
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 get_lambda_preload_scripts_exports = {};
20
+ __export(get_lambda_preload_scripts_exports, {
21
+ getLambdaPreloadScripts: () => getLambdaPreloadScripts
22
+ });
23
+ module.exports = __toCommonJS(get_lambda_preload_scripts_exports);
24
+ function getLambdaPreloadScripts(lambda, buffer, options) {
25
+ const scripts = [];
26
+ if (lambda.shouldAddSourcemapSupport) {
27
+ scripts.push("/opt/rust/source-map-support.js");
28
+ }
29
+ const BYTECODE_MIN_SIZE_BYTES = (Number.parseInt(options.bytecodeCachingThreshold || "", 10) || 400) * 1024;
30
+ if (options.vercelEnv === "production" && options.useBytecodeCaching === "1" && ["nodejs20.x", "nodejs22.x", "nodejs24.x"].includes(lambda.runtime) && buffer.byteLength >= BYTECODE_MIN_SIZE_BYTES) {
31
+ scripts.push(
32
+ ["nodejs22.x", "nodejs24.x"].includes(lambda.runtime) && options.useNativeBytecodeCaching === "1" ? "/opt/rust/bytecode-native.js" : "/opt/rust/bytecode.js"
33
+ );
34
+ }
35
+ if (lambda.framework?.slug === "nextjs") {
36
+ scripts.push("/opt/rust/next-data.js");
37
+ }
38
+ return scripts;
39
+ }
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ getLambdaPreloadScripts
43
+ });
@@ -0,0 +1,23 @@
1
+ import type { Files } from '../types';
2
+ interface LambdaLike {
3
+ files?: Files;
4
+ handler: string;
5
+ launcherType?: string;
6
+ runtime: string;
7
+ supportsResponseStreaming?: boolean;
8
+ }
9
+ export interface SupportsStreamingResult {
10
+ supportsStreaming: boolean | undefined;
11
+ error?: {
12
+ handler: string;
13
+ message: string;
14
+ };
15
+ }
16
+ /**
17
+ * Determines if a Lambda should have streaming enabled. If
18
+ * `forceStreamingRuntime` is true, streaming is always enabled. If the
19
+ * setting is defined it will be honored. For Node.js it checks the handler
20
+ * exports which is why it needs to be asynchronous.
21
+ */
22
+ export declare function getLambdaSupportsStreaming(lambda: LambdaLike, forceStreamingRuntime: boolean): Promise<SupportsStreamingResult>;
23
+ export {};
@@ -0,0 +1,98 @@
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 get_lambda_supports_streaming_exports = {};
20
+ __export(get_lambda_supports_streaming_exports, {
21
+ getLambdaSupportsStreaming: () => getLambdaSupportsStreaming
22
+ });
23
+ module.exports = __toCommonJS(get_lambda_supports_streaming_exports);
24
+ var import_cjs_module_lexer = require("cjs-module-lexer");
25
+ var import_es_module_lexer = require("es-module-lexer");
26
+ async function getLambdaSupportsStreaming(lambda, forceStreamingRuntime) {
27
+ if (forceStreamingRuntime) {
28
+ return { supportsStreaming: true };
29
+ }
30
+ if (typeof lambda.supportsResponseStreaming === "boolean") {
31
+ return { supportsStreaming: lambda.supportsResponseStreaming };
32
+ }
33
+ if ("launcherType" in lambda && lambda.launcherType === "Nodejs") {
34
+ return lambdaShouldStream(lambda);
35
+ }
36
+ return { supportsStreaming: void 0 };
37
+ }
38
+ const HTTP_METHODS = [
39
+ "GET",
40
+ "HEAD",
41
+ "OPTIONS",
42
+ "POST",
43
+ "PUT",
44
+ "DELETE",
45
+ "PATCH"
46
+ ];
47
+ async function lambdaShouldStream(lambda) {
48
+ const stream = lambda.files?.[lambda.handler]?.toStream();
49
+ if (!stream) {
50
+ return { supportsStreaming: void 0 };
51
+ }
52
+ try {
53
+ const buffer = await streamToBuffer(stream);
54
+ const names = await getFileExports(lambda.handler, buffer.toString("utf8"));
55
+ for (const name of names) {
56
+ if (HTTP_METHODS.includes(name)) {
57
+ return { supportsStreaming: true };
58
+ }
59
+ }
60
+ } catch (err) {
61
+ return {
62
+ supportsStreaming: void 0,
63
+ error: { handler: lambda.handler, message: String(err) }
64
+ };
65
+ }
66
+ return { supportsStreaming: void 0 };
67
+ }
68
+ async function getFileExports(filename, content) {
69
+ if (filename.endsWith(".mjs")) {
70
+ await import_es_module_lexer.init;
71
+ return (0, import_es_module_lexer.parse)(content)[1].map((specifier) => specifier.n);
72
+ }
73
+ try {
74
+ await (0, import_cjs_module_lexer.init)();
75
+ return (0, import_cjs_module_lexer.parse)(content).exports;
76
+ } catch {
77
+ await import_es_module_lexer.init;
78
+ return (0, import_es_module_lexer.parse)(content)[1].map((specifier) => specifier.n);
79
+ }
80
+ }
81
+ function streamToBuffer(stream) {
82
+ return new Promise((resolve, reject) => {
83
+ const buffers = [];
84
+ stream.on("error", (err) => {
85
+ reject(err);
86
+ });
87
+ stream.on("data", (buffer) => {
88
+ buffers.push(buffer);
89
+ });
90
+ stream.on("end", () => {
91
+ resolve(Buffer.concat(buffers));
92
+ });
93
+ });
94
+ }
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = {
97
+ getLambdaSupportsStreaming
98
+ });
package/dist/python.js CHANGED
@@ -40,7 +40,7 @@ async function isPythonEntrypoint(file) {
40
40
  if (!fsPath)
41
41
  return false;
42
42
  const content = await import_fs.default.promises.readFile(fsPath, "utf-8");
43
- return await (0, import_python_analysis.containsAppOrHandler)(content);
43
+ return await (0, import_python_analysis.findAppOrHandler)(content) !== null;
44
44
  } catch (err) {
45
45
  (0, import_debug.default)(`Failed to check Python entrypoint: ${err}`);
46
46
  return false;
package/dist/schemas.d.ts CHANGED
@@ -121,3 +121,83 @@ export declare const buildsSchema: {
121
121
  };
122
122
  };
123
123
  };
124
+ /**
125
+ * JSON Schema for builder-produced `package-manifest.json` files.
126
+ *
127
+ * Each builder (e.g. @vercel/python) may emit a `package-manifest.json`
128
+ * in its diagnostics output.
129
+ */
130
+ export declare const packageManifestSchema: {
131
+ readonly type: "object";
132
+ readonly required: readonly ["runtime", "dependencies"];
133
+ readonly additionalProperties: false;
134
+ readonly properties: {
135
+ readonly version: {
136
+ readonly type: "string";
137
+ readonly description: "Manifest schema version, e.g. \"20260304\".";
138
+ };
139
+ readonly runtime: {
140
+ readonly type: "string";
141
+ readonly description: "Runtime identifier, e.g. \"python\", \"node\".";
142
+ };
143
+ readonly runtimeVersion: {
144
+ readonly type: "object";
145
+ readonly additionalProperties: false;
146
+ readonly required: readonly ["resolved"];
147
+ readonly properties: {
148
+ readonly requested: {
149
+ readonly type: "string";
150
+ readonly description: "Version constraint from the project manifest, e.g. \">=3.10\".";
151
+ };
152
+ readonly requestedSource: {
153
+ readonly type: "string";
154
+ readonly description: "File that declared the constraint, e.g. \"pyproject.toml\".";
155
+ };
156
+ readonly resolved: {
157
+ readonly type: "string";
158
+ readonly description: "Actual resolved version, e.g. \"3.12\".";
159
+ };
160
+ };
161
+ };
162
+ readonly dependencies: {
163
+ readonly type: "array";
164
+ readonly items: {
165
+ readonly type: "object";
166
+ readonly required: readonly ["name", "type", "scopes", "resolved"];
167
+ readonly additionalProperties: false;
168
+ readonly properties: {
169
+ readonly name: {
170
+ readonly type: "string";
171
+ };
172
+ readonly type: {
173
+ readonly type: "string";
174
+ readonly enum: readonly ["direct", "transitive", "peer"];
175
+ };
176
+ readonly scopes: {
177
+ readonly type: "array";
178
+ readonly items: {
179
+ readonly type: "string";
180
+ };
181
+ readonly description: "Dependency groups this package belongs to, e.g. [\"main\", \"dev\"].";
182
+ };
183
+ readonly requested: {
184
+ readonly type: "string";
185
+ readonly description: "Version specifier as declared, e.g. \"flask>=2.0\".";
186
+ };
187
+ readonly resolved: {
188
+ readonly type: "string";
189
+ readonly description: "Resolved version, e.g. \"3.1.0\".";
190
+ };
191
+ readonly source: {
192
+ readonly type: "string";
193
+ readonly description: "Package source type, e.g. \"registry\", \"git\", \"path\".";
194
+ };
195
+ readonly sourceUrl: {
196
+ readonly type: "string";
197
+ readonly description: "Source URL, e.g. \"https://pypi.org\".";
198
+ };
199
+ };
200
+ };
201
+ };
202
+ };
203
+ };
package/dist/schemas.js CHANGED
@@ -19,7 +19,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var schemas_exports = {};
20
20
  __export(schemas_exports, {
21
21
  buildsSchema: () => buildsSchema,
22
- functionsSchema: () => functionsSchema
22
+ functionsSchema: () => functionsSchema,
23
+ packageManifestSchema: () => packageManifestSchema
23
24
  });
24
25
  module.exports = __toCommonJS(schemas_exports);
25
26
  const triggerEventSchemaV1 = {
@@ -173,8 +174,76 @@ const buildsSchema = {
173
174
  }
174
175
  }
175
176
  };
177
+ const packageManifestSchema = {
178
+ type: "object",
179
+ required: ["runtime", "dependencies"],
180
+ additionalProperties: false,
181
+ properties: {
182
+ version: {
183
+ type: "string",
184
+ description: 'Manifest schema version, e.g. "20260304".'
185
+ },
186
+ runtime: {
187
+ type: "string",
188
+ description: 'Runtime identifier, e.g. "python", "node".'
189
+ },
190
+ runtimeVersion: {
191
+ type: "object",
192
+ additionalProperties: false,
193
+ required: ["resolved"],
194
+ properties: {
195
+ requested: {
196
+ type: "string",
197
+ description: 'Version constraint from the project manifest, e.g. ">=3.10".'
198
+ },
199
+ requestedSource: {
200
+ type: "string",
201
+ description: 'File that declared the constraint, e.g. "pyproject.toml".'
202
+ },
203
+ resolved: {
204
+ type: "string",
205
+ description: 'Actual resolved version, e.g. "3.12".'
206
+ }
207
+ }
208
+ },
209
+ dependencies: {
210
+ type: "array",
211
+ items: {
212
+ type: "object",
213
+ required: ["name", "type", "scopes", "resolved"],
214
+ additionalProperties: false,
215
+ properties: {
216
+ name: { type: "string" },
217
+ type: { type: "string", enum: ["direct", "transitive", "peer"] },
218
+ scopes: {
219
+ type: "array",
220
+ items: { type: "string" },
221
+ description: 'Dependency groups this package belongs to, e.g. ["main", "dev"].'
222
+ },
223
+ requested: {
224
+ type: "string",
225
+ description: 'Version specifier as declared, e.g. "flask>=2.0".'
226
+ },
227
+ resolved: {
228
+ type: "string",
229
+ description: 'Resolved version, e.g. "3.1.0".'
230
+ },
231
+ source: {
232
+ type: "string",
233
+ description: 'Package source type, e.g. "registry", "git", "path".'
234
+ },
235
+ sourceUrl: {
236
+ type: "string",
237
+ description: 'Source URL, e.g. "https://pypi.org".'
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ };
176
244
  // Annotate the CommonJS export names for ESM import in node:
177
245
  0 && (module.exports = {
178
246
  buildsSchema,
179
- functionsSchema
247
+ functionsSchema,
248
+ packageManifestSchema
180
249
  });
package/dist/types.d.ts CHANGED
@@ -110,6 +110,8 @@ export interface BuildOptions {
110
110
  service?: {
111
111
  /** The service name as declared in the project configuration. */
112
112
  name?: string;
113
+ /** The service type (e.g., "web", "cron", "worker"). */
114
+ type?: ServiceType;
113
115
  /** URL path prefix where the service is mounted (e.g., "/api"). */
114
116
  routePrefix?: string;
115
117
  /** Optional subdomain this service is mounted on (e.g., "api"). */
@@ -384,6 +386,14 @@ export interface ProjectSettings {
384
386
  gitForkProtection?: boolean;
385
387
  commandForIgnoringBuildStep?: string | null;
386
388
  }
389
+ export interface BuilderVX {
390
+ version: -1;
391
+ build: BuildVX;
392
+ diagnostics?: Diagnostics;
393
+ prepareCache?: PrepareCache;
394
+ shouldServe?: ShouldServe;
395
+ startDevServer?: StartDevServer;
396
+ }
387
397
  export interface BuilderV2 {
388
398
  version: 2;
389
399
  build: BuildV2;
@@ -491,9 +501,17 @@ export interface Service {
491
501
  subdomain?: string;
492
502
  schedule?: string;
493
503
  handlerFunction?: string;
494
- topic?: string;
504
+ topics?: string[];
495
505
  consumer?: string;
506
+ /** custom prefix to inject service URL env vars */
507
+ envPrefix?: string;
496
508
  }
509
+ /**
510
+ * Returns the topics a worker service subscribes to, defaulting to ['default'].
511
+ */
512
+ export declare function getWorkerTopics(config: {
513
+ topics?: string[];
514
+ }): [string, ...string[]];
497
515
  /** The framework which created the function */
498
516
  export interface FunctionFramework {
499
517
  slug: string;
@@ -528,11 +546,19 @@ export interface BuildResultV2Typical {
528
546
  */
529
547
  deploymentId?: string;
530
548
  }
549
+ export type BuildResultVX = {
550
+ resultVersion: 2;
551
+ result: BuildResultV2;
552
+ } | {
553
+ resultVersion: 3;
554
+ result: BuildResultV3;
555
+ };
531
556
  export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;
532
557
  export interface BuildResultV3 {
533
558
  routes?: any[];
534
559
  output: Lambda | EdgeFunction;
535
560
  }
561
+ export type BuildVX = (options: BuildOptions) => Promise<BuildResultVX>;
536
562
  export type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
537
563
  export type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
538
564
  export type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
@@ -664,8 +690,10 @@ export interface ExperimentalServiceConfig {
664
690
  subdomain?: string;
665
691
  /** Cron schedule expression (e.g., "0 0 * * *") */
666
692
  schedule?: string;
667
- topic?: string;
693
+ topics?: string[];
668
694
  consumer?: string;
695
+ /** Custom prefix to use to inject service URL env vars */
696
+ envPrefix?: string;
669
697
  }
670
698
  /**
671
699
  * Map of service name to service configuration.
package/dist/types.js CHANGED
@@ -20,7 +20,8 @@ var types_exports = {};
20
20
  __export(types_exports, {
21
21
  BunVersion: () => BunVersion,
22
22
  NodeVersion: () => NodeVersion,
23
- Version: () => Version
23
+ Version: () => Version,
24
+ getWorkerTopics: () => getWorkerTopics
24
25
  });
25
26
  module.exports = __toCommonJS(types_exports);
26
27
  class Version {
@@ -47,9 +48,13 @@ class NodeVersion extends Version {
47
48
  }
48
49
  class BunVersion extends Version {
49
50
  }
51
+ function getWorkerTopics(config) {
52
+ return config.topics?.length ? config.topics : ["default"];
53
+ }
50
54
  // Annotate the CommonJS export names for ESM import in node:
51
55
  0 && (module.exports = {
52
56
  BunVersion,
53
57
  NodeVersion,
54
- Version
58
+ Version,
59
+ getWorkerTopics
55
60
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.8.2",
3
+ "version": "13.11.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -11,7 +11,9 @@
11
11
  "directory": "packages/now-build-utils"
12
12
  },
13
13
  "dependencies": {
14
- "@vercel/python-analysis": "0.10.1"
14
+ "cjs-module-lexer": "1.2.3",
15
+ "es-module-lexer": "1.5.0",
16
+ "@vercel/python-analysis": "0.11.0"
15
17
  },
16
18
  "devDependencies": {
17
19
  "@iarna/toml": "2.2.3",
@@ -50,7 +52,7 @@
50
52
  "yazl": "2.5.1",
51
53
  "vitest": "2.0.1",
52
54
  "json5": "2.2.3",
53
- "@vercel/routing-utils": "6.0.2",
55
+ "@vercel/routing-utils": "6.1.1",
54
56
  "@vercel/error-utils": "2.0.3"
55
57
  },
56
58
  "scripts": {