@effect/platform-node 4.0.0-beta.70 → 4.0.0-beta.72

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 (81) hide show
  1. package/dist/Mime.d.ts +6 -0
  2. package/dist/Mime.d.ts.map +1 -1
  3. package/dist/Mime.js +6 -0
  4. package/dist/Mime.js.map +1 -1
  5. package/dist/NodeCrypto.d.ts +1 -1
  6. package/dist/NodeCrypto.d.ts.map +1 -1
  7. package/dist/NodeCrypto.js +10 -2
  8. package/dist/NodeCrypto.js.map +1 -1
  9. package/dist/NodeFileSystem.d.ts.map +1 -1
  10. package/dist/NodeFileSystem.js +22 -14
  11. package/dist/NodeFileSystem.js.map +1 -1
  12. package/dist/NodeHttpClient.d.ts +44 -26
  13. package/dist/NodeHttpClient.d.ts.map +1 -1
  14. package/dist/NodeHttpClient.js +42 -24
  15. package/dist/NodeHttpClient.js.map +1 -1
  16. package/dist/NodeHttpIncomingMessage.d.ts +35 -14
  17. package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
  18. package/dist/NodeHttpIncomingMessage.js +34 -13
  19. package/dist/NodeHttpIncomingMessage.js.map +1 -1
  20. package/dist/NodeHttpServerRequest.d.ts +2 -2
  21. package/dist/NodeHttpServerRequest.js +2 -2
  22. package/dist/NodeMultipart.d.ts +31 -16
  23. package/dist/NodeMultipart.d.ts.map +1 -1
  24. package/dist/NodeMultipart.js +29 -14
  25. package/dist/NodeMultipart.js.map +1 -1
  26. package/dist/NodePath.d.ts.map +1 -1
  27. package/dist/NodePath.js +24 -11
  28. package/dist/NodePath.js.map +1 -1
  29. package/dist/NodeRedis.d.ts +34 -16
  30. package/dist/NodeRedis.d.ts.map +1 -1
  31. package/dist/NodeRedis.js +33 -15
  32. package/dist/NodeRedis.js.map +1 -1
  33. package/dist/NodeRuntime.d.ts +3 -3
  34. package/dist/NodeRuntime.d.ts.map +1 -1
  35. package/dist/NodeRuntime.js +26 -12
  36. package/dist/NodeRuntime.js.map +1 -1
  37. package/dist/NodeServices.d.ts +31 -16
  38. package/dist/NodeServices.d.ts.map +1 -1
  39. package/dist/NodeServices.js.map +1 -1
  40. package/dist/NodeSocket.d.ts.map +1 -1
  41. package/dist/NodeSocket.js +31 -16
  42. package/dist/NodeSocket.js.map +1 -1
  43. package/dist/NodeStdio.d.ts.map +1 -1
  44. package/dist/NodeStdio.js +21 -13
  45. package/dist/NodeStdio.js.map +1 -1
  46. package/dist/NodeTerminal.d.ts.map +1 -1
  47. package/dist/NodeTerminal.js +18 -8
  48. package/dist/NodeTerminal.js.map +1 -1
  49. package/dist/NodeWorker.d.ts.map +1 -1
  50. package/dist/NodeWorker.js +28 -14
  51. package/dist/NodeWorker.js.map +1 -1
  52. package/dist/NodeWorkerRunner.d.ts.map +1 -1
  53. package/dist/NodeWorkerRunner.js +35 -15
  54. package/dist/NodeWorkerRunner.js.map +1 -1
  55. package/dist/Undici.d.ts +13 -0
  56. package/dist/Undici.d.ts.map +1 -1
  57. package/dist/Undici.js +13 -0
  58. package/dist/Undici.js.map +1 -1
  59. package/dist/index.d.ts +0 -350
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +0 -350
  62. package/dist/index.js.map +1 -1
  63. package/package.json +4 -4
  64. package/src/Mime.ts +7 -0
  65. package/src/NodeCrypto.ts +10 -2
  66. package/src/NodeFileSystem.ts +22 -14
  67. package/src/NodeHttpClient.ts +42 -24
  68. package/src/NodeHttpIncomingMessage.ts +34 -13
  69. package/src/NodeHttpServerRequest.ts +2 -2
  70. package/src/NodeMultipart.ts +29 -14
  71. package/src/NodePath.ts +24 -11
  72. package/src/NodeRedis.ts +33 -15
  73. package/src/NodeRuntime.ts +28 -14
  74. package/src/NodeServices.ts +31 -16
  75. package/src/NodeSocket.ts +29 -14
  76. package/src/NodeStdio.ts +21 -13
  77. package/src/NodeTerminal.ts +18 -8
  78. package/src/NodeWorker.ts +28 -14
  79. package/src/NodeWorkerRunner.ts +35 -15
  80. package/src/Undici.ts +13 -0
  81. package/src/index.ts +0 -350
@@ -1,20 +1,35 @@
1
1
  /**
2
- * Node-specific helpers for parsing HTTP `multipart/form-data` request bodies.
3
- *
4
- * This module adapts a Node `Readable` request body plus its incoming headers
5
- * into the shared `Multipart` model. Use `stream` when an HTTP server route
6
- * wants to handle form fields and uploaded files incrementally, for example API
7
- * endpoints that validate text fields while piping file parts to storage. Use
8
- * `persisted` when the whole form should be collected into a record and uploaded
9
- * files should be written into scoped temporary files through the current
10
- * `FileSystem` and `Path` services.
11
- *
12
- * Node request bodies are one-shot streams, so consume either `stream` or
13
- * `persisted`, and make sure file parts are drained, piped, or otherwise
14
- * deliberately handled. `contentEffect` loads a file into memory and should be
15
- * reserved for small uploads. Persisted paths live only for the surrounding
16
- * `Scope`, and filenames supplied by clients should be treated as metadata, not
17
- * trusted filesystem paths.
2
+ * Node.js multipart parsing for HTTP `multipart/form-data` request bodies.
3
+ *
4
+ * `NodeMultipart` adapts a Node `Readable` plus incoming HTTP headers into
5
+ * Effect's shared multipart model. It can expose form parts as a stream for
6
+ * incremental processing, or collect a complete persisted form by writing file
7
+ * uploads to scoped temporary files through the current `FileSystem` and `Path`
8
+ * services.
9
+ *
10
+ * **Mental model**
11
+ *
12
+ * Multipart request bodies are one-shot byte streams. {@link stream} parses the
13
+ * body as it arrives: fields are decoded to strings and file parts keep their
14
+ * underlying Node readable stream. {@link persisted} consumes the same kind of
15
+ * body, builds a `Multipart.Persisted` record, and ties temporary upload files
16
+ * to the surrounding `Scope`.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Use {@link stream} when a route validates fields while piping file uploads
21
+ * to storage.
22
+ * - Use {@link persisted} when a route needs a complete form value with scoped
23
+ * temporary files.
24
+ * - Use {@link fileToReadable} when a downstream Node library expects a
25
+ * `Readable`.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * Consume a request body with only one parser. File parts must be drained,
30
+ * piped, or persisted so the request can finish reading. `contentEffect` loads
31
+ * an uploaded file into memory, so reserve it for small files. Client-supplied
32
+ * filenames are metadata, not trusted filesystem paths.
18
33
  *
19
34
  * @since 4.0.0
20
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeMultipart.d.ts","sourceRoot":"","sources":["../src/NodeMultipart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,KAAK,IAAI,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gCAAgC,CAAA;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAI3C;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GACjB,QAAQ,QAAQ,EAChB,SAAS,mBAAmB,KAC3B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,cAAc,CActD,CAAA;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,QAAQ,QAAQ,EAChB,SAAS,mBAAmB,KAC3B,MAAM,CAAC,MAAM,CACd,SAAS,CAAC,SAAS,EACnB,SAAS,CAAC,cAAc,EACxB,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAM1C,CAAA;AAEP;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,CAAC,IAAI,KAAG,QAAmC,CAAA"}
1
+ {"version":3,"file":"NodeMultipart.d.ts","sourceRoot":"","sources":["../src/NodeMultipart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAEpD,OAAO,KAAK,KAAK,IAAI,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gCAAgC,CAAA;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAI3C;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GACjB,QAAQ,QAAQ,EAChB,SAAS,mBAAmB,KAC3B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,cAAc,CActD,CAAA;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,QAAQ,QAAQ,EAChB,SAAS,mBAAmB,KAC3B,MAAM,CAAC,MAAM,CACd,SAAS,CAAC,SAAS,EACnB,SAAS,CAAC,cAAc,EACxB,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAM1C,CAAA;AAEP;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,CAAC,IAAI,KAAG,QAAmC,CAAA"}
@@ -1,20 +1,35 @@
1
1
  /**
2
- * Node-specific helpers for parsing HTTP `multipart/form-data` request bodies.
2
+ * Node.js multipart parsing for HTTP `multipart/form-data` request bodies.
3
3
  *
4
- * This module adapts a Node `Readable` request body plus its incoming headers
5
- * into the shared `Multipart` model. Use `stream` when an HTTP server route
6
- * wants to handle form fields and uploaded files incrementally, for example API
7
- * endpoints that validate text fields while piping file parts to storage. Use
8
- * `persisted` when the whole form should be collected into a record and uploaded
9
- * files should be written into scoped temporary files through the current
10
- * `FileSystem` and `Path` services.
4
+ * `NodeMultipart` adapts a Node `Readable` plus incoming HTTP headers into
5
+ * Effect's shared multipart model. It can expose form parts as a stream for
6
+ * incremental processing, or collect a complete persisted form by writing file
7
+ * uploads to scoped temporary files through the current `FileSystem` and `Path`
8
+ * services.
11
9
  *
12
- * Node request bodies are one-shot streams, so consume either `stream` or
13
- * `persisted`, and make sure file parts are drained, piped, or otherwise
14
- * deliberately handled. `contentEffect` loads a file into memory and should be
15
- * reserved for small uploads. Persisted paths live only for the surrounding
16
- * `Scope`, and filenames supplied by clients should be treated as metadata, not
17
- * trusted filesystem paths.
10
+ * **Mental model**
11
+ *
12
+ * Multipart request bodies are one-shot byte streams. {@link stream} parses the
13
+ * body as it arrives: fields are decoded to strings and file parts keep their
14
+ * underlying Node readable stream. {@link persisted} consumes the same kind of
15
+ * body, builds a `Multipart.Persisted` record, and ties temporary upload files
16
+ * to the surrounding `Scope`.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Use {@link stream} when a route validates fields while piping file uploads
21
+ * to storage.
22
+ * - Use {@link persisted} when a route needs a complete form value with scoped
23
+ * temporary files.
24
+ * - Use {@link fileToReadable} when a downstream Node library expects a
25
+ * `Readable`.
26
+ *
27
+ * **Gotchas**
28
+ *
29
+ * Consume a request body with only one parser. File parts must be drained,
30
+ * piped, or persisted so the request can finish reading. `contentEffect` loads
31
+ * an uploaded file into memory, so reserve it for small files. Client-supplied
32
+ * filenames are metadata, not trusted filesystem paths.
18
33
  *
19
34
  * @since 4.0.0
20
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeMultipart.js","names":["Effect","Inspectable","Stream","Multipart","MP","NFS","NodeStreamP","NodeStream","stream","source","headers","makeConfig","pipe","map","config","fromReadable","evaluate","parser","make","onError","error","convertError","unwrap","convertPart","persisted","toPersisted","path","file","tryPromise","try","signal","pipeline","createWriteStream","catch","cause","MultipartError","fromReason","fileToReadable","part","_tag","FieldImpl","info","value","FileImpl","PartBase","Class","TypeId","constructor","key","contentType","name","decodeField","toJSON","_id","content","contentEffect","filename","toUint8Array","limit"],"sources":["../src/NodeMultipart.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKA,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAKC,WAAW,MAAM,oBAAoB;AAGjD,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,SAAS,MAAM,gCAAgC;AAC3D,OAAO,KAAKC,EAAE,MAAM,sCAAsC;AAC1D,OAAO,KAAKC,GAAG,MAAM,SAAS;AAG9B,OAAO,KAAKC,WAAW,MAAM,sBAAsB;AACnD,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAAGA,CACpBC,MAAgB,EAChBC,OAA4B,KAE5BP,SAAS,CAACQ,UAAU,CAACD,OAAc,CAAC,CAACE,IAAI,CACvCZ,MAAM,CAACa,GAAG,CAAEC,MAAM,IAChBP,UAAU,CAACQ,YAAY,CAAoC;EACzDC,QAAQA,CAAA;IACN,MAAMC,MAAM,GAAGb,EAAE,CAACc,IAAI,CAACJ,MAAM,CAAC;IAC9BL,MAAM,CAACG,IAAI,CAACK,MAAM,CAAC;IACnB,OAAOA,MAAa;EACtB,CAAC;EACDE,OAAO,EAAGC,KAAK,IAAKC,YAAY,CAACD,KAAY;CAC9C,CAAC,CACH,EACDlB,MAAM,CAACoB,MAAM,EACbpB,MAAM,CAACW,GAAG,CAACU,WAAW,CAAC,CACxB;AAEH;;;;;;;AAOA,OAAO,MAAMC,SAAS,GAAGA,CACvBf,MAAgB,EAChBC,OAA4B,KAM5BP,SAAS,CAACsB,WAAW,CAACjB,MAAM,CAACC,MAAM,EAAEC,OAAO,CAAC,EAAE,CAACgB,IAAI,EAAEC,IAAI,KACxD3B,MAAM,CAAC4B,UAAU,CAAC;EAChBC,GAAG,EAAGC,MAAM,IAAKxB,WAAW,CAACyB,QAAQ,CAAEJ,IAAiB,CAACA,IAAI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E;UACA,KAAK,cAAc;YAAE;cACnB,OAAO/B,SAAS,CAACgC,cAAc,CAACC,UAAU,CAAC,eAAe,EAAEF,KAAK,CAAC;YACpE;UACA,KAAK,aAAa;YAAE;cAClB,OAAO/B,SAAS,CAACgC,cAAc,CAACC,UAAU,CAAC,cAAc,EAAEF,KAAK,CAAC;YACnE;UACA,KAAK,cAAc;YAAE;cACnB,OAAO/B,SAAS,CAACgC,cAAc,CAACC,UAAU,CAAC,cAAc,EAAEF,KAAK,CAAC;YACnE;QACF;MACF;IACA;MAAS;QACP,OAAO/B,SAAS,CAACgC,cAAc,CAACC,UAAU,CAAC,OAAO,EAAEF,KAAK,CAAC;MAC5D;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"NodeMultipart.js","names":["Effect","Inspectable","Stream","Multipart","MP","NFS","NodeStreamP","NodeStream","stream","source","headers","makeConfig","pipe","map","config","fromReadable","evaluate","parser","make","onError","error","convertError","unwrap","convertPart","persisted","toPersisted","path","file","tryPromise","try","signal","pipeline","createWriteStream","catch","cause","MultipartError","fromReason","fileToReadable","part","_tag","FieldImpl","info","value","FileImpl","PartBase","Class","TypeId","constructor","key","contentType","name","decodeField","toJSON","_id","content","contentEffect","filename","toUint8Array","limit"],"sources":["../src/NodeMultipart.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,OAAO,KAAKA,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAKC,WAAW,MAAM,oBAAoB;AAGjD,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,SAAS,MAAM,gCAAgC;AAC3D,OAAO,KAAKC,EAAE,MAAM,sCAAsC;AAC1D,OAAO,KAAKC,GAAG,MAAM,SAAS;AAG9B,OAAO,KAAKC,WAAW,MAAM,sBAAsB;AACnD,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAE7C;;;;;;;;AAQA,OAAO,MAAMC,MAAM,GAAGA,CACpBC,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.d.ts","sourceRoot":"","sources":["../src/NodePath.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAA;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAA;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAA"}
1
+ {"version":3,"file":"NodePath.d.ts","sourceRoot":"","sources":["../src/NodePath.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAA;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAA;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAA"}
package/dist/NodePath.js CHANGED
@@ -1,17 +1,30 @@
1
1
  /**
2
2
  * Node.js layers for Effect's `Path` service.
3
3
  *
4
- * Use this module when an Effect program running on Node needs path operations
5
- * from the `Path` service, such as joining and normalizing filesystem
6
- * locations, resolving configuration or static asset paths, working with CLI
7
- * path arguments, or converting between file paths and `file:` URLs.
8
- *
9
- * `layer` follows the host platform's `node:path` semantics. Use `layerPosix`
10
- * or `layerWin32` when code needs stable POSIX or Windows behavior regardless
11
- * of the operating system. These layers provide only path manipulation; they do
12
- * not read the filesystem or validate that paths exist. `NodeServices.layer`
13
- * already includes the default Node path layer, so provide this module directly
14
- * when you want the narrower service or one of the platform-specific variants.
4
+ * This module adapts Node's path and file URL behavior to the
5
+ * platform-independent `Path` service. Provide one of its layers when a Node
6
+ * program needs to build, normalize, parse, resolve, or convert paths without
7
+ * depending directly on `node:path`.
8
+ *
9
+ * **Mental model**
10
+ *
11
+ * `Path` is a syntactic service: it manipulates strings and `file:` URLs. It
12
+ * does not read the filesystem, check permissions, or validate that paths
13
+ * exist. The selected layer decides which separator, drive-letter, UNC, and URL
14
+ * conversion rules are used.
15
+ *
16
+ * **Common tasks**
17
+ *
18
+ * Use `layer` for host-platform Node semantics, `layerPosix` for stable POSIX
19
+ * behavior, and `layerWin32` for stable Windows behavior. `NodeServices.layer`
20
+ * already includes `layer`, so import this module directly when a program wants
21
+ * only path support or a platform-specific variant.
22
+ *
23
+ * **Gotchas**
24
+ *
25
+ * Results that are correct on one platform may not be portable to another.
26
+ * `fromFileUrl` and `toFileUrl` use Node's `node:url` conversion rules and
27
+ * report invalid conversions as `BadArgument` failures.
15
28
  *
16
29
  * @since 4.0.0
17
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBH,QAAQ,CAACG,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBH,QAAQ,CAACG,UAAU","ignoreList":[]}
@@ -1,22 +1,40 @@
1
1
  /**
2
2
  * Node.js Redis integration backed by `ioredis`.
3
3
  *
4
- * This module provides scoped layers that create an `ioredis` client and expose
5
- * both the low-level `Redis` service used by Effect persistence modules and the
6
- * `NodeRedis` service for direct access to the underlying client. It is useful
7
- * for Node applications that want Redis-backed persistence, persisted queues,
8
- * distributed rate limiting, or custom Redis commands alongside the Effect
9
- * services that build on Redis.
10
- *
11
- * The client is acquired when the layer is built and closed with `quit` when
12
- * the layer scope ends, so install the layer at the lifetime you want for the
13
- * connection and pass `ioredis` options, or `layerConfig`, for connection,
14
- * TLS, database, retry, and reconnect settings. Persistence and rate limiter
15
- * stores build their own keys and Lua scripts on top of this service; choose
16
- * stable prefixes and store ids to avoid collisions, account for persisted
17
- * values that may fail to decode after schema changes, and avoid unbounded
18
- * high-cardinality rate-limit keys unless you have a cleanup or bounding
19
- * strategy.
4
+ * This module creates a scoped `ioredis` client and exposes it in two forms:
5
+ * the generic `Redis` service consumed by Effect persistence modules, and the
6
+ * {@link NodeRedis} service for code that needs direct access to the underlying
7
+ * client.
8
+ *
9
+ * **Mental model**
10
+ *
11
+ * - {@link layer} creates one `ioredis` client from explicit client options
12
+ * - {@link layerConfig} reads the same options from `Config`
13
+ * - Building the layer opens the client, and closing the layer scope calls
14
+ * `quit`
15
+ * - The generic `Redis` service sends command strings through `client.call`
16
+ * - {@link NodeRedis} exposes the raw client plus `use`, which maps promise
17
+ * failures into `RedisError`
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * - Provide Redis-backed persistence, persisted queues, or distributed rate
22
+ * limiting in Node.js
23
+ * - Configure connection, TLS, database, retry, and reconnect behavior with
24
+ * standard `ioredis` options
25
+ * - Run custom Redis commands through {@link NodeRedis} when the generic
26
+ * `Redis` service does not cover the command shape you need
27
+ *
28
+ * **Gotchas**
29
+ *
30
+ * - Install the layer at the lifetime you want for the connection; a short
31
+ * scope opens and closes a Redis client for that scope
32
+ * - Persistence and rate limiter stores create their own keys and Lua scripts
33
+ * on top of this service, so choose stable prefixes and store ids
34
+ * - Persisted values may fail to decode after schema changes; plan migrations
35
+ * or cleanup for long-lived Redis data
36
+ * - Avoid unbounded high-cardinality rate-limit keys unless another process or
37
+ * key policy bounds their lifetime
20
38
  *
21
39
  * @since 4.0.0
22
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;;qBAWf,OAAO,CAAC,KAAK;kBAChB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;;AAVnG;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,cAGQ;CAAG;AAiC1C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,OAAO,CAAC,YAAY,GAAG,SAAS,KACzC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAuC,CAAA;AAE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}
package/dist/NodeRedis.js CHANGED
@@ -1,22 +1,40 @@
1
1
  /**
2
2
  * Node.js Redis integration backed by `ioredis`.
3
3
  *
4
- * This module provides scoped layers that create an `ioredis` client and expose
5
- * both the low-level `Redis` service used by Effect persistence modules and the
6
- * `NodeRedis` service for direct access to the underlying client. It is useful
7
- * for Node applications that want Redis-backed persistence, persisted queues,
8
- * distributed rate limiting, or custom Redis commands alongside the Effect
9
- * services that build on Redis.
4
+ * This module creates a scoped `ioredis` client and exposes it in two forms:
5
+ * the generic `Redis` service consumed by Effect persistence modules, and the
6
+ * {@link NodeRedis} service for code that needs direct access to the underlying
7
+ * client.
10
8
  *
11
- * The client is acquired when the layer is built and closed with `quit` when
12
- * the layer scope ends, so install the layer at the lifetime you want for the
13
- * connection and pass `ioredis` options, or `layerConfig`, for connection,
14
- * TLS, database, retry, and reconnect settings. Persistence and rate limiter
15
- * stores build their own keys and Lua scripts on top of this service; choose
16
- * stable prefixes and store ids to avoid collisions, account for persisted
17
- * values that may fail to decode after schema changes, and avoid unbounded
18
- * high-cardinality rate-limit keys unless you have a cleanup or bounding
19
- * strategy.
9
+ * **Mental model**
10
+ *
11
+ * - {@link layer} creates one `ioredis` client from explicit client options
12
+ * - {@link layerConfig} reads the same options from `Config`
13
+ * - Building the layer opens the client, and closing the layer scope calls
14
+ * `quit`
15
+ * - The generic `Redis` service sends command strings through `client.call`
16
+ * - {@link NodeRedis} exposes the raw client plus `use`, which maps promise
17
+ * failures into `RedisError`
18
+ *
19
+ * **Common tasks**
20
+ *
21
+ * - Provide Redis-backed persistence, persisted queues, or distributed rate
22
+ * limiting in Node.js
23
+ * - Configure connection, TLS, database, retry, and reconnect behavior with
24
+ * standard `ioredis` options
25
+ * - Run custom Redis commands through {@link NodeRedis} when the generic
26
+ * `Redis` service does not cover the command shape you need
27
+ *
28
+ * **Gotchas**
29
+ *
30
+ * - Install the layer at the lifetime you want for the connection; a short
31
+ * scope opens and closes a Redis client for that scope
32
+ * - Persistence and rate limiter stores create their own keys and Lua scripts
33
+ * on top of this service, so choose stable prefixes and store ids
34
+ * - Persisted values may fail to decode after schema changes; plan migrations
35
+ * or cleanup for long-lived Redis data
36
+ * - Avoid unbounded high-cardinality rate-limit keys unless another process or
37
+ * key policy bounds their lifetime
20
38
  *
21
39
  * @since 4.0.0
22
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRedis.js","names":["Config","Context","Effect","Fn","Layer","Scope","Redis","IoRedis","NodeRedis","Service","make","fnUntraced","options","scope","addFinalizer","promise","client","quit","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","call","nodeRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,mCAAmC;AAC1D,OAAO,KAAKC,OAAO,MAAM,SAAS;AAElC;;;;;;;;AAQA,OAAM,MAAOC,SAAU,sBAAQP,OAAO,CAACQ,OAAO,EAG1C,CAAC,iCAAiC,CAAC;AAEvC,MAAMC,IAAI,gBAAGR,MAAM,CAACS,UAAU,CAAC,WAC7BC,OAA8B;EAE9B,MAAMC,KAAK,GAAG,OAAOX,MAAM,CAACW,KAAK;EACjC,OAAOR,KAAK,CAACS,YAAY,CAACD,KAAK,EAAEX,MAAM,CAACa,OAAO,CAAC,MAAMC,MAAM,CAACC,IAAI,EAAE,CAAC,CAAC;EACrE,MAAMD,MAAM,GAAG,IAAIT,OAAO,CAACD,KAAK,CAACM,OAAO,IAAI,EAAE,CAAC;EAE/C,MAAMM,GAAG,GAAOC,CAAwC,IACtDjB,MAAM,CAACkB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMF,CAAC,CAACH,MAAM,CAAC;IACpBM,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;MAAED;IAAK,CAAE;GACjD,CAAC;EAEJ,MAAME,KAAK,GAAG,OAAOnB,KAAK,CAACI,IAAI,CAAC;IAC9BgB,IAAI,EAAEA,CAAcC,OAAe,EAAE,GAAGC,IAA2B,KACjE1B,MAAM,CAACkB,UAAU,CAAC;MAChBC,GAAG,EAAEA,CAAA,KAAML,MAAM,CAACa,IAAI,CAACF,OAAO,EAAE,GAAGC,IAAI,CAAe;MACtDN,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;QAAED;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMO,SAAS,GAAG3B,EAAE,CAAC4B,QAAQ,CAAuB;IAClDf,MAAM;IACNE;GACD,CAAC;EAEF,OAAOjB,OAAO,CAACS,IAAI,CAACF,SAAS,EAAEsB,SAAS,CAAC,CAACE,IAAI,CAC5C/B,OAAO,CAACgC,GAAG,CAAC3B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CAChC;AACH,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAMS,KAAK,GAChBtB,OAA0C,IACDR,KAAK,CAAC+B,aAAa,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE7E;;;;;;;AAOA,OAAO,MAAMwB,WAAW,GAGtBxB,OAA0C,IAE1CR,KAAK,CAAC+B,aAAa,CACjBnC,MAAM,CAACqC,MAAM,CAACzB,OAAO,CAAC,CAACoB,IAAI,CACzB9B,MAAM,CAACoC,OAAO,CAAC5B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
1
+ {"version":3,"file":"NodeRedis.js","names":["Config","Context","Effect","Fn","Layer","Scope","Redis","IoRedis","NodeRedis","Service","make","fnUntraced","options","scope","addFinalizer","promise","client","quit","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","call","nodeRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,mCAAmC;AAC1D,OAAO,KAAKC,OAAO,MAAM,SAAS;AAElC;;;;;;;;AAQA,OAAM,MAAOC,SAAU,sBAAQP,OAAO,CAACQ,OAAO,EAG1C,CAAC,iCAAiC,CAAC;AAEvC,MAAMC,IAAI,gBAAGR,MAAM,CAACS,UAAU,CAAC,WAC7BC,OAA8B;EAE9B,MAAMC,KAAK,GAAG,OAAOX,MAAM,CAACW,KAAK;EACjC,OAAOR,KAAK,CAACS,YAAY,CAACD,KAAK,EAAEX,MAAM,CAACa,OAAO,CAAC,MAAMC,MAAM,CAACC,IAAI,EAAE,CAAC,CAAC;EACrE,MAAMD,MAAM,GAAG,IAAIT,OAAO,CAACD,KAAK,CAACM,OAAO,IAAI,EAAE,CAAC;EAE/C,MAAMM,GAAG,GAAOC,CAAwC,IACtDjB,MAAM,CAACkB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMF,CAAC,CAACH,MAAM,CAAC;IACpBM,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;MAAED;IAAK,CAAE;GACjD,CAAC;EAEJ,MAAME,KAAK,GAAG,OAAOnB,KAAK,CAACI,IAAI,CAAC;IAC9BgB,IAAI,EAAEA,CAAcC,OAAe,EAAE,GAAGC,IAA2B,KACjE1B,MAAM,CAACkB,UAAU,CAAC;MAChBC,GAAG,EAAEA,CAAA,KAAML,MAAM,CAACa,IAAI,CAACF,OAAO,EAAE,GAAGC,IAAI,CAAe;MACtDN,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;QAAED;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMO,SAAS,GAAG3B,EAAE,CAAC4B,QAAQ,CAAuB;IAClDf,MAAM;IACNE;GACD,CAAC;EAEF,OAAOjB,OAAO,CAACS,IAAI,CAACF,SAAS,EAAEsB,SAAS,CAAC,CAACE,IAAI,CAC5C/B,OAAO,CAACgC,GAAG,CAAC3B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CAChC;AACH,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAMS,KAAK,GAChBtB,OAA0C,IACDR,KAAK,CAAC+B,aAAa,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE7E;;;;;;;AAOA,OAAO,MAAMwB,WAAW,GAGtBxB,OAA0C,IAE1CR,KAAK,CAAC+B,aAAa,CACjBnC,MAAM,CAACqC,MAAM,CAACzB,OAAO,CAAC,CAACoB,IAAI,CACzB9B,MAAM,CAACoC,OAAO,CAAC5B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
@@ -5,7 +5,7 @@ import type * as Runtime from "effect/Runtime";
5
5
  *
6
6
  * **When to use**
7
7
  *
8
- * Use this function to run an Effect as your application's main program, especially
8
+ * Use to run an Effect as your application's main program, especially
9
9
  * when you need structured error handling, log management, interrupt support,
10
10
  * or advanced teardown capabilities.
11
11
  *
@@ -30,7 +30,7 @@ export declare const runMain: {
30
30
  *
31
31
  * **When to use**
32
32
  *
33
- * Use this function to run an Effect as your application's main program, especially
33
+ * Use to run an Effect as your application's main program, especially
34
34
  * when you need structured error handling, log management, interrupt support,
35
35
  * or advanced teardown capabilities.
36
36
  *
@@ -58,7 +58,7 @@ export declare const runMain: {
58
58
  *
59
59
  * **When to use**
60
60
  *
61
- * Use this function to run an Effect as your application's main program, especially
61
+ * Use to run an Effect as your application's main program, especially
62
62
  * when you need structured error handling, log management, interrupt support,
63
63
  * or advanced teardown capabilities.
64
64
  *
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CACE,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAA;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,CAAC,EAAE,CAAC,EACH,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,IAAI,CAAA;CACc,CAAA"}
1
+ {"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CACE,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAA;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,CAAC,EAAE,CAAC,EACH,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,IAAI,CAAA;CACc,CAAA"}
@@ -1,17 +1,31 @@
1
1
  /**
2
- * Node.js entry-point helpers for running Effect programs.
2
+ * Node.js process runner for starting an Effect program at the application
3
+ * edge.
3
4
  *
4
- * This module exposes `runMain`, the Node runtime launcher used at the edge of
5
- * CLI tools, scripts, servers, and worker processes. It runs an already
6
- * self-contained Effect as the process main program, with built-in error
7
- * reporting and Node signal handling.
5
+ * This module exposes `runMain`, the launcher used by Node CLIs, scripts,
6
+ * servers, and workers when a single Effect should become the process root. It
7
+ * handles runtime error reporting, Node process signals, and teardown so the
8
+ * rest of the program can stay inside Effect.
8
9
  *
9
- * `NodeRuntime` does not provide application services by itself. Provide any
10
- * required layers, such as `NodeServices.layer` or narrower service-specific
11
- * layers, before passing the effect to `runMain`. On `SIGINT` or `SIGTERM`,
12
- * the main fiber is interrupted so scoped resources and finalizers can shut
13
- * down; keep long-running work attached to that scope and avoid finalizers that
14
- * never complete, otherwise process shutdown can be delayed.
10
+ * **Mental model**
11
+ *
12
+ * `runMain` is the last call in `main.ts`: build the effect, provide the layers
13
+ * it needs, then hand the self-contained program to this module. The function
14
+ * does not provide Node services itself; use `NodeServices.layer` or narrower
15
+ * platform layers before launching.
16
+ *
17
+ * **Common tasks**
18
+ *
19
+ * - Run a CLI command or script and let failures become process failures.
20
+ * - Keep a server or worker fiber alive as the process main program.
21
+ * - Override teardown or disable automatic error reporting at the boundary.
22
+ *
23
+ * **Gotchas**
24
+ *
25
+ * `SIGINT` and `SIGTERM` interrupt the main fiber so scoped finalizers can run.
26
+ * Clean success lets the event loop drain naturally, while signal-triggered
27
+ * interruption or a non-zero teardown code exits the process. Keep long-lived
28
+ * resources in Effect scopes and avoid finalizers that never complete.
15
29
  *
16
30
  * @since 4.0.0
17
31
  */
@@ -21,7 +35,7 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
21
35
  *
22
36
  * **When to use**
23
37
  *
24
- * Use this function to run an Effect as your application's main program, especially
38
+ * Use to run an Effect as your application's main program, especially
25
39
  * when you need structured error handling, log management, interrupt support,
26
40
  * or advanced teardown capabilities.
27
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
@@ -1,20 +1,35 @@
1
1
  /**
2
- * Provides the aggregate Node platform services layer for applications that run
3
- * on the Node.js runtime.
4
- *
5
- * This module is useful when an application needs the standard Node-backed
6
- * implementations of filesystem access, path operations, stdio, terminal
7
- * interaction, and child process spawning from a single layer. Provide
8
- * `NodeServices.layer` near the edge of a program to satisfy effects that read
9
- * or write files, resolve paths, interact with stdin/stdout/stderr or a
10
- * terminal, or launch subprocesses.
11
- *
12
- * The layer only supplies the runtime services listed by `NodeServices`; it does
13
- * not provide unrelated platform services such as HTTP clients or servers.
14
- * Libraries should continue to depend on the individual service tags they use,
15
- * while applications, CLIs, and tests can choose this layer or narrower
16
- * service-specific layers depending on how much of the Node runtime they want to
17
- * expose.
2
+ * Standard Node.js service bundle for Effect applications.
3
+ *
4
+ * `NodeServices.layer` provides the Node implementations of the core services
5
+ * most command-line programs and server entrypoints need: child process
6
+ * spawning, cryptography, filesystem access, path operations, stdio, terminal
7
+ * interaction, and related process I/O.
8
+ *
9
+ * **Mental model**
10
+ *
11
+ * Application code should depend on the individual Effect service tags it uses,
12
+ * such as `FileSystem`, `Path`, or `Stdio`. This module is the composition
13
+ * point for a Node runtime: provide the aggregate layer once near the program
14
+ * boundary, and those service requirements are satisfied by Node-backed
15
+ * implementations.
16
+ *
17
+ * **Common tasks**
18
+ *
19
+ * - Install the default Node platform services for a CLI, script, or process
20
+ * entrypoint with {@link layer}
21
+ * - Use narrower modules such as `NodeFileSystem`, `NodePath`, or `NodeStdio`
22
+ * when a test or embedded runtime should expose only one service
23
+ * - Keep libraries platform-independent by requiring service tags instead of
24
+ * importing this module directly
25
+ *
26
+ * **Gotchas**
27
+ *
28
+ * This is not every Node integration in `@effect/platform-node`. HTTP clients,
29
+ * HTTP servers, sockets, workers, Redis, and other specialized integrations
30
+ * still have their own modules and layers. Providing this layer also means
31
+ * effects can reach real process resources such as the filesystem, stdio,
32
+ * terminal handles, and child processes.
18
33
  *
19
34
  * @since 4.0.0
20
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAQtF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAS3C,CAAA"}
1
+ {"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAQtF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAS3C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeCrypto","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"AAsBA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,uBAAuB,MAAM,8BAA8B;AACvE,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAC7C,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAWjD;;;;;;;AAOA,OAAO,MAAMC,KAAK,gBAA8BP,KAAK,CAACQ,YAAY,CAChEP,uBAAuB,CAACM,KAAK,eAC7BP,KAAK,CAACS,QAAQ,CACZN,cAAc,CAACI,KAAK,EACpBL,UAAU,CAACK,KAAK,EAChBH,QAAQ,CAACG,KAAK,EACdF,SAAS,CAACE,KAAK,EACfD,YAAY,CAACC,KAAK,CACnB,CACF","ignoreList":[]}
1
+ {"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeCrypto","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"AAqCA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,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G,SAAS,CAAA;CACxD,GAAG,SAAS,KACV,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAI3C,CAAA"}
@@ -1,20 +1,35 @@
1
1
  /**
2
- * Node platform socket entry point for Effect sockets backed by Node streams
3
- * and WebSocket implementations.
4
- *
5
- * This module re-exports the shared Node socket constructors for TCP clients,
6
- * Unix domain socket clients, and adapters from existing Node `Duplex` streams,
7
- * then adds Node-specific WebSocket constructor layers. Use it when connecting
8
- * to raw socket protocols, wiring RPC transports over TCP or Unix sockets, or
9
- * opening WebSocket clients in Node.
10
- *
11
- * TCP and Unix socket behavior comes from the shared Node layer: Unix sockets
12
- * are selected with `NetConnectOpts.path`, scoped sockets close or destroy the
13
- * underlying stream on finalization, and Node open, read, write, and close
14
- * events are translated into `SocketError` values. For WebSockets,
15
- * `layerWebSocketConstructor` prefers `globalThis.WebSocket` when available
16
- * and falls back to `ws`; use `layerWebSocketConstructorWS` when you need the
17
- * `ws` implementation consistently across Node versions.
2
+ * Node.js socket constructors and layers for Effect sockets.
3
+ *
4
+ * This module combines shared Node stream-backed socket support with
5
+ * Node-specific WebSocket constructor layers. Use it to open TCP clients, Unix
6
+ * domain socket clients, adapt existing Node `Duplex` streams, or provide
7
+ * WebSocket clients to protocols built on Effect's `Socket.Socket`.
8
+ *
9
+ * **Mental model**
10
+ *
11
+ * TCP and Unix sockets come from `node:net` and are exposed as scoped
12
+ * `Socket.Socket` values. Stream open, read, write, and close events are
13
+ * translated to `SocketError` values, and finalization closes or destroys the
14
+ * underlying stream. WebSocket layers provide only the constructor service used
15
+ * by `Socket.makeWebSocket`; `layerWebSocket` combines that constructor with a
16
+ * URL to provide a socket layer.
17
+ *
18
+ * **Common tasks**
19
+ *
20
+ * - Use `makeNet`, `makeNetChannel`, or `layerNet` for TCP connections.
21
+ * - Set `NetConnectOpts.path` for Unix domain sockets.
22
+ * - Use `fromDuplex` when another library already owns a Node `Duplex`.
23
+ * - Use `layerWebSocketConstructor` for the native WebSocket when present, with
24
+ * fallback to `ws`; use `layerWebSocketConstructorWS` to force `ws`.
25
+ *
26
+ * **Gotchas**
27
+ *
28
+ * Socket lifetime is scoped, so release the layer or scope to close the
29
+ * connection. Writes complete when Node accepts or flushes the chunk, not when
30
+ * a peer processes it. Remote `end` events complete the socket run, while
31
+ * abnormal closes, open timeouts, and stream errors surface through
32
+ * `SocketError`; handle them in the Effect that runs the socket.
18
33
  *
19
34
  * @since 4.0.0
20
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocketConstructorWS","succeed","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBA,SAASA,MAAM,IAAIC,EAAE,QAAQ,yCAAyC;AAGtE,SAASC,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,IAAI,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAAC,MAAK;EAC/C,IAAI,WAAW,IAAIC,UAAU,EAAE;IAC7B,OAAO,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIF,UAAU,CAACG,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAC;EACrE;EACA,OAAO,CAACD,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC;AAChG,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAME,2BAA2B,gBAEpCT,KAAK,CAACU,OAAO,CAACT,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACE,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC,CACxF;AAED;;;;;;;;AAQA,OAAO,MAAMI,cAAc,gBAOqBZ,IAAI,CAClDE,MAAM,CAACW,aAAa,eACpBZ,KAAK,CAACa,MAAM,CAACZ,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACc,OAAO,CAACZ,yBAAyB,CAAC,CACzC","ignoreList":[]}
1
+ {"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocketConstructorWS","succeed","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAASA,MAAM,IAAIC,EAAE,QAAQ,yCAAyC;AAGtE,SAASC,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,IAAI,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAAC,MAAK;EAC/C,IAAI,WAAW,IAAIC,UAAU,EAAE;IAC7B,OAAO,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIF,UAAU,CAACG,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAC;EACrE;EACA,OAAO,CAACD,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC;AAChG,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAME,2BAA2B,gBAEpCT,KAAK,CAACU,OAAO,CAACT,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACE,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC,CACxF;AAED;;;;;;;;AAQA,OAAO,MAAMI,cAAc,gBAOqBZ,IAAI,CAClDE,MAAM,CAACW,aAAa,eACpBZ,KAAK,CAACa,MAAM,CAACZ,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACc,OAAO,CAACZ,yBAAyB,CAAC,CACzC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}
1
+ {"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}