File tree Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @cloudflare/unenv-preset " : patch
3+ ---
4+
5+ Removes node: net and node: timers from polyfills
Original file line number Diff line number Diff line change 5555 },
5656 "peerDependencies" : {
5757 "unenv" : " 2.0.0-rc.0" ,
58- "workerd" : " ^1.20241230 .0"
58+ "workerd" : " ^1.20250124 .0"
5959 },
6060 "peerDependenciesMeta" : {
6161 "workerd" : {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type { Preset } from "unenv";
44// Built-in APIs provided by workerd.
55// https://developers.cloudflare.com/workers/runtime-apis/nodejs/
66// https://github.com/cloudflare/workerd/tree/main/src/node
7- // Last checked: 2024-10-22
7+ // Last checked: 2025-01-24
88const cloudflareNodeCompatModules = [
99 "_stream_duplex" ,
1010 "_stream_passthrough" ,
@@ -18,6 +18,7 @@ const cloudflareNodeCompatModules = [
1818 "dns" ,
1919 "dns/promises" ,
2020 "events" ,
21+ "net" ,
2122 "path" ,
2223 "path/posix" ,
2324 "path/win32" ,
@@ -27,6 +28,8 @@ const cloudflareNodeCompatModules = [
2728 "stream/promises" ,
2829 "stream/web" ,
2930 "string_decoder" ,
31+ "timers" ,
32+ "timers/promises" ,
3033 "url" ,
3134 "util/types" ,
3235 "zlib" ,
@@ -39,7 +42,6 @@ const hybridNodeCompatModules = [
3942 "crypto" ,
4043 "module" ,
4144 "process" ,
42- "timers" ,
4345 "util" ,
4446] ;
4547
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export const TESTS = {
1010 testPath,
1111 testDns,
1212 testTimers,
13+ testNet,
1314} ;
1415
1516export default {
@@ -86,6 +87,7 @@ async function testModules() {
8687 "dns" ,
8788 "dns/promises" ,
8889 "events" ,
90+ "net" ,
8991 "path" ,
9092 "path/posix" ,
9193 "path/win32" ,
@@ -95,6 +97,8 @@ async function testModules() {
9597 "stream/promises" ,
9698 "stream/web" ,
9799 "string_decoder" ,
100+ "timers" ,
101+ "timers/promises" ,
98102 "url" ,
99103 "util/types" ,
100104 "zlib" ,
@@ -150,3 +154,10 @@ async function testTimers() {
150154 ( timers as any ) . active ( timeout ) ;
151155 timers . clearTimeout ( timeout ) ;
152156}
157+
158+ export async function testNet ( ) {
159+ const net = await import ( "node:net" ) ;
160+ assert . strictEqual ( typeof net , "object" ) ;
161+ assert . strictEqual ( typeof net . createConnection , "function" ) ;
162+ assert . throws ( ( ) => net . createServer ( ) , / n o t i m p l e m e n t e d / ) ;
163+ }
You can’t perform that action at this time.
0 commit comments