Skip to content

Commit

Permalink
fix: local tags for durable objects and vectorize (#7750)
Browse files Browse the repository at this point in the history
* fix: local tags for durable objects and vectorize

* chore: update tests

* chore: add changeset
  • Loading branch information
andyjessop authored Jan 14, 2025
1 parent 336cc48 commit df0e5be
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-ants-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

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`).
6 changes: 3 additions & 3 deletions packages/wrangler/e2e/__snapshots__/pages-dev.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ exports[`Pages 'wrangler pages dev' > should merge (with override) \`wrangler.to
- {"name":"DO_BINDING_2_TOML","class_name":"DO_2_TOML","script_name":"DO_SCRIPT_2_TOML"}
Your worker has access to the following bindings:
- Durable Objects:
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1 [not connected])
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML [not connected])
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS [not connected])
- DO_BINDING_1_TOML: NEW_DO_1 (defined in NEW_DO_SCRIPT_1 [not connected]) (local)
- DO_BINDING_2_TOML: DO_2_TOML (defined in DO_SCRIPT_2_TOML [not connected]) (local)
- DO_BINDING_3_ARGS: DO_3_ARGS (defined in DO_SCRIPT_3_ARGS [not connected]) (local)
- KV Namespaces:
- KV_BINDING_1_TOML: NEW_KV_ID_1 (local)
- KV_BINDING_2_TOML: KV_ID_2_TOML (local)
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/e2e/pages-dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe.sequential.each([{ cmd: "wrangler pages dev" }])(
expect(normalizeOutput(worker.currentOutput)).toContain(
dedent`Your worker has access to the following bindings:
- Durable Objects:
- TEST_DO: TestDurableObject (defined in a [not connected])
- TEST_DO: TestDurableObject (defined in a [not connected]) (local)
- KV Namespaces:
- TEST_KV: TEST_KV (local)
- D1 Databases:
Expand Down
8 changes: 4 additions & 4 deletions packages/wrangler/src/__tests__/dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,10 @@ describe.sequential("wrangler dev", () => {
expect(std.out).toMatchInlineSnapshot(`
"Your worker has access to the following bindings:
- Durable Objects:
- NAME_1: CLASS_1
- NAME_2: CLASS_2 (defined in SCRIPT_A [not connected])
- NAME_3: CLASS_3
- NAME_4: CLASS_4 (defined in SCRIPT_B [not connected])
- NAME_1: CLASS_1 (local)
- NAME_2: CLASS_2 (defined in SCRIPT_A [not connected]) (local)
- NAME_3: CLASS_3 (local)
- NAME_4: CLASS_4 (defined in SCRIPT_B [not connected]) (local)
"
`);
expect(std.warn).toMatchInlineSnapshot(`
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/utils/print-bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function printBindings(

return {
key: name,
value,
value: addLocalSuffix(value, context.local),
};
}
),
Expand Down Expand Up @@ -233,7 +233,7 @@ export function printBindings(
entries: vectorize.map(({ binding, index_name }) => {
return {
key: binding,
value: addLocalSuffix(index_name, context.local),
value: index_name,
};
}),
});
Expand Down

0 comments on commit df0e5be

Please sign in to comment.