@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +113 -2
- package/dist/cjs/BunFileSystem.d.ts +44 -0
- package/dist/cjs/BunFileSystem.d.ts.map +1 -0
- package/dist/cjs/BunFileSystem.js +38 -0
- package/dist/cjs/BunFileSystem.js.map +7 -0
- package/dist/cjs/BunHost.d.ts +205 -0
- package/dist/cjs/BunHost.d.ts.map +1 -0
- package/dist/cjs/BunHost.js +147 -0
- package/dist/cjs/BunHost.js.map +7 -0
- package/dist/cjs/index.d.ts +26 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/BunFileSystem.d.ts +44 -0
- package/dist/esm/BunFileSystem.d.ts.map +1 -0
- package/dist/esm/BunFileSystem.js +35 -0
- package/dist/esm/BunFileSystem.js.map +1 -0
- package/dist/esm/BunHost.d.ts +205 -0
- package/dist/esm/BunHost.d.ts.map +1 -0
- package/dist/esm/BunHost.js +242 -0
- package/dist/esm/BunHost.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/vendor/adapters.json +2707 -0
- package/dist/vendor/bun/BunChildProcessSpawner.d.ts +7 -0
- package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
- package/dist/vendor/bun/BunClusterHttp.d.ts +83 -0
- package/dist/vendor/bun/BunClusterHttp.js +39 -0
- package/dist/vendor/bun/BunClusterSocket.d.ts +65 -0
- package/dist/vendor/bun/BunClusterSocket.js +22 -0
- package/dist/vendor/bun/BunCrypto.d.ts +10 -0
- package/dist/vendor/bun/BunCrypto.js +8 -0
- package/dist/vendor/bun/BunFileSystem.d.ts +10 -0
- package/dist/vendor/bun/BunFileSystem.js +9 -0
- package/dist/vendor/bun/BunHttpClient.d.ts +9 -0
- package/dist/vendor/bun/BunHttpClient.js +1 -0
- package/dist/vendor/bun/BunHttpPlatform.d.ts +10 -0
- package/dist/vendor/bun/BunHttpPlatform.js +11 -0
- package/dist/vendor/bun/BunHttpServer.d.ts +142 -0
- package/dist/vendor/bun/BunHttpServer.js +38 -0
- package/dist/vendor/bun/BunHttpServerRequest.d.ts +18 -0
- package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
- package/dist/vendor/bun/BunMultipart.d.ts +31 -0
- package/dist/vendor/bun/BunMultipart.js +12 -0
- package/dist/vendor/bun/BunPath.d.ts +24 -0
- package/dist/vendor/bun/BunPath.js +12 -0
- package/dist/vendor/bun/BunRedis.d.ts +49 -0
- package/dist/vendor/bun/BunRedis.js +11 -0
- package/dist/vendor/bun/BunRuntime.d.ts +85 -0
- package/dist/vendor/bun/BunRuntime.js +8 -0
- package/dist/vendor/bun/BunServices.d.ts +34 -0
- package/dist/vendor/bun/BunServices.js +23 -0
- package/dist/vendor/bun/BunSink.d.ts +8 -0
- package/dist/vendor/bun/BunSink.js +12 -0
- package/dist/vendor/bun/BunSocket.d.ts +40 -0
- package/dist/vendor/bun/BunSocket.js +29 -0
- package/dist/vendor/bun/BunSocketServer.d.ts +8 -0
- package/dist/vendor/bun/BunSocketServer.js +21 -0
- package/dist/vendor/bun/BunStdio.d.ts +11 -0
- package/dist/vendor/bun/BunStdio.js +10 -0
- package/dist/vendor/bun/BunStream.d.ts +19 -0
- package/dist/vendor/bun/BunStream.js +30 -0
- package/dist/vendor/bun/BunTerminal.d.ts +21 -0
- package/dist/vendor/bun/BunTerminal.js +10 -0
- package/dist/vendor/bun/BunWorker.d.ts +20 -0
- package/dist/vendor/bun/BunWorker.js +9 -0
- package/dist/vendor/bun/BunWorkerRunner.d.ts +12 -0
- package/dist/vendor/bun/BunWorkerRunner.js +7 -0
- package/dist/vendor/bun/LICENSE +21 -0
- package/dist/vendor/bun/index.d.ts +92 -0
- package/dist/vendor/bun/index.js +107 -0
- package/dist/vendor/chunk-2KZ2IFIZ.js +71 -0
- package/dist/vendor/chunk-2Y7WC4KU.js +109 -0
- package/dist/vendor/chunk-3GR5VZ2M.js +118 -0
- package/dist/vendor/chunk-3QW2PNUY.js +7 -0
- package/dist/vendor/chunk-42QKY6T6.js +40 -0
- package/dist/vendor/chunk-54RLBMTZ.js +61 -0
- package/dist/vendor/chunk-5U3MC37H.js +63 -0
- package/dist/vendor/chunk-5ZMHBXIK.js +55 -0
- package/dist/vendor/chunk-64Q2B7BA.js +34 -0
- package/dist/vendor/chunk-6CRG556Y.js +15 -0
- package/dist/vendor/chunk-6HWHSZL3.js +34 -0
- package/dist/vendor/chunk-6J25AYCI.js +93 -0
- package/dist/vendor/chunk-6ME2W7TF.js +28 -0
- package/dist/vendor/chunk-6TZ7LQAC.js +18 -0
- package/dist/vendor/chunk-B3FZ67QU.js +59 -0
- package/dist/vendor/chunk-BBLQEPNJ.js +22 -0
- package/dist/vendor/chunk-BKTBUBQY.js +437 -0
- package/dist/vendor/chunk-CIB6JB2Y.js +63 -0
- package/dist/vendor/chunk-DS7GF46S.js +34 -0
- package/dist/vendor/chunk-DVOAHXPG.js +104 -0
- package/dist/vendor/chunk-DWSHTSVX.js +229 -0
- package/dist/vendor/chunk-EGBNVEEW.js +14 -0
- package/dist/vendor/chunk-EHDTBBPL.js +45 -0
- package/dist/vendor/chunk-EZWY45HP.js +18 -0
- package/dist/vendor/chunk-F7VENFF4.js +507 -0
- package/dist/vendor/chunk-GXCHI7BM.js +131 -0
- package/dist/vendor/chunk-HX4AXITW.js +65 -0
- package/dist/vendor/chunk-IIJ52ZU6.js +20 -0
- package/dist/vendor/chunk-IR7WG7SA.js +564 -0
- package/dist/vendor/chunk-J7A4CZDO.js +92 -0
- package/dist/vendor/chunk-JG5TTWPT.js +85 -0
- package/dist/vendor/chunk-JJ24ARBQ.js +394 -0
- package/dist/vendor/chunk-JUVIPOOR.js +18 -0
- package/dist/vendor/chunk-KCLEGTEN.js +86 -0
- package/dist/vendor/chunk-KOZMM5PZ.js +426 -0
- package/dist/vendor/chunk-KUUXSID7.js +18 -0
- package/dist/vendor/chunk-KWOY4JDR.js +398 -0
- package/dist/vendor/chunk-LEUPYT3Q.js +36 -0
- package/dist/vendor/chunk-LJVI2DIF.js +57 -0
- package/dist/vendor/chunk-M32LDTW7.js +18 -0
- package/dist/vendor/chunk-M7CLUILA.js +0 -0
- package/dist/vendor/chunk-MBSKBQ5D.js +21 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-MMEGG3WE.js +96 -0
- package/dist/vendor/chunk-MSWDMTAF.js +18 -0
- package/dist/vendor/chunk-NBVRTDTV.js +129 -0
- package/dist/vendor/chunk-NBYGGMAE.js +70 -0
- package/dist/vendor/chunk-NLMT7VBU.js +18 -0
- package/dist/vendor/chunk-OXNGN5H7.js +81 -0
- package/dist/vendor/chunk-RBKBXDZW.js +18 -0
- package/dist/vendor/chunk-RNBBYWS2.js +26 -0
- package/dist/vendor/chunk-SFHVFMSR.js +18 -0
- package/dist/vendor/chunk-TFIKFFSC.js +26 -0
- package/dist/vendor/chunk-TXKLEBBL.js +143 -0
- package/dist/vendor/chunk-U6OWSZD2.js +62 -0
- package/dist/vendor/chunk-UFH5UUZK.js +48 -0
- package/dist/vendor/chunk-UJAEC4DS.js +20 -0
- package/dist/vendor/chunk-VZBDV3TV.js +18 -0
- package/dist/vendor/chunk-WGN4AMSX.js +0 -0
- package/dist/vendor/chunk-WIYD3THC.js +31 -0
- package/dist/vendor/chunk-XDKNKFBW.js +22 -0
- package/dist/vendor/chunk-XH4U3JSV.js +249 -0
- package/dist/vendor/chunk-XWPHMSXO.js +28 -0
- package/dist/vendor/chunk-Y35ZAO5U.js +53 -0
- package/dist/vendor/chunk-ZJMRMY57.js +0 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +7 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +83 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +65 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunCrypto.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
- package/dist/vendor/cjs/bun/BunFileSystem.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpClient.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServer.d.ts +142 -0
- package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +18 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/bun/BunMultipart.d.ts +31 -0
- package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
- package/dist/vendor/cjs/bun/BunPath.d.ts +24 -0
- package/dist/vendor/cjs/bun/BunPath.js +1 -0
- package/dist/vendor/cjs/bun/BunRedis.d.ts +49 -0
- package/dist/vendor/cjs/bun/BunRedis.js +1 -0
- package/dist/vendor/cjs/bun/BunRuntime.d.ts +85 -0
- package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
- package/dist/vendor/cjs/bun/BunServices.d.ts +34 -0
- package/dist/vendor/cjs/bun/BunServices.js +1 -0
- package/dist/vendor/cjs/bun/BunSink.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunSink.js +1 -0
- package/dist/vendor/cjs/bun/BunSocket.d.ts +40 -0
- package/dist/vendor/cjs/bun/BunSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunSocketServer.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
- package/dist/vendor/cjs/bun/BunStdio.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunStdio.js +1 -0
- package/dist/vendor/cjs/bun/BunStream.d.ts +19 -0
- package/dist/vendor/cjs/bun/BunStream.js +1 -0
- package/dist/vendor/cjs/bun/BunTerminal.d.ts +21 -0
- package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
- package/dist/vendor/cjs/bun/BunWorker.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunWorker.js +1 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +12 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
- package/dist/vendor/cjs/bun/index.d.ts +92 -0
- package/dist/vendor/cjs/bun/index.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +7 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +63 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +79 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +179 -0
- package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +62 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +36 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +120 -0
- package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +29 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +46 -0
- package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +97 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
- package/dist/vendor/cjs/node/NodePath.d.ts +27 -0
- package/dist/vendor/cjs/node/NodePath.js +1 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +74 -0
- package/dist/vendor/cjs/node/NodeRedis.js +1 -0
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +85 -0
- package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +34 -0
- package/dist/vendor/cjs/node/NodeServices.js +1 -0
- package/dist/vendor/cjs/node/NodeSink.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeSink.js +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +38 -0
- package/dist/vendor/cjs/node/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeStream.js +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +21 -0
- package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node/NodeWorker.d.ts +22 -0
- package/dist/vendor/cjs/node/NodeWorker.js +1 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +12 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
- package/dist/vendor/cjs/node/Undici.d.ts +28 -0
- package/dist/vendor/cjs/node/Undici.js +1 -0
- package/dist/vendor/cjs/node/index.d.ts +100 -0
- package/dist/vendor/cjs/node/index.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +57 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +22 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +27 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +36 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +27 -0
- package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +47 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +69 -0
- package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +134 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +80 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +12 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +179 -0
- package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +22 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node-shared/index.d.ts +56 -0
- package/dist/vendor/cjs/node-shared/index.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
- package/dist/vendor/cjs/package.json +1 -0
- package/dist/vendor/cjs/platform-bun.d.ts +92 -0
- package/dist/vendor/cjs/platform-bun.js +1 -0
- package/dist/vendor/cjs/platform-node-shared.d.ts +56 -0
- package/dist/vendor/cjs/platform-node-shared.js +1 -0
- package/dist/vendor/cjs/platform-node.d.ts +100 -0
- package/dist/vendor/cjs/platform-node.js +1 -0
- package/dist/vendor/node/LICENSE +21 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +7 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
- package/dist/vendor/node/NodeClusterHttp.d.ts +63 -0
- package/dist/vendor/node/NodeClusterHttp.js +43 -0
- package/dist/vendor/node/NodeClusterSocket.d.ts +79 -0
- package/dist/vendor/node/NodeClusterSocket.js +30 -0
- package/dist/vendor/node/NodeCrypto.d.ts +10 -0
- package/dist/vendor/node/NodeCrypto.js +8 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +10 -0
- package/dist/vendor/node/NodeFileSystem.js +9 -0
- package/dist/vendor/node/NodeHttpClient.d.ts +179 -0
- package/dist/vendor/node/NodeHttpClient.js +46 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +62 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
- package/dist/vendor/node/NodeHttpPlatform.d.ts +36 -0
- package/dist/vendor/node/NodeHttpPlatform.js +16 -0
- package/dist/vendor/node/NodeHttpServer.d.ts +120 -0
- package/dist/vendor/node/NodeHttpServer.js +46 -0
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +29 -0
- package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
- package/dist/vendor/node/NodeMultipart.d.ts +46 -0
- package/dist/vendor/node/NodeMultipart.js +15 -0
- package/dist/vendor/node/NodeMultipartParser.d.ts +97 -0
- package/dist/vendor/node/NodeMultipartParser.js +11 -0
- package/dist/vendor/node/NodePath.d.ts +27 -0
- package/dist/vendor/node/NodePath.js +12 -0
- package/dist/vendor/node/NodeRedis.d.ts +74 -0
- package/dist/vendor/node/NodeRedis.js +11 -0
- package/dist/vendor/node/NodeRuntime.d.ts +85 -0
- package/dist/vendor/node/NodeRuntime.js +8 -0
- package/dist/vendor/node/NodeServices.d.ts +34 -0
- package/dist/vendor/node/NodeServices.js +23 -0
- package/dist/vendor/node/NodeSink.d.ts +8 -0
- package/dist/vendor/node/NodeSink.js +12 -0
- package/dist/vendor/node/NodeSocket.d.ts +38 -0
- package/dist/vendor/node/NodeSocket.js +31 -0
- package/dist/vendor/node/NodeSocketServer.d.ts +8 -0
- package/dist/vendor/node/NodeSocketServer.js +21 -0
- package/dist/vendor/node/NodeStdio.d.ts +11 -0
- package/dist/vendor/node/NodeStdio.js +10 -0
- package/dist/vendor/node/NodeStream.d.ts +8 -0
- package/dist/vendor/node/NodeStream.js +27 -0
- package/dist/vendor/node/NodeTerminal.d.ts +21 -0
- package/dist/vendor/node/NodeTerminal.js +10 -0
- package/dist/vendor/node/NodeWorker.d.ts +22 -0
- package/dist/vendor/node/NodeWorker.js +9 -0
- package/dist/vendor/node/NodeWorkerRunner.d.ts +12 -0
- package/dist/vendor/node/NodeWorkerRunner.js +7 -0
- package/dist/vendor/node/Undici.d.ts +28 -0
- package/dist/vendor/node/Undici.js +9 -0
- package/dist/vendor/node/index.d.ts +100 -0
- package/dist/vendor/node/index.js +115 -0
- package/dist/vendor/node-shared/LICENSE +21 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +57 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +22 -0
- package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
- package/dist/vendor/node-shared/NodeCrypto.d.ts +27 -0
- package/dist/vendor/node-shared/NodeCrypto.js +9 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +36 -0
- package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
- package/dist/vendor/node-shared/NodePath.d.ts +27 -0
- package/dist/vendor/node-shared/NodePath.js +11 -0
- package/dist/vendor/node-shared/NodeRuntime.d.ts +47 -0
- package/dist/vendor/node-shared/NodeRuntime.js +7 -0
- package/dist/vendor/node-shared/NodeSink.d.ts +69 -0
- package/dist/vendor/node-shared/NodeSink.js +11 -0
- package/dist/vendor/node-shared/NodeSocket.d.ts +134 -0
- package/dist/vendor/node-shared/NodeSocket.js +23 -0
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +80 -0
- package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
- package/dist/vendor/node-shared/NodeStdio.d.ts +12 -0
- package/dist/vendor/node-shared/NodeStdio.js +9 -0
- package/dist/vendor/node-shared/NodeStream.d.ts +179 -0
- package/dist/vendor/node-shared/NodeStream.js +26 -0
- package/dist/vendor/node-shared/NodeTerminal.d.ts +22 -0
- package/dist/vendor/node-shared/NodeTerminal.js +9 -0
- package/dist/vendor/node-shared/index.d.ts +56 -0
- package/dist/vendor/node-shared/index.js +58 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
- package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/node-shared/internal/utils.js +7 -0
- package/dist/vendor/platform-bun.d.ts +92 -0
- package/dist/vendor/platform-bun.js +107 -0
- package/dist/vendor/platform-node-shared.d.ts +56 -0
- package/dist/vendor/platform-node-shared.js +58 -0
- package/dist/vendor/platform-node.d.ts +100 -0
- package/dist/vendor/platform-node.js +115 -0
- package/docs/README.md +132 -0
- package/docs/api.md +265 -0
- package/docs/concepts/host-surface.md +152 -0
- package/docs/concepts/runtime-parity.md +80 -0
- package/docs/guides/bind-a-repository-root.md +109 -0
- package/docs/guides/configure-the-filesystem-helper.md +109 -0
- package/docs/guides/contain-child-processes.md +176 -0
- package/docs/installation.md +128 -0
- package/docs/quickstart.md +159 -0
- package/docs/troubleshooting.md +178 -0
- package/package.json +146 -3
- package/src/BunFileSystem.ts +47 -0
- package/src/BunHost.ts +338 -0
- package/src/index.ts +27 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layerClientProtocol,
|
|
3
|
+
layerSocketServer
|
|
4
|
+
} from "./chunk-Y35ZAO5U.js";
|
|
5
|
+
import {
|
|
6
|
+
layer
|
|
7
|
+
} from "./chunk-6TZ7LQAC.js";
|
|
8
|
+
import {
|
|
9
|
+
layer as layer2
|
|
10
|
+
} from "./chunk-MSWDMTAF.js";
|
|
11
|
+
import {
|
|
12
|
+
__export
|
|
13
|
+
} from "./chunk-MLKGABMK.js";
|
|
14
|
+
|
|
15
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.0-rc.115_effect@4.0.0-rc.115/node_modules/@effect/platform-bun/dist/BunClusterSocket.js
|
|
16
|
+
var BunClusterSocket_exports = {};
|
|
17
|
+
__export(BunClusterSocket_exports, {
|
|
18
|
+
layer: () => layer8,
|
|
19
|
+
layerClientProtocol: () => layerClientProtocol,
|
|
20
|
+
layerK8sHttpClient: () => layerK8sHttpClient,
|
|
21
|
+
layerSocketServer: () => layerSocketServer
|
|
22
|
+
});
|
|
23
|
+
import * as Effect from "effect/Effect";
|
|
24
|
+
import * as FileSystem from "effect/FileSystem";
|
|
25
|
+
import * as Layer from "effect/Layer";
|
|
26
|
+
import * as K8sHttpClient from "effect/unstable/cluster/K8sHttpClient";
|
|
27
|
+
import * as MessageStorage from "effect/unstable/cluster/MessageStorage";
|
|
28
|
+
import * as RunnerHealth from "effect/unstable/cluster/RunnerHealth";
|
|
29
|
+
import * as Runners from "effect/unstable/cluster/Runners";
|
|
30
|
+
import * as RunnerStorage from "effect/unstable/cluster/RunnerStorage";
|
|
31
|
+
import * as ShardingConfig from "effect/unstable/cluster/ShardingConfig";
|
|
32
|
+
import * as SocketRunner from "effect/unstable/cluster/SocketRunner";
|
|
33
|
+
import * as SqlMessageStorage from "effect/unstable/cluster/SqlMessageStorage";
|
|
34
|
+
import * as SqlRunnerStorage from "effect/unstable/cluster/SqlRunnerStorage";
|
|
35
|
+
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
36
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
37
|
+
var layer8 = (options) => {
|
|
38
|
+
const layer9 = options?.clientOnly ? Layer.provide(SocketRunner.layerClientOnly, layerClientProtocol) : Layer.provide(SocketRunner.layer, [layerSocketServer, layerClientProtocol]);
|
|
39
|
+
const runnerHealth = options?.clientOnly ? Layer.empty : options?.runnerHealth === "k8s" ? RunnerHealth.layerK8s(options.runnerHealthK8s).pipe(Layer.provide([layer2, layerK8sHttpClient])) : RunnerHealth.layerPing.pipe(Layer.provide(Runners.layerRpc), Layer.provide(layerClientProtocol));
|
|
40
|
+
return layer9.pipe(Layer.provide(runnerHealth), Layer.provideMerge(options?.storage === "local" ? MessageStorage.layerNoop : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlMessageStorage.layer).pipe(Layer.provide(layer))), Layer.provide(options?.storage === "local" ? RunnerStorage.layerMemory : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlRunnerStorage.layer)), Layer.provide(ShardingConfig.layerFromEnv(options?.shardingConfig)), Layer.provide(options?.serialization === "ndjson" ? RpcSerialization.layerNdjsonWith({
|
|
41
|
+
maxBufferSize: options?.serializationMaxBufferSize
|
|
42
|
+
}) : RpcSerialization.layerSchemaBinary({
|
|
43
|
+
maxFrameSize: options?.serializationMaxBufferSize
|
|
44
|
+
})));
|
|
45
|
+
};
|
|
46
|
+
var layerK8sHttpClient = /* @__PURE__ */ K8sHttpClient.layer.pipe(/* @__PURE__ */ Layer.provide(/* @__PURE__ */ Layer.unwrap(/* @__PURE__ */ Effect.gen(function* () {
|
|
47
|
+
const fs = yield* FileSystem.FileSystem;
|
|
48
|
+
const caCertOption = yield* fs.readFile("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt").pipe(Effect.option);
|
|
49
|
+
if (caCertOption._tag === "None") {
|
|
50
|
+
return FetchHttpClient.layer;
|
|
51
|
+
}
|
|
52
|
+
return Layer.fresh(FetchHttpClient.layer).pipe(Layer.provide(Layer.succeed(FetchHttpClient.RequestInit, {
|
|
53
|
+
tls: {
|
|
54
|
+
ca: caCertOption.value
|
|
55
|
+
}
|
|
56
|
+
})));
|
|
57
|
+
}))), /* @__PURE__ */ Layer.provide(layer2));
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
layer8 as layer,
|
|
61
|
+
layerK8sHttpClient,
|
|
62
|
+
BunClusterSocket_exports
|
|
63
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fromDuplex,
|
|
3
|
+
fromReadable,
|
|
4
|
+
fromReadableChannel,
|
|
5
|
+
pipeThroughDuplex,
|
|
6
|
+
pipeThroughSimple,
|
|
7
|
+
toArrayBuffer,
|
|
8
|
+
toReadable,
|
|
9
|
+
toReadableNever,
|
|
10
|
+
toString,
|
|
11
|
+
toUint8Array
|
|
12
|
+
} from "./chunk-XH4U3JSV.js";
|
|
13
|
+
import {
|
|
14
|
+
__export
|
|
15
|
+
} from "./chunk-MLKGABMK.js";
|
|
16
|
+
|
|
17
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.0-rc.115_effect@4.0.0-rc.115_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeStream.js
|
|
18
|
+
var NodeStream_exports = {};
|
|
19
|
+
__export(NodeStream_exports, {
|
|
20
|
+
fromDuplex: () => fromDuplex,
|
|
21
|
+
fromReadable: () => fromReadable,
|
|
22
|
+
fromReadableChannel: () => fromReadableChannel,
|
|
23
|
+
pipeThroughDuplex: () => pipeThroughDuplex,
|
|
24
|
+
pipeThroughSimple: () => pipeThroughSimple,
|
|
25
|
+
toArrayBuffer: () => toArrayBuffer,
|
|
26
|
+
toReadable: () => toReadable,
|
|
27
|
+
toReadableNever: () => toReadableNever,
|
|
28
|
+
toString: () => toString,
|
|
29
|
+
toUint8Array: () => toUint8Array
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
NodeStream_exports
|
|
34
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.0-rc.115_effect@4.0.0-rc.115_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeWorkerRunner.js
|
|
6
|
+
var NodeWorkerRunner_exports = {};
|
|
7
|
+
__export(NodeWorkerRunner_exports, {
|
|
8
|
+
layer: () => layer
|
|
9
|
+
});
|
|
10
|
+
import * as Cause from "effect/Cause";
|
|
11
|
+
import * as Deferred from "effect/Deferred";
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Exit from "effect/Exit";
|
|
14
|
+
import * as Fiber from "effect/Fiber";
|
|
15
|
+
import * as Layer from "effect/Layer";
|
|
16
|
+
import * as Scope from "effect/Scope";
|
|
17
|
+
import { WorkerError, WorkerReceiveError, WorkerSpawnError } from "effect/unstable/workers/WorkerError";
|
|
18
|
+
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
19
|
+
import * as WorkerThreads from "node:worker_threads";
|
|
20
|
+
var layer = /* @__PURE__ */ Layer.succeed(WorkerRunner.WorkerRunnerPlatform)({
|
|
21
|
+
start() {
|
|
22
|
+
return Effect.gen(function* () {
|
|
23
|
+
if (!WorkerThreads.parentPort && !process.send) {
|
|
24
|
+
return yield* new WorkerError({
|
|
25
|
+
reason: new WorkerSpawnError({
|
|
26
|
+
message: "not in a worker"
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const sendRaw = WorkerThreads.parentPort ? (_portId, message, transfers) => WorkerThreads.parentPort.postMessage(message, transfers) : (_portId, message, _transfers) => process.send(message);
|
|
31
|
+
const sendUnsafe = (_portId, message, transfers) => sendRaw(_portId, [1, message], transfers);
|
|
32
|
+
const send = (_portId, message, transfers) => Effect.sync(() => sendUnsafe(_portId, message, transfers));
|
|
33
|
+
const run = (handler) => Effect.scopedWith(Effect.fnUntraced(function* (scope) {
|
|
34
|
+
const closeLatch = Deferred.makeUnsafe();
|
|
35
|
+
const trackFiber = Fiber.runIn(scope);
|
|
36
|
+
const services = yield* Effect.context();
|
|
37
|
+
const runFork = Effect.runForkWith(services);
|
|
38
|
+
const onExit = (exit) => {
|
|
39
|
+
if (exit._tag === "Failure" && !Cause.hasInterruptsOnly(exit.cause)) {
|
|
40
|
+
runFork(Effect.logError("unhandled error in worker", exit.cause));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const port = WorkerThreads.parentPort ?? process;
|
|
44
|
+
function onMessage(message) {
|
|
45
|
+
if (message[0] === 0) {
|
|
46
|
+
const result = handler(0, message[1]);
|
|
47
|
+
if (Effect.isEffect(result)) {
|
|
48
|
+
const fiber = runFork(result);
|
|
49
|
+
fiber.addObserver(onExit);
|
|
50
|
+
trackFiber(fiber);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
if (WorkerThreads.parentPort) {
|
|
54
|
+
WorkerThreads.parentPort.close();
|
|
55
|
+
} else {
|
|
56
|
+
process.channel?.unref();
|
|
57
|
+
}
|
|
58
|
+
Deferred.doneUnsafe(closeLatch, Exit.void);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
port.on("message", onMessage);
|
|
62
|
+
function onMessageError(cause) {
|
|
63
|
+
Deferred.doneUnsafe(closeLatch, new WorkerError({
|
|
64
|
+
reason: new WorkerReceiveError({
|
|
65
|
+
message: "received messageerror event",
|
|
66
|
+
cause
|
|
67
|
+
})
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
function onError(cause) {
|
|
71
|
+
Deferred.doneUnsafe(closeLatch, new WorkerError({
|
|
72
|
+
reason: new WorkerReceiveError({
|
|
73
|
+
message: "received error event",
|
|
74
|
+
cause
|
|
75
|
+
})
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
if (WorkerThreads.parentPort) {
|
|
79
|
+
WorkerThreads.parentPort.on("messageerror", onMessageError);
|
|
80
|
+
WorkerThreads.parentPort.on("error", onError);
|
|
81
|
+
}
|
|
82
|
+
yield* Scope.addFinalizer(scope, Effect.sync(() => {
|
|
83
|
+
port.off("message", onMessage);
|
|
84
|
+
if (WorkerThreads.parentPort) {
|
|
85
|
+
WorkerThreads.parentPort.off("messageerror", onMessageError);
|
|
86
|
+
WorkerThreads.parentPort.off("error", onError);
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
sendRaw(0, [0]);
|
|
90
|
+
return yield* Deferred.await(closeLatch);
|
|
91
|
+
}));
|
|
92
|
+
return {
|
|
93
|
+
run,
|
|
94
|
+
send,
|
|
95
|
+
sendUnsafe
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
layer,
|
|
103
|
+
NodeWorkerRunner_exports
|
|
104
|
+
};
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NetSocket,
|
|
3
|
+
NodeWS,
|
|
4
|
+
fromDuplex
|
|
5
|
+
} from "./chunk-JJ24ARBQ.js";
|
|
6
|
+
import {
|
|
7
|
+
__export
|
|
8
|
+
} from "./chunk-MLKGABMK.js";
|
|
9
|
+
|
|
10
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-rc.115_effect@4.0.0-rc.115/node_modules/@effect/platform-node-shared/dist/NodeSocketServer.js
|
|
11
|
+
var NodeSocketServer_exports = {};
|
|
12
|
+
__export(NodeSocketServer_exports, {
|
|
13
|
+
IncomingMessage: () => IncomingMessage,
|
|
14
|
+
layer: () => layer,
|
|
15
|
+
layerTls: () => layerTls,
|
|
16
|
+
layerWebSocket: () => layerWebSocket,
|
|
17
|
+
make: () => make2,
|
|
18
|
+
makeTls: () => makeTls,
|
|
19
|
+
makeWebSocket: () => makeWebSocket
|
|
20
|
+
});
|
|
21
|
+
import * as Context from "effect/Context";
|
|
22
|
+
import * as Deferred from "effect/Deferred";
|
|
23
|
+
import * as Effect from "effect/Effect";
|
|
24
|
+
import * as Exit from "effect/Exit";
|
|
25
|
+
import * as Fiber from "effect/Fiber";
|
|
26
|
+
import { pipe } from "effect/Function";
|
|
27
|
+
import * as Function from "effect/Function";
|
|
28
|
+
import * as Layer from "effect/Layer";
|
|
29
|
+
import * as References from "effect/References";
|
|
30
|
+
import * as Scope from "effect/Scope";
|
|
31
|
+
import * as NetAddress from "effect/unstable/net/NetAddress";
|
|
32
|
+
import * as Socket from "effect/unstable/socket/Socket";
|
|
33
|
+
import * as SocketServer from "effect/unstable/socket/SocketServer";
|
|
34
|
+
import * as Net from "node:net";
|
|
35
|
+
import * as Tls from "node:tls";
|
|
36
|
+
var isDeno = "Deno" in globalThis;
|
|
37
|
+
var socketAddressFromNode = (address) => typeof address === "string" ? Effect.succeed(NetAddress.unixPathAddress(address)) : Effect.fromResult(NetAddress.inetAddressFromIpString(address.address, address.port)).pipe(Effect.mapError((cause) => new SocketServer.SocketServerError({
|
|
38
|
+
reason: new SocketServer.SocketServerOpenError({
|
|
39
|
+
cause
|
|
40
|
+
})
|
|
41
|
+
})));
|
|
42
|
+
var IncomingMessage = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-node-shared/NodeSocketServer/IncomingMessage")) {
|
|
43
|
+
};
|
|
44
|
+
var make2 = (options) => makeNetServer({
|
|
45
|
+
listenOptions: options,
|
|
46
|
+
connectionEvent: "connection",
|
|
47
|
+
createServer: () => Net.createServer(options)
|
|
48
|
+
});
|
|
49
|
+
var layer = /* @__PURE__ */ Function.flow(make2, /* @__PURE__ */ Layer.effect(SocketServer.SocketServer));
|
|
50
|
+
var makeTls = (options) => makeNetServer({
|
|
51
|
+
listenOptions: options,
|
|
52
|
+
connectionEvent: "secureConnection",
|
|
53
|
+
createServer: () => {
|
|
54
|
+
const server = Tls.createServer(options);
|
|
55
|
+
server.on("tlsClientError", (_error, socket) => {
|
|
56
|
+
socket.destroy();
|
|
57
|
+
});
|
|
58
|
+
return server;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
var layerTls = /* @__PURE__ */ Function.flow(makeTls, /* @__PURE__ */ Layer.effect(SocketServer.SocketServer));
|
|
62
|
+
var makeWebSocket = /* @__PURE__ */ Effect.fnUntraced(function* (options) {
|
|
63
|
+
const pendingConnections = /* @__PURE__ */ new Map();
|
|
64
|
+
const server = yield* Effect.acquireRelease(Effect.sync(() => new NodeWS.WebSocketServer(options)), (server2) => Effect.callback((resume) => {
|
|
65
|
+
pendingConnections.forEach(([, remove], conn) => {
|
|
66
|
+
remove();
|
|
67
|
+
conn.terminate();
|
|
68
|
+
});
|
|
69
|
+
server2.close(() => resume(Effect.void));
|
|
70
|
+
}));
|
|
71
|
+
function defaultHandler(conn, req) {
|
|
72
|
+
const remove = () => {
|
|
73
|
+
pendingConnections.delete(conn);
|
|
74
|
+
conn.removeEventListener("close", remove);
|
|
75
|
+
};
|
|
76
|
+
pendingConnections.set(conn, [req, remove]);
|
|
77
|
+
conn.addEventListener("close", remove);
|
|
78
|
+
}
|
|
79
|
+
let onConnection = defaultHandler;
|
|
80
|
+
server.on("connection", (conn, req) => {
|
|
81
|
+
conn.pause();
|
|
82
|
+
onConnection(conn, req);
|
|
83
|
+
});
|
|
84
|
+
yield* Effect.callback((resume) => {
|
|
85
|
+
server.once("error", (error) => {
|
|
86
|
+
resume(Effect.fail(new SocketServer.SocketServerError({
|
|
87
|
+
reason: new SocketServer.SocketServerOpenError({
|
|
88
|
+
cause: error
|
|
89
|
+
})
|
|
90
|
+
})));
|
|
91
|
+
});
|
|
92
|
+
server.once("listening", () => {
|
|
93
|
+
resume(Effect.void);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
const run = Effect.fnUntraced(function* (handler) {
|
|
97
|
+
const scope = yield* Scope.make();
|
|
98
|
+
const services = Context.omit(Scope.Scope)(yield* Effect.context());
|
|
99
|
+
const trackFiber = Fiber.runIn(scope);
|
|
100
|
+
const prevOnConnection = onConnection;
|
|
101
|
+
onConnection = function(conn, req) {
|
|
102
|
+
let context2 = services;
|
|
103
|
+
context2 = Context.add(context2, IncomingMessage, req);
|
|
104
|
+
context2 = Context.add(context2, Socket.WebSocket, conn);
|
|
105
|
+
pipe(Socket.fromWebSocket(Effect.acquireRelease(Effect.succeed(conn), (conn2) => Effect.sync(() => {
|
|
106
|
+
conn2.close();
|
|
107
|
+
}))), Effect.flatMap(handler), Effect.catchCause(reportUnhandledError), Effect.runForkWith(context2), trackFiber);
|
|
108
|
+
};
|
|
109
|
+
pendingConnections.forEach(([req, remove], conn) => {
|
|
110
|
+
remove();
|
|
111
|
+
onConnection(conn, req);
|
|
112
|
+
});
|
|
113
|
+
return yield* Effect.callback((_resume) => {
|
|
114
|
+
return Effect.sync(() => {
|
|
115
|
+
onConnection = prevOnConnection;
|
|
116
|
+
});
|
|
117
|
+
}).pipe(Effect.ensuring(Scope.close(scope, Exit.void)));
|
|
118
|
+
});
|
|
119
|
+
const boundAddress = yield* socketAddressFromNode(server.address());
|
|
120
|
+
return SocketServer.SocketServer.of({
|
|
121
|
+
address: boundAddress,
|
|
122
|
+
run
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
var layerWebSocket = /* @__PURE__ */ Function.flow(makeWebSocket, /* @__PURE__ */ Layer.effect(SocketServer.SocketServer));
|
|
126
|
+
var reportUnhandledError = (cause) => Effect.withFiber((fiber) => {
|
|
127
|
+
const unhandledLogLevel = fiber.getRef(References.UnhandledLogLevel);
|
|
128
|
+
if (unhandledLogLevel) {
|
|
129
|
+
return Effect.logWithLevel(unhandledLogLevel)(cause, "Unhandled error in SocketServer");
|
|
130
|
+
}
|
|
131
|
+
return Effect.void;
|
|
132
|
+
});
|
|
133
|
+
var makeNetServer = /* @__PURE__ */ Effect.fnUntraced(function* (options) {
|
|
134
|
+
const errorDeferred = Deferred.makeUnsafe();
|
|
135
|
+
const pending = /* @__PURE__ */ new Map();
|
|
136
|
+
function defaultOnConnection(conn) {
|
|
137
|
+
const remove = () => {
|
|
138
|
+
pending.delete(conn);
|
|
139
|
+
conn.off("close", remove);
|
|
140
|
+
conn.off("error", remove);
|
|
141
|
+
};
|
|
142
|
+
pending.set(conn, remove);
|
|
143
|
+
conn.on("close", remove);
|
|
144
|
+
conn.on("error", remove);
|
|
145
|
+
}
|
|
146
|
+
let onConnection = defaultOnConnection;
|
|
147
|
+
let server;
|
|
148
|
+
yield* Effect.addFinalizer(() => Effect.callback((resume) => {
|
|
149
|
+
pending.forEach((remove, conn) => {
|
|
150
|
+
remove();
|
|
151
|
+
conn.destroy();
|
|
152
|
+
});
|
|
153
|
+
server?.close(() => resume(Effect.void));
|
|
154
|
+
}));
|
|
155
|
+
server = options.createServer();
|
|
156
|
+
server.on(options.connectionEvent, (conn) => {
|
|
157
|
+
if (!isDeno) conn.pause();
|
|
158
|
+
onConnection(conn);
|
|
159
|
+
});
|
|
160
|
+
server.on("error", (err) => Deferred.doneUnsafe(errorDeferred, Exit.fail(err)));
|
|
161
|
+
yield* Effect.callback((resume) => {
|
|
162
|
+
server.listen(options.listenOptions, () => resume(Effect.void));
|
|
163
|
+
}).pipe(Effect.raceFirst(Effect.mapError(Deferred.await(errorDeferred), (err) => new SocketServer.SocketServerError({
|
|
164
|
+
reason: new SocketServer.SocketServerOpenError({
|
|
165
|
+
cause: err
|
|
166
|
+
})
|
|
167
|
+
}))));
|
|
168
|
+
const run = Effect.fnUntraced(function* (handler) {
|
|
169
|
+
const scope = yield* Scope.make();
|
|
170
|
+
const services = Context.omit(Scope.Scope)(yield* Effect.context());
|
|
171
|
+
const trackFiber = Fiber.runIn(scope);
|
|
172
|
+
const prevOnConnection = onConnection;
|
|
173
|
+
onConnection = function(conn) {
|
|
174
|
+
let error;
|
|
175
|
+
conn.on("error", (err) => {
|
|
176
|
+
error = err;
|
|
177
|
+
});
|
|
178
|
+
pipe(fromDuplex(Effect.acquireRelease(Effect.suspend(() => {
|
|
179
|
+
if (error) {
|
|
180
|
+
return Effect.fail(new Socket.SocketError({
|
|
181
|
+
reason: new Socket.SocketOpenError({
|
|
182
|
+
kind: "Unknown",
|
|
183
|
+
cause: error
|
|
184
|
+
})
|
|
185
|
+
}));
|
|
186
|
+
} else if (conn.closed) {
|
|
187
|
+
return Effect.fail(new Socket.SocketError({
|
|
188
|
+
reason: new Socket.SocketCloseError({
|
|
189
|
+
code: 1e3
|
|
190
|
+
})
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
return Effect.succeed(conn);
|
|
194
|
+
}), (conn2) => Effect.sync(() => {
|
|
195
|
+
if (conn2.closed === false) {
|
|
196
|
+
conn2.destroySoon();
|
|
197
|
+
}
|
|
198
|
+
})), {
|
|
199
|
+
tlsServer: true
|
|
200
|
+
}), Effect.flatMap(handler), Effect.catchCause(reportUnhandledError), Effect.runForkWith(Context.add(services, NetSocket, conn)), trackFiber);
|
|
201
|
+
};
|
|
202
|
+
pending.forEach((remove, conn) => {
|
|
203
|
+
remove();
|
|
204
|
+
onConnection(conn);
|
|
205
|
+
});
|
|
206
|
+
return yield* Effect.callback((_resume) => {
|
|
207
|
+
return Effect.suspend(() => {
|
|
208
|
+
onConnection = prevOnConnection;
|
|
209
|
+
return Scope.close(scope, Exit.void);
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
const boundAddress = yield* socketAddressFromNode(server.address());
|
|
214
|
+
return SocketServer.SocketServer.of({
|
|
215
|
+
address: boundAddress,
|
|
216
|
+
run
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
export {
|
|
221
|
+
IncomingMessage,
|
|
222
|
+
make2 as make,
|
|
223
|
+
layer,
|
|
224
|
+
makeTls,
|
|
225
|
+
layerTls,
|
|
226
|
+
makeWebSocket,
|
|
227
|
+
layerWebSocket,
|
|
228
|
+
NodeSocketServer_exports
|
|
229
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-rc.115_effect@4.0.0-rc.115/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
|
|
2
|
+
var buildSpawnOptions = (options, base, platform) => {
|
|
3
|
+
const detached = options.detached ?? platform !== "win32";
|
|
4
|
+
return {
|
|
5
|
+
...base,
|
|
6
|
+
detached,
|
|
7
|
+
shell: options.shell,
|
|
8
|
+
windowsHide: options.windowsHide ?? !detached
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
buildSpawnOptions
|
|
14
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NetSocket,
|
|
3
|
+
NodeWS,
|
|
4
|
+
fromDuplex,
|
|
5
|
+
layerNet,
|
|
6
|
+
layerTls,
|
|
7
|
+
makeNet,
|
|
8
|
+
makeNetChannel,
|
|
9
|
+
makeTls,
|
|
10
|
+
makeTlsChannel
|
|
11
|
+
} from "./chunk-JJ24ARBQ.js";
|
|
12
|
+
import {
|
|
13
|
+
__export
|
|
14
|
+
} from "./chunk-MLKGABMK.js";
|
|
15
|
+
|
|
16
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.0-rc.115_effect@4.0.0-rc.115/node_modules/@effect/platform-bun/dist/BunSocket.js
|
|
17
|
+
var BunSocket_exports = {};
|
|
18
|
+
__export(BunSocket_exports, {
|
|
19
|
+
NetSocket: () => NetSocket,
|
|
20
|
+
NodeWS: () => NodeWS,
|
|
21
|
+
fromDuplex: () => fromDuplex,
|
|
22
|
+
layerNet: () => layerNet,
|
|
23
|
+
layerTls: () => layerTls,
|
|
24
|
+
layerWebSocket: () => layerWebSocket,
|
|
25
|
+
layerWebSocketConstructor: () => layerWebSocketConstructor,
|
|
26
|
+
makeNet: () => makeNet,
|
|
27
|
+
makeNetChannel: () => makeNetChannel,
|
|
28
|
+
makeTls: () => makeTls,
|
|
29
|
+
makeTlsChannel: () => makeTlsChannel
|
|
30
|
+
});
|
|
31
|
+
import { flow } from "effect/Function";
|
|
32
|
+
import * as Layer from "effect/Layer";
|
|
33
|
+
import * as Socket from "effect/unstable/socket/Socket";
|
|
34
|
+
var layerWebSocketConstructor = /* @__PURE__ */ Layer.succeed(Socket.WebSocketConstructor)((url, options) => (
|
|
35
|
+
// Bun accepts `WebSocketOptions`, but `bun-types` selects the DOM overload
|
|
36
|
+
// when `lib.dom` is loaded and hides those constructor options.
|
|
37
|
+
new globalThis.WebSocket(url, options)
|
|
38
|
+
));
|
|
39
|
+
var layerWebSocket = /* @__PURE__ */ flow(Socket.makeWebSocket, /* @__PURE__ */ Layer.effect(Socket.Socket), /* @__PURE__ */ Layer.provide(layerWebSocketConstructor));
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
layerWebSocketConstructor,
|
|
43
|
+
layerWebSocket,
|
|
44
|
+
BunSocket_exports
|
|
45
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runMain
|
|
3
|
+
} from "./chunk-LEUPYT3Q.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.0-rc.115_effect@4.0.0-rc.115_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
9
|
+
var NodeRuntime_exports = {};
|
|
10
|
+
__export(NodeRuntime_exports, {
|
|
11
|
+
runMain: () => runMain2
|
|
12
|
+
});
|
|
13
|
+
var runMain2 = runMain;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
runMain2 as runMain,
|
|
17
|
+
NodeRuntime_exports
|
|
18
|
+
};
|