Skip to content

Commit

Permalink
fix: remote confusing --local messaging from wrangler pages dev (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot authored Jan 10, 2024
1 parent 4f6999e commit 0a488f6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/ten-dancers-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

fix: remove confusing `--local` messaging from `wrangler pages dev`

Running `wrangler pages dev` would previously log a warning saying `--local is no longer required` even though `--local` was never set. This change removes this warning.
14 changes: 12 additions & 2 deletions fixtures/pages-functions-app/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import { describe, it, beforeAll, afterAll } from "vitest";
import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived";

describe("Pages Functions", () => {
let ip: string, port: number, stop: (() => Promise<unknown>) | undefined;
let ip: string,
port: number,
stop: (() => Promise<unknown>) | undefined,
getOutput: () => string;

beforeAll(async () => {
({ ip, port, stop } = await runWranglerPagesDev(
({ ip, port, stop, getOutput } = await runWranglerPagesDev(
resolve(__dirname, ".."),
"public",
[
Expand Down Expand Up @@ -94,6 +97,13 @@ describe("Pages Functions", () => {
expect(text).toContain("<h1>An asset</h1>");
});

it("doesn't warn about local mode", async ({ expect }) => {
// Regression test for https://github.com/cloudflare/workers-sdk/issues/4210
expect(getOutput()).not.toContain(
"--local is no longer required and will be removed in a future version"
);
});

describe("can mount a plugin", () => {
it("should mount Middleware", async ({ expect }) => {
const response = await fetch(
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export async function unstable_dev(
_: [],
$0: "",
remote: !local,
local,
local: undefined,
experimentalLocal: undefined,
d1Databases,
disableDevRegistry,
Expand Down

0 comments on commit 0a488f6

Please sign in to comment.