@vercel/build-utils 14.13.2 → 14.15.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 +12 -0
- package/dist/daemons.d.ts +30 -0
- package/dist/daemons.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -3
- package/dist/schedules.d.ts +12 -0
- package/dist/schedules.js +148 -0
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 14.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a7ef28c: Accept a top-level `daemons` field in `vercel.json`. `vercel dev` warns that it doesn't run daemons, and `vercel build` doesn't build them yet.
|
|
8
|
+
|
|
9
|
+
## 14.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- deb48cd: Accept a flat `schedules` format in `vercel.json` that is aligned with `crons` (`schedule` plus one of `path`, `function`, `topic`, or `entrypoint`), and emit schedules in the flat format in Build Output API `config.json`. The nested `expression`/`target` format is still accepted.
|
|
14
|
+
|
|
3
15
|
## 14.13.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Replica counts by region. */
|
|
2
|
+
export type DaemonReplicas = Record<string, number>;
|
|
3
|
+
export interface DaemonResources {
|
|
4
|
+
requests: {
|
|
5
|
+
memory: '1Gi' | '2Gi' | '4Gi' | '8Gi';
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
/** A `vercel.json#daemons` entry. */
|
|
9
|
+
export interface DaemonConfig {
|
|
10
|
+
root: string;
|
|
11
|
+
entrypoint: string;
|
|
12
|
+
command?: string[];
|
|
13
|
+
replicas: DaemonReplicas;
|
|
14
|
+
resources?: DaemonResources;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Valid daemon names: service names, minus separator runs that aren't valid
|
|
18
|
+
* in an image repository name (`a___b`, `a_-b`), because each daemon's image
|
|
19
|
+
* gets its own repository named after it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DAEMON_NAME_PATTERN = "^[a-z]+(?:(?:_|__|-+)[a-z]+)*$";
|
|
22
|
+
/** Map of daemon name to daemon configuration for `vercel.json#daemons`. */
|
|
23
|
+
export type Daemons = Record<string, DaemonConfig>;
|
|
24
|
+
/**
|
|
25
|
+
* Names of the daemons in `vercel.json#daemons`. Safe on unvalidated config,
|
|
26
|
+
* where `daemons` may not be an object.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getDaemonNames(config: {
|
|
29
|
+
daemons?: unknown;
|
|
30
|
+
} | null | undefined): string[];
|
package/dist/daemons.js
ADDED
|
@@ -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 daemons_exports = {};
|
|
20
|
+
__export(daemons_exports, {
|
|
21
|
+
DAEMON_NAME_PATTERN: () => DAEMON_NAME_PATTERN,
|
|
22
|
+
getDaemonNames: () => getDaemonNames
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(daemons_exports);
|
|
25
|
+
const DAEMON_NAME_PATTERN = "^[a-z]+(?:(?:_|__|-+)[a-z]+)*$";
|
|
26
|
+
function getDaemonNames(config) {
|
|
27
|
+
const daemons = config?.daemons;
|
|
28
|
+
if (typeof daemons !== "object" || daemons === null || Array.isArray(daemons)) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
return Object.keys(daemons);
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
DAEMON_NAME_PATTERN,
|
|
36
|
+
getDaemonNames
|
|
37
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export { BACKEND_FRAMEWORKS, BACKEND_BUILDERS, UNIFIED_BACKEND_BUILDER, type Bac
|
|
|
51
51
|
export { isNodeEntrypoint } from './node-entrypoint';
|
|
52
52
|
export * from './service-path-utils';
|
|
53
53
|
export * from './schedule-path-utils';
|
|
54
|
+
export * from './schedules';
|
|
55
|
+
export { DAEMON_NAME_PATTERN, getDaemonNames, type DaemonConfig, type DaemonReplicas, type DaemonResources, type Daemons, } from './daemons';
|
|
54
56
|
export { getEncryptedEnv, type EncryptedEnvFile, } from './process-serverless/get-encrypted-env-file';
|
|
55
57
|
export { getLambdaEnvironment } from './process-serverless/get-lambda-environment';
|
|
56
58
|
export { getLambdaPreloadScripts, type BytecodeCachingOptions, } from './process-serverless/get-lambda-preload-scripts';
|