Skip to content

Commit e44f496

Browse files
authored
Only show dev registry connection status in local dev (#7039)
1 parent 44c954b commit e44f496

File tree

3 files changed

+36
-23
lines changed

3 files changed

+36
-23
lines changed

.changeset/heavy-taxis-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Only show dev registry connection status in local dev

packages/wrangler/src/__tests__/deploy.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,7 +6117,7 @@ addEventListener('fetch', event => {});`
61176117
Worker Startup Time: 100 ms
61186118
Your worker has access to the following bindings:
61196119
- Durable Objects:
6120-
- SOMENAME: SomeClass (defined in 🔴 some-script)
6120+
- SOMENAME: SomeClass (defined in some-script)
61216121
Uploaded test-name (TIMINGS)
61226122
Deployed test-name triggers (TIMINGS)
61236123
https://test-name.test-sub-domain.workers.dev
@@ -6812,8 +6812,8 @@ addEventListener('fetch', event => {});`
68126812
- DATA_BLOB_ONE: some-data-blob.bin
68136813
- DATA_BLOB_TWO: more-data-blob.bin
68146814
- Durable Objects:
6815-
- DURABLE_OBJECT_ONE: SomeDurableObject (defined in 🔴 some-durable-object-worker)
6816-
- DURABLE_OBJECT_TWO: AnotherDurableObject (defined in 🔴 another-durable-object-worker)
6815+
- DURABLE_OBJECT_ONE: SomeDurableObject (defined in some-durable-object-worker)
6816+
- DURABLE_OBJECT_TWO: AnotherDurableObject (defined in another-durable-object-worker)
68176817
- KV Namespaces:
68186818
- KV_NAMESPACE_ONE: kv-ns-one-id
68196819
- KV_NAMESPACE_TWO: kv-ns-two-id
@@ -7909,7 +7909,7 @@ addEventListener('fetch', event => {});`
79097909
Worker Startup Time: 100 ms
79107910
Your worker has access to the following bindings:
79117911
- Durable Objects:
7912-
- EXAMPLE_DO_BINDING: ExampleDurableObject (defined in 🔴 example-do-binding-worker)
7912+
- EXAMPLE_DO_BINDING: ExampleDurableObject (defined in example-do-binding-worker)
79137913
Uploaded test-name (TIMINGS)
79147914
Deployed test-name triggers (TIMINGS)
79157915
https://test-name.test-sub-domain.workers.dev
@@ -8079,7 +8079,7 @@ addEventListener('fetch', event => {});`
80798079
Worker Startup Time: 100 ms
80808080
Your worker has access to the following bindings:
80818081
- Services:
8082-
- FOO: 🔴 foo-service
8082+
- FOO: foo-service
80838083
Uploaded test-name (TIMINGS)
80848084
Deployed test-name triggers (TIMINGS)
80858085
https://test-name.test-sub-domain.workers.dev
@@ -8120,7 +8120,7 @@ addEventListener('fetch', event => {});`
81208120
Worker Startup Time: 100 ms
81218121
Your worker has access to the following bindings:
81228122
- Services:
8123-
- FOO: 🔴 foo-service#MyHandler
8123+
- FOO: foo-service#MyHandler
81248124
Uploaded test-name (TIMINGS)
81258125
Deployed test-name triggers (TIMINGS)
81268126
https://test-name.test-sub-domain.workers.dev

packages/wrangler/src/config/index.ts

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,21 @@ export function printBindings(
264264
({ name, class_name, script_name }) => {
265265
let value = class_name;
266266
if (script_name) {
267-
const registryDefinition = context.registry?.[script_name];
268-
if (
269-
registryDefinition &&
270-
registryDefinition.durableObjects.some(
271-
(d) => d.className === class_name
272-
)
273-
) {
274-
value += ` (defined in 🟢 ${script_name})`;
267+
if (context.local) {
268+
const registryDefinition = context.registry?.[script_name];
269+
270+
if (
271+
registryDefinition &&
272+
registryDefinition.durableObjects.some(
273+
(d) => d.className === class_name
274+
)
275+
) {
276+
value += ` (defined in 🟢 ${script_name})`;
277+
} else {
278+
value += ` (defined in 🔴 ${script_name})`;
279+
}
275280
} else {
276-
value += ` (defined in 🔴 ${script_name})`;
281+
value += ` (defined in ${script_name})`;
277282
}
278283
}
279284

@@ -426,14 +431,17 @@ export function printBindings(
426431
value += `#${entrypoint}`;
427432
}
428433

429-
const registryDefinition = context.registry?.[service];
430-
if (
431-
registryDefinition &&
432-
(!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])
433-
) {
434-
value = `🟢 ` + value;
435-
} else {
436-
value = `🔴 ` + value;
434+
if (context.local) {
435+
const registryDefinition = context.registry?.[service];
436+
if (
437+
registryDefinition &&
438+
(!entrypoint ||
439+
registryDefinition.entrypointAddresses?.[entrypoint])
440+
) {
441+
value = `🟢 ` + value;
442+
} else {
443+
value = `🔴 ` + value;
444+
}
437445
}
438446
return {
439447
key: binding,

0 commit comments

Comments
 (0)