@effect/platform-node 0.19.2 → 0.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/package.json +4 -0
- package/Http/Http/Etag/dist/effect-platform-node-Http-Etag.esm.js +23 -0
- package/Http/Http/FormData/dist/effect-platform-node-Http-FormData.esm.js +23 -0
- package/Http/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.esm.js +65 -0
- package/{mjs/Http/Platform.mjs → Http/Http/Platform/dist/effect-platform-node-Http-Platform.esm.js} +9 -8
- package/Http/Http/Server/dist/effect-platform-node-Http-Server.esm.js +29 -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/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/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/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
package/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Stream = exports.Sink = exports.Runtime = exports.Path = exports.NodeContext = exports.KeyValueStore = exports.HttpServer = exports.HttpClient = exports.FileSystem = exports.Error = exports.Effectify = exports.CommandExecutor = exports.Command = void 0;
|
|
7
|
-
var Command_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Command"));
|
|
8
|
-
exports.Command = Command_1;
|
|
9
|
-
var CommandExecutor_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/CommandExecutor"));
|
|
10
|
-
exports.CommandExecutor = CommandExecutor_1;
|
|
11
|
-
var Effectify_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Effectify"));
|
|
12
|
-
exports.Effectify = Effectify_1;
|
|
13
|
-
var Error_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Error"));
|
|
14
|
-
exports.Error = Error_1;
|
|
15
|
-
var FileSystem_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/FileSystem"));
|
|
16
|
-
exports.FileSystem = FileSystem_1;
|
|
17
|
-
var HttpClient_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/HttpClient"));
|
|
18
|
-
exports.HttpClient = HttpClient_1;
|
|
19
|
-
var HttpServer_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/HttpServer"));
|
|
20
|
-
exports.HttpServer = HttpServer_1;
|
|
21
|
-
var KeyValueStore_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/KeyValueStore"));
|
|
22
|
-
exports.KeyValueStore = KeyValueStore_1;
|
|
23
|
-
var NodeContext_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/NodeContext"));
|
|
24
|
-
exports.NodeContext = NodeContext_1;
|
|
25
|
-
var Path_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Path"));
|
|
26
|
-
exports.Path = Path_1;
|
|
27
|
-
var Runtime_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Runtime"));
|
|
28
|
-
exports.Runtime = Runtime_1;
|
|
29
|
-
var Sink_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Sink"));
|
|
30
|
-
exports.Sink = Sink_1;
|
|
31
|
-
var Stream_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform-node/Stream"));
|
|
32
|
-
exports.Stream = Stream_1;
|
|
33
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
34
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["exports","Command","Command_1","CommandExecutor","CommandExecutor_1","Effectify","Effectify_1","Error","Error_1","FileSystem","FileSystem_1","HttpClient","HttpClient_1","HttpServer","HttpServer_1","KeyValueStore","KeyValueStore_1","NodeContext","NodeContext_1","Path","Path_1","Runtime","Runtime_1","Sink","Sink_1","Stream","Stream_1","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_interopRequireWildcard","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key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AW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commandExecutor.d.ts","sourceRoot":"","sources":["../src/internal/commandExecutor.ts"],"names":[],"mappings":""}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.layer = void 0;
|
|
7
|
-
var _error = /*#__PURE__*/require("@effect/platform-node/internal/error");
|
|
8
|
-
var _sink = /*#__PURE__*/require("@effect/platform-node/internal/sink");
|
|
9
|
-
var _stream = /*#__PURE__*/require("@effect/platform-node/internal/stream");
|
|
10
|
-
var Command = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Command"));
|
|
11
|
-
var CommandExecutor = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/CommandExecutor"));
|
|
12
|
-
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem"));
|
|
13
|
-
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect"));
|
|
14
|
-
var _Function = /*#__PURE__*/require("effect/Function");
|
|
15
|
-
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
|
|
16
|
-
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option"));
|
|
17
|
-
var Sink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Sink"));
|
|
18
|
-
var Stream = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Stream"));
|
|
19
|
-
var ChildProcess = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:child_process"));
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
const inputToStdioOption = stdin => Option.match(stdin, {
|
|
23
|
-
onNone: () => "inherit",
|
|
24
|
-
onSome: () => "pipe"
|
|
25
|
-
});
|
|
26
|
-
const outputToStdioOption = output => typeof output === "string" ? output : "pipe";
|
|
27
|
-
const toError = err => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));
|
|
28
|
-
const toPlatformError = (method, error, command) => {
|
|
29
|
-
const flattened = Command.flatten(command).reduce((acc, curr) => {
|
|
30
|
-
const command = `${curr.command} ${curr.args.join(" ")}`;
|
|
31
|
-
return acc.length === 0 ? command : `${acc} | ${command}`;
|
|
32
|
-
}, "");
|
|
33
|
-
return (0, _error.handleErrnoException)("Command", method)(error, [flattened]);
|
|
34
|
-
};
|
|
35
|
-
const runCommand = fileSystem => command => {
|
|
36
|
-
switch (command._tag) {
|
|
37
|
-
case "StandardCommand":
|
|
38
|
-
{
|
|
39
|
-
return (0, _Function.pipe)(
|
|
40
|
-
// Validate that the directory is accessible
|
|
41
|
-
Option.match(command.cwd, {
|
|
42
|
-
onNone: () => Effect.unit,
|
|
43
|
-
onSome: dir => fileSystem.access(dir)
|
|
44
|
-
}), Effect.zipRight(Effect.sync(() => globalThis.process.env)), Effect.flatMap(env => Effect.async(resume => {
|
|
45
|
-
const handle = ChildProcess.spawn(command.command, command.args, {
|
|
46
|
-
stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],
|
|
47
|
-
cwd: Option.getOrElse(command.cwd, _Function.constUndefined),
|
|
48
|
-
env: {
|
|
49
|
-
...env,
|
|
50
|
-
...Object.fromEntries(command.env)
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
let exited = false;
|
|
54
|
-
handle.on("exit", () => {
|
|
55
|
-
exited = true;
|
|
56
|
-
});
|
|
57
|
-
// If starting the process throws an error, make sure to capture it
|
|
58
|
-
handle.on("error", err => {
|
|
59
|
-
handle.kill("SIGKILL");
|
|
60
|
-
resume(Effect.fail(toPlatformError("spawn", err, command)));
|
|
61
|
-
});
|
|
62
|
-
// If the process is assigned a process identifier, then we know it
|
|
63
|
-
// was spawned successfully
|
|
64
|
-
if (handle.pid) {
|
|
65
|
-
let stdin = Sink.drain;
|
|
66
|
-
if (handle.stdin !== null) {
|
|
67
|
-
stdin = (0, _sink.fromWritable)(() => handle.stdin, err => toPlatformError("toWritable", toError(err), command));
|
|
68
|
-
}
|
|
69
|
-
const exitCode = Effect.async(resume => {
|
|
70
|
-
if (exited) {
|
|
71
|
-
return resume(handle.exitCode !== null ? Effect.succeed(CommandExecutor.ExitCode(handle.exitCode)) : Effect.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${handle.signalCode}`), command)));
|
|
72
|
-
}
|
|
73
|
-
handle.on("exit", (code, signal) => {
|
|
74
|
-
if (code !== null) {
|
|
75
|
-
resume(Effect.succeed(CommandExecutor.ExitCode(code)));
|
|
76
|
-
} else {
|
|
77
|
-
// If code is `null`, then `signal` must be defined. See the NodeJS
|
|
78
|
-
// documentation for the `"exit"` event on a `child_process`.
|
|
79
|
-
// https://nodejs.org/api/child_process.html#child_process_event_exit
|
|
80
|
-
resume(Effect.fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command)));
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
// Make sure to terminate the running process if the fiber is
|
|
84
|
-
// terminated
|
|
85
|
-
return Effect.sync(() => {
|
|
86
|
-
handle.kill("SIGKILL");
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
const isRunning = Effect.sync(() => handle.exitCode === null && handle.signalCode === null && !handle.killed);
|
|
90
|
-
const kill = (signal = "SIGTERM") => Effect.async(resume => {
|
|
91
|
-
handle.kill(signal);
|
|
92
|
-
handle.on("exit", () => {
|
|
93
|
-
resume(Effect.unit);
|
|
94
|
-
});
|
|
95
|
-
// Make sure to terminate the running process if the fiber
|
|
96
|
-
// is terminated
|
|
97
|
-
return Effect.sync(() => {
|
|
98
|
-
handle.kill("SIGKILL");
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
resume(Effect.sync(() => {
|
|
102
|
-
const pid = CommandExecutor.ProcessId(handle.pid);
|
|
103
|
-
const stderr = (0, _stream.fromReadable)(() => handle.stderr, err => toPlatformError("fromReadable(stderr)", toError(err), command));
|
|
104
|
-
let stdout = (0, _stream.fromReadable)(() => handle.stdout, err => toPlatformError("fromReadable(stdout)", toError(err), command));
|
|
105
|
-
// TODO: add Sink.isSink
|
|
106
|
-
if (typeof command.stdout !== "string") {
|
|
107
|
-
stdout = Stream.transduce(stdout, command.stdout);
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
[CommandExecutor.ProcessTypeId]: CommandExecutor.ProcessTypeId,
|
|
111
|
-
pid,
|
|
112
|
-
exitCode,
|
|
113
|
-
isRunning,
|
|
114
|
-
kill,
|
|
115
|
-
stdin,
|
|
116
|
-
stderr,
|
|
117
|
-
stdout
|
|
118
|
-
};
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
return Effect.async(resume => {
|
|
122
|
-
if (handle.pid) {
|
|
123
|
-
handle.kill("SIGTERM");
|
|
124
|
-
}
|
|
125
|
-
handle.on("exit", () => {
|
|
126
|
-
resume(Effect.unit);
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
})), Effect.tap(process => Option.match(command.stdin, {
|
|
130
|
-
onNone: () => Effect.unit,
|
|
131
|
-
onSome: stdin => Effect.forkDaemon(Stream.run(stdin, process.stdin))
|
|
132
|
-
})));
|
|
133
|
-
}
|
|
134
|
-
case "PipedCommand":
|
|
135
|
-
{
|
|
136
|
-
const flattened = Command.flatten(command);
|
|
137
|
-
if (flattened.length === 1) {
|
|
138
|
-
return (0, _Function.pipe)(flattened[0], runCommand(fileSystem));
|
|
139
|
-
}
|
|
140
|
-
const head = flattened[0];
|
|
141
|
-
const tail = flattened.slice(1);
|
|
142
|
-
const initial = tail.slice(0, tail.length - 1);
|
|
143
|
-
const last = tail[tail.length - 1];
|
|
144
|
-
const stream = initial.reduce((stdin, command) => (0, _Function.pipe)(Command.stdin(command, stdin), runCommand(fileSystem), Stream.flatMap(process => process.stdout)), (0, _Function.pipe)(runCommand(fileSystem)(head), Stream.flatMap(process => process.stdout)));
|
|
145
|
-
return (0, _Function.pipe)(Command.stdin(last, stream), runCommand(fileSystem));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
/** @internal */
|
|
150
|
-
const layer = exports.layer = /*#__PURE__*/Layer.effect(CommandExecutor.CommandExecutor, /*#__PURE__*/(0, _Function.pipe)(FileSystem.FileSystem, /*#__PURE__*/Effect.map(fileSystem => CommandExecutor.makeExecutor(runCommand(fileSystem)))));
|
|
151
|
-
//# sourceMappingURL=commandExecutor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commandExecutor.js","names":["_error","require","_sink","_stream","Command","_interopRequireWildcard","CommandExecutor","FileSystem","Effect","_Function","Layer","Option","Sink","Stream","ChildProcess","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","inputToStdioOption","stdin","match","onNone","onSome","outputToStdioOption","output","toError","err","globalThis","Error","String","toPlatformError","method","error","command","flattened","flatten","reduce","acc","curr","args","join","length","handleErrnoException","runCommand","fileSystem","_tag","pipe","cwd","unit","dir","access","zipRight","sync","process","env","flatMap","async","resume","handle","spawn","stdio","stdout","stderr","getOrElse","constUndefined","fromEntries","exited","on","kill","fail","pid","drain","fromWritable","exitCode","succeed","ExitCode","signalCode","code","signal","isRunning","killed","ProcessId","fromReadable","transduce","ProcessTypeId","tap","forkDaemon","run","head","tail","slice","initial","last","stream","layer","exports","effect","map","makeExecutor"],"sources":["../src/internal/commandExecutor.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,MAAA,gBAAAC,OAAA;AACA,IAAAC,KAAA,gBAAAD,OAAA;AACA,IAAAE,OAAA,gBAAAF,OAAA;AACA,IAAAG,OAAA,gBAAAC,uBAAA,eAAAJ,OAAA;AACA,IAAAK,eAAA,gBAAAD,uBAAA,eAAAJ,OAAA;AAEA,IAAAM,UAAA,gBAAAF,uBAAA,eAAAJ,OAAA;AACA,IAAAO,MAA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,GAAGF,IAAI,CAACC,KAAK,CAAC,CAAC,EAAED,IAAI,CAAChD,MAAM,GAAG,CAAC,CAAC;QAC9C,MAAMmD,IAAI,GAAGH,IAAI,CAACA,IAAI,CAAChD,MAAM,GAAG,CAAC,CAAC;QAClC,MAAMoD,MAAM,GAAGF,OAAO,CAACvD,MAAM,CAC3B,CAACjB,KAAK,EAAEc,OAAO,KACb,IAAAa,cAAI,EACF7D,OAAO,CAACkC,KAAK,CAACc,OAAO,EAAEd,KAAK,CAAC,EAC7BwB,UAAU,CAACC,UAAU,CAAC,EACtBlD,MAAM,CAAC6D,OAAO,CAAEF,OAAO,IAAKA,OAAO,CAACQ,MAAM,CAAC,CAC5C,EACH,IAAAf,cAAI,EACFH,UAAU,CAACC,UAAU,CAAC,CAAC4C,IAAI,CAAC,EAC5B9F,MAAM,CAAC6D,OAAO,CAAEF,OAAO,IAAKA,OAAO,CAACQ,MAAM,CAAC,CAC5C,CACF;QACD,OAAO,IAAAf,cAAI,EAAC7D,OAAO,CAACkC,KAAK,CAACyE,IAAI,EAAEC,MAAM,CAAC,EAAElD,UAAU,CAACC,UAAU,CAAC,CAAC;;;AAGtE,CAAC;AAEH;AACO,MAAMkD,KAAK,GAAAC,OAAA,CAAAD,KAAA,gBAA+EvG,KAAK,CAACyG,MAAM,CAC3G7G,eAAe,CAACA,eAAe,eAC/B,IAAA2D,cAAI,EACF1D,UAAU,CAACA,UAAU,eACrBC,MAAM,CAAC4G,GAAG,CAAErD,UAAU,IAAKzD,eAAe,CAAC+G,YAAY,CAACvD,UAAU,CAACC,UAAU,CAAC,CAAC,CAAC,CACjF,CACF"}
|
package/internal/error.d.ts
DELETED
package/internal/error.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/internal/error.ts"],"names":[],"mappings":""}
|
package/internal/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","names":["_Error","require","handleErrnoException","module","method","err","path","reason","code","SystemError","pathOrDescriptor","syscall","message","exports"],"sources":["../src/internal/error.ts"],"sourcesContent":[null],"mappings":";;;;;;AACA,IAAAA,MAAA,gBAAAC,OAAA;AAGA;AACO,MAAMC,oBAAoB,GAAGA,CAACC,MAA6B,EAAEC,MAAc,KAClF,CACEC,GAA0B,EAC1B,CAACC,IAAI,CAAiD,KACrC;EACjB,IAAIC,MAAM,GAAsB,SAAS;EAEzC,QAAQF,GAAG,CAACG,IAAI;IACd,KAAK,QAAQ;MACXD,MAAM,GAAG,UAAU;MACnB;IAEF,KAAK,QAAQ;MACXA,MAAM,GAAG,kBAAkB;MAC3B;IAEF,KAAK,QAAQ;MACXA,MAAM,GAAG,eAAe;MACxB;IAEF,KAAK,QAAQ;MACXA,MAAM,GAAG,aAAa;MACtB;IAEF,KAAK,SAAS;MACZA,MAAM,GAAG,aAAa;MACtB;IAEF,KAAK,OAAO;MACVA,MAAM,GAAG,MAAM;MACf;IAEF,KAAK,OAAO;MACVA,MAAM,GAAG,aAAa;MACtB;;EAGJ,OAAO,IAAAE,kBAAW,EAAC;IACjBF,MAAM;IACNJ,MAAM;IACNC,MAAM;IACNM,gBAAgB,EAAEJ,IAAuB;IACzCK,OAAO,EAAEN,GAAG,CAACM,OAAO;IACpBC,OAAO,EAAEP,GAAG,CAACO;GACd,CAAC;AACJ,CAAC;AAAAC,OAAA,CAAAX,oBAAA,GAAAA,oBAAA"}
|
package/internal/fileSystem.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.d.ts","sourceRoot":"","sources":["../src/internal/fileSystem.ts"],"names":[],"mappings":""}
|
package/internal/fileSystem.js
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.layer = void 0;
|
|
7
|
-
var _error = /*#__PURE__*/require("@effect/platform-node/internal/error");
|
|
8
|
-
var _Effectify = /*#__PURE__*/require("@effect/platform/Effectify");
|
|
9
|
-
var Error = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Error"));
|
|
10
|
-
var FileSystem = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/FileSystem"));
|
|
11
|
-
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect"));
|
|
12
|
-
var _Function = /*#__PURE__*/require("effect/Function");
|
|
13
|
-
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
|
|
14
|
-
var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option"));
|
|
15
|
-
var Crypto = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:crypto"));
|
|
16
|
-
var NFS = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:fs"));
|
|
17
|
-
var OS = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:os"));
|
|
18
|
-
var Path = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("node:path"));
|
|
19
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
const handleBadArgument = method => err => Error.BadArgument({
|
|
22
|
-
module: "FileSystem",
|
|
23
|
-
method,
|
|
24
|
-
message: err.message ?? String(err)
|
|
25
|
-
});
|
|
26
|
-
// == access
|
|
27
|
-
const access = /*#__PURE__*/(() => {
|
|
28
|
-
const nodeAccess = /*#__PURE__*/(0, _Effectify.effectify)(NFS.access, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "access"), /*#__PURE__*/handleBadArgument("access"));
|
|
29
|
-
return (path, options) => {
|
|
30
|
-
let mode = NFS.constants.F_OK;
|
|
31
|
-
if (options?.readable) {
|
|
32
|
-
mode |= NFS.constants.R_OK;
|
|
33
|
-
}
|
|
34
|
-
if (options?.writable) {
|
|
35
|
-
mode |= NFS.constants.W_OK;
|
|
36
|
-
}
|
|
37
|
-
return nodeAccess(path, mode);
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
// == copy
|
|
41
|
-
const copy = /*#__PURE__*/(() => {
|
|
42
|
-
const nodeCp = /*#__PURE__*/(0, _Effectify.effectify)(NFS.cp, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "copy"), /*#__PURE__*/handleBadArgument("copy"));
|
|
43
|
-
return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {
|
|
44
|
-
force: options?.overwrite ?? false,
|
|
45
|
-
preserveTimestamps: options?.preserveTimestamps ?? false,
|
|
46
|
-
recursive: true
|
|
47
|
-
});
|
|
48
|
-
})();
|
|
49
|
-
// == copyFile
|
|
50
|
-
const copyFile = /*#__PURE__*/(() => {
|
|
51
|
-
const nodeCopyFile = /*#__PURE__*/(0, _Effectify.effectify)(NFS.copyFile, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "copyFile"), /*#__PURE__*/handleBadArgument("copyFile"));
|
|
52
|
-
return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
|
|
53
|
-
})();
|
|
54
|
-
// == chmod
|
|
55
|
-
const chmod = /*#__PURE__*/(() => {
|
|
56
|
-
const nodeChmod = /*#__PURE__*/(0, _Effectify.effectify)(NFS.chmod, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "chmod"), /*#__PURE__*/handleBadArgument("chmod"));
|
|
57
|
-
return (path, mode) => nodeChmod(path, mode);
|
|
58
|
-
})();
|
|
59
|
-
// == chown
|
|
60
|
-
const chown = /*#__PURE__*/(() => {
|
|
61
|
-
const nodeChown = /*#__PURE__*/(0, _Effectify.effectify)(NFS.chown, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "chown"), /*#__PURE__*/handleBadArgument("chown"));
|
|
62
|
-
return (path, uid, gid) => nodeChown(path, uid, gid);
|
|
63
|
-
})();
|
|
64
|
-
// == link
|
|
65
|
-
const link = /*#__PURE__*/(() => {
|
|
66
|
-
const nodeLink = /*#__PURE__*/(0, _Effectify.effectify)(NFS.link, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "link"), /*#__PURE__*/handleBadArgument("link"));
|
|
67
|
-
return (existingPath, newPath) => nodeLink(existingPath, newPath);
|
|
68
|
-
})();
|
|
69
|
-
// == makeDirectory
|
|
70
|
-
const makeDirectory = /*#__PURE__*/(() => {
|
|
71
|
-
const nodeMkdir = /*#__PURE__*/(0, _Effectify.effectify)(NFS.mkdir, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "makeDirectory"), /*#__PURE__*/handleBadArgument("makeDirectory"));
|
|
72
|
-
return (path, options) => nodeMkdir(path, {
|
|
73
|
-
recursive: options?.recursive ?? false,
|
|
74
|
-
mode: options?.mode
|
|
75
|
-
});
|
|
76
|
-
})();
|
|
77
|
-
// == makeTempDirectory
|
|
78
|
-
const makeTempDirectoryFactory = method => {
|
|
79
|
-
const nodeMkdtemp = (0, _Effectify.effectify)(NFS.mkdtemp, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
80
|
-
return options => Effect.suspend(() => {
|
|
81
|
-
const prefix = options?.prefix ?? "";
|
|
82
|
-
const directory = typeof options?.directory === "string" ? Path.join(options.directory, ".") : OS.tmpdir();
|
|
83
|
-
return nodeMkdtemp(prefix ? Path.join(directory, prefix) : directory + "/");
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const makeTempDirectory = /*#__PURE__*/makeTempDirectoryFactory("makeTempDirectory");
|
|
87
|
-
// == remove
|
|
88
|
-
const removeFactory = method => {
|
|
89
|
-
const nodeRm = (0, _Effectify.effectify)(NFS.rm, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
90
|
-
return (path, options) => nodeRm(path, {
|
|
91
|
-
recursive: options?.recursive ?? false
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const remove = /*#__PURE__*/removeFactory("remove");
|
|
95
|
-
// == makeTempDirectoryScoped
|
|
96
|
-
const makeTempDirectoryScoped = /*#__PURE__*/(() => {
|
|
97
|
-
const makeDirectory = /*#__PURE__*/makeTempDirectoryFactory("makeTempDirectoryScoped");
|
|
98
|
-
const removeDirectory = /*#__PURE__*/removeFactory("makeTempDirectoryScoped");
|
|
99
|
-
return options => Effect.acquireRelease(makeDirectory(options), directory => Effect.orDie(removeDirectory(directory, {
|
|
100
|
-
recursive: true
|
|
101
|
-
})));
|
|
102
|
-
})();
|
|
103
|
-
// == open
|
|
104
|
-
const openFactory = method => {
|
|
105
|
-
const nodeOpen = (0, _Effectify.effectify)(NFS.open, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
106
|
-
const nodeClose = (0, _Effectify.effectify)(NFS.close, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
107
|
-
return (path, options) => (0, _Function.pipe)(Effect.acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), fd => Effect.orDie(nodeClose(fd))), Effect.map(fd => makeFile(FileSystem.FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
|
|
108
|
-
};
|
|
109
|
-
const open = /*#__PURE__*/openFactory("open");
|
|
110
|
-
const makeFile = /*#__PURE__*/(() => {
|
|
111
|
-
const nodeReadFactory = method => (0, _Effectify.effectify)(NFS.read, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
112
|
-
const nodeRead = /*#__PURE__*/nodeReadFactory("read");
|
|
113
|
-
const nodeReadAlloc = /*#__PURE__*/nodeReadFactory("readAlloc");
|
|
114
|
-
const nodeStat = /*#__PURE__*/(0, _Effectify.effectify)(NFS.fstat, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "stat"), /*#__PURE__*/handleBadArgument("stat"));
|
|
115
|
-
const nodeTruncate = /*#__PURE__*/(0, _Effectify.effectify)(NFS.ftruncate, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "truncate"), /*#__PURE__*/handleBadArgument("truncate"));
|
|
116
|
-
const nodeWriteFactory = method => (0, _Effectify.effectify)(NFS.write, (0, _error.handleErrnoException)("FileSystem", method), handleBadArgument(method));
|
|
117
|
-
const nodeWrite = /*#__PURE__*/nodeWriteFactory("write");
|
|
118
|
-
const nodeWriteAll = /*#__PURE__*/nodeWriteFactory("writeAll");
|
|
119
|
-
class FileImpl {
|
|
120
|
-
constructor(fd, append) {
|
|
121
|
-
this.fd = fd;
|
|
122
|
-
this.append = append;
|
|
123
|
-
this.semaphore = Effect.unsafeMakeSemaphore(1);
|
|
124
|
-
this.position = 0n;
|
|
125
|
-
this[FileSystem.FileTypeId] = FileSystem.FileTypeId;
|
|
126
|
-
}
|
|
127
|
-
get stat() {
|
|
128
|
-
return Effect.map(nodeStat(this.fd), makeFileInfo);
|
|
129
|
-
}
|
|
130
|
-
seek(offset, from) {
|
|
131
|
-
const offsetSize = FileSystem.Size(offset);
|
|
132
|
-
return this.semaphore.withPermits(1)(Effect.sync(() => {
|
|
133
|
-
if (from === "start") {
|
|
134
|
-
this.position = offsetSize;
|
|
135
|
-
} else if (from === "current") {
|
|
136
|
-
this.position = this.position + offsetSize;
|
|
137
|
-
}
|
|
138
|
-
return this.position;
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
read(buffer) {
|
|
142
|
-
return this.semaphore.withPermits(1)(Effect.map(Effect.suspend(() => nodeRead(this.fd, {
|
|
143
|
-
buffer,
|
|
144
|
-
position: this.position
|
|
145
|
-
})), bytesRead => {
|
|
146
|
-
const sizeRead = FileSystem.Size(bytesRead);
|
|
147
|
-
this.position = this.position + sizeRead;
|
|
148
|
-
return sizeRead;
|
|
149
|
-
}));
|
|
150
|
-
}
|
|
151
|
-
readAlloc(size) {
|
|
152
|
-
const sizeNumber = Number(size);
|
|
153
|
-
return this.semaphore.withPermits(1)(Effect.flatMap(Effect.sync(() => Buffer.allocUnsafeSlow(sizeNumber)), buffer => Effect.map(nodeReadAlloc(this.fd, {
|
|
154
|
-
buffer,
|
|
155
|
-
position: this.position
|
|
156
|
-
}), bytesRead => {
|
|
157
|
-
if (bytesRead === 0) {
|
|
158
|
-
return Option.none();
|
|
159
|
-
}
|
|
160
|
-
this.position = this.position + BigInt(bytesRead);
|
|
161
|
-
if (bytesRead === sizeNumber) {
|
|
162
|
-
return Option.some(buffer);
|
|
163
|
-
}
|
|
164
|
-
const dst = Buffer.allocUnsafeSlow(bytesRead);
|
|
165
|
-
buffer.copy(dst, 0, 0, bytesRead);
|
|
166
|
-
return Option.some(dst);
|
|
167
|
-
})));
|
|
168
|
-
}
|
|
169
|
-
truncate(length) {
|
|
170
|
-
return this.semaphore.withPermits(1)(Effect.map(nodeTruncate(this.fd, length ? Number(length) : undefined), () => {
|
|
171
|
-
if (!this.append) {
|
|
172
|
-
const len = BigInt(length ?? 0);
|
|
173
|
-
if (this.position > len) {
|
|
174
|
-
this.position = len;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}));
|
|
178
|
-
}
|
|
179
|
-
write(buffer) {
|
|
180
|
-
return this.semaphore.withPermits(1)(Effect.map(Effect.suspend(() => nodeWrite(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(this.position))), bytesWritten => {
|
|
181
|
-
const sizeWritten = FileSystem.Size(bytesWritten);
|
|
182
|
-
if (!this.append) {
|
|
183
|
-
this.position = this.position + sizeWritten;
|
|
184
|
-
}
|
|
185
|
-
return sizeWritten;
|
|
186
|
-
}));
|
|
187
|
-
}
|
|
188
|
-
writeAllChunk(buffer) {
|
|
189
|
-
return Effect.flatMap(Effect.suspend(() => nodeWriteAll(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(this.position))), bytesWritten => {
|
|
190
|
-
if (bytesWritten === 0) {
|
|
191
|
-
return Effect.fail(Error.SystemError({
|
|
192
|
-
module: "FileSystem",
|
|
193
|
-
method: "writeAll",
|
|
194
|
-
reason: "WriteZero",
|
|
195
|
-
pathOrDescriptor: this.fd,
|
|
196
|
-
message: "write returned 0 bytes written"
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
if (!this.append) {
|
|
200
|
-
this.position = this.position + BigInt(bytesWritten);
|
|
201
|
-
}
|
|
202
|
-
return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.unit;
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
writeAll(buffer) {
|
|
206
|
-
return this.semaphore.withPermits(1)(this.writeAllChunk(buffer));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
FileSystem.FileTypeId;
|
|
210
|
-
return (fd, append) => new FileImpl(fd, append);
|
|
211
|
-
})();
|
|
212
|
-
// == makeTempFile
|
|
213
|
-
const makeTempFileFactory = method => {
|
|
214
|
-
const makeDirectory = makeTempDirectoryFactory(method);
|
|
215
|
-
const open = openFactory(method);
|
|
216
|
-
const randomHexString = bytes => Effect.sync(() => Crypto.randomBytes(bytes).toString("hex"));
|
|
217
|
-
return options => (0, _Function.pipe)(Effect.zip(makeDirectory(options), randomHexString(6)), Effect.map(([directory, random]) => Path.join(directory, random)), Effect.tap(path => Effect.scoped(open(path, {
|
|
218
|
-
flag: "w+"
|
|
219
|
-
}))));
|
|
220
|
-
};
|
|
221
|
-
const makeTempFile = /*#__PURE__*/makeTempFileFactory("makeTempFile");
|
|
222
|
-
// == makeTempFileScoped
|
|
223
|
-
const makeTempFileScoped = /*#__PURE__*/(() => {
|
|
224
|
-
const makeFile = /*#__PURE__*/makeTempFileFactory("makeTempFileScoped");
|
|
225
|
-
const removeFile = /*#__PURE__*/removeFactory("makeTempFileScoped");
|
|
226
|
-
return options => Effect.acquireRelease(makeFile(options), file => Effect.orDie(removeFile(file)));
|
|
227
|
-
})();
|
|
228
|
-
// == readDirectory
|
|
229
|
-
const readDirectory = /*#__PURE__*/(() => {
|
|
230
|
-
const nodeReadDirectory = /*#__PURE__*/(0, _Effectify.effectify)(NFS.readdir, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "readDirectory"), /*#__PURE__*/handleBadArgument("readDirectory"));
|
|
231
|
-
return (path, options) => nodeReadDirectory(path, options);
|
|
232
|
-
})();
|
|
233
|
-
// == readFile
|
|
234
|
-
const readFile = path => Effect.async((resume, signal) => {
|
|
235
|
-
try {
|
|
236
|
-
NFS.readFile(path, {
|
|
237
|
-
signal
|
|
238
|
-
}, (err, data) => {
|
|
239
|
-
if (err) {
|
|
240
|
-
resume(Effect.fail((0, _error.handleErrnoException)("FileSystem", "readFile")(err, [path])));
|
|
241
|
-
} else {
|
|
242
|
-
resume(Effect.succeed(data));
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
} catch (err) {
|
|
246
|
-
resume(Effect.fail(handleBadArgument("readFile")(err)));
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
// == readLink
|
|
250
|
-
const readLink = /*#__PURE__*/(() => {
|
|
251
|
-
const nodeReadLink = /*#__PURE__*/(0, _Effectify.effectify)(NFS.readlink, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "readLink"), /*#__PURE__*/handleBadArgument("readLink"));
|
|
252
|
-
return path => nodeReadLink(path);
|
|
253
|
-
})();
|
|
254
|
-
// == realPath
|
|
255
|
-
const realPath = /*#__PURE__*/(() => {
|
|
256
|
-
const nodeRealPath = /*#__PURE__*/(0, _Effectify.effectify)(NFS.realpath, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "realPath"), /*#__PURE__*/handleBadArgument("realPath"));
|
|
257
|
-
return path => nodeRealPath(path);
|
|
258
|
-
})();
|
|
259
|
-
// == rename
|
|
260
|
-
const rename = /*#__PURE__*/(() => {
|
|
261
|
-
const nodeRename = /*#__PURE__*/(0, _Effectify.effectify)(NFS.rename, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "rename"), /*#__PURE__*/handleBadArgument("rename"));
|
|
262
|
-
return (oldPath, newPath) => nodeRename(oldPath, newPath);
|
|
263
|
-
})();
|
|
264
|
-
// == stat
|
|
265
|
-
const makeFileInfo = stat => ({
|
|
266
|
-
type: stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : stat.isBlockDevice() ? "BlockDevice" : stat.isCharacterDevice() ? "CharacterDevice" : stat.isFIFO() ? "FIFO" : stat.isSocket() ? "Socket" : "Unknown",
|
|
267
|
-
mtime: Option.fromNullable(stat.mtime),
|
|
268
|
-
atime: Option.fromNullable(stat.atime),
|
|
269
|
-
birthtime: Option.fromNullable(stat.birthtime),
|
|
270
|
-
dev: stat.dev,
|
|
271
|
-
rdev: Option.fromNullable(stat.rdev),
|
|
272
|
-
ino: Option.fromNullable(stat.ino),
|
|
273
|
-
mode: stat.mode,
|
|
274
|
-
nlink: Option.fromNullable(stat.nlink),
|
|
275
|
-
uid: Option.fromNullable(stat.uid),
|
|
276
|
-
gid: Option.fromNullable(stat.gid),
|
|
277
|
-
size: FileSystem.Size(stat.size),
|
|
278
|
-
blksize: Option.fromNullable(FileSystem.Size(stat.blksize)),
|
|
279
|
-
blocks: Option.fromNullable(stat.blocks)
|
|
280
|
-
});
|
|
281
|
-
const stat = /*#__PURE__*/(() => {
|
|
282
|
-
const nodeStat = /*#__PURE__*/(0, _Effectify.effectify)(NFS.stat, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "stat"), /*#__PURE__*/handleBadArgument("stat"));
|
|
283
|
-
return path => Effect.map(nodeStat(path), makeFileInfo);
|
|
284
|
-
})();
|
|
285
|
-
// == symlink
|
|
286
|
-
const symlink = /*#__PURE__*/(() => {
|
|
287
|
-
const nodeSymlink = /*#__PURE__*/(0, _Effectify.effectify)(NFS.symlink, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "symlink"), /*#__PURE__*/handleBadArgument("symlink"));
|
|
288
|
-
return (target, path) => nodeSymlink(target, path);
|
|
289
|
-
})();
|
|
290
|
-
// == truncate
|
|
291
|
-
const truncate = /*#__PURE__*/(() => {
|
|
292
|
-
const nodeTruncate = /*#__PURE__*/(0, _Effectify.effectify)(NFS.truncate, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "truncate"), /*#__PURE__*/handleBadArgument("truncate"));
|
|
293
|
-
return (path, length) => nodeTruncate(path, length !== undefined ? Number(length) : undefined);
|
|
294
|
-
})();
|
|
295
|
-
// == utimes
|
|
296
|
-
const utimes = /*#__PURE__*/(() => {
|
|
297
|
-
const nodeUtimes = /*#__PURE__*/(0, _Effectify.effectify)(NFS.utimes, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "utime"), /*#__PURE__*/handleBadArgument("utime"));
|
|
298
|
-
return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
|
|
299
|
-
})();
|
|
300
|
-
// == writeFile
|
|
301
|
-
const writeFile = (path, data, options) => Effect.async((resume, signal) => {
|
|
302
|
-
try {
|
|
303
|
-
NFS.writeFile(path, data, {
|
|
304
|
-
signal,
|
|
305
|
-
flag: options?.flag,
|
|
306
|
-
mode: options?.mode
|
|
307
|
-
}, err => {
|
|
308
|
-
if (err) {
|
|
309
|
-
resume(Effect.fail((0, _error.handleErrnoException)("FileSystem", "writeFile")(err, [path])));
|
|
310
|
-
} else {
|
|
311
|
-
resume(Effect.unit);
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
} catch (err) {
|
|
315
|
-
resume(Effect.fail(handleBadArgument("writeFile")(err)));
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
const fileSystemImpl = /*#__PURE__*/FileSystem.make({
|
|
319
|
-
access,
|
|
320
|
-
chmod,
|
|
321
|
-
chown,
|
|
322
|
-
copy,
|
|
323
|
-
copyFile,
|
|
324
|
-
link,
|
|
325
|
-
makeDirectory,
|
|
326
|
-
makeTempDirectory,
|
|
327
|
-
makeTempDirectoryScoped,
|
|
328
|
-
makeTempFile,
|
|
329
|
-
makeTempFileScoped,
|
|
330
|
-
open,
|
|
331
|
-
readDirectory,
|
|
332
|
-
readFile,
|
|
333
|
-
readLink,
|
|
334
|
-
realPath,
|
|
335
|
-
remove,
|
|
336
|
-
rename,
|
|
337
|
-
stat,
|
|
338
|
-
symlink,
|
|
339
|
-
truncate,
|
|
340
|
-
utimes,
|
|
341
|
-
writeFile
|
|
342
|
-
});
|
|
343
|
-
/** @internal */
|
|
344
|
-
const layer = exports.layer = /*#__PURE__*/Layer.succeed(FileSystem.FileSystem, fileSystemImpl);
|
|
345
|
-
//# sourceMappingURL=fileSystem.js.map
|