Skip to content

Commit 37ab91c

Browse files
dependabot[bot]Wrangler automated PR updateredmundhung
authored
Bump the workerd-and-workers-types group with 2 updates (#16307)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wrangler automated PR updater <wrangler@cloudflare.com> Co-authored-by: Edmund Hung <edmund@cloudflare.com>
1 parent 1a0e1a4 commit 37ab91c

11 files changed

Lines changed: 303 additions & 209 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"miniflare": patch
3+
"wrangler": patch
4+
---
5+
6+
Update dependencies of "miniflare", "wrangler"
7+
8+
The following dependency versions have been updated:
9+
10+
| Dependency | From | To |
11+
| ------------------------- | ------------- | ------------- |
12+
| @cloudflare/workers-types | ^5.20261006.1 | ^5.20261016.1 |
13+
| workerd | 1.20261012.1 | 1.20261016.1 |

‎fixtures/pages-nodejs-v2-compat/apps/workerjs-directory/_worker.js/index.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4-
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5-
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
64
globalThis.process = process;
75

86
export default {

‎fixtures/pages-nodejs-v2-compat/apps/workerjs-file/_worker.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4-
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5-
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
64
globalThis.process = process;
75

86
export default {

‎fixtures/pages-nodejs-v2-compat/functions/[[path]].ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
process.env.foo = "bar";
22

33
// Check that we don't get a build time error when assigning to globalThis.process.
4-
// @ts-expect-error `@cloudflare/workers-types` declares `process` as a `const`, so
5-
// TypeScript does not treat it as a property of `globalThis`, but this is valid at runtime.
64
globalThis.process = process;
75

86
export const onRequest = () => {

‎packages/miniflare/src/plugins/assets/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ const walk = async (dir: string) => {
461461
contentHash,
462462
});
463463
assetsReverseMap[bytesToHex(contentHash)] = {
464-
filePath: relativeFilepath,
464+
filePath: relativeFilepath.split(path.sep).join("/"),
465465
contentType: getContentType(filepath),
466466
};
467467
counter++;

‎packages/miniflare/test/plugins/assets/index.spec.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ test("serves files from assets directory", async ({ expect }) => {
9797
expect(await res.text()).toBe("hello from asset");
9898
});
9999

100+
test("serves nested assets with encoded path names", async ({ expect }) => {
101+
const tmp = await useTmp();
102+
const directory = path.join(tmp, "nested");
103+
await fs.mkdir(directory);
104+
await fs.writeFile(path.join(directory, "[fünky].txt"), "nested asset");
105+
const mf = new Miniflare(makeOptions(tmp));
106+
useDispose(mf);
107+
108+
const response = await mf.dispatchFetch(
109+
"http://example.com/nested/%5Bf%C3%BCnky%5D.txt"
110+
);
111+
expect(response.status).toBe(200);
112+
expect(await response.text()).toBe("nested asset");
113+
});
114+
100115
test("serves files from assets directory relative to rootPath", async ({
101116
expect,
102117
}) => {

‎packages/miniflare/test/plugins/browser/index.spec.ts‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ async function sendMessage(ws: WebSocket, message: unknown) {
5050
}
5151

5252
async function waitForClosedConnection(ws: WebSocket): Promise<void> {
53+
if (ws.readyState === ws.CLOSING) {
54+
ws.close();
55+
return;
56+
}
5357
if (ws.readyState === ws.CLOSED) {
5458
return;
5559
}
@@ -63,6 +67,41 @@ async function waitForClosedConnection(ws: WebSocket): Promise<void> {
6367
});
6468
}
6569

70+
test("waitForClosedConnection handles an already received close event", async ({
71+
expect,
72+
}) => {
73+
const mf = new Miniflare({
74+
workers: [
75+
{
76+
config: {
77+
name: "worker",
78+
compatibilityDate: "2024-11-20",
79+
manifest: singleModuleManifest(`
80+
${waitForClosedConnection.toString()}
81+
export default {
82+
async fetch() {
83+
const [client, server] = Object.values(new WebSocketPair());
84+
client.accept();
85+
server.accept();
86+
const closeEvent = new Promise(resolve => client.addEventListener("close", resolve, { once: true }));
87+
server.close();
88+
await closeEvent;
89+
const closingState = client.readyState;
90+
await waitForClosedConnection(client);
91+
return Response.json({ closingState, closedState: client.readyState });
92+
}
93+
};`),
94+
},
95+
},
96+
],
97+
});
98+
useDispose(mf);
99+
const response = await mf.dispatchFetch("https://localhost");
100+
const responseText = await response.text();
101+
expect(response.status, responseText).toBe(200);
102+
expect(JSON.parse(responseText)).toEqual({ closingState: 2, closedState: 3 });
103+
});
104+
66105
const BROWSER_RENDERING_RETRY = {
67106
retry: {
68107
condition:

‎packages/miniflare/test/plugins/core/index.spec.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,26 @@ opensslTest("NODE_EXTRA_CA_CERTS: loads certificates", async ({ expect }) => {
1818

1919
// Generate self-signed certificate
2020
childProcess.execSync(
21-
'openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 30 -out cert.pem -subj "/CN=localhost"',
21+
'openssl req -newkey rsa:2048 -nodes -keyout ca-key.pem -x509 -days 30 -out ca.pem -subj "/CN=Test CA"',
22+
{ cwd: tmp, stdio: "ignore" }
23+
);
24+
childProcess.execSync(
25+
'openssl req -newkey rsa:2048 -nodes -keyout key.pem -out cert.csr -subj "/CN=localhost"',
26+
{ cwd: tmp, stdio: "ignore" }
27+
);
28+
await fs.writeFile(
29+
path.join(tmp, "extensions.cnf"),
30+
"subjectAltName=DNS:localhost\nbasicConstraints=critical,CA:FALSE\nextendedKeyUsage=serverAuth\n"
31+
);
32+
childProcess.execSync(
33+
"openssl x509 -req -in cert.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -days 30 -out cert.pem -extfile extensions.cnf",
2234
{ cwd: tmp, stdio: "ignore" }
2335
);
2436
const keyPath = path.join(tmp, "key.pem");
2537
const certPath = path.join(tmp, "cert.pem");
2638
const key = await fs.readFile(keyPath);
2739
const cert = await fs.readFile(certPath);
2840

29-
// Start HTTPS server with self-signed certificate
3041
const responseBody = "secure body";
3142
const server = https.createServer({ key, cert }, (req, res) => {
3243
res.end(responseBody);
@@ -47,7 +58,10 @@ opensslTest("NODE_EXTRA_CA_CERTS: loads certificates", async ({ expect }) => {
4758
// Write NODE_EXTRA_CA_CERTS file, with multiple certificates
4859
// (see https://github.com/cloudflare/miniflare/pull/587/files#r1271579671)
4960
const caCertsPath = path.join(tmp, "bundle.pem");
50-
const caCerts = [...tls.rootCertificates, cert];
61+
const caCerts = [
62+
...tls.rootCertificates,
63+
await fs.readFile(path.join(tmp, "ca.pem")),
64+
];
5165
await fs.writeFile(
5266
caCertsPath,
5367
["## This is a comment which should be ignored\n"].concat(

‎packages/workers-utils/src/default-compat-date.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ import type { CompatDate } from "./compatibility-date";
1919
* @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/BUILD.bazel
2020
* @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/compatibility-date.c%2B%2B
2121
*/
22-
export const DEFAULT_COMPAT_DATE: CompatDate = "2026-10-12";
22+
export const DEFAULT_COMPAT_DATE: CompatDate = "2026-10-16";

0 commit comments

Comments
 (0)