Skip to content

Commit

Permalink
Bump miniflare version to 20231023 (#4274)
Browse files Browse the repository at this point in the history
* Bump miniflare version to 20231023

* chore: bump `miniflare` to `3.20231025.0`

* Try to improve reliability of `pages-plugin-mounted-on-root-app` test

---------

Co-authored-by: bcoll <bcoll@cloudflare.com>
  • Loading branch information
jspspike and mrbbot authored Oct 26, 2023
1 parent b404ab7 commit be0c628
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 64 deletions.
9 changes: 9 additions & 0 deletions .changeset/good-beers-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

chore: bump `miniflare` to [`3.20231025.0`](https://github.com/cloudflare/miniflare/releases/tag/v3.20231025.0)

This change enables Node-like `console.log()`ing in local mode. Objects with
lots of properties, and instances of internal classes like `Request`, `Headers`,
`ReadableStream`, etc will now be logged with much more detail.
36 changes: 8 additions & 28 deletions fixtures/pages-plugin-mounted-on-root-app/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
import { fork } from "child_process";
import * as path from "path";
import { fetch } from "undici";
import { describe, it, beforeAll, afterAll } from "vitest";
import type { ChildProcess } from "child_process";
import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived";

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

beforeAll(async () => {
await new Promise((resolve) => {
wranglerProcess = fork(
path.join("..", "..", "packages", "wrangler", "bin", "wrangler.js"),
["pages", "dev", "public", "--port=0"],
{
stdio: ["ignore", "ignore", "ignore", "ipc"],
cwd: path.resolve(__dirname, ".."),
}
).on("message", (message) => {
const parsedMessage = JSON.parse(message.toString());
ip = parsedMessage.ip;
port = parsedMessage.port;
resolve(null);
});
});
({ ip, port, stop } = await runWranglerPagesDev(
path.resolve(__dirname, ".."),
"public",
["--port=0"]
));
});

afterAll(async () => {
await new Promise((resolve, reject) => {
wranglerProcess.once("exit", (code) => {
if (!code) {
resolve(code);
} else {
reject(code);
}
});
wranglerProcess.kill("SIGTERM");
});
await stop?.();
});

it("mounts a plugin correctly at root", async ({ expect }) => {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/pages-ws-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"miniflare": "3.20231016.0",
"miniflare": "3.20231025.0",
"wrangler": "workspace:*",
"ws": "^8.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/pages-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:ci": "vitest run"
},
"dependencies": {
"miniflare": "3.20231016.0"
"miniflare": "3.20231025.0"
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"blake3-wasm": "^2.1.5",
"chokidar": "^3.5.3",
"esbuild": "0.17.19",
"miniflare": "3.20231016.0",
"miniflare": "3.20231025.0",
"nanoid": "^3.3.3",
"path-to-regexp": "^6.2.0",
"resolve.exports": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/dev/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function Local(props: LocalProps) {
useInspector({
inspectorUrl,
port: props.inspectorPort,
logToTerminal: true,
logToTerminal: false,
sourceMapPath: props.sourceMapPath,
name: props.name,
sourceMapMetadata: props.bundle?.sourceMapMetadata,
Expand Down
64 changes: 32 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be0c628

Please sign in to comment.