@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.12
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 +110 -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 +148 -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 +248 -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 +3067 -0
- package/dist/vendor/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/bun/BunAddressResolver.js +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
- package/dist/vendor/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/bun/BunClusterHttp.js +39 -0
- package/dist/vendor/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/bun/BunClusterSocket.js +22 -0
- package/dist/vendor/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/bun/BunCrypto.js +8 -0
- package/dist/vendor/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/bun/BunDatagramSocket.js +11 -0
- package/dist/vendor/bun/BunDns.d.ts +72 -0
- package/dist/vendor/bun/BunDns.js +12 -0
- package/dist/vendor/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/bun/BunFileSystem.js +9 -0
- package/dist/vendor/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/bun/BunHttpClient.js +1 -0
- package/dist/vendor/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/bun/BunHttpPlatform.js +11 -0
- package/dist/vendor/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/bun/BunHttpServer.js +38 -0
- package/dist/vendor/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
- package/dist/vendor/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/bun/BunMultipart.js +12 -0
- package/dist/vendor/bun/BunPath.d.ts +27 -0
- package/dist/vendor/bun/BunPath.js +12 -0
- package/dist/vendor/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/bun/BunRedis.js +11 -0
- package/dist/vendor/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/bun/BunRuntime.js +8 -0
- package/dist/vendor/bun/BunServices.d.ts +37 -0
- package/dist/vendor/bun/BunServices.js +23 -0
- package/dist/vendor/bun/BunSink.d.ts +9 -0
- package/dist/vendor/bun/BunSink.js +12 -0
- package/dist/vendor/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/bun/BunSocket.js +29 -0
- package/dist/vendor/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/bun/BunSocketServer.js +21 -0
- package/dist/vendor/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/bun/BunStdio.js +10 -0
- package/dist/vendor/bun/BunStream.d.ts +20 -0
- package/dist/vendor/bun/BunStream.js +30 -0
- package/dist/vendor/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/bun/BunTerminal.js +10 -0
- package/dist/vendor/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/bun/BunWorker.js +9 -0
- package/dist/vendor/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/bun/BunWorkerRunner.js +7 -0
- package/dist/vendor/bun/LICENSE +21 -0
- package/dist/vendor/bun/index.d.ts +130 -0
- package/dist/vendor/bun/index.js +121 -0
- package/dist/vendor/chunk-2ZAGBWTH.js +40 -0
- package/dist/vendor/chunk-3SL3HKQA.js +118 -0
- package/dist/vendor/chunk-3WUGYBFU.js +0 -0
- package/dist/vendor/chunk-4WIQ2XN7.js +28 -0
- package/dist/vendor/chunk-5ET7NHI7.js +15 -0
- package/dist/vendor/chunk-6FSJ2PMW.js +53 -0
- package/dist/vendor/chunk-6L2NJEOV.js +62 -0
- package/dist/vendor/chunk-72X6VEVD.js +62 -0
- package/dist/vendor/chunk-7NMJM44J.js +26 -0
- package/dist/vendor/chunk-A7AY2JP7.js +71 -0
- package/dist/vendor/chunk-A7UXCEJA.js +81 -0
- package/dist/vendor/chunk-ADP5LRUF.js +274 -0
- package/dist/vendor/chunk-ASGOJ3XA.js +0 -0
- package/dist/vendor/chunk-AWNTTSHL.js +34 -0
- package/dist/vendor/chunk-BUKVIAEM.js +20 -0
- package/dist/vendor/chunk-BY3SDXID.js +501 -0
- package/dist/vendor/chunk-C3PGUWW5.js +414 -0
- package/dist/vendor/chunk-CL4EIDIY.js +7 -0
- package/dist/vendor/chunk-D2ZL4PLZ.js +93 -0
- package/dist/vendor/chunk-D4HEMNGU.js +22 -0
- package/dist/vendor/chunk-F4V5TRY7.js +85 -0
- package/dist/vendor/chunk-F772LLZ5.js +31 -0
- package/dist/vendor/chunk-FFD6R5JZ.js +104 -0
- package/dist/vendor/chunk-G4HOH7GK.js +65 -0
- package/dist/vendor/chunk-GJN7MEBF.js +18 -0
- package/dist/vendor/chunk-HDV6VIRM.js +48 -0
- package/dist/vendor/chunk-IHV7Z4SW.js +34 -0
- package/dist/vendor/chunk-IWSDM4CG.js +16 -0
- package/dist/vendor/chunk-JOQDB2HC.js +26 -0
- package/dist/vendor/chunk-KABHKTVG.js +18 -0
- package/dist/vendor/chunk-KFDBU6RR.js +60 -0
- package/dist/vendor/chunk-KHPN5DWT.js +20 -0
- package/dist/vendor/chunk-LNWGIDIG.js +20 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-MUEED3C3.js +144 -0
- package/dist/vendor/chunk-N6TK35N5.js +18 -0
- package/dist/vendor/chunk-NQO6V4KI.js +580 -0
- package/dist/vendor/chunk-NUJQMLJP.js +325 -0
- package/dist/vendor/chunk-OF3N2FN4.js +61 -0
- package/dist/vendor/chunk-OGZJACUS.js +57 -0
- package/dist/vendor/chunk-PCEVZYXO.js +63 -0
- package/dist/vendor/chunk-PECOFLCU.js +85 -0
- package/dist/vendor/chunk-PU7QVYND.js +18 -0
- package/dist/vendor/chunk-QGPZPULA.js +51 -0
- package/dist/vendor/chunk-QHR2RC5M.js +109 -0
- package/dist/vendor/chunk-R2YON4A6.js +28 -0
- package/dist/vendor/chunk-R327POEZ.js +18 -0
- package/dist/vendor/chunk-REFJNBQR.js +18 -0
- package/dist/vendor/chunk-RHJ6LV32.js +43 -0
- package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
- package/dist/vendor/chunk-RP3EWS4C.js +0 -0
- package/dist/vendor/chunk-RQH5DSBA.js +249 -0
- package/dist/vendor/chunk-RQQ5TSCD.js +374 -0
- package/dist/vendor/chunk-S6QUQLBV.js +229 -0
- package/dist/vendor/chunk-SCXQLSNW.js +34 -0
- package/dist/vendor/chunk-SD4X5NGU.js +515 -0
- package/dist/vendor/chunk-T332WJRS.js +128 -0
- package/dist/vendor/chunk-T5FQGISI.js +18 -0
- package/dist/vendor/chunk-TBPDCAMH.js +70 -0
- package/dist/vendor/chunk-UFWLKG4I.js +16 -0
- package/dist/vendor/chunk-UPIQ52FQ.js +426 -0
- package/dist/vendor/chunk-UUQXJRMK.js +14 -0
- package/dist/vendor/chunk-UUYTTEDH.js +36 -0
- package/dist/vendor/chunk-V2EB7FHY.js +129 -0
- package/dist/vendor/chunk-VIWU4EBF.js +18 -0
- package/dist/vendor/chunk-WPZDL2D7.js +21 -0
- package/dist/vendor/chunk-X4YPHWAE.js +22 -0
- package/dist/vendor/chunk-XACFQJY7.js +93 -0
- package/dist/vendor/chunk-Y7V6ISZS.js +418 -0
- package/dist/vendor/chunk-YDY5P7GL.js +20 -0
- package/dist/vendor/chunk-ZNKZXDUD.js +18 -0
- package/dist/vendor/chunk-ZS3VW5QR.js +63 -0
- package/dist/vendor/chunk-ZUUCLHBP.js +18 -0
- package/dist/vendor/chunk-ZVJCBTJG.js +131 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.js +1 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunDns.d.ts +72 -0
- package/dist/vendor/cjs/bun/BunDns.js +1 -0
- package/dist/vendor/cjs/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
- package/dist/vendor/cjs/bun/BunPath.d.ts +27 -0
- package/dist/vendor/cjs/bun/BunPath.js +1 -0
- package/dist/vendor/cjs/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/cjs/bun/BunRedis.js +1 -0
- package/dist/vendor/cjs/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
- package/dist/vendor/cjs/bun/BunServices.d.ts +37 -0
- package/dist/vendor/cjs/bun/BunServices.js +1 -0
- package/dist/vendor/cjs/bun/BunSink.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSink.js +1 -0
- package/dist/vendor/cjs/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/cjs/bun/BunSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
- package/dist/vendor/cjs/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/cjs/bun/BunStdio.js +1 -0
- package/dist/vendor/cjs/bun/BunStream.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunStream.js +1 -0
- package/dist/vendor/cjs/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
- package/dist/vendor/cjs/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/cjs/bun/BunWorker.js +1 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
- package/dist/vendor/cjs/bun/index.d.ts +130 -0
- package/dist/vendor/cjs/bun/index.js +1 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
- package/dist/vendor/cjs/node/NodeDns.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
- package/dist/vendor/cjs/node/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node/NodePath.js +1 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/cjs/node/NodeRedis.js +1 -0
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +37 -0
- package/dist/vendor/cjs/node/NodeServices.js +1 -0
- package/dist/vendor/cjs/node/NodeSink.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSink.js +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/cjs/node/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/cjs/node/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeStream.js +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeWorker.js +1 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
- package/dist/vendor/cjs/node/Undici.d.ts +31 -0
- package/dist/vendor/cjs/node/Undici.js +1 -0
- package/dist/vendor/cjs/node/index.d.ts +140 -0
- package/dist/vendor/cjs/node/index.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node-shared/index.d.ts +85 -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 +130 -0
- package/dist/vendor/cjs/platform-bun.js +1 -0
- package/dist/vendor/cjs/platform-node-shared.d.ts +85 -0
- package/dist/vendor/cjs/platform-node-shared.js +1 -0
- package/dist/vendor/cjs/platform-node.d.ts +140 -0
- package/dist/vendor/cjs/platform-node.js +1 -0
- package/dist/vendor/node/LICENSE +21 -0
- package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/node/NodeAddressResolver.js +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
- package/dist/vendor/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/node/NodeClusterHttp.js +43 -0
- package/dist/vendor/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/node/NodeClusterSocket.js +30 -0
- package/dist/vendor/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/node/NodeCrypto.js +8 -0
- package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/node/NodeDatagramSocket.js +12 -0
- package/dist/vendor/node/NodeDns.d.ts +51 -0
- package/dist/vendor/node/NodeDns.js +12 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/node/NodeFileSystem.js +9 -0
- package/dist/vendor/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/node/NodeHttpClient.js +46 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
- package/dist/vendor/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/node/NodeHttpPlatform.js +16 -0
- package/dist/vendor/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/node/NodeHttpServer.js +46 -0
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
- package/dist/vendor/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/node/NodeMultipart.js +15 -0
- package/dist/vendor/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/node/NodeMultipartParser.js +11 -0
- package/dist/vendor/node/NodePath.d.ts +30 -0
- package/dist/vendor/node/NodePath.js +12 -0
- package/dist/vendor/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/node/NodeRedis.js +11 -0
- package/dist/vendor/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/node/NodeRuntime.js +8 -0
- package/dist/vendor/node/NodeServices.d.ts +37 -0
- package/dist/vendor/node/NodeServices.js +23 -0
- package/dist/vendor/node/NodeSink.d.ts +9 -0
- package/dist/vendor/node/NodeSink.js +12 -0
- package/dist/vendor/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/node/NodeSocket.js +31 -0
- package/dist/vendor/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/node/NodeSocketServer.js +21 -0
- package/dist/vendor/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/node/NodeStdio.js +10 -0
- package/dist/vendor/node/NodeStream.d.ts +9 -0
- package/dist/vendor/node/NodeStream.js +27 -0
- package/dist/vendor/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node/NodeTerminal.js +10 -0
- package/dist/vendor/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/node/NodeWorker.js +9 -0
- package/dist/vendor/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/node/NodeWorkerRunner.js +7 -0
- package/dist/vendor/node/Undici.d.ts +31 -0
- package/dist/vendor/node/Undici.js +9 -0
- package/dist/vendor/node/index.d.ts +140 -0
- package/dist/vendor/node/index.js +130 -0
- package/dist/vendor/node-shared/LICENSE +21 -0
- package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
- package/dist/vendor/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/node-shared/NodeCrypto.js +9 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
- package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/node-shared/NodeDns.js +31 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
- package/dist/vendor/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/node-shared/NodePath.js +11 -0
- package/dist/vendor/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/node-shared/NodeRuntime.js +7 -0
- package/dist/vendor/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/node-shared/NodeSink.js +11 -0
- package/dist/vendor/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/node-shared/NodeSocket.js +23 -0
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
- package/dist/vendor/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/node-shared/NodeStdio.js +9 -0
- package/dist/vendor/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/node-shared/NodeStream.js +26 -0
- package/dist/vendor/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node-shared/NodeTerminal.js +9 -0
- package/dist/vendor/node-shared/index.d.ts +85 -0
- package/dist/vendor/node-shared/index.js +70 -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 +130 -0
- package/dist/vendor/platform-bun.js +121 -0
- package/dist/vendor/platform-node-shared.d.ts +85 -0
- package/dist/vendor/platform-node-shared.js +70 -0
- package/dist/vendor/platform-node.d.ts +140 -0
- package/dist/vendor/platform-node.js +130 -0
- package/docs/README.md +135 -0
- package/docs/api.md +264 -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 +113 -0
- package/docs/guides/contain-child-processes.md +178 -0
- package/docs/installation.md +131 -0
- package/docs/quickstart.md +163 -0
- package/docs/troubleshooting.md +163 -0
- package/package.json +146 -3
- package/src/BunFileSystem.ts +47 -0
- package/src/BunHost.ts +345 -0
- package/src/index.ts +27 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer
|
|
3
|
+
} from "./chunk-BY3SDXID.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeFileSystem.js
|
|
9
|
+
var NodeFileSystem_exports = {};
|
|
10
|
+
__export(NodeFileSystem_exports, {
|
|
11
|
+
layer: () => layer2
|
|
12
|
+
});
|
|
13
|
+
var layer2 = layer;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
layer2 as layer,
|
|
17
|
+
NodeFileSystem_exports
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeHttpServerRequest.js
|
|
6
|
+
var NodeHttpServerRequest_exports = {};
|
|
7
|
+
__export(NodeHttpServerRequest_exports, {
|
|
8
|
+
toIncomingMessage: () => toIncomingMessage,
|
|
9
|
+
toServerResponse: () => toServerResponse
|
|
10
|
+
});
|
|
11
|
+
var toIncomingMessage = (self) => self.source;
|
|
12
|
+
var toServerResponse = (self) => {
|
|
13
|
+
const res = self.response;
|
|
14
|
+
return typeof res === "function" ? res() : res;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
toIncomingMessage,
|
|
19
|
+
toServerResponse,
|
|
20
|
+
NodeHttpServerRequest_exports
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer,
|
|
3
|
+
make
|
|
4
|
+
} from "./chunk-MUEED3C3.js";
|
|
5
|
+
import {
|
|
6
|
+
__export
|
|
7
|
+
} from "./chunk-MLKGABMK.js";
|
|
8
|
+
|
|
9
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunTerminal.js
|
|
10
|
+
var BunTerminal_exports = {};
|
|
11
|
+
__export(BunTerminal_exports, {
|
|
12
|
+
layer: () => layer2,
|
|
13
|
+
make: () => make2
|
|
14
|
+
});
|
|
15
|
+
var make2 = make;
|
|
16
|
+
var layer2 = layer;
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
make2 as make,
|
|
20
|
+
layer2 as layer,
|
|
21
|
+
BunTerminal_exports
|
|
22
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunRedis.js
|
|
6
|
+
var BunRedis_exports = {};
|
|
7
|
+
__export(BunRedis_exports, {
|
|
8
|
+
BunRedis: () => BunRedis,
|
|
9
|
+
layer: () => layer,
|
|
10
|
+
layerConfig: () => layerConfig
|
|
11
|
+
});
|
|
12
|
+
import * as Config from "effect/Config";
|
|
13
|
+
import * as Context from "effect/Context";
|
|
14
|
+
import * as Deferred from "effect/Deferred";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
import * as Fn from "effect/Function";
|
|
17
|
+
import * as Layer from "effect/Layer";
|
|
18
|
+
import * as Redis from "effect/persistence/Redis";
|
|
19
|
+
import * as Scope from "effect/Scope";
|
|
20
|
+
var BunRedis = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-bun/BunRedis")) {
|
|
21
|
+
};
|
|
22
|
+
var make4 = /* @__PURE__ */ Effect.fnUntraced(function* (options) {
|
|
23
|
+
const {
|
|
24
|
+
RedisClient
|
|
25
|
+
} = yield* Effect.promise(() => import("bun"));
|
|
26
|
+
const scope2 = yield* Effect.scope;
|
|
27
|
+
yield* Scope.addFinalizer(scope2, Effect.sync(() => client.close()));
|
|
28
|
+
const client = new RedisClient(options?.url, options);
|
|
29
|
+
const use = (f) => Effect.tryPromise({
|
|
30
|
+
try: () => f(client),
|
|
31
|
+
catch: (cause) => new Redis.RedisError({
|
|
32
|
+
cause
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
const redis = yield* Redis.make({
|
|
36
|
+
send: (command, ...args) => Effect.tryPromise({
|
|
37
|
+
try: () => client.send(command, args),
|
|
38
|
+
catch: (cause) => new Redis.RedisError({
|
|
39
|
+
cause
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
subscribe: (channel, onMessage) => Effect.gen(function* () {
|
|
43
|
+
const terminal = yield* Deferred.make();
|
|
44
|
+
yield* Effect.acquireRelease(Effect.tryPromise({
|
|
45
|
+
try: async () => {
|
|
46
|
+
const subscriber = new RedisClient(options?.url, {
|
|
47
|
+
...options,
|
|
48
|
+
autoReconnect: false
|
|
49
|
+
});
|
|
50
|
+
subscriber.onclose = (cause) => {
|
|
51
|
+
Deferred.doneUnsafe(terminal, new Redis.RedisError({
|
|
52
|
+
cause
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
await subscriber.subscribe(channel, (message, channel2) => {
|
|
57
|
+
onMessage({
|
|
58
|
+
channel: channel2,
|
|
59
|
+
message
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
return subscriber;
|
|
63
|
+
} catch (cause) {
|
|
64
|
+
subscriber.onclose = null;
|
|
65
|
+
subscriber.close();
|
|
66
|
+
throw cause;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
catch: (cause) => new Redis.RedisError({
|
|
70
|
+
cause
|
|
71
|
+
})
|
|
72
|
+
}), (subscriber) => Effect.sync(() => {
|
|
73
|
+
subscriber.onclose = null;
|
|
74
|
+
subscriber.close();
|
|
75
|
+
}));
|
|
76
|
+
return Deferred.await(terminal);
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
const bunRedis = Fn.identity({
|
|
80
|
+
client,
|
|
81
|
+
use
|
|
82
|
+
});
|
|
83
|
+
return Context.make(BunRedis, bunRedis).pipe(Context.add(Redis.Redis, redis));
|
|
84
|
+
});
|
|
85
|
+
var layer = (options) => Layer.effectContext(make4(options));
|
|
86
|
+
var layerConfig = (options) => Layer.effectContext(Config.unwrap(options).pipe(Effect.flatMap(make4)));
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
BunRedis,
|
|
90
|
+
layer,
|
|
91
|
+
layerConfig,
|
|
92
|
+
BunRedis_exports
|
|
93
|
+
};
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import {
|
|
2
|
+
persisted,
|
|
3
|
+
stream
|
|
4
|
+
} from "./chunk-ZVJCBTJG.js";
|
|
5
|
+
import {
|
|
6
|
+
layer as layer2
|
|
7
|
+
} from "./chunk-SCXQLSNW.js";
|
|
8
|
+
import {
|
|
9
|
+
layer
|
|
10
|
+
} from "./chunk-T332WJRS.js";
|
|
11
|
+
import {
|
|
12
|
+
NodeHttpIncomingMessage
|
|
13
|
+
} from "./chunk-D2ZL4PLZ.js";
|
|
14
|
+
import {
|
|
15
|
+
NodeWS
|
|
16
|
+
} from "./chunk-C3PGUWW5.js";
|
|
17
|
+
import {
|
|
18
|
+
__export
|
|
19
|
+
} from "./chunk-MLKGABMK.js";
|
|
20
|
+
|
|
21
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeHttpServer.js
|
|
22
|
+
var NodeHttpServer_exports = {};
|
|
23
|
+
__export(NodeHttpServer_exports, {
|
|
24
|
+
layer: () => layer4,
|
|
25
|
+
layerConfig: () => layerConfig,
|
|
26
|
+
layerHttpServices: () => layerHttpServices,
|
|
27
|
+
layerServer: () => layerServer,
|
|
28
|
+
layerTest: () => layerTest,
|
|
29
|
+
make: () => make2,
|
|
30
|
+
makeHandler: () => makeHandler,
|
|
31
|
+
makeUpgradeHandler: () => makeUpgradeHandler
|
|
32
|
+
});
|
|
33
|
+
import * as Cause from "effect/Cause";
|
|
34
|
+
import * as Config from "effect/Config";
|
|
35
|
+
import * as Context from "effect/Context";
|
|
36
|
+
import * as Duration from "effect/Duration";
|
|
37
|
+
import * as Effect from "effect/Effect";
|
|
38
|
+
import * as Exit from "effect/Exit";
|
|
39
|
+
import * as Fiber from "effect/Fiber";
|
|
40
|
+
import { flow } from "effect/Function";
|
|
41
|
+
import * as Cookies from "effect/http/Cookies";
|
|
42
|
+
import * as Etag from "effect/http/Etag";
|
|
43
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
44
|
+
import * as HttpEffect from "effect/http/HttpEffect";
|
|
45
|
+
import * as HttpIncomingMessage from "effect/http/HttpIncomingMessage";
|
|
46
|
+
import * as HttpServer from "effect/http/HttpServer";
|
|
47
|
+
import { causeResponse, ClientAbort, HttpServerError, RequestParseError, ResponseError, ServeError } from "effect/http/HttpServerError";
|
|
48
|
+
import * as Request from "effect/http/HttpServerRequest";
|
|
49
|
+
import { HttpServerRequest } from "effect/http/HttpServerRequest";
|
|
50
|
+
import * as Response from "effect/http/HttpServerResponse";
|
|
51
|
+
import * as Latch from "effect/Latch";
|
|
52
|
+
import * as Layer from "effect/Layer";
|
|
53
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
54
|
+
import * as Scope from "effect/Scope";
|
|
55
|
+
import * as Socket from "effect/socket/Socket";
|
|
56
|
+
import * as Stream from "effect/Stream";
|
|
57
|
+
import * as Http from "node:http";
|
|
58
|
+
import { Readable } from "node:stream";
|
|
59
|
+
import { pipeline } from "node:stream/promises";
|
|
60
|
+
var make2 = /* @__PURE__ */ Effect.fnUntraced(function* (evaluate, options) {
|
|
61
|
+
const scope2 = yield* Effect.scope;
|
|
62
|
+
const server = evaluate();
|
|
63
|
+
const shutdown = yield* Effect.callback((resume) => {
|
|
64
|
+
if (!server.listening) {
|
|
65
|
+
return resume(Effect.void);
|
|
66
|
+
}
|
|
67
|
+
server.close((error) => {
|
|
68
|
+
if (error) {
|
|
69
|
+
resume(Effect.die(error));
|
|
70
|
+
} else {
|
|
71
|
+
resume(Effect.void);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}).pipe(Effect.cached);
|
|
75
|
+
const preemptiveShutdown = options.disablePreemptiveShutdown ? Effect.void : Effect.timeoutOrElse(shutdown, {
|
|
76
|
+
duration: options.gracefulShutdownTimeout ?? Duration.seconds(20),
|
|
77
|
+
orElse: () => Effect.void
|
|
78
|
+
});
|
|
79
|
+
yield* Scope.addFinalizer(scope2, shutdown);
|
|
80
|
+
yield* Effect.callback((resume) => {
|
|
81
|
+
function onError(cause) {
|
|
82
|
+
resume(Effect.fail(new ServeError({
|
|
83
|
+
cause
|
|
84
|
+
})));
|
|
85
|
+
}
|
|
86
|
+
server.on("error", onError);
|
|
87
|
+
server.listen(options, () => {
|
|
88
|
+
server.off("error", onError);
|
|
89
|
+
resume(Effect.void);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
const address = server.address();
|
|
93
|
+
const effectAddress = typeof address === "string" ? Effect.succeed(NetAddress.unixPathAddress(address)) : Effect.fromResult(NetAddress.inetAddressFromIpString(address.address, address.port)).pipe(Effect.mapError((cause) => new ServeError({
|
|
94
|
+
cause
|
|
95
|
+
})));
|
|
96
|
+
const boundAddress = yield* effectAddress;
|
|
97
|
+
const wss = yield* Effect.acquireRelease(Effect.sync(() => new NodeWS.WebSocketServer({
|
|
98
|
+
...options.websocket,
|
|
99
|
+
noServer: true
|
|
100
|
+
})), (wss2) => Effect.callback((resume) => {
|
|
101
|
+
wss2.close(() => resume(Effect.void));
|
|
102
|
+
})).pipe(Scope.provide(scope2), Effect.cached);
|
|
103
|
+
return HttpServer.make({
|
|
104
|
+
address: boundAddress,
|
|
105
|
+
serve: Effect.fnUntraced(function* (httpApp, middleware) {
|
|
106
|
+
const serveScope = yield* Effect.scope;
|
|
107
|
+
const scope3 = Scope.forkUnsafe(serveScope, "parallel");
|
|
108
|
+
const handler = yield* makeHandler(httpApp, {
|
|
109
|
+
middleware,
|
|
110
|
+
scope: scope3
|
|
111
|
+
});
|
|
112
|
+
const upgradeHandler = yield* makeUpgradeHandler(wss, httpApp, {
|
|
113
|
+
middleware,
|
|
114
|
+
scope: scope3
|
|
115
|
+
});
|
|
116
|
+
yield* Scope.addFinalizerExit(serveScope, () => Effect.ensuring(preemptiveShutdown, Effect.sync(() => {
|
|
117
|
+
server.off("request", handler);
|
|
118
|
+
server.off("upgrade", upgradeHandler);
|
|
119
|
+
})));
|
|
120
|
+
server.on("request", handler);
|
|
121
|
+
server.on("upgrade", upgradeHandler);
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
var makeHandler = (httpEffect, options) => {
|
|
126
|
+
const handled = HttpEffect.toHandled(httpEffect, handleResponse, options.middleware);
|
|
127
|
+
return Effect.withFiber((parent) => {
|
|
128
|
+
const services = parent.context;
|
|
129
|
+
return Effect.succeed(function handler(nodeRequest, nodeResponse) {
|
|
130
|
+
const context = Context.add(services, HttpServerRequest, new ServerRequestImpl(nodeRequest, nodeResponse));
|
|
131
|
+
const fiber = Fiber.runIn(Effect.runForkWith(context)(handled), options.scope);
|
|
132
|
+
if (fiber.pollUnsafe() === void 0) {
|
|
133
|
+
nodeResponse.on("close", () => {
|
|
134
|
+
if (!nodeResponse.writableEnded) {
|
|
135
|
+
fiber.interruptUnsafe(parent.id, ClientAbort.annotation);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
var makeUpgradeHandler = (lazyWss, httpEffect, options) => {
|
|
143
|
+
const handledApp = HttpEffect.toHandled(httpEffect, handleResponse, options.middleware);
|
|
144
|
+
return Effect.withFiber((parent) => {
|
|
145
|
+
const services = parent.context;
|
|
146
|
+
return Effect.succeed(function handler(nodeRequest, socket, head) {
|
|
147
|
+
let nodeResponse_ = void 0;
|
|
148
|
+
const nodeResponse = () => {
|
|
149
|
+
if (nodeResponse_ === void 0) {
|
|
150
|
+
nodeResponse_ = new Http.ServerResponse(nodeRequest);
|
|
151
|
+
if (request.upgraded || socket.destroyed) {
|
|
152
|
+
nodeResponse_.end();
|
|
153
|
+
} else {
|
|
154
|
+
nodeResponse_.assignSocket(socket);
|
|
155
|
+
nodeResponse_.on("finish", () => {
|
|
156
|
+
socket.end();
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return nodeResponse_;
|
|
161
|
+
};
|
|
162
|
+
const upgradeEffect = Socket.fromWebSocket(Effect.flatMap(lazyWss, (wss) => Effect.acquireRelease(Effect.callback((resume) => {
|
|
163
|
+
const onClose = () => resume(Effect.fail(new Socket.SocketError({
|
|
164
|
+
reason: new Socket.SocketOpenError({
|
|
165
|
+
kind: "Unknown",
|
|
166
|
+
cause: new Error("The socket closed before the upgrade")
|
|
167
|
+
})
|
|
168
|
+
})));
|
|
169
|
+
if (socket.destroyed) return onClose();
|
|
170
|
+
socket.once("close", onClose);
|
|
171
|
+
wss.handleUpgrade(nodeRequest, socket, head, (ws) => {
|
|
172
|
+
socket.off("close", onClose);
|
|
173
|
+
request.upgraded = true;
|
|
174
|
+
resume(Effect.succeed(ws));
|
|
175
|
+
});
|
|
176
|
+
}), (ws, exit) => Effect.sync(() => ws.close(closeCode(exit))))));
|
|
177
|
+
const request = new ServerRequestImpl(nodeRequest, nodeResponse, upgradeEffect);
|
|
178
|
+
const context = Context.add(services, HttpServerRequest, request);
|
|
179
|
+
const fiber = Fiber.runIn(Effect.runForkWith(context)(handledApp), options.scope);
|
|
180
|
+
socket.on("error", () => {
|
|
181
|
+
});
|
|
182
|
+
socket.on("close", () => {
|
|
183
|
+
if (!socket.writableEnded) {
|
|
184
|
+
fiber.interruptUnsafe(parent.id, ClientAbort.annotation);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
var ServerRequestImpl = class _ServerRequestImpl extends NodeHttpIncomingMessage {
|
|
191
|
+
[Request.TypeId];
|
|
192
|
+
response;
|
|
193
|
+
upgradeEffect;
|
|
194
|
+
upgraded = false;
|
|
195
|
+
url;
|
|
196
|
+
headersOverride;
|
|
197
|
+
constructor(source, response, upgradeEffect, url = source.url, headersOverride, remoteAddressOverride) {
|
|
198
|
+
super(source, (cause) => new HttpServerError({
|
|
199
|
+
reason: new RequestParseError({
|
|
200
|
+
request: this,
|
|
201
|
+
cause
|
|
202
|
+
})
|
|
203
|
+
}), remoteAddressOverride);
|
|
204
|
+
this[Request.TypeId] = Request.TypeId;
|
|
205
|
+
this.response = response;
|
|
206
|
+
this.upgradeEffect = upgradeEffect;
|
|
207
|
+
this.url = url;
|
|
208
|
+
this.headersOverride = headersOverride;
|
|
209
|
+
}
|
|
210
|
+
cachedCookies;
|
|
211
|
+
get cookies() {
|
|
212
|
+
if (this.cachedCookies) {
|
|
213
|
+
return this.cachedCookies;
|
|
214
|
+
}
|
|
215
|
+
return this.cachedCookies = Cookies.parseHeader(this.headers.cookie ?? "");
|
|
216
|
+
}
|
|
217
|
+
get resolvedResponse() {
|
|
218
|
+
return typeof this.response === "function" ? this.response() : this.response;
|
|
219
|
+
}
|
|
220
|
+
modify(options) {
|
|
221
|
+
return new _ServerRequestImpl(this.source, this.response, this.upgradeEffect, options.url ?? this.url, options.headers ?? this.headersOverride, "remoteAddress" in options ? options.remoteAddress : this.remoteAddressOverride);
|
|
222
|
+
}
|
|
223
|
+
get originalUrl() {
|
|
224
|
+
return this.source.url;
|
|
225
|
+
}
|
|
226
|
+
cachedMethod;
|
|
227
|
+
get method() {
|
|
228
|
+
return this.cachedMethod ??= this.source.method.toUpperCase();
|
|
229
|
+
}
|
|
230
|
+
get headers() {
|
|
231
|
+
this.headersOverride ??= this.source.headers;
|
|
232
|
+
return this.headersOverride;
|
|
233
|
+
}
|
|
234
|
+
multipartEffect;
|
|
235
|
+
get multipart() {
|
|
236
|
+
if (this.multipartEffect) {
|
|
237
|
+
return this.multipartEffect;
|
|
238
|
+
}
|
|
239
|
+
this.multipartEffect = Effect.runSync(Effect.cached(persisted(this.source, this.source.headers)));
|
|
240
|
+
return this.multipartEffect;
|
|
241
|
+
}
|
|
242
|
+
get multipartStream() {
|
|
243
|
+
return stream(this.source, this.source.headers);
|
|
244
|
+
}
|
|
245
|
+
get upgrade() {
|
|
246
|
+
return this.upgradeEffect ?? Effect.fail(new HttpServerError({
|
|
247
|
+
reason: new RequestParseError({
|
|
248
|
+
request: this,
|
|
249
|
+
description: "not an upgradeable ServerRequest"
|
|
250
|
+
})
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
toString() {
|
|
254
|
+
return `ServerRequest(${this.method} ${this.url})`;
|
|
255
|
+
}
|
|
256
|
+
toJSON() {
|
|
257
|
+
return HttpIncomingMessage.inspect(this, {
|
|
258
|
+
_id: "HttpServerRequest",
|
|
259
|
+
method: this.method,
|
|
260
|
+
url: this.originalUrl
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
var layerServer = /* @__PURE__ */ flow(make2, /* @__PURE__ */ Layer.effect(HttpServer.HttpServer));
|
|
265
|
+
var layerHttpServices = /* @__PURE__ */ Layer.mergeAll(layer, Etag.layerWeak, layer2);
|
|
266
|
+
var layer4 = (evaluate, options) => Layer.mergeAll(layerServer(evaluate, options), layerHttpServices);
|
|
267
|
+
var layerConfig = (evaluate, options) => Layer.mergeAll(Layer.effect(HttpServer.HttpServer)(Effect.flatMap(Config.unwrap(options), (options2) => make2(evaluate, options2))), layerHttpServices);
|
|
268
|
+
var layerTest = /* @__PURE__ */ HttpServer.layerTestClient.pipe(/* @__PURE__ */ Layer.provide(/* @__PURE__ */ Layer.fresh(FetchHttpClient.layer).pipe(/* @__PURE__ */ Layer.provide(/* @__PURE__ */ Layer.succeed(FetchHttpClient.RequestInit)({
|
|
269
|
+
keepalive: false
|
|
270
|
+
})))), /* @__PURE__ */ Layer.provideMerge(/* @__PURE__ */ layer4(Http.createServer, {
|
|
271
|
+
port: 0
|
|
272
|
+
})));
|
|
273
|
+
var closeCode = (exit) => Exit.isSuccess(exit) ? 1e3 : Cause.hasInterruptsOnly(exit.cause) ? 1001 : 1011;
|
|
274
|
+
var upgradedResponse = /* @__PURE__ */ Response.empty({
|
|
275
|
+
status: 101
|
|
276
|
+
});
|
|
277
|
+
var handleResponse = (request, response) => {
|
|
278
|
+
if (request.upgraded) {
|
|
279
|
+
return Effect.succeed(upgradedResponse);
|
|
280
|
+
}
|
|
281
|
+
const nodeResponse = request.resolvedResponse;
|
|
282
|
+
if (nodeResponse.writableEnded) {
|
|
283
|
+
return Effect.void;
|
|
284
|
+
}
|
|
285
|
+
let headers = response.headers;
|
|
286
|
+
if (!Cookies.isEmpty(response.cookies)) {
|
|
287
|
+
headers = {
|
|
288
|
+
...headers
|
|
289
|
+
};
|
|
290
|
+
const toSet = Cookies.toSetCookieHeaders(response.cookies);
|
|
291
|
+
if (headers["set-cookie"] !== void 0) {
|
|
292
|
+
toSet.push(headers["set-cookie"]);
|
|
293
|
+
}
|
|
294
|
+
headers["set-cookie"] = toSet;
|
|
295
|
+
}
|
|
296
|
+
if (request.method === "HEAD") {
|
|
297
|
+
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
298
|
+
return Effect.andThen(cancelResponseBody(response.body), Effect.callback((resume) => {
|
|
299
|
+
let completed = false;
|
|
300
|
+
const done = () => {
|
|
301
|
+
if (completed) return;
|
|
302
|
+
completed = true;
|
|
303
|
+
nodeResponse.off("close", done);
|
|
304
|
+
resume(Effect.void);
|
|
305
|
+
};
|
|
306
|
+
nodeResponse.once("close", done);
|
|
307
|
+
nodeResponse.end(done);
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
const body = response.body;
|
|
311
|
+
switch (body._tag) {
|
|
312
|
+
case "Empty": {
|
|
313
|
+
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
314
|
+
nodeResponse.end();
|
|
315
|
+
return Effect.void;
|
|
316
|
+
}
|
|
317
|
+
case "Raw": {
|
|
318
|
+
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
319
|
+
if (typeof body.body === "object" && body.body !== null && "pipe" in body.body && typeof body.body.pipe === "function") {
|
|
320
|
+
return Effect.tryPromise({
|
|
321
|
+
try: (signal) => pipeline(body.body, nodeResponse, {
|
|
322
|
+
signal,
|
|
323
|
+
end: true
|
|
324
|
+
}),
|
|
325
|
+
catch: (cause) => new HttpServerError({
|
|
326
|
+
reason: new ResponseError({
|
|
327
|
+
request,
|
|
328
|
+
response,
|
|
329
|
+
description: "Error writing raw response",
|
|
330
|
+
cause
|
|
331
|
+
})
|
|
332
|
+
})
|
|
333
|
+
}).pipe(Effect.interruptible, Effect.tapCause(handleCause(nodeResponse, response)));
|
|
334
|
+
}
|
|
335
|
+
return Effect.callback((resume) => {
|
|
336
|
+
nodeResponse.end(body.body, () => resume(Effect.void));
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
case "Uint8Array": {
|
|
340
|
+
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
341
|
+
if (body.contentLength < 1024 * 1024) {
|
|
342
|
+
nodeResponse.end(body.text ?? body.body);
|
|
343
|
+
return Effect.void;
|
|
344
|
+
}
|
|
345
|
+
return Effect.callback((resume) => {
|
|
346
|
+
nodeResponse.end(body.text ?? body.body, () => resume(Effect.void));
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
case "FormData": {
|
|
350
|
+
return Effect.suspend(() => {
|
|
351
|
+
const r = new globalThis.Response(body.formData);
|
|
352
|
+
nodeResponse.writeHead(response.status, response.statusText, {
|
|
353
|
+
...headers,
|
|
354
|
+
...Object.fromEntries(r.headers)
|
|
355
|
+
});
|
|
356
|
+
return Effect.callback((resume, signal) => {
|
|
357
|
+
Readable.fromWeb(r.body, {
|
|
358
|
+
signal
|
|
359
|
+
}).pipe(nodeResponse).on("error", (cause) => {
|
|
360
|
+
resume(Effect.fail(new HttpServerError({
|
|
361
|
+
reason: new ResponseError({
|
|
362
|
+
request,
|
|
363
|
+
response,
|
|
364
|
+
description: "Error writing FormData response",
|
|
365
|
+
cause
|
|
366
|
+
})
|
|
367
|
+
})));
|
|
368
|
+
}).once("finish", () => {
|
|
369
|
+
resume(Effect.void);
|
|
370
|
+
});
|
|
371
|
+
}).pipe(Effect.interruptible, Effect.tapCause(handleCause(nodeResponse, response)));
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
case "Stream": {
|
|
375
|
+
nodeResponse.writeHead(response.status, response.statusText, headers);
|
|
376
|
+
const drainLatch = Latch.makeUnsafe();
|
|
377
|
+
nodeResponse.on("drain", () => drainLatch.openUnsafe());
|
|
378
|
+
return body.stream.pipe(Stream.orDie, Stream.runForEachArray((array) => {
|
|
379
|
+
const chunk = array.length > 1 ? Buffer.concat(array) : array[0];
|
|
380
|
+
if (nodeResponse.write(chunk)) return Effect.void;
|
|
381
|
+
drainLatch.closeUnsafe();
|
|
382
|
+
return drainLatch.await;
|
|
383
|
+
}), Effect.interruptible, Effect.matchCauseEffect({
|
|
384
|
+
onSuccess: () => Effect.sync(() => nodeResponse.end()),
|
|
385
|
+
onFailure: handleCause(nodeResponse, response)
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
var cancelResponseBody = (body) => {
|
|
391
|
+
const stream2 = body._tag === "Raw" ? body.body : void 0;
|
|
392
|
+
if (stream2 instanceof Readable) {
|
|
393
|
+
return Effect.sync(() => stream2.destroy());
|
|
394
|
+
}
|
|
395
|
+
return Effect.void;
|
|
396
|
+
};
|
|
397
|
+
var handleCause = (nodeResponse, originalResponse) => (originalCause) => Effect.flatMap(causeResponse(originalCause), ([response, cause]) => {
|
|
398
|
+
const headersSent = nodeResponse.headersSent;
|
|
399
|
+
if (!headersSent) {
|
|
400
|
+
nodeResponse.writeHead(response.status, response.statusText);
|
|
401
|
+
}
|
|
402
|
+
if (!nodeResponse.writableEnded) {
|
|
403
|
+
nodeResponse.end();
|
|
404
|
+
}
|
|
405
|
+
return Effect.failCause(headersSent ? Cause.combine(originalCause, Cause.die(originalResponse)) : cause);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
export {
|
|
409
|
+
make2 as make,
|
|
410
|
+
makeHandler,
|
|
411
|
+
makeUpgradeHandler,
|
|
412
|
+
layerServer,
|
|
413
|
+
layerHttpServices,
|
|
414
|
+
layer4 as layer,
|
|
415
|
+
layerConfig,
|
|
416
|
+
layerTest,
|
|
417
|
+
NodeHttpServer_exports
|
|
418
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer,
|
|
3
|
+
layerConfig,
|
|
4
|
+
make
|
|
5
|
+
} from "./chunk-ADP5LRUF.js";
|
|
6
|
+
import {
|
|
7
|
+
__export
|
|
8
|
+
} from "./chunk-MLKGABMK.js";
|
|
9
|
+
|
|
10
|
+
// ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeDns.js
|
|
11
|
+
var NodeDns_exports = {};
|
|
12
|
+
__export(NodeDns_exports, {
|
|
13
|
+
layer: () => layer,
|
|
14
|
+
layerConfig: () => layerConfig,
|
|
15
|
+
make: () => make
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
NodeDns_exports
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer
|
|
3
|
+
} from "./chunk-BY3SDXID.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunFileSystem.js
|
|
9
|
+
var BunFileSystem_exports = {};
|
|
10
|
+
__export(BunFileSystem_exports, {
|
|
11
|
+
layer: () => layer2
|
|
12
|
+
});
|
|
13
|
+
var layer2 = layer;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
layer2 as layer,
|
|
17
|
+
BunFileSystem_exports
|
|
18
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunWorker.js
|
|
6
|
+
var BunWorker_exports = {};
|
|
7
|
+
__export(BunWorker_exports, {
|
|
8
|
+
layer: () => layer,
|
|
9
|
+
layerPlatform: () => layerPlatform
|
|
10
|
+
});
|
|
11
|
+
import * as Deferred from "effect/Deferred";
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Exit from "effect/Exit";
|
|
14
|
+
import * as Layer from "effect/Layer";
|
|
15
|
+
import * as Scope from "effect/Scope";
|
|
16
|
+
import * as Worker from "effect/workers/Worker";
|
|
17
|
+
import { WorkerError, WorkerUnknownError } from "effect/workers/WorkerError";
|
|
18
|
+
var layer = (spawn) => Layer.merge(layerPlatform, Layer.succeed(Worker.Spawner)(spawn));
|
|
19
|
+
var layerPlatform = /* @__PURE__ */ Layer.succeed(Worker.WorkerPlatform)(/* @__PURE__ */ Worker.makePlatform()({
|
|
20
|
+
setup({
|
|
21
|
+
scope,
|
|
22
|
+
worker
|
|
23
|
+
}) {
|
|
24
|
+
const closeDeferred = Deferred.makeUnsafe();
|
|
25
|
+
worker.addEventListener("close", () => {
|
|
26
|
+
Deferred.doneUnsafe(closeDeferred, Exit.void);
|
|
27
|
+
});
|
|
28
|
+
return Effect.as(Scope.addFinalizer(scope, Effect.suspend(() => {
|
|
29
|
+
worker.postMessage([1]);
|
|
30
|
+
return Deferred.await(closeDeferred);
|
|
31
|
+
}).pipe(Effect.interruptible, Effect.timeout(5e3), Effect.catchCause(() => Effect.sync(() => worker.terminate())))), worker);
|
|
32
|
+
},
|
|
33
|
+
listen({
|
|
34
|
+
deferred,
|
|
35
|
+
emit,
|
|
36
|
+
port,
|
|
37
|
+
scope
|
|
38
|
+
}) {
|
|
39
|
+
function onMessage(event) {
|
|
40
|
+
emit(event.data);
|
|
41
|
+
}
|
|
42
|
+
function onError(event) {
|
|
43
|
+
Deferred.doneUnsafe(deferred, new WorkerError({
|
|
44
|
+
reason: new WorkerUnknownError({
|
|
45
|
+
message: "An error event was emitted",
|
|
46
|
+
cause: event.error ?? event.message
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
port.addEventListener("message", onMessage);
|
|
51
|
+
port.addEventListener("error", onError);
|
|
52
|
+
return Scope.addFinalizer(scope, Effect.sync(() => {
|
|
53
|
+
port.removeEventListener("message", onMessage);
|
|
54
|
+
port.removeEventListener("error", onError);
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
layer,
|
|
61
|
+
layerPlatform,
|
|
62
|
+
BunWorker_exports
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layer
|
|
3
|
+
} from "./chunk-KFDBU6RR.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-MLKGABMK.js";
|
|
7
|
+
|
|
8
|
+
// ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunStdio.js
|
|
9
|
+
var BunStdio_exports = {};
|
|
10
|
+
__export(BunStdio_exports, {
|
|
11
|
+
layer: () => layer2
|
|
12
|
+
});
|
|
13
|
+
var layer2 = layer;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
layer2 as layer,
|
|
17
|
+
BunStdio_exports
|
|
18
|
+
};
|