Skip to content

Commit ea71df3

Browse files
authored
bump unenv to 2.0.0-rc.17 (#9219)
1 parent 5695a67 commit ea71df3

File tree

6 files changed

+68
-9
lines changed

6 files changed

+68
-9
lines changed

.changeset/new-clocks-obey.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@cloudflare/unenv-preset": patch
3+
"wrangler": patch
4+
---
5+
6+
bump unenv to 2.0.0-rc.17

fixtures/nodejs-hybrid-app/src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export default {
3434
return await testTls();
3535
case "/test-crypto":
3636
return await testCrypto();
37+
case "/test-sqlite":
38+
return await testSqlite();
39+
case "/test-http":
40+
return await testHttp();
3741
}
3842

3943
return new Response(
@@ -45,6 +49,8 @@ export default {
4549
<a href="test-immediate">Test setImmediate</a>
4650
<a href="test-tls">node:tls</a>
4751
<a href="test-crypto">node:crypto</a>
52+
<a href="test-sqlite">node:sqlite</a>
53+
<a href="test-http">node:http</a>
4854
`,
4955
{ headers: { "Content-Type": "text/html; charset=utf-8" } }
5056
);
@@ -145,6 +151,8 @@ function testProcessBehavior() {
145151
assert.notEqual(process, undefined);
146152
assert.strictEqual(globalThis.process, process);
147153
assert.strictEqual(global.process, process);
154+
assert.strictEqual(typeof process.version, "string");
155+
assert.strictEqual(typeof process.versions.node, "string");
148156

149157
const fakeProcess1 = {} as typeof process;
150158
process = fakeProcess1;
@@ -241,3 +249,20 @@ async function testCrypto() {
241249

242250
return new Response("OK");
243251
}
252+
253+
async function testSqlite() {
254+
const sqlite = await import("node:sqlite");
255+
256+
assert.strictEqual(typeof sqlite.DatabaseSync, "function");
257+
258+
return new Response("OK");
259+
}
260+
261+
async function testHttp() {
262+
const http = await import("node:http");
263+
264+
const agent = new http.Agent();
265+
assert.strictEqual(typeof agent.options, "object");
266+
267+
return new Response("OK");
268+
}

fixtures/nodejs-hybrid-app/tests/index.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,16 @@ describe("nodejs compat", () => {
7676
const response = await fetch(`http://${ip}:${port}/test-crypto`);
7777
await expect(response.text()).resolves.toBe("OK");
7878
});
79+
80+
test("node:sqlite", async ({ expect }) => {
81+
const { ip, port } = wrangler;
82+
const response = await fetch(`http://${ip}:${port}/test-sqlite`);
83+
await expect(response.text()).resolves.toBe("OK");
84+
});
85+
86+
test("node:http", async ({ expect }) => {
87+
const { ip, port } = wrangler;
88+
const response = await fetch(`http://${ip}:${port}/test-http`);
89+
await expect(response.text()).resolves.toBe("OK");
90+
});
7991
});

packages/unenv-preset/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"wrangler": "workspace:*"
5454
},
5555
"peerDependencies": {
56-
"unenv": "2.0.0-rc.15",
56+
"unenv": "2.0.0-rc.17",
5757
"workerd": "^1.20250320.0"
5858
},
5959
"peerDependenciesMeta": {

packages/wrangler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"esbuild": "catalog:default",
7575
"miniflare": "workspace:*",
7676
"path-to-regexp": "6.3.0",
77-
"unenv": "2.0.0-rc.15",
77+
"unenv": "2.0.0-rc.17",
7878
"workerd": "1.20250508.0"
7979
},
8080
"devDependencies": {

pnpm-lock.yaml

Lines changed: 23 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)