Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/dependabot-update-12618.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"miniflare": patch
"wrangler": patch
---

Update dependencies of "miniflare", "wrangler"

The following dependency versions have been updated:

| Dependency | From | To |
| ---------- | ------------ | ------------ |
| workerd | 1.20260219.0 | 1.20260227.0 |
2 changes: 1 addition & 1 deletion packages/miniflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@cspotcode/source-map-support": "0.8.1",
"sharp": "^0.34.5",
"undici": "catalog:default",
"workerd": "1.20260219.0",
"workerd": "1.20260227.0",
"ws": "catalog:default",
"youch": "4.1.0-beta.10"
},
Expand Down
18 changes: 16 additions & 2 deletions packages/miniflare/src/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import rl from "node:readline";
import { Readable, Transform } from "node:stream";
import { $ as $colors, red } from "kleur/colors";
import workerdPath, {
compatibilityDate as supportedCompatibilityDate,
compatibilityDate as workerdCompatibilityDate,
} from "workerd";
import { z } from "zod";
import { SERVICE_LOOPBACK, SOCKET_ENTRY } from "../plugins";
Expand Down Expand Up @@ -349,4 +349,18 @@ export class Runtime {
}

export * from "./config";
export { supportedCompatibilityDate };

/**
* Gets a safe compatibility date from workerd. If the workerd compatibility
* date is in the future, returns today's date instead. This handles the case
* where workerd releases set their compatibility date up to 7 days in the future.
*/
function getSafeCompatibilityDate(): string {
const today = new Date().toISOString().slice(0, 10);
if (workerdCompatibilityDate > today) {
return today;
}
return workerdCompatibilityDate;
}

export const supportedCompatibilityDate = getSafeCompatibilityDate();
2 changes: 1 addition & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"miniflare": "workspace:*",
"path-to-regexp": "6.3.0",
"unenv": "2.0.0-rc.24",
"workerd": "1.20260219.0"
"workerd": "1.20260227.0"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.721.0",
Expand Down
11 changes: 4 additions & 7 deletions packages/wrangler/src/__tests__/dev.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as fs from "node:fs";
import module from "node:module";
import {
COMPLIANCE_REGION_CONFIG_UNKNOWN,
FatalError,
getLocalWorkerdCompatibilityDate,
} from "@cloudflare/workers-utils";
import { writeWranglerConfig } from "@cloudflare/workers-utils/test-helpers";
import ci from "ci-info";
Expand Down Expand Up @@ -278,12 +278,9 @@ describe.sequential("wrangler dev", () => {
fs.writeFileSync("index.js", `export default {};`);
await runWranglerUntilConfig("dev");

const miniflareEntry = require.resolve("miniflare");
const miniflareRequire = module.createRequire(miniflareEntry);
const miniflareWorkerd = miniflareRequire("workerd") as {
compatibilityDate: string;
};
const currentDate = miniflareWorkerd.compatibilityDate;
// Use getLocalWorkerdCompatibilityDate() which applies the same safe date
// conversion as wrangler does (converting future dates to today's date)
const { date: currentDate } = getLocalWorkerdCompatibilityDate();

expect(std.warn.replaceAll(currentDate, "<current-date>"))
.toMatchInlineSnapshot(`
Expand Down
Loading
Loading