@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.
Files changed (475) hide show
  1. package/Command/dist/effect-platform-node-Command.cjs.d.mts +2 -0
  2. package/Command/dist/effect-platform-node-Command.cjs.d.mts.map +1 -0
  3. package/Command/dist/effect-platform-node-Command.cjs.d.ts +2 -0
  4. package/Command/dist/effect-platform-node-Command.cjs.d.ts.map +1 -0
  5. package/Command/dist/effect-platform-node-Command.cjs.dev.js +72 -0
  6. package/Command/dist/effect-platform-node-Command.cjs.js +7 -0
  7. package/Command/dist/effect-platform-node-Command.cjs.mjs +18 -0
  8. package/Command/dist/effect-platform-node-Command.cjs.prod.js +72 -0
  9. package/Command/dist/effect-platform-node-Command.esm.js +5 -0
  10. package/Command/package.json +4 -0
  11. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts +2 -0
  12. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts.map +1 -0
  13. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts +2 -0
  14. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts.map +1 -0
  15. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.dev.js +27 -0
  16. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.js +7 -0
  17. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.mjs +4 -0
  18. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.prod.js +27 -0
  19. package/CommandExecutor/dist/effect-platform-node-CommandExecutor.esm.js +14 -0
  20. package/CommandExecutor/package.json +4 -0
  21. package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts +2 -0
  22. package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts.map +1 -0
  23. package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts +2 -0
  24. package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts.map +1 -0
  25. package/Effectify/dist/effect-platform-node-Effectify.cjs.dev.js +12 -0
  26. package/Effectify/dist/effect-platform-node-Effectify.cjs.js +7 -0
  27. package/Effectify/dist/effect-platform-node-Effectify.cjs.mjs +3 -0
  28. package/Effectify/dist/effect-platform-node-Effectify.cjs.prod.js +12 -0
  29. package/Effectify/dist/effect-platform-node-Effectify.esm.js +5 -0
  30. package/Effectify/package.json +4 -0
  31. package/Error/dist/effect-platform-node-Error.cjs.d.mts +2 -0
  32. package/Error/dist/effect-platform-node-Error.cjs.d.mts.map +1 -0
  33. package/Error/dist/effect-platform-node-Error.cjs.d.ts +2 -0
  34. package/Error/dist/effect-platform-node-Error.cjs.d.ts.map +1 -0
  35. package/Error/dist/effect-platform-node-Error.cjs.dev.js +28 -0
  36. package/Error/dist/effect-platform-node-Error.cjs.js +7 -0
  37. package/Error/dist/effect-platform-node-Error.cjs.mjs +7 -0
  38. package/Error/dist/effect-platform-node-Error.cjs.prod.js +28 -0
  39. package/Error/dist/effect-platform-node-Error.esm.js +5 -0
  40. package/Error/package.json +4 -0
  41. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts +2 -0
  42. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts.map +1 -0
  43. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts +2 -0
  44. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts.map +1 -0
  45. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.dev.js +29 -0
  46. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.js +7 -0
  47. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.mjs +5 -0
  48. package/FileSystem/dist/effect-platform-node-FileSystem.cjs.prod.js +29 -0
  49. package/FileSystem/dist/effect-platform-node-FileSystem.esm.js +14 -0
  50. package/FileSystem/package.json +4 -0
  51. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts +2 -0
  52. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts.map +1 -0
  53. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts +2 -0
  54. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts.map +1 -0
  55. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.dev.js +19 -0
  56. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.js +7 -0
  57. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.mjs +1 -0
  58. package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.prod.js +19 -0
  59. package/Http/Etag/dist/effect-platform-node-Http-Etag.esm.js +23 -0
  60. package/Http/Etag/package.json +4 -0
  61. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts +2 -0
  62. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts.map +1 -0
  63. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts +2 -0
  64. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts.map +1 -0
  65. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.dev.js +31 -0
  66. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.js +7 -0
  67. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.mjs +1 -0
  68. package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.prod.js +31 -0
  69. package/Http/FormData/dist/effect-platform-node-Http-FormData.esm.js +23 -0
  70. package/Http/FormData/package.json +4 -0
  71. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts +2 -0
  72. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts.map +1 -0
  73. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts +2 -0
  74. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts.map +1 -0
  75. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.dev.js +39 -0
  76. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.js +7 -0
  77. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.mjs +10 -0
  78. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.prod.js +39 -0
  79. package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.esm.js +65 -0
  80. package/Http/NodeClient/package.json +4 -0
  81. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts +2 -0
  82. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts.map +1 -0
  83. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts +2 -0
  84. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts.map +1 -0
  85. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.dev.js +51 -0
  86. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.js +7 -0
  87. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.mjs +1 -0
  88. package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.prod.js +51 -0
  89. package/{mjs/Http/Platform.mjs → Http/Platform/dist/effect-platform-node-Http-Platform.esm.js} +9 -8
  90. package/Http/Platform/package.json +4 -0
  91. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts +2 -0
  92. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts.map +1 -0
  93. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts +2 -0
  94. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts.map +1 -0
  95. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.dev.js +61 -0
  96. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.js +7 -0
  97. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.mjs +1 -0
  98. package/Http/Server/dist/effect-platform-node-Http-Server.cjs.prod.js +61 -0
  99. package/Http/Server/dist/effect-platform-node-Http-Server.esm.js +29 -0
  100. package/Http/Server/package.json +4 -0
  101. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts +2 -0
  102. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts.map +1 -0
  103. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts +2 -0
  104. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts.map +1 -0
  105. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.dev.js +67 -0
  106. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.js +7 -0
  107. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.mjs +10 -0
  108. package/HttpClient/dist/effect-platform-node-HttpClient.cjs.prod.js +67 -0
  109. package/HttpClient/dist/effect-platform-node-HttpClient.esm.js +20 -0
  110. package/HttpClient/package.json +4 -0
  111. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts +2 -0
  112. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts.map +1 -0
  113. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts +2 -0
  114. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts.map +1 -0
  115. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.dev.js +96 -0
  116. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.js +7 -0
  117. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.mjs +14 -0
  118. package/HttpServer/dist/effect-platform-node-HttpServer.cjs.prod.js +96 -0
  119. package/HttpServer/dist/effect-platform-node-HttpServer.esm.js +28 -0
  120. package/HttpServer/package.json +4 -0
  121. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts +2 -0
  122. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts.map +1 -0
  123. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts +2 -0
  124. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts.map +1 -0
  125. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.dev.js +32 -0
  126. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.js +7 -0
  127. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.mjs +1 -0
  128. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.prod.js +32 -0
  129. package/KeyValueStore/dist/effect-platform-node-KeyValueStore.esm.js +19 -0
  130. package/KeyValueStore/package.json +4 -0
  131. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts +2 -0
  132. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts.map +1 -0
  133. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts +2 -0
  134. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts.map +1 -0
  135. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.dev.js +33 -0
  136. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.js +7 -0
  137. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.mjs +3 -0
  138. package/NodeContext/dist/effect-platform-node-NodeContext.cjs.prod.js +33 -0
  139. package/NodeContext/dist/effect-platform-node-NodeContext.esm.js +22 -0
  140. package/NodeContext/package.json +4 -0
  141. package/Path/dist/effect-platform-node-Path.cjs.d.mts +2 -0
  142. package/Path/dist/effect-platform-node-Path.cjs.d.mts.map +1 -0
  143. package/Path/dist/effect-platform-node-Path.cjs.d.ts +2 -0
  144. package/Path/dist/effect-platform-node-Path.cjs.d.ts.map +1 -0
  145. package/Path/dist/effect-platform-node-Path.cjs.dev.js +21 -0
  146. package/Path/dist/effect-platform-node-Path.cjs.js +7 -0
  147. package/Path/dist/effect-platform-node-Path.cjs.mjs +6 -0
  148. package/Path/dist/effect-platform-node-Path.cjs.prod.js +21 -0
  149. package/Path/dist/effect-platform-node-Path.esm.js +26 -0
  150. package/Path/package.json +4 -0
  151. package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts +2 -0
  152. package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts.map +1 -0
  153. package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts +2 -0
  154. package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts.map +1 -0
  155. package/Runtime/dist/effect-platform-node-Runtime.cjs.dev.js +16 -0
  156. package/Runtime/dist/effect-platform-node-Runtime.cjs.js +7 -0
  157. package/Runtime/dist/effect-platform-node-Runtime.cjs.mjs +4 -0
  158. package/Runtime/dist/effect-platform-node-Runtime.cjs.prod.js +16 -0
  159. package/Runtime/dist/effect-platform-node-Runtime.esm.js +14 -0
  160. package/Runtime/package.json +4 -0
  161. package/Sink/dist/effect-platform-node-Sink.cjs.d.mts +2 -0
  162. package/Sink/dist/effect-platform-node-Sink.cjs.d.mts.map +1 -0
  163. package/Sink/dist/effect-platform-node-Sink.cjs.d.ts +2 -0
  164. package/Sink/dist/effect-platform-node-Sink.cjs.d.ts.map +1 -0
  165. package/Sink/dist/effect-platform-node-Sink.cjs.dev.js +13 -0
  166. package/Sink/dist/effect-platform-node-Sink.cjs.js +7 -0
  167. package/Sink/dist/effect-platform-node-Sink.cjs.mjs +3 -0
  168. package/Sink/dist/effect-platform-node-Sink.cjs.prod.js +13 -0
  169. package/Sink/dist/effect-platform-node-Sink.esm.js +18 -0
  170. package/Sink/package.json +4 -0
  171. package/Stream/dist/effect-platform-node-Stream.cjs.d.mts +2 -0
  172. package/Stream/dist/effect-platform-node-Stream.cjs.d.mts.map +1 -0
  173. package/Stream/dist/effect-platform-node-Stream.cjs.d.ts +2 -0
  174. package/Stream/dist/effect-platform-node-Stream.cjs.d.ts.map +1 -0
  175. package/Stream/dist/effect-platform-node-Stream.cjs.dev.js +16 -0
  176. package/Stream/dist/effect-platform-node-Stream.cjs.js +7 -0
  177. package/Stream/dist/effect-platform-node-Stream.cjs.mjs +5 -0
  178. package/Stream/dist/effect-platform-node-Stream.cjs.prod.js +16 -0
  179. package/Stream/dist/effect-platform-node-Stream.esm.js +30 -0
  180. package/Stream/package.json +4 -0
  181. package/dist/Command-15b84341.cjs.dev.js +29 -0
  182. package/dist/Command-2fc875e9.cjs.prod.js +29 -0
  183. package/dist/CommandExecutor-b7cb55b8.cjs.dev.js +195 -0
  184. package/dist/CommandExecutor-bccc7563.cjs.prod.js +195 -0
  185. package/dist/Effectify-1676f59e.cjs.prod.js +14 -0
  186. package/dist/Effectify-c94620ca.cjs.dev.js +14 -0
  187. package/dist/Error-004c8162.cjs.prod.js +18 -0
  188. package/dist/Error-6db0ba89.cjs.dev.js +18 -0
  189. package/dist/Etag-7a3db878.cjs.prod.js +112 -0
  190. package/dist/Etag-b38be81c.cjs.dev.js +112 -0
  191. package/dist/FileSystem-a207377d.cjs.prod.js +433 -0
  192. package/dist/FileSystem-d7b8eeac.cjs.dev.js +433 -0
  193. package/dist/FormData-053407d4.cjs.dev.js +67 -0
  194. package/dist/FormData-c7339a7b.cjs.prod.js +67 -0
  195. package/dist/HttpClient-595a26fa.cjs.prod.js +54 -0
  196. package/dist/HttpClient-6c942c00.cjs.dev.js +54 -0
  197. package/dist/HttpServer-2a788d37.cjs.prod.js +64 -0
  198. package/dist/HttpServer-cc291592.cjs.dev.js +64 -0
  199. package/dist/KeyValueStore-35cb6494.cjs.prod.js +62 -0
  200. package/dist/KeyValueStore-af7495b6.cjs.dev.js +62 -0
  201. package/dist/NodeClient-8db3bc84.cjs.prod.js +280 -0
  202. package/dist/NodeClient-ab5848bf.cjs.dev.js +280 -0
  203. package/dist/NodeContext-3c96e955.cjs.dev.js +50 -0
  204. package/dist/NodeContext-dff7bc0b.cjs.prod.js +50 -0
  205. package/dist/Path-bf4c3b07.cjs.prod.js +104 -0
  206. package/dist/Path-feae3dcf.cjs.dev.js +104 -0
  207. package/dist/Runtime-6aeac6f0.cjs.dev.js +68 -0
  208. package/dist/Runtime-e746c66d.cjs.prod.js +68 -0
  209. package/dist/Server-4638865c.cjs.prod.js +301 -0
  210. package/dist/Server-86853bf9.cjs.dev.js +301 -0
  211. package/dist/Sink-536c2b16.cjs.dev.js +26 -0
  212. package/dist/Sink-735101fa.cjs.prod.js +26 -0
  213. package/dist/Stream-53f57af5.cjs.dev.js +42 -0
  214. package/dist/Stream-7424efca.cjs.prod.js +42 -0
  215. package/dist/declarations/src/Command.d.ts.map +1 -0
  216. package/{CommandExecutor.d.ts → dist/declarations/src/CommandExecutor.d.ts} +3 -0
  217. package/dist/declarations/src/CommandExecutor.d.ts.map +1 -0
  218. package/dist/declarations/src/Effectify.d.ts.map +1 -0
  219. package/dist/declarations/src/Error.d.ts.map +1 -0
  220. package/dist/declarations/src/FileSystem.d.ts.map +1 -0
  221. package/{Http → dist/declarations/src/Http}/Etag.d.ts +5 -0
  222. package/dist/declarations/src/Http/Etag.d.ts.map +1 -0
  223. package/{Http → dist/declarations/src/Http}/FormData.d.ts +5 -0
  224. package/dist/declarations/src/Http/FormData.d.ts.map +1 -0
  225. package/{Http → dist/declarations/src/Http}/NodeClient.d.ts +3 -0
  226. package/dist/declarations/src/Http/NodeClient.d.ts.map +1 -0
  227. package/{Http → dist/declarations/src/Http}/Platform.d.ts +5 -0
  228. package/dist/declarations/src/Http/Platform.d.ts.map +1 -0
  229. package/{Http → dist/declarations/src/Http}/Server.d.ts +5 -0
  230. package/dist/declarations/src/Http/Server.d.ts.map +1 -0
  231. package/{HttpClient.d.ts → dist/declarations/src/HttpClient.d.ts} +1 -1
  232. package/dist/declarations/src/HttpClient.d.ts.map +1 -0
  233. package/{HttpServer.d.ts → dist/declarations/src/HttpServer.d.ts} +3 -3
  234. package/dist/declarations/src/HttpServer.d.ts.map +1 -0
  235. package/{KeyValueStore.d.ts → dist/declarations/src/KeyValueStore.d.ts} +5 -0
  236. package/dist/declarations/src/KeyValueStore.d.ts.map +1 -0
  237. package/{NodeContext.d.ts → dist/declarations/src/NodeContext.d.ts} +3 -6
  238. package/dist/declarations/src/NodeContext.d.ts.map +1 -0
  239. package/dist/declarations/src/Path.d.ts.map +1 -0
  240. package/{Runtime.d.ts → dist/declarations/src/Runtime.d.ts} +3 -0
  241. package/dist/declarations/src/Runtime.d.ts.map +1 -0
  242. package/dist/declarations/src/Sink.d.ts.map +1 -0
  243. package/{Stream.d.ts → dist/declarations/src/Stream.d.ts} +3 -0
  244. package/dist/declarations/src/Stream.d.ts.map +1 -0
  245. package/dist/declarations/src/index.d.ts +55 -0
  246. package/dist/declarations/src/index.d.ts.map +1 -0
  247. package/dist/effect-platform-node.cjs.d.mts +2 -0
  248. package/dist/effect-platform-node.cjs.d.mts.map +1 -0
  249. package/dist/effect-platform-node.cjs.d.ts +2 -0
  250. package/dist/effect-platform-node.cjs.d.ts.map +1 -0
  251. package/dist/effect-platform-node.cjs.dev.js +93 -0
  252. package/dist/effect-platform-node.cjs.js +7 -0
  253. package/dist/effect-platform-node.cjs.mjs +15 -0
  254. package/dist/effect-platform-node.cjs.prod.js +93 -0
  255. package/dist/effect-platform-node.esm.js +26 -0
  256. package/{internal/error.js → dist/error-4f074a3a.cjs.prod.js} +5 -8
  257. package/dist/error-e477c10b.cjs.dev.js +41 -0
  258. package/dist/formData-09ad7f6d.cjs.prod.js +141 -0
  259. package/dist/formData-fac89256.cjs.dev.js +141 -0
  260. package/dist/incomingMessage-28bc73d7.cjs.dev.js +85 -0
  261. package/dist/incomingMessage-ed443788.cjs.prod.js +85 -0
  262. package/dist/platform-1c31462c.cjs.dev.js +73 -0
  263. package/dist/platform-d09ef04f.cjs.prod.js +73 -0
  264. package/dist/sink-da49e187.cjs.prod.js +57 -0
  265. package/dist/sink-daf9e0e5.cjs.dev.js +57 -0
  266. package/dist/stream-1456ece0.cjs.dev.js +120 -0
  267. package/dist/stream-ef8b6a66.cjs.prod.js +120 -0
  268. package/{mjs/internal/commandExecutor.mjs → internal/commandExecutor.esm.js} +20 -15
  269. package/{mjs/internal/error.mjs → internal/error.esm.js} +5 -3
  270. package/{mjs/internal/fileSystem.mjs → internal/fileSystem.esm.js} +68 -20
  271. package/{mjs/internal/http/etag.mjs → internal/http/etag.esm.js} +10 -6
  272. package/{mjs/internal/http/formData.mjs → internal/http/formData.esm.js} +24 -23
  273. package/{mjs/internal/http/incomingMessage.mjs → internal/http/incomingMessage.esm.js} +14 -13
  274. package/{mjs/internal/http/nodeClient.mjs → internal/http/nodeClient.esm.js} +34 -26
  275. package/{mjs/internal/http/platform.mjs → internal/http/platform.esm.js} +16 -13
  276. package/{mjs/internal/http/server.mjs → internal/http/server.esm.js} +30 -27
  277. package/{mjs/internal/path.mjs → internal/path.esm.js} +15 -10
  278. package/{mjs/internal/runtime.mjs → internal/runtime.esm.js} +7 -5
  279. package/{mjs/internal/sink.mjs → internal/sink.esm.js} +7 -5
  280. package/{mjs/internal/stream.mjs → internal/stream.esm.js} +13 -8
  281. package/package.json +174 -31
  282. package/src/CommandExecutor.ts +1 -1
  283. package/src/FileSystem.ts +1 -1
  284. package/src/Http/Etag.ts +1 -1
  285. package/src/Http/FormData.ts +1 -1
  286. package/src/Http/NodeClient.ts +1 -1
  287. package/src/Http/Platform.ts +1 -1
  288. package/src/Http/Server.ts +1 -1
  289. package/src/HttpClient.ts +1 -1
  290. package/src/HttpServer.ts +3 -3
  291. package/src/KeyValueStore.ts +2 -2
  292. package/src/NodeContext.ts +3 -3
  293. package/src/Path.ts +1 -1
  294. package/src/Runtime.ts +1 -1
  295. package/src/Sink.ts +1 -1
  296. package/src/Stream.ts +1 -1
  297. package/src/index.ts +13 -13
  298. package/src/internal/commandExecutor.ts +3 -3
  299. package/src/internal/fileSystem.ts +1 -1
  300. package/src/internal/http/formData.ts +1 -1
  301. package/src/internal/http/incomingMessage.ts +1 -1
  302. package/src/internal/http/nodeClient.ts +3 -3
  303. package/src/internal/http/platform.ts +2 -2
  304. package/src/internal/http/server.ts +4 -4
  305. package/src/internal/sink.ts +1 -1
  306. package/src/internal/stream.ts +1 -1
  307. package/Command.d.ts.map +0 -1
  308. package/Command.js +0 -103
  309. package/Command.js.map +0 -1
  310. package/CommandExecutor.d.ts.map +0 -1
  311. package/CommandExecutor.js +0 -26
  312. package/CommandExecutor.js.map +0 -1
  313. package/Effectify.d.ts.map +0 -1
  314. package/Effectify.js +0 -13
  315. package/Effectify.js.map +0 -1
  316. package/Error.d.ts.map +0 -1
  317. package/Error.js +0 -25
  318. package/Error.js.map +0 -1
  319. package/FileSystem.d.ts.map +0 -1
  320. package/FileSystem.js +0 -32
  321. package/FileSystem.js.map +0 -1
  322. package/Http/Etag.d.ts.map +0 -1
  323. package/Http/Etag.js +0 -46
  324. package/Http/Etag.js.map +0 -1
  325. package/Http/FormData.d.ts.map +0 -1
  326. package/Http/FormData.js +0 -46
  327. package/Http/FormData.js.map +0 -1
  328. package/Http/NodeClient.d.ts.map +0 -1
  329. package/Http/NodeClient.js +0 -54
  330. package/Http/NodeClient.js.map +0 -1
  331. package/Http/Platform.d.ts.map +0 -1
  332. package/Http/Platform.js +0 -46
  333. package/Http/Platform.js.map +0 -1
  334. package/Http/Server.d.ts.map +0 -1
  335. package/Http/Server.js +0 -52
  336. package/Http/Server.js.map +0 -1
  337. package/HttpClient.d.ts.map +0 -1
  338. package/HttpClient.js +0 -25
  339. package/HttpClient.js.map +0 -1
  340. package/HttpServer.d.ts.map +0 -1
  341. package/HttpServer.js +0 -33
  342. package/HttpServer.js.map +0 -1
  343. package/KeyValueStore.d.ts.map +0 -1
  344. package/KeyValueStore.js +0 -43
  345. package/KeyValueStore.js.map +0 -1
  346. package/NodeContext.d.ts.map +0 -1
  347. package/NodeContext.js +0 -23
  348. package/NodeContext.js.map +0 -1
  349. package/Path.d.ts.map +0 -1
  350. package/Path.js +0 -36
  351. package/Path.js.map +0 -1
  352. package/Runtime.d.ts.map +0 -1
  353. package/Runtime.js +0 -26
  354. package/Runtime.js.map +0 -1
  355. package/Sink.d.ts.map +0 -1
  356. package/Sink.js +0 -19
  357. package/Sink.js.map +0 -1
  358. package/Stream.d.ts.map +0 -1
  359. package/Stream.js +0 -29
  360. package/Stream.js.map +0 -1
  361. package/index.d.ts +0 -55
  362. package/index.d.ts.map +0 -1
  363. package/index.js +0 -35
  364. package/index.js.map +0 -1
  365. package/internal/commandExecutor.d.ts +0 -2
  366. package/internal/commandExecutor.d.ts.map +0 -1
  367. package/internal/commandExecutor.js +0 -151
  368. package/internal/commandExecutor.js.map +0 -1
  369. package/internal/error.d.ts +0 -2
  370. package/internal/error.d.ts.map +0 -1
  371. package/internal/error.js.map +0 -1
  372. package/internal/fileSystem.d.ts +0 -2
  373. package/internal/fileSystem.d.ts.map +0 -1
  374. package/internal/fileSystem.js +0 -345
  375. package/internal/fileSystem.js.map +0 -1
  376. package/internal/http/etag.d.ts +0 -2
  377. package/internal/http/etag.d.ts.map +0 -1
  378. package/internal/http/etag.js +0 -51
  379. package/internal/http/etag.js.map +0 -1
  380. package/internal/http/formData.d.ts +0 -6
  381. package/internal/http/formData.d.ts.map +0 -1
  382. package/internal/http/formData.js +0 -116
  383. package/internal/http/formData.js.map +0 -1
  384. package/internal/http/incomingMessage.d.ts +0 -2
  385. package/internal/http/incomingMessage.d.ts.map +0 -1
  386. package/internal/http/incomingMessage.js +0 -66
  387. package/internal/http/incomingMessage.js.map +0 -1
  388. package/internal/http/nodeClient.d.ts +0 -2
  389. package/internal/http/nodeClient.d.ts.map +0 -1
  390. package/internal/http/nodeClient.js +0 -169
  391. package/internal/http/nodeClient.js.map +0 -1
  392. package/internal/http/platform.d.ts +0 -2
  393. package/internal/http/platform.d.ts.map +0 -1
  394. package/internal/http/platform.js +0 -50
  395. package/internal/http/platform.js.map +0 -1
  396. package/internal/http/server.d.ts +0 -2
  397. package/internal/http/server.d.ts.map +0 -1
  398. package/internal/http/server.js +0 -226
  399. package/internal/http/server.js.map +0 -1
  400. package/internal/path.d.ts +0 -2
  401. package/internal/path.d.ts.map +0 -1
  402. package/internal/path.js +0 -49
  403. package/internal/path.js.map +0 -1
  404. package/internal/runtime.d.ts +0 -2
  405. package/internal/runtime.d.ts.map +0 -1
  406. package/internal/runtime.js +0 -35
  407. package/internal/runtime.js.map +0 -1
  408. package/internal/sink.d.ts +0 -2
  409. package/internal/sink.d.ts.map +0 -1
  410. package/internal/sink.js +0 -41
  411. package/internal/sink.js.map +0 -1
  412. package/internal/stream.d.ts +0 -2
  413. package/internal/stream.d.ts.map +0 -1
  414. package/internal/stream.js +0 -100
  415. package/internal/stream.js.map +0 -1
  416. package/mjs/Command.mjs +0 -85
  417. package/mjs/Command.mjs.map +0 -1
  418. package/mjs/CommandExecutor.mjs +0 -16
  419. package/mjs/CommandExecutor.mjs.map +0 -1
  420. package/mjs/Effectify.mjs +0 -10
  421. package/mjs/Effectify.mjs.map +0 -1
  422. package/mjs/Error.mjs +0 -20
  423. package/mjs/Error.mjs.map +0 -1
  424. package/mjs/FileSystem.mjs +0 -21
  425. package/mjs/FileSystem.mjs.map +0 -1
  426. package/mjs/Http/Etag.mjs +0 -21
  427. package/mjs/Http/Etag.mjs.map +0 -1
  428. package/mjs/Http/FormData.mjs +0 -21
  429. package/mjs/Http/FormData.mjs.map +0 -1
  430. package/mjs/Http/NodeClient.mjs +0 -45
  431. package/mjs/Http/NodeClient.mjs.map +0 -1
  432. package/mjs/Http/Platform.mjs.map +0 -1
  433. package/mjs/Http/Server.mjs +0 -26
  434. package/mjs/Http/Server.mjs.map +0 -1
  435. package/mjs/HttpClient.mjs +0 -69
  436. package/mjs/HttpClient.mjs.map +0 -1
  437. package/mjs/HttpServer.mjs +0 -101
  438. package/mjs/HttpServer.mjs.map +0 -1
  439. package/mjs/KeyValueStore.mjs +0 -19
  440. package/mjs/KeyValueStore.mjs.map +0 -1
  441. package/mjs/NodeContext.mjs +0 -14
  442. package/mjs/NodeContext.mjs.map +0 -1
  443. package/mjs/Path.mjs +0 -26
  444. package/mjs/Path.mjs.map +0 -1
  445. package/mjs/Runtime.mjs +0 -16
  446. package/mjs/Runtime.mjs.map +0 -1
  447. package/mjs/Sink.mjs +0 -10
  448. package/mjs/Sink.mjs.map +0 -1
  449. package/mjs/Stream.mjs +0 -20
  450. package/mjs/Stream.mjs.map +0 -1
  451. package/mjs/index.mjs +0 -27
  452. package/mjs/index.mjs.map +0 -1
  453. package/mjs/internal/commandExecutor.mjs.map +0 -1
  454. package/mjs/internal/error.mjs.map +0 -1
  455. package/mjs/internal/fileSystem.mjs.map +0 -1
  456. package/mjs/internal/http/etag.mjs.map +0 -1
  457. package/mjs/internal/http/formData.mjs.map +0 -1
  458. package/mjs/internal/http/incomingMessage.mjs.map +0 -1
  459. package/mjs/internal/http/nodeClient.mjs.map +0 -1
  460. package/mjs/internal/http/platform.mjs.map +0 -1
  461. package/mjs/internal/http/server.mjs.map +0 -1
  462. package/mjs/internal/path.mjs.map +0 -1
  463. package/mjs/internal/runtime.mjs.map +0 -1
  464. package/mjs/internal/sink.mjs.map +0 -1
  465. package/mjs/internal/stream.mjs.map +0 -1
  466. package/tsconfig.build.json +0 -11
  467. package/tsconfig.examples.json +0 -12
  468. package/tsconfig.json +0 -11
  469. package/tsconfig.test.json +0 -17
  470. /package/{Command.d.ts → dist/declarations/src/Command.d.ts} +0 -0
  471. /package/{Effectify.d.ts → dist/declarations/src/Effectify.d.ts} +0 -0
  472. /package/{Error.d.ts → dist/declarations/src/Error.d.ts} +0 -0
  473. /package/{FileSystem.d.ts → dist/declarations/src/FileSystem.d.ts} +0 -0
  474. /package/{Path.d.ts → dist/declarations/src/Path.d.ts} +0 -0
  475. /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","prototype","hasOwnProperty","call","desc","set"],"sources":["./src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;AAGwDA,OAAA,CAAAC,OAAA,GAAAC,SAAA;;AAKgBF,OAAA,CAAAG,eAAA,GAAAC,iBAAA;;AAKZJ,OAAA,CAAAK,SAAA,GAAAC,WAAA;;AAKRN,OAAA,CAAAO,KAAA,GAAAC,OAAA;;AAKUR,OAAA,CAAAS,UAAA,GAAAC,YAAA;;AAKAV,OAAA,CAAAW,UAAA,GAAAC,YAAA;;AAKAZ,OAAA,CAAAa,UAAA,GAAAC,YAAA;;AAOMd,OAAA,CAAAe,aAAA,GAAAC,eAAA;;AAKJh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,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=commandExecutor.d.ts.map
@@ -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,MAAA,gBAAAH,uBAAA,eAAAJ,OAAA;AACA,IAAAQ,SAAA,gBAAAR,OAAA;AACA,IAAAS,KAAA,gBAAAL,uBAAA,eAAAJ,OAAA;AACA,IAAAU,MAAA,gBAAAN,uBAAA,eAAAJ,OAAA;AACA,IAAAW,IAAA,gBAAAP,uBAAA,eAAAJ,OAAA;AACA,IAAAY,MAAA,gBAAAR,uBAAA,eAAAJ,OAAA;AACA,IAAAa,YAAA,gBAAAT,uBAAA,eAAAJ,OAAA;AAAkD,SAAAc,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAA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,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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/internal/error.ts"],"names":[],"mappings":""}
@@ -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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=fileSystem.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileSystem.d.ts","sourceRoot":"","sources":["../src/internal/fileSystem.ts"],"names":[],"mappings":""}
@@ -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