@vercel/build-utils 15.4.0 → 15.4.1-snapshot-c7f6a2a993e4

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,13 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 15.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 160d952: Run Python schedules in-process from the `@schedule` handlers a module declares. A schedule whose `entrypoint` is a Python module path, such as `"jobs": { "root": "jobs", "entrypoint": "tasks" }`, builds as a service named after the schedule, in its `root` like a command schedule. The build imports the module and creates a schedule for each `@schedule`, named `<service>.<schedule name>`, with its cron, timezone, and jitter. A schedule can set the `max_duration` and `regions` of its function. Schedules with the same settings share a function, which runs the handler of the schedule that each firing names: `schedules` for schedules that set none, and a name from the settings for each other combination, such as `schedules-fra1-15m`. A module entrypoint rejects `schedule`, `timezone`, and `jitter`. Python schedules are experimental: the build requires the environment variable `VERCEL_EXPERIMENTAL_PYTHON_SCHEDULES=1`.
8
+
9
+ `@vercel/build-utils` builders can return `schedules` from `build`.
10
+
3
11
  ## 15.4.0
4
12
 
5
13
  ### Minor Changes
@@ -10,7 +10,15 @@ export type VercelJsonScheduleDefinition = ScheduleDefinition | (Pick<ScheduleDe
10
10
  run: string[];
11
11
  /** Directory of the schedule's service; `entrypoint` is relative to it. */
12
12
  root: string;
13
- });
13
+ }) | {
14
+ /**
15
+ * Python module whose `@schedule` handlers set the cron, timezone and
16
+ * jitter of the schedules it creates, like `jobs.tasks`.
17
+ */
18
+ entrypoint: string;
19
+ /** Directory of the schedule's service; `entrypoint` is relative to it. */
20
+ root: string;
21
+ };
14
22
  /**
15
23
  * Whether a `vercel.json` schedule runs as a service: it has an `entrypoint`
16
24
  * or a `run`. The build turns it into the service's Build Output
package/dist/types.d.ts CHANGED
@@ -58,6 +58,13 @@ export interface Config {
58
58
  serviceName?: string;
59
59
  /** Buildpack runtime slug (e.g. "ruby"). */
60
60
  buildpack?: string;
61
+ /**
62
+ * Set when this build serves a Python schedule's module: the `@schedule`
63
+ * handlers that importing `module` registers.
64
+ */
65
+ schedulesModule?: {
66
+ module: string;
67
+ };
61
68
  /** Set when this build produces the named daemon. */
62
69
  daemon?: DaemonConfig & {
63
70
  name: string;
@@ -856,6 +863,8 @@ export interface BuildResultV2Typical {
856
863
  */
857
864
  deploymentId?: string;
858
865
  crons?: Cron[];
866
+ /** Schedules keyed by name, using the Build Output API schema. */
867
+ schedules?: Schedules;
859
868
  /** Daemon descriptors, written to `daemons/<name>/.vc-config.json`. */
860
869
  daemons?: Record<string, DaemonOutput>;
861
870
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "15.4.0",
3
+ "version": "15.4.1-snapshot-c7f6a2a993e4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",