@void/deploy-cloudflare 1.1.11 → 1.2.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 CHANGED
@@ -28,6 +28,19 @@ type CloudflareOperation = ({
28
28
  type: "d1.migrations.list" | "d1.migrations.apply";
29
29
  database: string;
30
30
  configPath: string;
31
+ } | {
32
+ type: "d1.time-travel.bookmark";
33
+ database: string;
34
+ configPath: string;
35
+ } | {
36
+ type: "d1.time-travel.restore";
37
+ database: string;
38
+ target: {
39
+ bookmark: string;
40
+ } | {
41
+ timestamp: string;
42
+ };
43
+ configPath: string;
31
44
  } | {
32
45
  type: "kv.namespace.create";
33
46
  name: string;
@@ -81,6 +94,11 @@ type CloudflareOperation = ({
81
94
  assetsDirectory?: string;
82
95
  previewAlias?: string;
83
96
  noBundle?: boolean;
97
+ /**
98
+ * Attach the Cloudflare CLI to this terminal so that it can ask the
99
+ * operator. The result then has only the exit status.
100
+ */
101
+ interactive?: boolean;
84
102
  } & WorkerTarget) | ({
85
103
  type: "triggers.deploy";
86
104
  assets?: boolean;
@@ -290,6 +308,8 @@ type CloudflareTriggerConfig = Readonly<{
290
308
  preservePreviewUrls?: boolean;
291
309
  /** Fingerprint of explicit non-versioned settings while remote triggers stay opaque. */
292
310
  settingsHash?: string;
311
+ /** Explicit Worker-wide observability settings, published after version activation. */
312
+ observability?: Readonly<Record<string, unknown>>;
293
313
  workers_dev: boolean;
294
314
  preview_urls: boolean;
295
315
  routes: ReadonlyArray<unknown>;
@@ -335,11 +355,11 @@ export declare function encodeCloudflareVersionMessage(migrations: ReadonlyArray
335
355
  /** Read migration state written by {@link encodeCloudflareVersionMessage}. */
336
356
  export declare function parseCloudflareVersionMessage(message: string | null | undefined): CloudflareVersionMetadata | null;
337
357
  /**
338
- * Capture every configuration surface mutated by `wrangler triggers deploy` — routes,
339
- * workers.dev / preview flags, crons, queue consumers, workflows, and Email Routing addresses.
358
+ * Capture shared configuration published after activation: routes, workers.dev / preview flags,
359
+ * crons, queue consumers, workflows, Email Routing addresses, and explicit observability.
340
360
  */
341
361
  export declare function readCloudflareTriggerConfig(configPath: string, sourceConfigPath?: string): CloudflareTriggerConfig;
342
- /** Apply a version's persisted trigger state using an isolated temporary Wrangler config. */
362
+ /** Apply a version's persisted triggers and Worker settings using an isolated temporary config. */
343
363
  export declare function deployCloudflareVersionTriggers(options: {
344
364
  runWrangler: CloudflareCommandRunner;
345
365
  workerName: string;
package/dist/index.mjs CHANGED
@@ -835,13 +835,17 @@ function parseCloudflareVersionMessage(message) {
835
835
  }
836
836
  }
837
837
  /**
838
- * Capture every configuration surface mutated by `wrangler triggers deploy` — routes,
839
- * workers.dev / preview flags, crons, queue consumers, workflows, and Email Routing addresses.
838
+ * Capture shared configuration published after activation: routes, workers.dev / preview flags,
839
+ * crons, queue consumers, workflows, Email Routing addresses, and explicit observability.
840
840
  */
841
841
  function readCloudflareTriggerConfig(configPath, sourceConfigPath) {
842
- const result = triggerConfigFromWrangler(parseRootWranglerConfig(configPath));
842
+ const config = parseRootWranglerConfig(configPath);
843
+ const source = sourceConfigPath ? parseRootWranglerConfig(sourceConfigPath) : config;
844
+ const result = triggerConfigFromWrangler({
845
+ ...config,
846
+ observability: source.observability
847
+ });
843
848
  if (!sourceConfigPath) return result;
844
- const source = parseRootWranglerConfig(sourceConfigPath);
845
849
  return {
846
850
  ...result,
847
851
  settingsHash: nonVersionedSettingsHash(source),
@@ -850,7 +854,7 @@ function readCloudflareTriggerConfig(configPath, sourceConfigPath) {
850
854
  ...source.preview_urls === void 0 ? { preservePreviewUrls: true } : {}
851
855
  };
852
856
  }
853
- /** Apply a version's persisted trigger state using an isolated temporary Wrangler config. */
857
+ /** Apply a version's persisted triggers and Worker settings using an isolated temporary config. */
854
858
  async function deployCloudflareVersionTriggers(options) {
855
859
  if (options.triggerConfig.preserve) return {
856
860
  status: 0,
@@ -1079,6 +1083,7 @@ function triggerConfigFromWrangler(config) {
1079
1083
  ...config.workers_dev === void 0 ? { preserveWorkersDev: true } : {},
1080
1084
  ...config.preview_urls === void 0 ? { preservePreviewUrls: true } : {},
1081
1085
  settingsHash: nonVersionedSettingsHash(config),
1086
+ ...isRecord(config.observability) ? { observability: config.observability } : {},
1082
1087
  workers_dev: workersDev,
1083
1088
  preview_urls: typeof config.preview_urls === "boolean" ? config.preview_urls : workersDev,
1084
1089
  routes,
@@ -1113,13 +1118,14 @@ function parseTriggerConfig(value) {
1113
1118
  "preserveRoutes",
1114
1119
  "preserveWorkersDev",
1115
1120
  "preservePreviewUrls"
1116
- ].some((key) => value[key] !== void 0 && typeof value[key] !== "boolean") || value.settingsHash !== void 0 && typeof value.settingsHash !== "string" || typeof value.workers_dev !== "boolean" || typeof value.preview_urls !== "boolean" || !Array.isArray(value.routes) || !Array.isArray(value.crons) || !Array.isArray(value.queueConsumers) || !Array.isArray(value.workflows) || value.addresses !== void 0 && readEmailAddresses(value.addresses) === void 0) return null;
1121
+ ].some((key) => value[key] !== void 0 && typeof value[key] !== "boolean") || value.settingsHash !== void 0 && typeof value.settingsHash !== "string" || value.observability !== void 0 && !isRecord(value.observability) || typeof value.workers_dev !== "boolean" || typeof value.preview_urls !== "boolean" || !Array.isArray(value.routes) || !Array.isArray(value.crons) || !Array.isArray(value.queueConsumers) || !Array.isArray(value.workflows) || value.addresses !== void 0 && readEmailAddresses(value.addresses) === void 0) return null;
1117
1122
  return {
1118
1123
  ...value.preserve === true ? { preserve: true } : {},
1119
1124
  ...value.preserveRoutes === true ? { preserveRoutes: true } : {},
1120
1125
  ...value.preserveWorkersDev === true ? { preserveWorkersDev: true } : {},
1121
1126
  ...value.preservePreviewUrls === true ? { preservePreviewUrls: true } : {},
1122
1127
  ...typeof value.settingsHash === "string" ? { settingsHash: value.settingsHash } : {},
1128
+ ...isRecord(value.observability) ? { observability: value.observability } : {},
1123
1129
  workers_dev: value.workers_dev,
1124
1130
  preview_urls: value.preview_urls,
1125
1131
  routes: value.routes,
@@ -1136,6 +1142,7 @@ function triggerWranglerConfig(base, triggerConfig, manageRoutes = true) {
1136
1142
  queues.consumers = [...triggerConfig.queueConsumers];
1137
1143
  const config = {
1138
1144
  ...base,
1145
+ ...triggerConfig.observability === void 0 ? {} : { observability: triggerConfig.observability },
1139
1146
  triggers,
1140
1147
  queues,
1141
1148
  workflows: [...triggerConfig.workflows],
@@ -1154,6 +1161,7 @@ function resolvePreservedTraffic(desired, previous, workerExists) {
1154
1161
  return {
1155
1162
  ...desired.preserve ? { preserve: true } : {},
1156
1163
  ...desired.settingsHash ? { settingsHash: desired.settingsHash } : {},
1164
+ ...desired.observability === void 0 ? {} : { observability: desired.observability },
1157
1165
  workers_dev: desired.preserveWorkersDev ? previous?.workers_dev ?? desired.workers_dev : desired.workers_dev,
1158
1166
  preview_urls: desired.preservePreviewUrls ? previous?.preview_urls ?? desired.preview_urls : desired.preview_urls,
1159
1167
  routes: desired.preserveRoutes ? previous?.routes ?? desired.routes : desired.routes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/deploy-cloudflare",
3
- "version": "1.1.11",
3
+ "version": "1.2.0",
4
4
  "description": "Cloudflare deployment primitives for Void runtimes and deployment adapters.",
5
5
  "homepage": "https://void.cloud",
6
6
  "bugs": {
@@ -26,15 +26,15 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@void/deploy-core": "1.1.11",
29
+ "@void/deploy-core": "1.2.0",
30
30
  "jsonc-parser": "^3.3.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@cloudflare/workers-types": "^5.20261014.1",
33
+ "@cloudflare/workers-types": "^5.20261019.1",
34
34
  "@types/node": "^26.6.5",
35
35
  "pathslash": "^0.1.0",
36
36
  "typescript": "7.0.2",
37
- "vite-plus": "1.2.0"
37
+ "vite-plus": "1.3.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "vp pack",