@vercel/build-utils 14.14.0 → 14.16.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 +1 -0
- package/dist/index.js +4 -4
- package/dist/schedules.d.ts +18 -1
- package/dist/schedules.js +12 -5
- package/dist/types.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @vercel/build-utils
|
|
2
2
|
|
|
3
|
+
## 14.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 20c5940: Make `name` optional for flat `schedules` entries. When omitted, the name defaults to a hash of the target and cron expression, matching the name the API derives. `vercel build` leaves unnamed schedules unnamed in `config.json`, except entrypoint schedules, which keep the derived name their function dispatches on.
|
|
8
|
+
|
|
9
|
+
## 14.15.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
3
15
|
## 14.14.0
|
|
4
16
|
|
|
5
17
|
### Minor 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
|
@@ -52,6 +52,7 @@ export { isNodeEntrypoint } from './node-entrypoint';
|
|
|
52
52
|
export * from './service-path-utils';
|
|
53
53
|
export * from './schedule-path-utils';
|
|
54
54
|
export * from './schedules';
|
|
55
|
+
export { DAEMON_NAME_PATTERN, getDaemonNames, type DaemonConfig, type DaemonReplicas, type DaemonResources, type Daemons, } from './daemons';
|
|
55
56
|
export { getEncryptedEnv, type EncryptedEnvFile, } from './process-serverless/get-encrypted-env-file';
|
|
56
57
|
export { getLambdaEnvironment } from './process-serverless/get-lambda-environment';
|
|
57
58
|
export { getLambdaPreloadScripts, type BytecodeCachingOptions, } from './process-serverless/get-lambda-preload-scripts';
|