@vercel/build-utils 14.16.0 → 14.17.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.
@@ -8,6 +8,10 @@
8
8
  * Reserved internal namespace used by services routing/runtime plumbing.
9
9
  */
10
10
  export declare const INTERNAL_SERVICE_PREFIX = "/_svc";
11
+ /**
12
+ * Valid service names, which are also used as path segments.
13
+ */
14
+ export declare const SERVICE_NAME_PATTERN = "^[a-z]([a-z_-]*[a-z])?$";
11
15
  export declare function getInternalServiceFunctionPath(serviceName: string): string;
12
16
  export declare function getInternalServiceCronPathPrefix(serviceName: string): string;
13
17
  export declare function getInternalServiceCronPath(serviceName: string, entrypoint: string, handler?: string): string;
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var service_path_utils_exports = {};
20
20
  __export(service_path_utils_exports, {
21
21
  INTERNAL_SERVICE_PREFIX: () => INTERNAL_SERVICE_PREFIX,
22
+ SERVICE_NAME_PATTERN: () => SERVICE_NAME_PATTERN,
22
23
  getInternalServiceCronPath: () => getInternalServiceCronPath,
23
24
  getInternalServiceCronPathPrefix: () => getInternalServiceCronPathPrefix,
24
25
  getInternalServiceFunctionPath: () => getInternalServiceFunctionPath,
@@ -27,6 +28,7 @@ __export(service_path_utils_exports, {
27
28
  });
28
29
  module.exports = __toCommonJS(service_path_utils_exports);
29
30
  const INTERNAL_SERVICE_PREFIX = "/_svc";
31
+ const SERVICE_NAME_PATTERN = "^[a-z]([a-z_-]*[a-z])?$";
30
32
  function normalizeInternalServiceEntrypoint(entrypoint) {
31
33
  const normalized = entrypoint.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\.[^/.]+$/, "");
32
34
  return normalized || "index";
@@ -51,6 +53,7 @@ function getInternalServiceWorkerPath(serviceName, entrypoint, handler = "worker
51
53
  // Annotate the CommonJS export names for ESM import in node:
52
54
  0 && (module.exports = {
53
55
  INTERNAL_SERVICE_PREFIX,
56
+ SERVICE_NAME_PATTERN,
54
57
  getInternalServiceCronPath,
55
58
  getInternalServiceCronPathPrefix,
56
59
  getInternalServiceFunctionPath,
package/dist/types.d.ts CHANGED
@@ -5,6 +5,7 @@ import type { Lambda, LambdaAffinity, LambdaArchitecture } from './lambda';
5
5
  import type { Prerender } from './prerender';
6
6
  import type { EdgeFunction } from './edge-function';
7
7
  import type { ContainerImage } from './container-image';
8
+ import type { DaemonConfig, DaemonOutput } from './daemons';
8
9
  import type { Span } from './trace';
9
10
  import type { HasField, Route, Rewrite, Redirect, Header } from '@vercel/routing-utils';
10
11
  export interface Env {
@@ -73,10 +74,18 @@ export interface Config {
73
74
  buildpack?: string;
74
75
  /** Set when this build produces a function for schedule entrypoints. */
75
76
  scheduleFunction?: ScheduleFunctionBuildConfig;
77
+ /** Set when this build produces the named daemon. */
78
+ daemon?: DaemonConfig & {
79
+ name: string;
80
+ };
76
81
  [key: string]: unknown;
77
82
  }
78
83
  export type { HasField };
79
84
  export interface Meta {
85
+ daemonContext?: {
86
+ projectRoot: string;
87
+ daemons: Record<string, DaemonConfig>;
88
+ };
80
89
  isDev?: boolean;
81
90
  devCacheDir?: string;
82
91
  skipDownload?: boolean;
@@ -827,6 +836,8 @@ export interface BuildResultV2Typical {
827
836
  */
828
837
  deploymentId?: string;
829
838
  crons?: Cron[];
839
+ /** Daemon descriptors, written to `daemons/<name>/.vc-config.json`. */
840
+ daemons?: Record<string, DaemonOutput>;
830
841
  }
831
842
  export type BuildResultVX = {
832
843
  resultVersion: 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "14.16.0",
3
+ "version": "14.17.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",