@vercel/build-utils 13.24.0 → 13.25.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fb0cb8d: Add normalized entrypoint detector for runtime builders.
8
+ - 4fc110b: [services] add preDeployCommand for experimentalServices
9
+
3
10
  ## 13.24.0
4
11
 
5
12
  ### Minor Changes
package/dist/index.js CHANGED
@@ -34489,6 +34489,7 @@ __export(src_exports, {
34489
34489
  BACKEND_FRAMEWORKS: () => BACKEND_FRAMEWORKS,
34490
34490
  BUILDER_COMPILE_STEP: () => BUILDER_COMPILE_STEP,
34491
34491
  BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP,
34492
+ BUILDER_PRE_DEPLOY_STEP: () => BUILDER_PRE_DEPLOY_STEP,
34492
34493
  BunVersion: () => BunVersion,
34493
34494
  ENV_WRAPPER_SUPPORTED_FAMILIES: () => ENV_WRAPPER_SUPPORTED_FAMILIES,
34494
34495
  EdgeFunction: () => EdgeFunction,
@@ -38944,6 +38945,7 @@ var Span = class _Span {
38944
38945
  // src/trace/constants.ts
38945
38946
  var BUILDER_INSTALLER_STEP = "vc.builder.install";
38946
38947
  var BUILDER_COMPILE_STEP = "vc.builder.build";
38948
+ var BUILDER_PRE_DEPLOY_STEP = "vc.builder.preDeploy";
38947
38949
 
38948
38950
  // src/get-installed-package-version.ts
38949
38951
  async function getInstalledPackageVersion(packageName, path8) {
@@ -40282,6 +40284,7 @@ function getExtendedPayload({
40282
40284
  BACKEND_FRAMEWORKS,
40283
40285
  BUILDER_COMPILE_STEP,
40284
40286
  BUILDER_INSTALLER_STEP,
40287
+ BUILDER_PRE_DEPLOY_STEP,
40285
40288
  BunVersion,
40286
40289
  ENV_WRAPPER_SUPPORTED_FAMILIES,
40287
40290
  EdgeFunction,
@@ -1,2 +1,3 @@
1
1
  export declare const BUILDER_INSTALLER_STEP = "vc.builder.install";
2
2
  export declare const BUILDER_COMPILE_STEP = "vc.builder.build";
3
+ export declare const BUILDER_PRE_DEPLOY_STEP = "vc.builder.preDeploy";
@@ -19,13 +19,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var constants_exports = {};
20
20
  __export(constants_exports, {
21
21
  BUILDER_COMPILE_STEP: () => BUILDER_COMPILE_STEP,
22
- BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP
22
+ BUILDER_INSTALLER_STEP: () => BUILDER_INSTALLER_STEP,
23
+ BUILDER_PRE_DEPLOY_STEP: () => BUILDER_PRE_DEPLOY_STEP
23
24
  });
24
25
  module.exports = __toCommonJS(constants_exports);
25
26
  const BUILDER_INSTALLER_STEP = "vc.builder.install";
26
27
  const BUILDER_COMPILE_STEP = "vc.builder.build";
28
+ const BUILDER_PRE_DEPLOY_STEP = "vc.builder.preDeploy";
27
29
  // Annotate the CommonJS export names for ESM import in node:
28
30
  0 && (module.exports = {
29
31
  BUILDER_COMPILE_STEP,
30
- BUILDER_INSTALLER_STEP
32
+ BUILDER_INSTALLER_STEP,
33
+ BUILDER_PRE_DEPLOY_STEP
31
34
  });
@@ -1,3 +1,3 @@
1
1
  export { Span } from './trace';
2
- export { BUILDER_COMPILE_STEP, BUILDER_INSTALLER_STEP } from './constants';
2
+ export { BUILDER_COMPILE_STEP, BUILDER_INSTALLER_STEP, BUILDER_PRE_DEPLOY_STEP, } from './constants';
3
3
  export type { SpanId, TraceEvent, Reporter } from './trace';
@@ -20,6 +20,7 @@ var trace_exports = {};
20
20
  __export(trace_exports, {
21
21
  BUILDER_COMPILE_STEP: () => import_constants.BUILDER_COMPILE_STEP,
22
22
  BUILDER_INSTALLER_STEP: () => import_constants.BUILDER_INSTALLER_STEP,
23
+ BUILDER_PRE_DEPLOY_STEP: () => import_constants.BUILDER_PRE_DEPLOY_STEP,
23
24
  Span: () => import_trace.Span
24
25
  });
25
26
  module.exports = __toCommonJS(trace_exports);
@@ -29,5 +30,6 @@ var import_constants = require("./constants");
29
30
  0 && (module.exports = {
30
31
  BUILDER_COMPILE_STEP,
31
32
  BUILDER_INSTALLER_STEP,
33
+ BUILDER_PRE_DEPLOY_STEP,
32
34
  Span
33
35
  });
package/dist/types.d.ts CHANGED
@@ -97,6 +97,12 @@ export interface BuildOptions {
97
97
  * fully processed
98
98
  */
99
99
  buildCallback?: (opts: Omit<BuildOptions, 'buildCallback'>) => Promise<void>;
100
+ /**
101
+ * Called by the builder to register a callback that will execute the
102
+ * service's pre-deploy command. The CLI collects these and invokes
103
+ * them only after every builder has succeeded.
104
+ */
105
+ registerPreDeploy?: (callback: () => Promise<void>) => void;
100
106
  /**
101
107
  * The current trace state from the internal vc tracing
102
108
  */
@@ -518,6 +524,7 @@ export interface Service {
518
524
  runtime?: string;
519
525
  buildCommand?: string;
520
526
  installCommand?: string;
527
+ preDeployCommand?: string;
521
528
  routePrefix?: string;
522
529
  routePrefixSource?: 'configured' | 'generated';
523
530
  subdomain?: string;
@@ -805,3 +812,37 @@ export type Services = Record<string, ServiceConfig>;
805
812
  * }
806
813
  */
807
814
  export type ExperimentalServiceGroups = Record<string, string[]>;
815
+ /**
816
+ * Result of a runtime builder's normalized entrypoint detection.
817
+ *
818
+ * - `kind: 'file'` — `entrypoint` is a path relative to the scanned `workPath`
819
+ * (e.g. `"src/index.ts"`, `"main.go"`, `"main.py"`).
820
+ * - `kind: 'py-module:attr'` — `entrypoint` is a Python `module:attr` reference
821
+ * where the module is dot-separated and resolved relative to the scanned
822
+ * `workPath` (e.g. `"main:app"`, `"src.main:app"`).
823
+ *
824
+ * @experimental This feature is experimental and may change.
825
+ */
826
+ export type DetectedEntrypoint = {
827
+ kind: 'file';
828
+ entrypoint: string;
829
+ } | {
830
+ kind: 'py-module:attr';
831
+ entrypoint: string;
832
+ } | null;
833
+ /**
834
+ * Input to a runtime builder's normalized entrypoint detector.
835
+ * @experimental This feature is experimental and may change.
836
+ */
837
+ export interface DetectEntrypointOptions {
838
+ /** Path to the candidate service directory relative to project root. */
839
+ workPath: string;
840
+ /** Framework slug detected for this directory, if any. */
841
+ framework?: string;
842
+ }
843
+ /**
844
+ * Normalized entrypoint detector signature, implemented by each runtime builder
845
+ * and consumed by services auto-detection to populate suggested service configs.
846
+ * @experimental This feature is experimental and may change.
847
+ */
848
+ export type DetectEntrypointFn = (opts: DetectEntrypointOptions) => Promise<DetectedEntrypoint>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.24.0",
3
+ "version": "13.25.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",