@effect/platform-node 0.19.2 → 0.19.4
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/Command/dist/effect-platform-node-Command.cjs.d.mts +2 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.mts.map +1 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.ts +2 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.ts.map +1 -0
- package/Command/dist/effect-platform-node-Command.cjs.dev.js +72 -0
- package/Command/dist/effect-platform-node-Command.cjs.js +7 -0
- package/Command/dist/effect-platform-node-Command.cjs.mjs +18 -0
- package/Command/dist/effect-platform-node-Command.cjs.prod.js +72 -0
- package/Command/dist/effect-platform-node-Command.esm.js +5 -0
- package/Command/package.json +4 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts +2 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts.map +1 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts +2 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts.map +1 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.dev.js +27 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.js +7 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.mjs +4 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.prod.js +27 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.esm.js +14 -0
- package/CommandExecutor/package.json +4 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts +2 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts.map +1 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts +2 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts.map +1 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.dev.js +12 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.js +7 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.mjs +3 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.prod.js +12 -0
- package/Effectify/dist/effect-platform-node-Effectify.esm.js +5 -0
- package/Effectify/package.json +4 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.mts +2 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.mts.map +1 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.ts +2 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.ts.map +1 -0
- package/Error/dist/effect-platform-node-Error.cjs.dev.js +28 -0
- package/Error/dist/effect-platform-node-Error.cjs.js +7 -0
- package/Error/dist/effect-platform-node-Error.cjs.mjs +7 -0
- package/Error/dist/effect-platform-node-Error.cjs.prod.js +28 -0
- package/Error/dist/effect-platform-node-Error.esm.js +5 -0
- package/Error/package.json +4 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts +2 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts.map +1 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts +2 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts.map +1 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.dev.js +29 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.js +7 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.mjs +5 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.prod.js +29 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.esm.js +14 -0
- package/FileSystem/package.json +4 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts +2 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts.map +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts +2 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts.map +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.dev.js +19 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.js +7 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.mjs +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.prod.js +19 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.esm.js +23 -0
- package/Http/Etag/package.json +4 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts +2 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts.map +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts +2 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts.map +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.dev.js +31 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.js +7 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.mjs +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.prod.js +31 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.esm.js +23 -0
- package/Http/FormData/package.json +4 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts +2 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts.map +1 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts +2 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts.map +1 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.dev.js +39 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.js +7 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.mjs +10 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.prod.js +39 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.esm.js +65 -0
- package/Http/NodeClient/package.json +4 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts +2 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts.map +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts +2 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts.map +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.dev.js +51 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.js +7 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.mjs +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.prod.js +51 -0
- package/{mjs/Http/Platform.mjs → Http/Platform/dist/effect-platform-node-Http-Platform.esm.js} +9 -8
- package/Http/Platform/package.json +4 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts +2 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts.map +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts +2 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts.map +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.dev.js +61 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.js +7 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.mjs +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.prod.js +61 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.esm.js +29 -0
- package/Http/Server/package.json +4 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts +2 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts.map +1 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts +2 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts.map +1 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.dev.js +67 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.js +7 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.mjs +10 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.prod.js +67 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.esm.js +20 -0
- package/HttpClient/package.json +4 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts +2 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts.map +1 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts +2 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts.map +1 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.dev.js +96 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.js +7 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.mjs +14 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.prod.js +96 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.esm.js +28 -0
- package/HttpServer/package.json +4 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts +2 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts.map +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts +2 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts.map +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.dev.js +32 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.js +7 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.mjs +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.prod.js +32 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.esm.js +19 -0
- package/KeyValueStore/package.json +4 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts +2 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts.map +1 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts +2 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts.map +1 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.dev.js +33 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.js +7 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.mjs +3 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.prod.js +33 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.esm.js +22 -0
- package/NodeContext/package.json +4 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.mts +2 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.mts.map +1 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.ts +2 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.ts.map +1 -0
- package/Path/dist/effect-platform-node-Path.cjs.dev.js +21 -0
- package/Path/dist/effect-platform-node-Path.cjs.js +7 -0
- package/Path/dist/effect-platform-node-Path.cjs.mjs +6 -0
- package/Path/dist/effect-platform-node-Path.cjs.prod.js +21 -0
- package/Path/dist/effect-platform-node-Path.esm.js +26 -0
- package/Path/package.json +4 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts +2 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts.map +1 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts +2 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts.map +1 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.dev.js +16 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.js +7 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.mjs +4 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.prod.js +16 -0
- package/Runtime/dist/effect-platform-node-Runtime.esm.js +14 -0
- package/Runtime/package.json +4 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.mts +2 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.mts.map +1 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.ts +2 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.ts.map +1 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.dev.js +13 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.js +7 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.mjs +3 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.prod.js +13 -0
- package/Sink/dist/effect-platform-node-Sink.esm.js +18 -0
- package/Sink/package.json +4 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.mts +2 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.mts.map +1 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.ts +2 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.ts.map +1 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.dev.js +16 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.js +7 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.mjs +5 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.prod.js +16 -0
- package/Stream/dist/effect-platform-node-Stream.esm.js +30 -0
- package/Stream/package.json +4 -0
- package/dist/Command-15b84341.cjs.dev.js +29 -0
- package/dist/Command-2fc875e9.cjs.prod.js +29 -0
- package/dist/CommandExecutor-b7cb55b8.cjs.dev.js +195 -0
- package/dist/CommandExecutor-bccc7563.cjs.prod.js +195 -0
- package/dist/Effectify-1676f59e.cjs.prod.js +14 -0
- package/dist/Effectify-c94620ca.cjs.dev.js +14 -0
- package/dist/Error-004c8162.cjs.prod.js +18 -0
- package/dist/Error-6db0ba89.cjs.dev.js +18 -0
- package/dist/Etag-7a3db878.cjs.prod.js +112 -0
- package/dist/Etag-b38be81c.cjs.dev.js +112 -0
- package/dist/FileSystem-a207377d.cjs.prod.js +433 -0
- package/dist/FileSystem-d7b8eeac.cjs.dev.js +433 -0
- package/dist/FormData-053407d4.cjs.dev.js +67 -0
- package/dist/FormData-c7339a7b.cjs.prod.js +67 -0
- package/dist/HttpClient-595a26fa.cjs.prod.js +54 -0
- package/dist/HttpClient-6c942c00.cjs.dev.js +54 -0
- package/dist/HttpServer-2a788d37.cjs.prod.js +64 -0
- package/dist/HttpServer-cc291592.cjs.dev.js +64 -0
- package/dist/KeyValueStore-35cb6494.cjs.prod.js +62 -0
- package/dist/KeyValueStore-af7495b6.cjs.dev.js +62 -0
- package/dist/NodeClient-8db3bc84.cjs.prod.js +280 -0
- package/dist/NodeClient-ab5848bf.cjs.dev.js +280 -0
- package/dist/NodeContext-3c96e955.cjs.dev.js +50 -0
- package/dist/NodeContext-dff7bc0b.cjs.prod.js +50 -0
- package/dist/Path-bf4c3b07.cjs.prod.js +104 -0
- package/dist/Path-feae3dcf.cjs.dev.js +104 -0
- package/dist/Runtime-6aeac6f0.cjs.dev.js +68 -0
- package/dist/Runtime-e746c66d.cjs.prod.js +68 -0
- package/dist/Server-4638865c.cjs.prod.js +301 -0
- package/dist/Server-86853bf9.cjs.dev.js +301 -0
- package/dist/Sink-536c2b16.cjs.dev.js +26 -0
- package/dist/Sink-735101fa.cjs.prod.js +26 -0
- package/dist/Stream-53f57af5.cjs.dev.js +42 -0
- package/dist/Stream-7424efca.cjs.prod.js +42 -0
- package/dist/declarations/src/Command.d.ts.map +1 -0
- package/{CommandExecutor.d.ts → dist/declarations/src/CommandExecutor.d.ts} +3 -0
- package/dist/declarations/src/CommandExecutor.d.ts.map +1 -0
- package/dist/declarations/src/Effectify.d.ts.map +1 -0
- package/dist/declarations/src/Error.d.ts.map +1 -0
- package/dist/declarations/src/FileSystem.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Etag.d.ts +5 -0
- package/dist/declarations/src/Http/Etag.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/FormData.d.ts +5 -0
- package/dist/declarations/src/Http/FormData.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/NodeClient.d.ts +3 -0
- package/dist/declarations/src/Http/NodeClient.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Platform.d.ts +5 -0
- package/dist/declarations/src/Http/Platform.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Server.d.ts +5 -0
- package/dist/declarations/src/Http/Server.d.ts.map +1 -0
- package/{HttpClient.d.ts → dist/declarations/src/HttpClient.d.ts} +1 -1
- package/dist/declarations/src/HttpClient.d.ts.map +1 -0
- package/{HttpServer.d.ts → dist/declarations/src/HttpServer.d.ts} +3 -3
- package/dist/declarations/src/HttpServer.d.ts.map +1 -0
- package/{KeyValueStore.d.ts → dist/declarations/src/KeyValueStore.d.ts} +5 -0
- package/dist/declarations/src/KeyValueStore.d.ts.map +1 -0
- package/{NodeContext.d.ts → dist/declarations/src/NodeContext.d.ts} +3 -6
- package/dist/declarations/src/NodeContext.d.ts.map +1 -0
- package/dist/declarations/src/Path.d.ts.map +1 -0
- package/{Runtime.d.ts → dist/declarations/src/Runtime.d.ts} +3 -0
- package/dist/declarations/src/Runtime.d.ts.map +1 -0
- package/dist/declarations/src/Sink.d.ts.map +1 -0
- package/{Stream.d.ts → dist/declarations/src/Stream.d.ts} +3 -0
- package/dist/declarations/src/Stream.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +55 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/dist/effect-platform-node.cjs.d.mts +2 -0
- package/dist/effect-platform-node.cjs.d.mts.map +1 -0
- package/dist/effect-platform-node.cjs.d.ts +2 -0
- package/dist/effect-platform-node.cjs.d.ts.map +1 -0
- package/dist/effect-platform-node.cjs.dev.js +93 -0
- package/dist/effect-platform-node.cjs.js +7 -0
- package/dist/effect-platform-node.cjs.mjs +15 -0
- package/dist/effect-platform-node.cjs.prod.js +93 -0
- package/dist/effect-platform-node.esm.js +26 -0
- package/{internal/error.js → dist/error-4f074a3a.cjs.prod.js} +5 -8
- package/dist/error-e477c10b.cjs.dev.js +41 -0
- package/dist/formData-09ad7f6d.cjs.prod.js +141 -0
- package/dist/formData-fac89256.cjs.dev.js +141 -0
- package/dist/incomingMessage-28bc73d7.cjs.dev.js +85 -0
- package/dist/incomingMessage-ed443788.cjs.prod.js +85 -0
- package/dist/platform-1c31462c.cjs.dev.js +73 -0
- package/dist/platform-d09ef04f.cjs.prod.js +73 -0
- package/dist/sink-da49e187.cjs.prod.js +57 -0
- package/dist/sink-daf9e0e5.cjs.dev.js +57 -0
- package/dist/stream-1456ece0.cjs.dev.js +120 -0
- package/dist/stream-ef8b6a66.cjs.prod.js +120 -0
- package/{mjs/internal/commandExecutor.mjs → internal/commandExecutor.esm.js} +20 -15
- package/{mjs/internal/error.mjs → internal/error.esm.js} +5 -3
- package/{mjs/internal/fileSystem.mjs → internal/fileSystem.esm.js} +68 -20
- package/{mjs/internal/http/etag.mjs → internal/http/etag.esm.js} +10 -6
- package/{mjs/internal/http/formData.mjs → internal/http/formData.esm.js} +24 -23
- package/{mjs/internal/http/incomingMessage.mjs → internal/http/incomingMessage.esm.js} +14 -13
- package/{mjs/internal/http/nodeClient.mjs → internal/http/nodeClient.esm.js} +34 -26
- package/{mjs/internal/http/platform.mjs → internal/http/platform.esm.js} +16 -13
- package/{mjs/internal/http/server.mjs → internal/http/server.esm.js} +30 -27
- package/{mjs/internal/path.mjs → internal/path.esm.js} +15 -10
- package/{mjs/internal/runtime.mjs → internal/runtime.esm.js} +7 -5
- package/{mjs/internal/sink.mjs → internal/sink.esm.js} +7 -5
- package/{mjs/internal/stream.mjs → internal/stream.esm.js} +13 -8
- package/package.json +174 -31
- package/src/CommandExecutor.ts +1 -1
- package/src/FileSystem.ts +1 -1
- package/src/Http/Etag.ts +1 -1
- package/src/Http/FormData.ts +1 -1
- package/src/Http/NodeClient.ts +1 -1
- package/src/Http/Platform.ts +1 -1
- package/src/Http/Server.ts +1 -1
- package/src/HttpClient.ts +1 -1
- package/src/HttpServer.ts +3 -3
- package/src/KeyValueStore.ts +2 -2
- package/src/NodeContext.ts +3 -3
- package/src/Path.ts +1 -1
- package/src/Runtime.ts +1 -1
- package/src/Sink.ts +1 -1
- package/src/Stream.ts +1 -1
- package/src/index.ts +13 -13
- package/src/internal/commandExecutor.ts +3 -3
- package/src/internal/fileSystem.ts +1 -1
- package/src/internal/http/formData.ts +1 -1
- package/src/internal/http/incomingMessage.ts +1 -1
- package/src/internal/http/nodeClient.ts +3 -3
- package/src/internal/http/platform.ts +2 -2
- package/src/internal/http/server.ts +4 -4
- package/src/internal/sink.ts +1 -1
- package/src/internal/stream.ts +1 -1
- package/Command.d.ts.map +0 -1
- package/Command.js +0 -103
- package/Command.js.map +0 -1
- package/CommandExecutor.d.ts.map +0 -1
- package/CommandExecutor.js +0 -26
- package/CommandExecutor.js.map +0 -1
- package/Effectify.d.ts.map +0 -1
- package/Effectify.js +0 -13
- package/Effectify.js.map +0 -1
- package/Error.d.ts.map +0 -1
- package/Error.js +0 -25
- package/Error.js.map +0 -1
- package/FileSystem.d.ts.map +0 -1
- package/FileSystem.js +0 -32
- package/FileSystem.js.map +0 -1
- package/Http/Etag.d.ts.map +0 -1
- package/Http/Etag.js +0 -46
- package/Http/Etag.js.map +0 -1
- package/Http/FormData.d.ts.map +0 -1
- package/Http/FormData.js +0 -46
- package/Http/FormData.js.map +0 -1
- package/Http/NodeClient.d.ts.map +0 -1
- package/Http/NodeClient.js +0 -54
- package/Http/NodeClient.js.map +0 -1
- package/Http/Platform.d.ts.map +0 -1
- package/Http/Platform.js +0 -46
- package/Http/Platform.js.map +0 -1
- package/Http/Server.d.ts.map +0 -1
- package/Http/Server.js +0 -52
- package/Http/Server.js.map +0 -1
- package/HttpClient.d.ts.map +0 -1
- package/HttpClient.js +0 -25
- package/HttpClient.js.map +0 -1
- package/HttpServer.d.ts.map +0 -1
- package/HttpServer.js +0 -33
- package/HttpServer.js.map +0 -1
- package/KeyValueStore.d.ts.map +0 -1
- package/KeyValueStore.js +0 -43
- package/KeyValueStore.js.map +0 -1
- package/NodeContext.d.ts.map +0 -1
- package/NodeContext.js +0 -23
- package/NodeContext.js.map +0 -1
- package/Path.d.ts.map +0 -1
- package/Path.js +0 -36
- package/Path.js.map +0 -1
- package/Runtime.d.ts.map +0 -1
- package/Runtime.js +0 -26
- package/Runtime.js.map +0 -1
- package/Sink.d.ts.map +0 -1
- package/Sink.js +0 -19
- package/Sink.js.map +0 -1
- package/Stream.d.ts.map +0 -1
- package/Stream.js +0 -29
- package/Stream.js.map +0 -1
- package/index.d.ts +0 -55
- package/index.d.ts.map +0 -1
- package/index.js +0 -35
- package/index.js.map +0 -1
- package/internal/commandExecutor.d.ts +0 -2
- package/internal/commandExecutor.d.ts.map +0 -1
- package/internal/commandExecutor.js +0 -151
- package/internal/commandExecutor.js.map +0 -1
- package/internal/error.d.ts +0 -2
- package/internal/error.d.ts.map +0 -1
- package/internal/error.js.map +0 -1
- package/internal/fileSystem.d.ts +0 -2
- package/internal/fileSystem.d.ts.map +0 -1
- package/internal/fileSystem.js +0 -345
- package/internal/fileSystem.js.map +0 -1
- package/internal/http/etag.d.ts +0 -2
- package/internal/http/etag.d.ts.map +0 -1
- package/internal/http/etag.js +0 -51
- package/internal/http/etag.js.map +0 -1
- package/internal/http/formData.d.ts +0 -6
- package/internal/http/formData.d.ts.map +0 -1
- package/internal/http/formData.js +0 -116
- package/internal/http/formData.js.map +0 -1
- package/internal/http/incomingMessage.d.ts +0 -2
- package/internal/http/incomingMessage.d.ts.map +0 -1
- package/internal/http/incomingMessage.js +0 -66
- package/internal/http/incomingMessage.js.map +0 -1
- package/internal/http/nodeClient.d.ts +0 -2
- package/internal/http/nodeClient.d.ts.map +0 -1
- package/internal/http/nodeClient.js +0 -169
- package/internal/http/nodeClient.js.map +0 -1
- package/internal/http/platform.d.ts +0 -2
- package/internal/http/platform.d.ts.map +0 -1
- package/internal/http/platform.js +0 -50
- package/internal/http/platform.js.map +0 -1
- package/internal/http/server.d.ts +0 -2
- package/internal/http/server.d.ts.map +0 -1
- package/internal/http/server.js +0 -226
- package/internal/http/server.js.map +0 -1
- package/internal/path.d.ts +0 -2
- package/internal/path.d.ts.map +0 -1
- package/internal/path.js +0 -49
- package/internal/path.js.map +0 -1
- package/internal/runtime.d.ts +0 -2
- package/internal/runtime.d.ts.map +0 -1
- package/internal/runtime.js +0 -35
- package/internal/runtime.js.map +0 -1
- package/internal/sink.d.ts +0 -2
- package/internal/sink.d.ts.map +0 -1
- package/internal/sink.js +0 -41
- package/internal/sink.js.map +0 -1
- package/internal/stream.d.ts +0 -2
- package/internal/stream.d.ts.map +0 -1
- package/internal/stream.js +0 -100
- package/internal/stream.js.map +0 -1
- package/mjs/Command.mjs +0 -85
- package/mjs/Command.mjs.map +0 -1
- package/mjs/CommandExecutor.mjs +0 -16
- package/mjs/CommandExecutor.mjs.map +0 -1
- package/mjs/Effectify.mjs +0 -10
- package/mjs/Effectify.mjs.map +0 -1
- package/mjs/Error.mjs +0 -20
- package/mjs/Error.mjs.map +0 -1
- package/mjs/FileSystem.mjs +0 -21
- package/mjs/FileSystem.mjs.map +0 -1
- package/mjs/Http/Etag.mjs +0 -21
- package/mjs/Http/Etag.mjs.map +0 -1
- package/mjs/Http/FormData.mjs +0 -21
- package/mjs/Http/FormData.mjs.map +0 -1
- package/mjs/Http/NodeClient.mjs +0 -45
- package/mjs/Http/NodeClient.mjs.map +0 -1
- package/mjs/Http/Platform.mjs.map +0 -1
- package/mjs/Http/Server.mjs +0 -26
- package/mjs/Http/Server.mjs.map +0 -1
- package/mjs/HttpClient.mjs +0 -69
- package/mjs/HttpClient.mjs.map +0 -1
- package/mjs/HttpServer.mjs +0 -101
- package/mjs/HttpServer.mjs.map +0 -1
- package/mjs/KeyValueStore.mjs +0 -19
- package/mjs/KeyValueStore.mjs.map +0 -1
- package/mjs/NodeContext.mjs +0 -14
- package/mjs/NodeContext.mjs.map +0 -1
- package/mjs/Path.mjs +0 -26
- package/mjs/Path.mjs.map +0 -1
- package/mjs/Runtime.mjs +0 -16
- package/mjs/Runtime.mjs.map +0 -1
- package/mjs/Sink.mjs +0 -10
- package/mjs/Sink.mjs.map +0 -1
- package/mjs/Stream.mjs +0 -20
- package/mjs/Stream.mjs.map +0 -1
- package/mjs/index.mjs +0 -27
- package/mjs/index.mjs.map +0 -1
- package/mjs/internal/commandExecutor.mjs.map +0 -1
- package/mjs/internal/error.mjs.map +0 -1
- package/mjs/internal/fileSystem.mjs.map +0 -1
- package/mjs/internal/http/etag.mjs.map +0 -1
- package/mjs/internal/http/formData.mjs.map +0 -1
- package/mjs/internal/http/incomingMessage.mjs.map +0 -1
- package/mjs/internal/http/nodeClient.mjs.map +0 -1
- package/mjs/internal/http/platform.mjs.map +0 -1
- package/mjs/internal/http/server.mjs.map +0 -1
- package/mjs/internal/path.mjs.map +0 -1
- package/mjs/internal/runtime.mjs.map +0 -1
- package/mjs/internal/sink.mjs.map +0 -1
- package/mjs/internal/stream.mjs.map +0 -1
- package/tsconfig.build.json +0 -11
- package/tsconfig.examples.json +0 -12
- package/tsconfig.json +0 -11
- package/tsconfig.test.json +0 -17
- /package/{Command.d.ts → dist/declarations/src/Command.d.ts} +0 -0
- /package/{Effectify.d.ts → dist/declarations/src/Effectify.d.ts} +0 -0
- /package/{Error.d.ts → dist/declarations/src/Error.d.ts} +0 -0
- /package/{FileSystem.d.ts → dist/declarations/src/FileSystem.d.ts} +0 -0
- /package/{Path.d.ts → dist/declarations/src/Path.d.ts} +0 -0
- /package/{Sink.d.ts → dist/declarations/src/Sink.d.ts} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Platform = require('@effect/platform/Http/Platform');
|
|
4
|
+
var ServerResponse = require('@effect/platform/Http/ServerResponse');
|
|
5
|
+
var Function = require('effect/Function');
|
|
6
|
+
var Layer = require('effect/Layer');
|
|
7
|
+
var Mime = require('mime');
|
|
8
|
+
var NFS = require('node:fs');
|
|
9
|
+
var node_stream = require('node:stream');
|
|
10
|
+
var FileSystem_dist_effectPlatformNodeFileSystem = require('./FileSystem-a207377d.cjs.prod.js');
|
|
11
|
+
var Http_Etag_dist_effectPlatformNodeHttpEtag = require('./Etag-7a3db878.cjs.prod.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n["default"] = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var Platform__namespace = /*#__PURE__*/_interopNamespace(Platform);
|
|
34
|
+
var ServerResponse__namespace = /*#__PURE__*/_interopNamespace(ServerResponse);
|
|
35
|
+
var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
|
|
36
|
+
var Mime__default = /*#__PURE__*/_interopDefault(Mime);
|
|
37
|
+
var NFS__namespace = /*#__PURE__*/_interopNamespace(NFS);
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
const make = /*#__PURE__*/Platform__namespace.make({
|
|
41
|
+
fileResponse(path, status, statusText, headers, start, end, contentLength) {
|
|
42
|
+
const stream = NFS__namespace.createReadStream(path, {
|
|
43
|
+
start,
|
|
44
|
+
end
|
|
45
|
+
});
|
|
46
|
+
return ServerResponse__namespace.raw(stream, {
|
|
47
|
+
headers: {
|
|
48
|
+
...headers,
|
|
49
|
+
"content-type": headers["content-type"] ?? Mime__default["default"].getType(path) ?? "application/octet-stream",
|
|
50
|
+
"content-length": contentLength.toString()
|
|
51
|
+
},
|
|
52
|
+
status,
|
|
53
|
+
statusText
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
fileWebResponse(file, status, statusText, headers, _options) {
|
|
57
|
+
return ServerResponse__namespace.raw(node_stream.Readable.fromWeb(file.stream()), {
|
|
58
|
+
headers: {
|
|
59
|
+
...headers,
|
|
60
|
+
"content-type": headers["content-type"] ?? Mime__default["default"].getType(file.name) ?? "application/octet-stream",
|
|
61
|
+
"content-length": file.size.toString()
|
|
62
|
+
},
|
|
63
|
+
status,
|
|
64
|
+
statusText
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
const layer = /*#__PURE__*/Function.pipe( /*#__PURE__*/Layer__namespace.effect(Platform__namespace.Platform, make), /*#__PURE__*/Layer__namespace.use(FileSystem_dist_effectPlatformNodeFileSystem.layer), /*#__PURE__*/Layer__namespace.use(Http_Etag_dist_effectPlatformNodeHttpEtag.layer));
|
|
71
|
+
|
|
72
|
+
exports.layer = layer;
|
|
73
|
+
exports.make = make;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effect = require('effect/Effect');
|
|
4
|
+
var Function = require('effect/Function');
|
|
5
|
+
var Sink = require('effect/Sink');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
26
|
+
var Sink__namespace = /*#__PURE__*/_interopNamespace(Sink);
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
const fromWritable = (evaluate, onError, {
|
|
30
|
+
encoding,
|
|
31
|
+
endOnClose = true
|
|
32
|
+
} = {}) => endOnClose ? makeSinkWithRelease(evaluate, onError, encoding) : makeSink(evaluate, onError, encoding);
|
|
33
|
+
const makeSink = (stream, onError, encoding) => Function.pipe(Effect__namespace.sync(stream), Effect__namespace.map(stream => Sink__namespace.forEach(write(stream, onError, encoding))), Sink__namespace.unwrap);
|
|
34
|
+
const makeSinkWithRelease = (stream, onError, encoding) => Function.pipe(Effect__namespace.acquireRelease(Effect__namespace.sync(stream), endWritable), Effect__namespace.map(stream => Sink__namespace.forEach(write(stream, onError, encoding))), Sink__namespace.unwrapScoped);
|
|
35
|
+
const endWritable = stream => Effect__namespace.async(resume => {
|
|
36
|
+
if (stream.closed) {
|
|
37
|
+
resume(Effect__namespace.unit);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
stream.end(() => resume(Effect__namespace.unit));
|
|
41
|
+
});
|
|
42
|
+
const write = (stream, onError, encoding) => _ => Effect__namespace.async(resume => {
|
|
43
|
+
const cb = err => {
|
|
44
|
+
if (err) {
|
|
45
|
+
resume(Effect__namespace.fail(onError(err)));
|
|
46
|
+
} else {
|
|
47
|
+
resume(Effect__namespace.unit);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
if (encoding) {
|
|
51
|
+
stream.write(_, encoding, cb);
|
|
52
|
+
} else {
|
|
53
|
+
stream.write(_, cb);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
exports.fromWritable = fromWritable;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effect = require('effect/Effect');
|
|
4
|
+
var Function = require('effect/Function');
|
|
5
|
+
var Sink = require('effect/Sink');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
26
|
+
var Sink__namespace = /*#__PURE__*/_interopNamespace(Sink);
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
const fromWritable = (evaluate, onError, {
|
|
30
|
+
encoding,
|
|
31
|
+
endOnClose = true
|
|
32
|
+
} = {}) => endOnClose ? makeSinkWithRelease(evaluate, onError, encoding) : makeSink(evaluate, onError, encoding);
|
|
33
|
+
const makeSink = (stream, onError, encoding) => Function.pipe(Effect__namespace.sync(stream), Effect__namespace.map(stream => Sink__namespace.forEach(write(stream, onError, encoding))), Sink__namespace.unwrap);
|
|
34
|
+
const makeSinkWithRelease = (stream, onError, encoding) => Function.pipe(Effect__namespace.acquireRelease(Effect__namespace.sync(stream), endWritable), Effect__namespace.map(stream => Sink__namespace.forEach(write(stream, onError, encoding))), Sink__namespace.unwrapScoped);
|
|
35
|
+
const endWritable = stream => Effect__namespace.async(resume => {
|
|
36
|
+
if (stream.closed) {
|
|
37
|
+
resume(Effect__namespace.unit);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
stream.end(() => resume(Effect__namespace.unit));
|
|
41
|
+
});
|
|
42
|
+
const write = (stream, onError, encoding) => _ => Effect__namespace.async(resume => {
|
|
43
|
+
const cb = err => {
|
|
44
|
+
if (err) {
|
|
45
|
+
resume(Effect__namespace.fail(onError(err)));
|
|
46
|
+
} else {
|
|
47
|
+
resume(Effect__namespace.unit);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
if (encoding) {
|
|
51
|
+
stream.write(_, encoding, cb);
|
|
52
|
+
} else {
|
|
53
|
+
stream.write(_, cb);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
exports.fromWritable = fromWritable;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effect = require('effect/Effect');
|
|
4
|
+
var Function = require('effect/Function');
|
|
5
|
+
var Option = require('effect/Option');
|
|
6
|
+
var Stream = require('effect/Stream');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
27
|
+
var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
|
|
28
|
+
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
const fromReadable = (evaluate, onError, {
|
|
32
|
+
chunkSize
|
|
33
|
+
} = {}) => Function.pipe(Effect__namespace.acquireRelease(Effect__namespace.sync(evaluate), stream => Effect__namespace.sync(() => {
|
|
34
|
+
stream.removeAllListeners();
|
|
35
|
+
if (!stream.closed) {
|
|
36
|
+
stream.destroy();
|
|
37
|
+
}
|
|
38
|
+
})), Effect__namespace.map(stream => Stream__namespace.async(emit => {
|
|
39
|
+
stream.once("error", err => {
|
|
40
|
+
emit.fail(onError(err));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// The 'close' event is emitted after a process has ended and the stdio
|
|
44
|
+
// streams of a child process have been closed. This is distinct from
|
|
45
|
+
// the 'exit' event, since multiple processes might share the same
|
|
46
|
+
// stdio streams. The 'close' event will always emit after 'exit' was
|
|
47
|
+
// already emitted, or 'error' if the child failed to spawn.
|
|
48
|
+
stream.once("close", () => {
|
|
49
|
+
emit.end();
|
|
50
|
+
});
|
|
51
|
+
stream.on("readable", () => {
|
|
52
|
+
emit.single(stream);
|
|
53
|
+
});
|
|
54
|
+
if (stream.readable) {
|
|
55
|
+
emit.single(stream);
|
|
56
|
+
}
|
|
57
|
+
}, 1)), Stream__namespace.unwrapScoped, Stream__namespace.flatMap(_ => Stream__namespace.repeatEffectOption(readChunk(_, chunkSize))));
|
|
58
|
+
const readChunk = (stream, size) => Function.pipe(Effect__namespace.sync(() => size ? stream.read(Number(size)) : stream.read()), Effect__namespace.flatMap(_ => _ ? Effect__namespace.succeed(_) : Effect__namespace.fail(Option__namespace.none())));
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
const toString = options => {
|
|
62
|
+
const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;
|
|
63
|
+
return Effect__namespace.acquireUseRelease(Effect__namespace.sync(() => {
|
|
64
|
+
const stream = options.readable();
|
|
65
|
+
stream.setEncoding(options.encoding ?? "utf8");
|
|
66
|
+
return stream;
|
|
67
|
+
}), stream => Effect__namespace.async(resume => {
|
|
68
|
+
let string = "";
|
|
69
|
+
let bytes = 0;
|
|
70
|
+
stream.once("error", err => {
|
|
71
|
+
resume(Effect__namespace.fail(options.onFailure(err)));
|
|
72
|
+
});
|
|
73
|
+
stream.once("end", () => {
|
|
74
|
+
resume(Effect__namespace.succeed(string));
|
|
75
|
+
});
|
|
76
|
+
stream.on("data", chunk => {
|
|
77
|
+
string += chunk;
|
|
78
|
+
bytes += Buffer.byteLength(chunk);
|
|
79
|
+
if (maxBytesNumber && bytes > maxBytesNumber) {
|
|
80
|
+
resume(Effect__namespace.fail(options.onFailure(new Error("maxBytes exceeded"))));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}), stream => Effect__namespace.sync(() => {
|
|
84
|
+
stream.removeAllListeners();
|
|
85
|
+
if (!stream.closed) {
|
|
86
|
+
stream.destroy();
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
const toUint8Array = options => {
|
|
93
|
+
const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;
|
|
94
|
+
return Effect__namespace.acquireUseRelease(Effect__namespace.sync(options.readable), stream => Effect__namespace.async(resume => {
|
|
95
|
+
let buffer = Buffer.alloc(0);
|
|
96
|
+
let bytes = 0;
|
|
97
|
+
stream.once("error", err => {
|
|
98
|
+
resume(Effect__namespace.fail(options.onFailure(err)));
|
|
99
|
+
});
|
|
100
|
+
stream.once("end", () => {
|
|
101
|
+
resume(Effect__namespace.succeed(buffer));
|
|
102
|
+
});
|
|
103
|
+
stream.on("data", chunk => {
|
|
104
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
105
|
+
bytes += chunk.length;
|
|
106
|
+
if (maxBytesNumber && bytes > maxBytesNumber) {
|
|
107
|
+
resume(Effect__namespace.fail(options.onFailure(new Error("maxBytes exceeded"))));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}), stream => Effect__namespace.sync(() => {
|
|
111
|
+
stream.removeAllListeners();
|
|
112
|
+
if (!stream.closed) {
|
|
113
|
+
stream.destroy();
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.fromReadable = fromReadable;
|
|
119
|
+
exports.toString = toString;
|
|
120
|
+
exports.toUint8Array = toUint8Array;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effect = require('effect/Effect');
|
|
4
|
+
var Function = require('effect/Function');
|
|
5
|
+
var Option = require('effect/Option');
|
|
6
|
+
var Stream = require('effect/Stream');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
27
|
+
var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
|
|
28
|
+
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
const fromReadable = (evaluate, onError, {
|
|
32
|
+
chunkSize
|
|
33
|
+
} = {}) => Function.pipe(Effect__namespace.acquireRelease(Effect__namespace.sync(evaluate), stream => Effect__namespace.sync(() => {
|
|
34
|
+
stream.removeAllListeners();
|
|
35
|
+
if (!stream.closed) {
|
|
36
|
+
stream.destroy();
|
|
37
|
+
}
|
|
38
|
+
})), Effect__namespace.map(stream => Stream__namespace.async(emit => {
|
|
39
|
+
stream.once("error", err => {
|
|
40
|
+
emit.fail(onError(err));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// The 'close' event is emitted after a process has ended and the stdio
|
|
44
|
+
// streams of a child process have been closed. This is distinct from
|
|
45
|
+
// the 'exit' event, since multiple processes might share the same
|
|
46
|
+
// stdio streams. The 'close' event will always emit after 'exit' was
|
|
47
|
+
// already emitted, or 'error' if the child failed to spawn.
|
|
48
|
+
stream.once("close", () => {
|
|
49
|
+
emit.end();
|
|
50
|
+
});
|
|
51
|
+
stream.on("readable", () => {
|
|
52
|
+
emit.single(stream);
|
|
53
|
+
});
|
|
54
|
+
if (stream.readable) {
|
|
55
|
+
emit.single(stream);
|
|
56
|
+
}
|
|
57
|
+
}, 1)), Stream__namespace.unwrapScoped, Stream__namespace.flatMap(_ => Stream__namespace.repeatEffectOption(readChunk(_, chunkSize))));
|
|
58
|
+
const readChunk = (stream, size) => Function.pipe(Effect__namespace.sync(() => size ? stream.read(Number(size)) : stream.read()), Effect__namespace.flatMap(_ => _ ? Effect__namespace.succeed(_) : Effect__namespace.fail(Option__namespace.none())));
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
const toString = options => {
|
|
62
|
+
const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;
|
|
63
|
+
return Effect__namespace.acquireUseRelease(Effect__namespace.sync(() => {
|
|
64
|
+
const stream = options.readable();
|
|
65
|
+
stream.setEncoding(options.encoding ?? "utf8");
|
|
66
|
+
return stream;
|
|
67
|
+
}), stream => Effect__namespace.async(resume => {
|
|
68
|
+
let string = "";
|
|
69
|
+
let bytes = 0;
|
|
70
|
+
stream.once("error", err => {
|
|
71
|
+
resume(Effect__namespace.fail(options.onFailure(err)));
|
|
72
|
+
});
|
|
73
|
+
stream.once("end", () => {
|
|
74
|
+
resume(Effect__namespace.succeed(string));
|
|
75
|
+
});
|
|
76
|
+
stream.on("data", chunk => {
|
|
77
|
+
string += chunk;
|
|
78
|
+
bytes += Buffer.byteLength(chunk);
|
|
79
|
+
if (maxBytesNumber && bytes > maxBytesNumber) {
|
|
80
|
+
resume(Effect__namespace.fail(options.onFailure(new Error("maxBytes exceeded"))));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}), stream => Effect__namespace.sync(() => {
|
|
84
|
+
stream.removeAllListeners();
|
|
85
|
+
if (!stream.closed) {
|
|
86
|
+
stream.destroy();
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
const toUint8Array = options => {
|
|
93
|
+
const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;
|
|
94
|
+
return Effect__namespace.acquireUseRelease(Effect__namespace.sync(options.readable), stream => Effect__namespace.async(resume => {
|
|
95
|
+
let buffer = Buffer.alloc(0);
|
|
96
|
+
let bytes = 0;
|
|
97
|
+
stream.once("error", err => {
|
|
98
|
+
resume(Effect__namespace.fail(options.onFailure(err)));
|
|
99
|
+
});
|
|
100
|
+
stream.once("end", () => {
|
|
101
|
+
resume(Effect__namespace.succeed(buffer));
|
|
102
|
+
});
|
|
103
|
+
stream.on("data", chunk => {
|
|
104
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
105
|
+
bytes += chunk.length;
|
|
106
|
+
if (maxBytesNumber && bytes > maxBytesNumber) {
|
|
107
|
+
resume(Effect__namespace.fail(options.onFailure(new Error("maxBytes exceeded"))));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}), stream => Effect__namespace.sync(() => {
|
|
111
|
+
stream.removeAllListeners();
|
|
112
|
+
if (!stream.closed) {
|
|
113
|
+
stream.destroy();
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.fromReadable = fromReadable;
|
|
119
|
+
exports.toString = toString;
|
|
120
|
+
exports.toUint8Array = toUint8Array;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
import * as Command from '@effect/platform/Command';
|
|
2
|
+
import * as CommandExecutor from '@effect/platform/CommandExecutor';
|
|
3
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import { pipe, constUndefined } from 'effect/Function';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import * as Sink from 'effect/Sink';
|
|
9
|
+
import * as Stream from 'effect/Stream';
|
|
10
|
+
import * as ChildProcess from 'node:child_process';
|
|
11
|
+
import { handleErrnoException } from './error.esm.js';
|
|
12
|
+
import { fromWritable } from './sink.esm.js';
|
|
13
|
+
import { fromReadable } from './stream.esm.js';
|
|
14
|
+
|
|
14
15
|
const inputToStdioOption = stdin => Option.match(stdin, {
|
|
15
16
|
onNone: () => "inherit",
|
|
16
17
|
onSome: () => "pipe"
|
|
@@ -46,11 +47,13 @@ const runCommand = fileSystem => command => {
|
|
|
46
47
|
handle.on("exit", () => {
|
|
47
48
|
exited = true;
|
|
48
49
|
});
|
|
50
|
+
|
|
49
51
|
// If starting the process throws an error, make sure to capture it
|
|
50
52
|
handle.on("error", err => {
|
|
51
53
|
handle.kill("SIGKILL");
|
|
52
54
|
resume(Effect.fail(toPlatformError("spawn", err, command)));
|
|
53
55
|
});
|
|
56
|
+
|
|
54
57
|
// If the process is assigned a process identifier, then we know it
|
|
55
58
|
// was spawned successfully
|
|
56
59
|
if (handle.pid) {
|
|
@@ -138,6 +141,8 @@ const runCommand = fileSystem => command => {
|
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
};
|
|
144
|
+
|
|
141
145
|
/** @internal */
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
const layer = /*#__PURE__*/Layer.effect(CommandExecutor.CommandExecutor, /*#__PURE__*/pipe(FileSystem.FileSystem, /*#__PURE__*/Effect.map(fileSystem => CommandExecutor.makeExecutor(runCommand(fileSystem)))));
|
|
147
|
+
|
|
148
|
+
export { layer };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { SystemError } from
|
|
1
|
+
import { SystemError } from '@effect/platform/Error';
|
|
2
|
+
|
|
2
3
|
/** @internal */
|
|
3
|
-
|
|
4
|
+
const handleErrnoException = (module, method) => (err, [path]) => {
|
|
4
5
|
let reason = "Unknown";
|
|
5
6
|
switch (err.code) {
|
|
6
7
|
case "ENOENT":
|
|
@@ -34,4 +35,5 @@ export const handleErrnoException = (module, method) => (err, [path]) => {
|
|
|
34
35
|
message: err.message
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
export { handleErrnoException };
|