Skip to content

Commit

Permalink
chore: remove d1 local hardcoding (#2248)
Browse files Browse the repository at this point in the history
* chore: remove d1 local hardcoding

* Create tall-waves-film.md
  • Loading branch information
rozenmd authored Nov 21, 2022
1 parent ef24dba commit effc221
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/tall-waves-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

chore: remove d1 local hardcoding

Prior to this change wrangler would only ever use local mode when testing d1.

After this change d1 tests can access both local and remote Workers.
5 changes: 4 additions & 1 deletion packages/wrangler/src/dev/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export async function startDevServer(
services: props.bindings.services,
firstPartyWorkerDevFacade: props.firstPartyWorker,
testScheduled: props.testScheduled,
local: props.local,
});

if (props.local) {
Expand Down Expand Up @@ -206,6 +207,7 @@ async function runEsbuild({
services,
firstPartyWorkerDevFacade,
testScheduled,
local,
}: {
entry: Entry;
destination: string | undefined;
Expand All @@ -224,6 +226,7 @@ async function runEsbuild({
workerDefinitions: WorkerRegistry;
firstPartyWorkerDevFacade: boolean | undefined;
testScheduled?: boolean;
local: boolean;
}): Promise<EsbuildBundle | undefined> {
if (!destination) return;

Expand Down Expand Up @@ -262,7 +265,7 @@ async function runEsbuild({
services,
firstPartyWorkerDevFacade,
targetConsumer: "dev", // We are starting a dev server
local: true,
local,
testScheduled,
});

Expand Down

0 comments on commit effc221

Please sign in to comment.