Skip to content

Commit 6ad12e3

Browse files
committed
address comments
1 parent a2b0aa2 commit 6ad12e3

File tree

1 file changed

+13
-5
lines changed
  • packages/wrangler/src/api/startDevWorker

1 file changed

+13
-5
lines changed

packages/wrangler/src/api/startDevWorker/utils.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { readFile } from "node:fs/promises";
33
import { assertNever } from "../../utils/assert-never";
44
import type { ConfigBindingOptions } from "../../config";
55
import type { WorkerMetadataBinding } from "../../deployment-bundle/create-worker-upload-form";
6-
import type { CfWorkerInit } from "../../deployment-bundle/worker";
6+
import type {
7+
CfDispatchNamespace,
8+
CfWorkerInit,
9+
} from "../../deployment-bundle/worker";
710
import type {
811
Binding,
912
File,
@@ -458,13 +461,18 @@ export async function convertBindingsToCfWorkerInitBindings(
458461
});
459462
} else if (binding.type === "dispatch_namespace") {
460463
bindings.dispatch_namespaces ??= [];
464+
const outbound: CfDispatchNamespace["outbound"] =
465+
binding.outbound && "worker" in binding.outbound
466+
? {
467+
service: binding.outbound.worker.service,
468+
environment: binding.outbound.worker.environment,
469+
parameters: binding.outbound.params?.map((p) => p.name),
470+
}
471+
: binding.outbound;
461472
bindings.dispatch_namespaces.push({
462473
...omitType(binding),
463474
binding: name,
464-
outbound:
465-
binding.outbound && "worker" in binding.outbound
466-
? undefined
467-
: binding.outbound,
475+
outbound,
468476
});
469477
} else if (binding.type === "mtls_certificate") {
470478
bindings.mtls_certificates ??= [];

0 commit comments

Comments
 (0)