@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,195 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Command = require('@effect/platform/Command');
|
|
4
|
+
var CommandExecutor$1 = require('@effect/platform/CommandExecutor');
|
|
5
|
+
var FileSystem = require('@effect/platform/FileSystem');
|
|
6
|
+
var Effect = require('effect/Effect');
|
|
7
|
+
var Function = require('effect/Function');
|
|
8
|
+
var Layer = require('effect/Layer');
|
|
9
|
+
var Option = require('effect/Option');
|
|
10
|
+
var Sink = require('effect/Sink');
|
|
11
|
+
var Stream = require('effect/Stream');
|
|
12
|
+
var ChildProcess = require('node:child_process');
|
|
13
|
+
var error = require('./error-e477c10b.cjs.dev.js');
|
|
14
|
+
var sink = require('./sink-daf9e0e5.cjs.dev.js');
|
|
15
|
+
var stream = require('./stream-1456ece0.cjs.dev.js');
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var Command__namespace = /*#__PURE__*/_interopNamespace(Command);
|
|
36
|
+
var CommandExecutor__namespace = /*#__PURE__*/_interopNamespace(CommandExecutor$1);
|
|
37
|
+
var FileSystem__namespace = /*#__PURE__*/_interopNamespace(FileSystem);
|
|
38
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
39
|
+
var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
|
|
40
|
+
var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
|
|
41
|
+
var Sink__namespace = /*#__PURE__*/_interopNamespace(Sink);
|
|
42
|
+
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
|
|
43
|
+
var ChildProcess__namespace = /*#__PURE__*/_interopNamespace(ChildProcess);
|
|
44
|
+
|
|
45
|
+
const inputToStdioOption = stdin => Option__namespace.match(stdin, {
|
|
46
|
+
onNone: () => "inherit",
|
|
47
|
+
onSome: () => "pipe"
|
|
48
|
+
});
|
|
49
|
+
const outputToStdioOption = output => typeof output === "string" ? output : "pipe";
|
|
50
|
+
const toError = err => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));
|
|
51
|
+
const toPlatformError = (method, error$1, command) => {
|
|
52
|
+
const flattened = Command__namespace.flatten(command).reduce((acc, curr) => {
|
|
53
|
+
const command = `${curr.command} ${curr.args.join(" ")}`;
|
|
54
|
+
return acc.length === 0 ? command : `${acc} | ${command}`;
|
|
55
|
+
}, "");
|
|
56
|
+
return error.handleErrnoException("Command", method)(error$1, [flattened]);
|
|
57
|
+
};
|
|
58
|
+
const runCommand = fileSystem => command => {
|
|
59
|
+
switch (command._tag) {
|
|
60
|
+
case "StandardCommand":
|
|
61
|
+
{
|
|
62
|
+
return Function.pipe(
|
|
63
|
+
// Validate that the directory is accessible
|
|
64
|
+
Option__namespace.match(command.cwd, {
|
|
65
|
+
onNone: () => Effect__namespace.unit,
|
|
66
|
+
onSome: dir => fileSystem.access(dir)
|
|
67
|
+
}), Effect__namespace.zipRight(Effect__namespace.sync(() => globalThis.process.env)), Effect__namespace.flatMap(env => Effect__namespace.async(resume => {
|
|
68
|
+
const handle = ChildProcess__namespace.spawn(command.command, command.args, {
|
|
69
|
+
stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],
|
|
70
|
+
cwd: Option__namespace.getOrElse(command.cwd, Function.constUndefined),
|
|
71
|
+
env: {
|
|
72
|
+
...env,
|
|
73
|
+
...Object.fromEntries(command.env)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
let exited = false;
|
|
77
|
+
handle.on("exit", () => {
|
|
78
|
+
exited = true;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// If starting the process throws an error, make sure to capture it
|
|
82
|
+
handle.on("error", err => {
|
|
83
|
+
handle.kill("SIGKILL");
|
|
84
|
+
resume(Effect__namespace.fail(toPlatformError("spawn", err, command)));
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// If the process is assigned a process identifier, then we know it
|
|
88
|
+
// was spawned successfully
|
|
89
|
+
if (handle.pid) {
|
|
90
|
+
let stdin = Sink__namespace.drain;
|
|
91
|
+
if (handle.stdin !== null) {
|
|
92
|
+
stdin = sink.fromWritable(() => handle.stdin, err => toPlatformError("toWritable", toError(err), command));
|
|
93
|
+
}
|
|
94
|
+
const exitCode = Effect__namespace.async(resume => {
|
|
95
|
+
if (exited) {
|
|
96
|
+
return resume(handle.exitCode !== null ? Effect__namespace.succeed(CommandExecutor__namespace.ExitCode(handle.exitCode)) : Effect__namespace.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${handle.signalCode}`), command)));
|
|
97
|
+
}
|
|
98
|
+
handle.on("exit", (code, signal) => {
|
|
99
|
+
if (code !== null) {
|
|
100
|
+
resume(Effect__namespace.succeed(CommandExecutor__namespace.ExitCode(code)));
|
|
101
|
+
} else {
|
|
102
|
+
// If code is `null`, then `signal` must be defined. See the NodeJS
|
|
103
|
+
// documentation for the `"exit"` event on a `child_process`.
|
|
104
|
+
// https://nodejs.org/api/child_process.html#child_process_event_exit
|
|
105
|
+
resume(Effect__namespace.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command)));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// Make sure to terminate the running process if the fiber is
|
|
109
|
+
// terminated
|
|
110
|
+
return Effect__namespace.sync(() => {
|
|
111
|
+
handle.kill("SIGKILL");
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
const isRunning = Effect__namespace.sync(() => handle.exitCode === null && handle.signalCode === null && !handle.killed);
|
|
115
|
+
const kill = (signal = "SIGTERM") => Effect__namespace.async(resume => {
|
|
116
|
+
handle.kill(signal);
|
|
117
|
+
handle.on("exit", () => {
|
|
118
|
+
resume(Effect__namespace.unit);
|
|
119
|
+
});
|
|
120
|
+
// Make sure to terminate the running process if the fiber
|
|
121
|
+
// is terminated
|
|
122
|
+
return Effect__namespace.sync(() => {
|
|
123
|
+
handle.kill("SIGKILL");
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
resume(Effect__namespace.sync(() => {
|
|
127
|
+
const pid = CommandExecutor__namespace.ProcessId(handle.pid);
|
|
128
|
+
const stderr = stream.fromReadable(() => handle.stderr, err => toPlatformError("fromReadable(stderr)", toError(err), command));
|
|
129
|
+
let stdout = stream.fromReadable(() => handle.stdout, err => toPlatformError("fromReadable(stdout)", toError(err), command));
|
|
130
|
+
// TODO: add Sink.isSink
|
|
131
|
+
if (typeof command.stdout !== "string") {
|
|
132
|
+
stdout = Stream__namespace.transduce(stdout, command.stdout);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
[CommandExecutor__namespace.ProcessTypeId]: CommandExecutor__namespace.ProcessTypeId,
|
|
136
|
+
pid,
|
|
137
|
+
exitCode,
|
|
138
|
+
isRunning,
|
|
139
|
+
kill,
|
|
140
|
+
stdin,
|
|
141
|
+
stderr,
|
|
142
|
+
stdout
|
|
143
|
+
};
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
return Effect__namespace.async(resume => {
|
|
147
|
+
if (handle.pid) {
|
|
148
|
+
handle.kill("SIGTERM");
|
|
149
|
+
}
|
|
150
|
+
handle.on("exit", () => {
|
|
151
|
+
resume(Effect__namespace.unit);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
})), Effect__namespace.tap(process => Option__namespace.match(command.stdin, {
|
|
155
|
+
onNone: () => Effect__namespace.unit,
|
|
156
|
+
onSome: stdin => Effect__namespace.forkDaemon(Stream__namespace.run(stdin, process.stdin))
|
|
157
|
+
})));
|
|
158
|
+
}
|
|
159
|
+
case "PipedCommand":
|
|
160
|
+
{
|
|
161
|
+
const flattened = Command__namespace.flatten(command);
|
|
162
|
+
if (flattened.length === 1) {
|
|
163
|
+
return Function.pipe(flattened[0], runCommand(fileSystem));
|
|
164
|
+
}
|
|
165
|
+
const head = flattened[0];
|
|
166
|
+
const tail = flattened.slice(1);
|
|
167
|
+
const initial = tail.slice(0, tail.length - 1);
|
|
168
|
+
const last = tail[tail.length - 1];
|
|
169
|
+
const stream = initial.reduce((stdin, command) => Function.pipe(Command__namespace.stdin(command, stdin), runCommand(fileSystem), Stream__namespace.flatMap(process => process.stdout)), Function.pipe(runCommand(fileSystem)(head), Stream__namespace.flatMap(process => process.stdout)));
|
|
170
|
+
return Function.pipe(Command__namespace.stdin(last, stream), runCommand(fileSystem));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
const layer$1 = /*#__PURE__*/Layer__namespace.effect(CommandExecutor__namespace.CommandExecutor, /*#__PURE__*/Function.pipe(FileSystem__namespace.FileSystem, /*#__PURE__*/Effect__namespace.map(fileSystem => CommandExecutor__namespace.makeExecutor(runCommand(fileSystem)))));
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @since 1.0.0
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @since 1.0.0
|
|
184
|
+
* @category layer
|
|
185
|
+
*/
|
|
186
|
+
const layer = layer$1;
|
|
187
|
+
|
|
188
|
+
var CommandExecutor = /*#__PURE__*/Object.freeze({
|
|
189
|
+
__proto__: null,
|
|
190
|
+
layer: layer,
|
|
191
|
+
CommandExecutor: CommandExecutor$1.CommandExecutor
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
exports.CommandExecutor = CommandExecutor;
|
|
195
|
+
exports.layer = layer;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Command = require('@effect/platform/Command');
|
|
4
|
+
var CommandExecutor$1 = require('@effect/platform/CommandExecutor');
|
|
5
|
+
var FileSystem = require('@effect/platform/FileSystem');
|
|
6
|
+
var Effect = require('effect/Effect');
|
|
7
|
+
var Function = require('effect/Function');
|
|
8
|
+
var Layer = require('effect/Layer');
|
|
9
|
+
var Option = require('effect/Option');
|
|
10
|
+
var Sink = require('effect/Sink');
|
|
11
|
+
var Stream = require('effect/Stream');
|
|
12
|
+
var ChildProcess = require('node:child_process');
|
|
13
|
+
var error = require('./error-4f074a3a.cjs.prod.js');
|
|
14
|
+
var sink = require('./sink-da49e187.cjs.prod.js');
|
|
15
|
+
var stream = require('./stream-ef8b6a66.cjs.prod.js');
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var Command__namespace = /*#__PURE__*/_interopNamespace(Command);
|
|
36
|
+
var CommandExecutor__namespace = /*#__PURE__*/_interopNamespace(CommandExecutor$1);
|
|
37
|
+
var FileSystem__namespace = /*#__PURE__*/_interopNamespace(FileSystem);
|
|
38
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
39
|
+
var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
|
|
40
|
+
var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
|
|
41
|
+
var Sink__namespace = /*#__PURE__*/_interopNamespace(Sink);
|
|
42
|
+
var Stream__namespace = /*#__PURE__*/_interopNamespace(Stream);
|
|
43
|
+
var ChildProcess__namespace = /*#__PURE__*/_interopNamespace(ChildProcess);
|
|
44
|
+
|
|
45
|
+
const inputToStdioOption = stdin => Option__namespace.match(stdin, {
|
|
46
|
+
onNone: () => "inherit",
|
|
47
|
+
onSome: () => "pipe"
|
|
48
|
+
});
|
|
49
|
+
const outputToStdioOption = output => typeof output === "string" ? output : "pipe";
|
|
50
|
+
const toError = err => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));
|
|
51
|
+
const toPlatformError = (method, error$1, command) => {
|
|
52
|
+
const flattened = Command__namespace.flatten(command).reduce((acc, curr) => {
|
|
53
|
+
const command = `${curr.command} ${curr.args.join(" ")}`;
|
|
54
|
+
return acc.length === 0 ? command : `${acc} | ${command}`;
|
|
55
|
+
}, "");
|
|
56
|
+
return error.handleErrnoException("Command", method)(error$1, [flattened]);
|
|
57
|
+
};
|
|
58
|
+
const runCommand = fileSystem => command => {
|
|
59
|
+
switch (command._tag) {
|
|
60
|
+
case "StandardCommand":
|
|
61
|
+
{
|
|
62
|
+
return Function.pipe(
|
|
63
|
+
// Validate that the directory is accessible
|
|
64
|
+
Option__namespace.match(command.cwd, {
|
|
65
|
+
onNone: () => Effect__namespace.unit,
|
|
66
|
+
onSome: dir => fileSystem.access(dir)
|
|
67
|
+
}), Effect__namespace.zipRight(Effect__namespace.sync(() => globalThis.process.env)), Effect__namespace.flatMap(env => Effect__namespace.async(resume => {
|
|
68
|
+
const handle = ChildProcess__namespace.spawn(command.command, command.args, {
|
|
69
|
+
stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],
|
|
70
|
+
cwd: Option__namespace.getOrElse(command.cwd, Function.constUndefined),
|
|
71
|
+
env: {
|
|
72
|
+
...env,
|
|
73
|
+
...Object.fromEntries(command.env)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
let exited = false;
|
|
77
|
+
handle.on("exit", () => {
|
|
78
|
+
exited = true;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// If starting the process throws an error, make sure to capture it
|
|
82
|
+
handle.on("error", err => {
|
|
83
|
+
handle.kill("SIGKILL");
|
|
84
|
+
resume(Effect__namespace.fail(toPlatformError("spawn", err, command)));
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// If the process is assigned a process identifier, then we know it
|
|
88
|
+
// was spawned successfully
|
|
89
|
+
if (handle.pid) {
|
|
90
|
+
let stdin = Sink__namespace.drain;
|
|
91
|
+
if (handle.stdin !== null) {
|
|
92
|
+
stdin = sink.fromWritable(() => handle.stdin, err => toPlatformError("toWritable", toError(err), command));
|
|
93
|
+
}
|
|
94
|
+
const exitCode = Effect__namespace.async(resume => {
|
|
95
|
+
if (exited) {
|
|
96
|
+
return resume(handle.exitCode !== null ? Effect__namespace.succeed(CommandExecutor__namespace.ExitCode(handle.exitCode)) : Effect__namespace.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${handle.signalCode}`), command)));
|
|
97
|
+
}
|
|
98
|
+
handle.on("exit", (code, signal) => {
|
|
99
|
+
if (code !== null) {
|
|
100
|
+
resume(Effect__namespace.succeed(CommandExecutor__namespace.ExitCode(code)));
|
|
101
|
+
} else {
|
|
102
|
+
// If code is `null`, then `signal` must be defined. See the NodeJS
|
|
103
|
+
// documentation for the `"exit"` event on a `child_process`.
|
|
104
|
+
// https://nodejs.org/api/child_process.html#child_process_event_exit
|
|
105
|
+
resume(Effect__namespace.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command)));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// Make sure to terminate the running process if the fiber is
|
|
109
|
+
// terminated
|
|
110
|
+
return Effect__namespace.sync(() => {
|
|
111
|
+
handle.kill("SIGKILL");
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
const isRunning = Effect__namespace.sync(() => handle.exitCode === null && handle.signalCode === null && !handle.killed);
|
|
115
|
+
const kill = (signal = "SIGTERM") => Effect__namespace.async(resume => {
|
|
116
|
+
handle.kill(signal);
|
|
117
|
+
handle.on("exit", () => {
|
|
118
|
+
resume(Effect__namespace.unit);
|
|
119
|
+
});
|
|
120
|
+
// Make sure to terminate the running process if the fiber
|
|
121
|
+
// is terminated
|
|
122
|
+
return Effect__namespace.sync(() => {
|
|
123
|
+
handle.kill("SIGKILL");
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
resume(Effect__namespace.sync(() => {
|
|
127
|
+
const pid = CommandExecutor__namespace.ProcessId(handle.pid);
|
|
128
|
+
const stderr = stream.fromReadable(() => handle.stderr, err => toPlatformError("fromReadable(stderr)", toError(err), command));
|
|
129
|
+
let stdout = stream.fromReadable(() => handle.stdout, err => toPlatformError("fromReadable(stdout)", toError(err), command));
|
|
130
|
+
// TODO: add Sink.isSink
|
|
131
|
+
if (typeof command.stdout !== "string") {
|
|
132
|
+
stdout = Stream__namespace.transduce(stdout, command.stdout);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
[CommandExecutor__namespace.ProcessTypeId]: CommandExecutor__namespace.ProcessTypeId,
|
|
136
|
+
pid,
|
|
137
|
+
exitCode,
|
|
138
|
+
isRunning,
|
|
139
|
+
kill,
|
|
140
|
+
stdin,
|
|
141
|
+
stderr,
|
|
142
|
+
stdout
|
|
143
|
+
};
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
return Effect__namespace.async(resume => {
|
|
147
|
+
if (handle.pid) {
|
|
148
|
+
handle.kill("SIGTERM");
|
|
149
|
+
}
|
|
150
|
+
handle.on("exit", () => {
|
|
151
|
+
resume(Effect__namespace.unit);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
})), Effect__namespace.tap(process => Option__namespace.match(command.stdin, {
|
|
155
|
+
onNone: () => Effect__namespace.unit,
|
|
156
|
+
onSome: stdin => Effect__namespace.forkDaemon(Stream__namespace.run(stdin, process.stdin))
|
|
157
|
+
})));
|
|
158
|
+
}
|
|
159
|
+
case "PipedCommand":
|
|
160
|
+
{
|
|
161
|
+
const flattened = Command__namespace.flatten(command);
|
|
162
|
+
if (flattened.length === 1) {
|
|
163
|
+
return Function.pipe(flattened[0], runCommand(fileSystem));
|
|
164
|
+
}
|
|
165
|
+
const head = flattened[0];
|
|
166
|
+
const tail = flattened.slice(1);
|
|
167
|
+
const initial = tail.slice(0, tail.length - 1);
|
|
168
|
+
const last = tail[tail.length - 1];
|
|
169
|
+
const stream = initial.reduce((stdin, command) => Function.pipe(Command__namespace.stdin(command, stdin), runCommand(fileSystem), Stream__namespace.flatMap(process => process.stdout)), Function.pipe(runCommand(fileSystem)(head), Stream__namespace.flatMap(process => process.stdout)));
|
|
170
|
+
return Function.pipe(Command__namespace.stdin(last, stream), runCommand(fileSystem));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
const layer$1 = /*#__PURE__*/Layer__namespace.effect(CommandExecutor__namespace.CommandExecutor, /*#__PURE__*/Function.pipe(FileSystem__namespace.FileSystem, /*#__PURE__*/Effect__namespace.map(fileSystem => CommandExecutor__namespace.makeExecutor(runCommand(fileSystem)))));
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @since 1.0.0
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @since 1.0.0
|
|
184
|
+
* @category layer
|
|
185
|
+
*/
|
|
186
|
+
const layer = layer$1;
|
|
187
|
+
|
|
188
|
+
var CommandExecutor = /*#__PURE__*/Object.freeze({
|
|
189
|
+
__proto__: null,
|
|
190
|
+
layer: layer,
|
|
191
|
+
CommandExecutor: CommandExecutor$1.CommandExecutor
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
exports.CommandExecutor = CommandExecutor;
|
|
195
|
+
exports.layer = layer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effectify$1 = require('@effect/platform/Effectify');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var Effectify = /*#__PURE__*/Object.freeze({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
effectify: Effectify$1.effectify
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.Effectify = Effectify;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Effectify$1 = require('@effect/platform/Effectify');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var Effectify = /*#__PURE__*/Object.freeze({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
effectify: Effectify$1.effectify
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.Effectify = Effectify;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Error$1 = require('@effect/platform/Error');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var Error = /*#__PURE__*/Object.freeze({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
BadArgument: Error$1.BadArgument,
|
|
12
|
+
PlatformError: Error$1.PlatformError,
|
|
13
|
+
PlatformErrorTypeId: Error$1.PlatformErrorTypeId,
|
|
14
|
+
SystemError: Error$1.SystemError,
|
|
15
|
+
SystemErrorReason: Error$1.SystemErrorReason
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
exports.Error = Error;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Error$1 = require('@effect/platform/Error');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var Error = /*#__PURE__*/Object.freeze({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
BadArgument: Error$1.BadArgument,
|
|
12
|
+
PlatformError: Error$1.PlatformError,
|
|
13
|
+
PlatformErrorTypeId: Error$1.PlatformErrorTypeId,
|
|
14
|
+
SystemError: Error$1.SystemError,
|
|
15
|
+
SystemErrorReason: Error$1.SystemErrorReason
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
exports.Error = Error;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Etag$1 = require('@effect/platform/Http/Etag');
|
|
4
|
+
var Effect = require('effect/Effect');
|
|
5
|
+
var Layer = require('effect/Layer');
|
|
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
|
+
function _mergeNamespaces(n, m) {
|
|
26
|
+
m.forEach(function (e) {
|
|
27
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
28
|
+
if (k !== 'default' && !(k in n)) {
|
|
29
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
30
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return e[k]; }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return Object.freeze(n);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var Etag__namespace = /*#__PURE__*/_interopNamespace(Etag$1);
|
|
41
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
42
|
+
var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
|
|
43
|
+
|
|
44
|
+
const fromFileInfo = info => {
|
|
45
|
+
const mtime = info.mtime._tag === "Some" ? info.mtime.value.getTime().toString(16) : "0";
|
|
46
|
+
return `${info.size.toString(16)}-${mtime}`;
|
|
47
|
+
};
|
|
48
|
+
const fromFileWeb = file => {
|
|
49
|
+
return `${file.size.toString(16)}-${file.lastModified.toString(16)}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
const layer$1 = /*#__PURE__*/Layer__namespace.succeed(Etag__namespace.Generator, /*#__PURE__*/Etag__namespace.Generator.of({
|
|
54
|
+
[Etag__namespace.GeneratorTypeId]: Etag__namespace.GeneratorTypeId,
|
|
55
|
+
fromFileInfo(info) {
|
|
56
|
+
return Effect__namespace.sync(() => ({
|
|
57
|
+
_tag: "Strong",
|
|
58
|
+
value: fromFileInfo(info)
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
fromFileWeb(file) {
|
|
62
|
+
return Effect__namespace.sync(() => ({
|
|
63
|
+
_tag: "Strong",
|
|
64
|
+
value: fromFileWeb(file)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
const layerWeak$1 = /*#__PURE__*/Layer__namespace.succeed(Etag__namespace.Generator, /*#__PURE__*/Etag__namespace.Generator.of({
|
|
71
|
+
[Etag__namespace.GeneratorTypeId]: Etag__namespace.GeneratorTypeId,
|
|
72
|
+
fromFileInfo(info) {
|
|
73
|
+
return Effect__namespace.sync(() => ({
|
|
74
|
+
_tag: "Weak",
|
|
75
|
+
value: fromFileInfo(info)
|
|
76
|
+
}));
|
|
77
|
+
},
|
|
78
|
+
fromFileWeb(file) {
|
|
79
|
+
return Effect__namespace.sync(() => ({
|
|
80
|
+
_tag: "Weak",
|
|
81
|
+
value: fromFileWeb(file)
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @since 1.0.0
|
|
88
|
+
*
|
|
89
|
+
* Also includes exports from [`@effect/platform/Http/Etag`](https://effect-ts.github.io/platform/platform/Http/Etag.ts.html).
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @since 1.0.0
|
|
94
|
+
* @category layers
|
|
95
|
+
*/
|
|
96
|
+
const layer = layer$1;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
* @category layers
|
|
101
|
+
*/
|
|
102
|
+
const layerWeak = layerWeak$1;
|
|
103
|
+
|
|
104
|
+
var Etag = /*#__PURE__*/_mergeNamespaces({
|
|
105
|
+
__proto__: null,
|
|
106
|
+
layer: layer,
|
|
107
|
+
layerWeak: layerWeak
|
|
108
|
+
}, [Etag__namespace]);
|
|
109
|
+
|
|
110
|
+
exports.Etag = Etag;
|
|
111
|
+
exports.layer = layer;
|
|
112
|
+
exports.layerWeak = layerWeak;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Etag$1 = require('@effect/platform/Http/Etag');
|
|
4
|
+
var Effect = require('effect/Effect');
|
|
5
|
+
var Layer = require('effect/Layer');
|
|
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
|
+
function _mergeNamespaces(n, m) {
|
|
26
|
+
m.forEach(function (e) {
|
|
27
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
28
|
+
if (k !== 'default' && !(k in n)) {
|
|
29
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
30
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return e[k]; }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return Object.freeze(n);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
var Etag__namespace = /*#__PURE__*/_interopNamespace(Etag$1);
|
|
41
|
+
var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
|
|
42
|
+
var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
|
|
43
|
+
|
|
44
|
+
const fromFileInfo = info => {
|
|
45
|
+
const mtime = info.mtime._tag === "Some" ? info.mtime.value.getTime().toString(16) : "0";
|
|
46
|
+
return `${info.size.toString(16)}-${mtime}`;
|
|
47
|
+
};
|
|
48
|
+
const fromFileWeb = file => {
|
|
49
|
+
return `${file.size.toString(16)}-${file.lastModified.toString(16)}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
const layer$1 = /*#__PURE__*/Layer__namespace.succeed(Etag__namespace.Generator, /*#__PURE__*/Etag__namespace.Generator.of({
|
|
54
|
+
[Etag__namespace.GeneratorTypeId]: Etag__namespace.GeneratorTypeId,
|
|
55
|
+
fromFileInfo(info) {
|
|
56
|
+
return Effect__namespace.sync(() => ({
|
|
57
|
+
_tag: "Strong",
|
|
58
|
+
value: fromFileInfo(info)
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
fromFileWeb(file) {
|
|
62
|
+
return Effect__namespace.sync(() => ({
|
|
63
|
+
_tag: "Strong",
|
|
64
|
+
value: fromFileWeb(file)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
const layerWeak$1 = /*#__PURE__*/Layer__namespace.succeed(Etag__namespace.Generator, /*#__PURE__*/Etag__namespace.Generator.of({
|
|
71
|
+
[Etag__namespace.GeneratorTypeId]: Etag__namespace.GeneratorTypeId,
|
|
72
|
+
fromFileInfo(info) {
|
|
73
|
+
return Effect__namespace.sync(() => ({
|
|
74
|
+
_tag: "Weak",
|
|
75
|
+
value: fromFileInfo(info)
|
|
76
|
+
}));
|
|
77
|
+
},
|
|
78
|
+
fromFileWeb(file) {
|
|
79
|
+
return Effect__namespace.sync(() => ({
|
|
80
|
+
_tag: "Weak",
|
|
81
|
+
value: fromFileWeb(file)
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @since 1.0.0
|
|
88
|
+
*
|
|
89
|
+
* Also includes exports from [`@effect/platform/Http/Etag`](https://effect-ts.github.io/platform/platform/Http/Etag.ts.html).
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @since 1.0.0
|
|
94
|
+
* @category layers
|
|
95
|
+
*/
|
|
96
|
+
const layer = layer$1;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
* @category layers
|
|
101
|
+
*/
|
|
102
|
+
const layerWeak = layerWeak$1;
|
|
103
|
+
|
|
104
|
+
var Etag = /*#__PURE__*/_mergeNamespaces({
|
|
105
|
+
__proto__: null,
|
|
106
|
+
layer: layer,
|
|
107
|
+
layerWeak: layerWeak
|
|
108
|
+
}, [Etag__namespace]);
|
|
109
|
+
|
|
110
|
+
exports.Etag = Etag;
|
|
111
|
+
exports.layer = layer;
|
|
112
|
+
exports.layerWeak = layerWeak;
|