Skip to content

Commit df0e5be

Browse files
authoredJan 14, 2025··
fix: local tags for durable objects and vectorize (#7750)
* fix: local tags for durable objects and vectorize * chore: update tests * chore: add changeset
1 parent 336cc48 commit df0e5be

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed
 

‎.changeset/angry-ants-call.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
bug: Removes the (local) tag on Vectorize bindings in the console output of `wrangler dev`, and adds-in the same tag for Durable Objects (which are emulated locally in `wrangler dev`).

‎packages/wrangler/e2e/__snapshots__/pages-dev.test.ts.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ exports[`Pages 'wrangler pages dev' > should merge (with override) \`wrangler.to
99
- {"name":"DO_BINDING_2_TOML","class_name":"DO_2_TOML","script_name":"DO_SCRIPT_2_TOML"}
1010
Your worker has access to the following bindings:
1111
- Durable Objects:
12-
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1 [not connected])
13-
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML [not connected])
14-
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS [not connected])
12+
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1 [not connected]) (local)
13+
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML [not connected]) (local)
14+
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS [not connected]) (local)
1515
- KV Namespaces:
1616
- KV_BINDING_1_TOML: NEW_KV_ID_1 (local)
1717
- KV_BINDING_2_TOML: KV_ID_2_TOML (local)

‎packages/wrangler/e2e/pages-dev.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe.sequential.each([{ cmd: "wrangler pages dev" }])(
121121
expect(normalizeOutput(worker.currentOutput)).toContain(
122122
dedent`Your worker has access to the following bindings:
123123
- Durable Objects:
124-
- TEST_DO: TestDurableObject (defined in a [not connected])
124+
- TEST_DO: TestDurableObject (defined in a [not connected]) (local)
125125
- KV Namespaces:
126126
- TEST_KV: TEST_KV (local)
127127
- D1 Databases:

‎packages/wrangler/src/__tests__/dev.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1208,10 +1208,10 @@ describe.sequential("wrangler dev", () => {
12081208
expect(std.out).toMatchInlineSnapshot(`
12091209
"Your worker has access to the following bindings:
12101210
- Durable Objects:
1211-
- NAME_1: CLASS_1
1212-
- NAME_2: CLASS_2 (defined in SCRIPT_A [not connected])
1213-
- NAME_3: CLASS_3
1214-
- NAME_4: CLASS_4 (defined in SCRIPT_B [not connected])
1211+
- NAME_1: CLASS_1 (local)
1212+
- NAME_2: CLASS_2 (defined in SCRIPT_A [not connected]) (local)
1213+
- NAME_3: CLASS_3 (local)
1214+
- NAME_4: CLASS_4 (defined in SCRIPT_B [not connected]) (local)
12151215
"
12161216
`);
12171217
expect(std.warn).toMatchInlineSnapshot(`

‎packages/wrangler/src/utils/print-bindings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export function printBindings(
137137

138138
return {
139139
key: name,
140-
value,
140+
value: addLocalSuffix(value, context.local),
141141
};
142142
}
143143
),
@@ -233,7 +233,7 @@ export function printBindings(
233233
entries: vectorize.map(({ binding, index_name }) => {
234234
return {
235235
key: binding,
236-
value: addLocalSuffix(index_name, context.local),
236+
value: index_name,
237237
};
238238
}),
239239
});

0 commit comments

Comments
 (0)
Please sign in to comment.