@void/deploy-core 1.10.0 → 1.11.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/dist/index.d.mts +5 -0
- package/dist/index.mjs +6 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ export declare function validateManifestShape(manifest: unknown): string | null;
|
|
|
15
15
|
type DeployResource = {
|
|
16
16
|
type: "d1";
|
|
17
17
|
bindingName: string;
|
|
18
|
+
readReplication?: boolean;
|
|
18
19
|
} | {
|
|
19
20
|
type: "kv";
|
|
20
21
|
bindingName: string;
|
|
@@ -431,6 +432,10 @@ export type DurableObjectManifestMeta = {
|
|
|
431
432
|
};
|
|
432
433
|
export type DeployManifest = {
|
|
433
434
|
version: number;
|
|
435
|
+
/** D1 provisioning preferences. Omitted preserves existing replication; false disables it. */
|
|
436
|
+
database?: {
|
|
437
|
+
readReplication?: boolean;
|
|
438
|
+
};
|
|
434
439
|
/** R2 creation preferences. Requires manifest version 5. */
|
|
435
440
|
storage?: StorageConfig;
|
|
436
441
|
assetManifestVersion?: 1 | 2;
|
package/dist/index.mjs
CHANGED
|
@@ -87,6 +87,10 @@ function validateManifestShape(manifest) {
|
|
|
87
87
|
if (manifest.migrationMode !== void 0 && manifest.migrationMode !== "apply" && manifest.migrationMode !== "skip") return "invalid manifest shape: migrationMode must be apply or skip";
|
|
88
88
|
if (!isRecord(manifest.bindings)) return "invalid manifest shape: bindings must be an object";
|
|
89
89
|
const bindings = manifest.bindings;
|
|
90
|
+
if (manifest.database !== void 0) {
|
|
91
|
+
if (!isRecord(manifest.database) || Object.keys(manifest.database).some((key) => key !== "readReplication") || manifest.database.readReplication !== void 0 && typeof manifest.database.readReplication !== "boolean") return "invalid manifest shape: database.readReplication must be a boolean";
|
|
92
|
+
if (!Array.isArray(bindings.d1) || bindings.d1.length === 0) return "invalid manifest shape: database requires a D1 binding";
|
|
93
|
+
}
|
|
90
94
|
for (const key of [
|
|
91
95
|
"d1",
|
|
92
96
|
"kv",
|
|
@@ -324,7 +328,8 @@ function createDeployResourcePlan(manifest) {
|
|
|
324
328
|
const resources = [];
|
|
325
329
|
for (const bindingName of manifest.bindings.d1 ?? []) resources.push({
|
|
326
330
|
type: "d1",
|
|
327
|
-
bindingName
|
|
331
|
+
bindingName,
|
|
332
|
+
...manifest.database?.readReplication !== void 0 && { readReplication: manifest.database.readReplication }
|
|
328
333
|
});
|
|
329
334
|
for (const bindingName of manifest.bindings.kv ?? []) resources.push({
|
|
330
335
|
type: "kv",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/deploy-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Shared deployment contracts, manifests, and resource plans for Void.",
|
|
5
5
|
"homepage": "https://void.cloud",
|
|
6
6
|
"bugs": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "7.0.2",
|
|
30
|
-
"vite-plus": "1.
|
|
30
|
+
"vite-plus": "1.7.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vp pack",
|