Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show dev registry connection status in local dev #7039

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/heavy-taxis-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Only show dev registry connection status in local dev
12 changes: 6 additions & 6 deletions packages/wrangler/src/__tests__/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6117,7 +6117,7 @@ addEventListener('fetch', event => {});`
Worker Startup Time: 100 ms
Your worker has access to the following bindings:
- Durable Objects:
- SOMENAME: SomeClass (defined in 🔴 some-script)
- SOMENAME: SomeClass (defined in some-script)
Uploaded test-name (TIMINGS)
Deployed test-name triggers (TIMINGS)
https://test-name.test-sub-domain.workers.dev
Expand Down Expand Up @@ -6812,8 +6812,8 @@ addEventListener('fetch', event => {});`
- DATA_BLOB_ONE: some-data-blob.bin
- DATA_BLOB_TWO: more-data-blob.bin
- Durable Objects:
- DURABLE_OBJECT_ONE: SomeDurableObject (defined in 🔴 some-durable-object-worker)
- DURABLE_OBJECT_TWO: AnotherDurableObject (defined in 🔴 another-durable-object-worker)
- DURABLE_OBJECT_ONE: SomeDurableObject (defined in some-durable-object-worker)
- DURABLE_OBJECT_TWO: AnotherDurableObject (defined in another-durable-object-worker)
- KV Namespaces:
- KV_NAMESPACE_ONE: kv-ns-one-id
- KV_NAMESPACE_TWO: kv-ns-two-id
Expand Down Expand Up @@ -7909,7 +7909,7 @@ addEventListener('fetch', event => {});`
Worker Startup Time: 100 ms
Your worker has access to the following bindings:
- Durable Objects:
- EXAMPLE_DO_BINDING: ExampleDurableObject (defined in 🔴 example-do-binding-worker)
- EXAMPLE_DO_BINDING: ExampleDurableObject (defined in example-do-binding-worker)
Uploaded test-name (TIMINGS)
Deployed test-name triggers (TIMINGS)
https://test-name.test-sub-domain.workers.dev
Expand Down Expand Up @@ -8079,7 +8079,7 @@ addEventListener('fetch', event => {});`
Worker Startup Time: 100 ms
Your worker has access to the following bindings:
- Services:
- FOO: 🔴 foo-service
- FOO: foo-service
Uploaded test-name (TIMINGS)
Deployed test-name triggers (TIMINGS)
https://test-name.test-sub-domain.workers.dev
Expand Down Expand Up @@ -8120,7 +8120,7 @@ addEventListener('fetch', event => {});`
Worker Startup Time: 100 ms
Your worker has access to the following bindings:
- Services:
- FOO: 🔴 foo-service#MyHandler
- FOO: foo-service#MyHandler
Uploaded test-name (TIMINGS)
Deployed test-name triggers (TIMINGS)
https://test-name.test-sub-domain.workers.dev
Expand Down
42 changes: 25 additions & 17 deletions packages/wrangler/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,21 @@ export function printBindings(
({ name, class_name, script_name }) => {
let value = class_name;
if (script_name) {
const registryDefinition = context.registry?.[script_name];
if (
registryDefinition &&
registryDefinition.durableObjects.some(
(d) => d.className === class_name
)
) {
value += ` (defined in 🟢 ${script_name})`;
if (context.local) {
const registryDefinition = context.registry?.[script_name];

if (
registryDefinition &&
registryDefinition.durableObjects.some(
(d) => d.className === class_name
)
) {
value += ` (defined in 🟢 ${script_name})`;
} else {
value += ` (defined in 🔴 ${script_name})`;
CarmenPopoviciu marked this conversation as resolved.
Show resolved Hide resolved
}
} else {
value += ` (defined in 🔴 ${script_name})`;
value += ` (defined in ${script_name})`;
CarmenPopoviciu marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down Expand Up @@ -426,14 +431,17 @@ export function printBindings(
value += `#${entrypoint}`;
}

const registryDefinition = context.registry?.[service];
if (
registryDefinition &&
(!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])
) {
value = `🟢 ` + value;
} else {
value = `🔴 ` + value;
if (context.local) {
const registryDefinition = context.registry?.[service];
if (
registryDefinition &&
(!entrypoint ||
registryDefinition.entrypointAddresses?.[entrypoint])
) {
value = `🟢 ` + value;
} else {
value = `🔴 ` + value;
}
}
return {
key: binding,
Expand Down
Loading