@effect/platform-node 4.0.0-beta.7 → 4.0.0-beta.71

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 (123) hide show
  1. package/dist/Mime.d.ts +9 -3
  2. package/dist/Mime.d.ts.map +1 -1
  3. package/dist/Mime.js +9 -3
  4. package/dist/Mime.js.map +1 -1
  5. package/dist/NodeChildProcessSpawner.d.ts +1 -1
  6. package/dist/NodeChildProcessSpawner.js +1 -1
  7. package/dist/NodeClusterHttp.d.ts +49 -7
  8. package/dist/NodeClusterHttp.d.ts.map +1 -1
  9. package/dist/NodeClusterHttp.js +20 -10
  10. package/dist/NodeClusterHttp.js.map +1 -1
  11. package/dist/NodeClusterSocket.d.ts +57 -11
  12. package/dist/NodeClusterSocket.d.ts.map +1 -1
  13. package/dist/NodeClusterSocket.js +57 -11
  14. package/dist/NodeClusterSocket.js.map +1 -1
  15. package/dist/NodeCrypto.d.ts +10 -0
  16. package/dist/NodeCrypto.d.ts.map +1 -0
  17. package/dist/NodeCrypto.js +22 -0
  18. package/dist/NodeCrypto.js.map +1 -0
  19. package/dist/NodeFileSystem.d.ts +4 -2
  20. package/dist/NodeFileSystem.d.ts.map +1 -1
  21. package/dist/NodeFileSystem.js +30 -3
  22. package/dist/NodeFileSystem.js.map +1 -1
  23. package/dist/NodeHttpClient.d.ts +111 -24
  24. package/dist/NodeHttpClient.d.ts.map +1 -1
  25. package/dist/NodeHttpClient.js +133 -28
  26. package/dist/NodeHttpClient.js.map +1 -1
  27. package/dist/NodeHttpIncomingMessage.d.ts +43 -9
  28. package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
  29. package/dist/NodeHttpIncomingMessage.js +47 -8
  30. package/dist/NodeHttpIncomingMessage.js.map +1 -1
  31. package/dist/NodeHttpPlatform.d.ts +10 -4
  32. package/dist/NodeHttpPlatform.d.ts.map +1 -1
  33. package/dist/NodeHttpPlatform.js +34 -7
  34. package/dist/NodeHttpPlatform.js.map +1 -1
  35. package/dist/NodeHttpServer.d.ts +56 -16
  36. package/dist/NodeHttpServer.d.ts.map +1 -1
  37. package/dist/NodeHttpServer.js +117 -49
  38. package/dist/NodeHttpServer.js.map +1 -1
  39. package/dist/NodeHttpServerRequest.d.ts +29 -3
  40. package/dist/NodeHttpServerRequest.d.ts.map +1 -1
  41. package/dist/NodeHttpServerRequest.js +9 -2
  42. package/dist/NodeHttpServerRequest.js.map +1 -1
  43. package/dist/NodeMultipart.d.ts +47 -4
  44. package/dist/NodeMultipart.d.ts.map +1 -1
  45. package/dist/NodeMultipart.js +47 -4
  46. package/dist/NodeMultipart.js.map +1 -1
  47. package/dist/NodePath.d.ts +15 -6
  48. package/dist/NodePath.d.ts.map +1 -1
  49. package/dist/NodePath.js +43 -7
  50. package/dist/NodePath.js.map +1 -1
  51. package/dist/NodeRedis.d.ts +56 -9
  52. package/dist/NodeRedis.d.ts.map +1 -1
  53. package/dist/NodeRedis.js +59 -12
  54. package/dist/NodeRedis.js.map +1 -1
  55. package/dist/NodeRuntime.d.ts +27 -36
  56. package/dist/NodeRuntime.d.ts.map +1 -1
  57. package/dist/NodeRuntime.js +38 -13
  58. package/dist/NodeRuntime.js.map +1 -1
  59. package/dist/NodeServices.d.ts +44 -5
  60. package/dist/NodeServices.d.ts.map +1 -1
  61. package/dist/NodeServices.js +7 -3
  62. package/dist/NodeServices.js.map +1 -1
  63. package/dist/NodeSink.d.ts +2 -2
  64. package/dist/NodeSink.js +2 -2
  65. package/dist/NodeSocket.d.ts +18 -3
  66. package/dist/NodeSocket.d.ts.map +1 -1
  67. package/dist/NodeSocket.js +51 -4
  68. package/dist/NodeSocket.js.map +1 -1
  69. package/dist/NodeSocketServer.d.ts +2 -2
  70. package/dist/NodeSocketServer.js +2 -2
  71. package/dist/NodeStdio.d.ts +5 -2
  72. package/dist/NodeStdio.d.ts.map +1 -1
  73. package/dist/NodeStdio.js +30 -3
  74. package/dist/NodeStdio.js.map +1 -1
  75. package/dist/NodeStream.d.ts +2 -2
  76. package/dist/NodeStream.js +2 -2
  77. package/dist/NodeTerminal.d.ts +8 -2
  78. package/dist/NodeTerminal.d.ts.map +1 -1
  79. package/dist/NodeTerminal.js +29 -3
  80. package/dist/NodeTerminal.js.map +1 -1
  81. package/dist/NodeWorker.d.ts +9 -2
  82. package/dist/NodeWorker.d.ts.map +1 -1
  83. package/dist/NodeWorker.js +45 -6
  84. package/dist/NodeWorker.js.map +1 -1
  85. package/dist/NodeWorkerRunner.d.ts +5 -1
  86. package/dist/NodeWorkerRunner.d.ts.map +1 -1
  87. package/dist/NodeWorkerRunner.js +47 -5
  88. package/dist/NodeWorkerRunner.js.map +1 -1
  89. package/dist/Undici.d.ts +16 -3
  90. package/dist/Undici.d.ts.map +1 -1
  91. package/dist/Undici.js +16 -3
  92. package/dist/Undici.js.map +1 -1
  93. package/dist/index.d.ts +28 -26
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +28 -26
  96. package/dist/index.js.map +1 -1
  97. package/package.json +9 -9
  98. package/src/Mime.ts +10 -3
  99. package/src/NodeChildProcessSpawner.ts +1 -1
  100. package/src/NodeClusterHttp.ts +54 -11
  101. package/src/NodeClusterSocket.ts +57 -11
  102. package/src/NodeCrypto.ts +24 -0
  103. package/src/NodeFileSystem.ts +30 -3
  104. package/src/NodeHttpClient.ts +141 -33
  105. package/src/NodeHttpIncomingMessage.ts +55 -12
  106. package/src/NodeHttpPlatform.ts +35 -6
  107. package/src/NodeHttpServer.ts +139 -53
  108. package/src/NodeHttpServerRequest.ts +29 -3
  109. package/src/NodeMultipart.ts +47 -4
  110. package/src/NodePath.ts +43 -7
  111. package/src/NodeRedis.ts +61 -14
  112. package/src/NodeRuntime.ts +56 -37
  113. package/src/NodeServices.ts +46 -5
  114. package/src/NodeSink.ts +2 -2
  115. package/src/NodeSocket.ts +56 -4
  116. package/src/NodeSocketServer.ts +2 -2
  117. package/src/NodeStdio.ts +30 -3
  118. package/src/NodeStream.ts +2 -2
  119. package/src/NodeTerminal.ts +29 -3
  120. package/src/NodeWorker.ts +45 -6
  121. package/src/NodeWorkerRunner.ts +47 -5
  122. package/src/Undici.ts +16 -3
  123. package/src/index.ts +29 -26
@@ -1,18 +1,27 @@
1
1
  import type * as Layer from "effect/Layer";
2
2
  import type { Path } from "effect/Path";
3
3
  /**
4
- * @since 1.0.0
5
- * @category layer
4
+ * Provides the default Node `Path` service using the platform's `node:path`
5
+ * implementation.
6
+ *
7
+ * @category layers
8
+ * @since 4.0.0
6
9
  */
7
10
  export declare const layer: Layer.Layer<Path>;
8
11
  /**
9
- * @since 1.0.0
10
- * @category layer
12
+ * Provides the `Path` service using Node's POSIX path implementation,
13
+ * regardless of the host platform.
14
+ *
15
+ * @category layers
16
+ * @since 4.0.0
11
17
  */
12
18
  export declare const layerPosix: Layer.Layer<Path>;
13
19
  /**
14
- * @since 1.0.0
15
- * @category layer
20
+ * Provides the `Path` service using Node's Windows path implementation,
21
+ * regardless of the host platform.
22
+ *
23
+ * @category layers
24
+ * @since 4.0.0
16
25
  */
17
26
  export declare const layerWin32: Layer.Layer<Path>;
18
27
  //# sourceMappingURL=NodePath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodePath.d.ts","sourceRoot":"","sources":["../src/NodePath.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAkB,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAuB,CAAA;AAEhE;;;GAGG;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,20 +1,56 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Node.js layers for Effect's `Path` service.
3
+ *
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.
28
+ *
29
+ * @since 4.0.0
3
30
  */
4
31
  import * as NodePath from "@effect/platform-node-shared/NodePath";
5
32
  /**
6
- * @since 1.0.0
7
- * @category layer
33
+ * Provides the default Node `Path` service using the platform's `node:path`
34
+ * implementation.
35
+ *
36
+ * @category layers
37
+ * @since 4.0.0
8
38
  */
9
39
  export const layer = NodePath.layer;
10
40
  /**
11
- * @since 1.0.0
12
- * @category layer
41
+ * Provides the `Path` service using Node's POSIX path implementation,
42
+ * regardless of the host platform.
43
+ *
44
+ * @category layers
45
+ * @since 4.0.0
13
46
  */
14
47
  export const layerPosix = NodePath.layerPosix;
15
48
  /**
16
- * @since 1.0.0
17
- * @category layer
49
+ * Provides the `Path` service using Node's Windows path implementation,
50
+ * regardless of the host platform.
51
+ *
52
+ * @category layers
53
+ * @since 4.0.0
18
54
  */
19
55
  export const layerWin32 = NodePath.layerWin32;
20
56
  //# sourceMappingURL=NodePath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;AAIA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;AAIA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;AAIA,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,30 +1,77 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Node.js Redis integration backed by `ioredis`.
3
+ *
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
38
+ *
39
+ * @since 4.0.0
3
40
  */
4
41
  import * as Config from "effect/Config";
42
+ import * as Context from "effect/Context";
5
43
  import * as Effect from "effect/Effect";
6
44
  import * as Layer from "effect/Layer";
7
- import * as ServiceMap from "effect/ServiceMap";
8
45
  import * as Redis from "effect/unstable/persistence/Redis";
9
46
  import * as IoRedis from "ioredis";
10
- declare const NodeRedis_base: ServiceMap.ServiceClass<NodeRedis, "@effect/platform-node/NodeRedis", {
47
+ declare const NodeRedis_base: Context.ServiceClass<NodeRedis, "@effect/platform-node/NodeRedis", {
11
48
  readonly client: IoRedis.Redis;
12
49
  readonly use: <A>(f: (client: IoRedis.Redis) => Promise<A>) => Effect.Effect<A, Redis.RedisError>;
13
50
  }>;
14
51
  /**
15
- * @since 1.0.0
16
- * @category Service
52
+ * Service tag for the Node Redis integration, exposing the underlying
53
+ * `ioredis` client and a `use` helper that maps client failures to
54
+ * `RedisError`.
55
+ *
56
+ * @category services
57
+ * @since 4.0.0
17
58
  */
18
59
  export declare class NodeRedis extends NodeRedis_base {
19
60
  }
20
61
  /**
21
- * @since 1.0.0
22
- * @category Layers
62
+ * Provides `Redis` and `NodeRedis` services backed by an `ioredis` client
63
+ * created with the supplied options and closed when the layer scope ends.
64
+ *
65
+ * @category layers
66
+ * @since 4.0.0
23
67
  */
24
68
  export declare const layer: (options?: IoRedis.RedisOptions | undefined) => Layer.Layer<Redis.Redis | NodeRedis>;
25
69
  /**
26
- * @since 1.0.0
27
- * @category Layers
70
+ * Provides `Redis` and `NodeRedis` services from `Config`-backed ioredis
71
+ * options, closing the client when the layer scope ends.
72
+ *
73
+ * @category layers
74
+ * @since 4.0.0
28
75
  */
29
76
  export declare const layerConfig: (options: Config.Wrap<IoRedis.RedisOptions>) => Layer.Layer<Redis.Redis | NodeRedis, Config.ConfigError>;
30
77
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;;qBAOf,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;;AANnG;;;GAGG;AACH,qBAAa,SAAU,SAAQ,cAGQ;CAAG;AAiC1C;;;GAGG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,OAAO,CAAC,YAAY,GAAG,SAAS,KACzC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAwC,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,CACxB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,MAAM,CAAC,WAAW,CAOzD,CAAA"}
1
+ {"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;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;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,CACxB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,MAAM,CAAC,WAAW,CAOzD,CAAA"}
package/dist/NodeRedis.js CHANGED
@@ -1,19 +1,60 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Node.js Redis integration backed by `ioredis`.
3
+ *
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
38
+ *
39
+ * @since 4.0.0
3
40
  */
4
41
  import * as Config from "effect/Config";
42
+ import * as Context from "effect/Context";
5
43
  import * as Effect from "effect/Effect";
6
44
  import * as Fn from "effect/Function";
7
45
  import * as Layer from "effect/Layer";
8
46
  import * as Scope from "effect/Scope";
9
- import * as ServiceMap from "effect/ServiceMap";
10
47
  import * as Redis from "effect/unstable/persistence/Redis";
11
48
  import * as IoRedis from "ioredis";
12
49
  /**
13
- * @since 1.0.0
14
- * @category Service
50
+ * Service tag for the Node Redis integration, exposing the underlying
51
+ * `ioredis` client and a `use` helper that maps client failures to
52
+ * `RedisError`.
53
+ *
54
+ * @category services
55
+ * @since 4.0.0
15
56
  */
16
- export class NodeRedis extends /*#__PURE__*/ServiceMap.Service()("@effect/platform-node/NodeRedis") {}
57
+ export class NodeRedis extends /*#__PURE__*/Context.Service()("@effect/platform-node/NodeRedis") {}
17
58
  const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
18
59
  const scope = yield* Effect.scope;
19
60
  yield* Scope.addFinalizer(scope, Effect.promise(() => client.quit()));
@@ -36,16 +77,22 @@ const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
36
77
  client,
37
78
  use
38
79
  });
39
- return ServiceMap.make(NodeRedis, nodeRedis).pipe(ServiceMap.add(Redis.Redis, redis));
80
+ return Context.make(NodeRedis, nodeRedis).pipe(Context.add(Redis.Redis, redis));
40
81
  });
41
82
  /**
42
- * @since 1.0.0
43
- * @category Layers
83
+ * Provides `Redis` and `NodeRedis` services backed by an `ioredis` client
84
+ * created with the supplied options and closed when the layer scope ends.
85
+ *
86
+ * @category layers
87
+ * @since 4.0.0
44
88
  */
45
- export const layer = options => Layer.effectServices(make(options));
89
+ export const layer = options => Layer.effectContext(make(options));
46
90
  /**
47
- * @since 1.0.0
48
- * @category Layers
91
+ * Provides `Redis` and `NodeRedis` services from `Config`-backed ioredis
92
+ * options, closing the client when the layer scope ends.
93
+ *
94
+ * @category layers
95
+ * @since 4.0.0
49
96
  */
50
- export const layerConfig = options => Layer.effectServices(Config.unwrap(options).asEffect().pipe(Effect.flatMap(make)));
97
+ export const layerConfig = options => Layer.effectContext(Config.unwrap(options).pipe(Effect.flatMap(make)));
51
98
  //# sourceMappingURL=NodeRedis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRedis.js","names":["Config","Effect","Fn","Layer","Scope","ServiceMap","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","effectServices","layerConfig","unwrap","asEffect","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,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,UAAU,MAAM,mBAAmB;AAC/C,OAAO,KAAKC,KAAK,MAAM,mCAAmC;AAC1D,OAAO,KAAKC,OAAO,MAAM,SAAS;AAElC;;;;AAIA,OAAM,MAAOC,SAAU,sBAAQH,UAAU,CAACI,OAAO,EAG7C,CAAC,iCAAiC,CAAC;AAEvC,MAAMC,IAAI,gBAAGT,MAAM,CAACU,UAAU,CAAC,WAC7BC,OAA8B;EAE9B,MAAMC,KAAK,GAAG,OAAOZ,MAAM,CAACY,KAAK;EACjC,OAAOT,KAAK,CAACU,YAAY,CAACD,KAAK,EAAEZ,MAAM,CAACc,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,IACtDlB,MAAM,CAACmB,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,KACjE3B,MAAM,CAACmB,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,GAAG5B,EAAE,CAAC6B,QAAQ,CAAuB;IAClDf,MAAM;IACNE;GACD,CAAC;EAEF,OAAOb,UAAU,CAACK,IAAI,CAACF,SAAS,EAAEsB,SAAS,CAAC,CAACE,IAAI,CAC/C3B,UAAU,CAAC4B,GAAG,CAAC3B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CACnC;AACH,CAAC,CAAC;AAEF;;;;AAIA,OAAO,MAAMS,KAAK,GAChBtB,OAA0C,IACDT,KAAK,CAACgC,cAAc,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE9E;;;;AAIA,OAAO,MAAMwB,WAAW,GAGtBxB,OAA0C,IAE1CT,KAAK,CAACgC,cAAc,CAClBnC,MAAM,CAACqC,MAAM,CAACzB,OAAO,CAAC,CAAC0B,QAAQ,EAAE,CAACN,IAAI,CACpC/B,MAAM,CAACsC,OAAO,CAAC7B,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":[]}
@@ -3,6 +3,12 @@ import type * as Runtime from "effect/Runtime";
3
3
  /**
4
4
  * Helps you run a main effect with built-in error handling, logging, and signal management.
5
5
  *
6
+ * **When to use**
7
+ *
8
+ * Use to run an Effect as your application's main program, especially
9
+ * when you need structured error handling, log management, interrupt support,
10
+ * or advanced teardown capabilities.
11
+ *
6
12
  * **Details**
7
13
  *
8
14
  * This function launches an Effect as the main entry point, setting exit codes
@@ -11,26 +17,23 @@ import type * as Runtime from "effect/Runtime";
11
17
  * behaviors can be turned off. You can also provide custom teardown logic to
12
18
  * finalize resources or produce different exit codes.
13
19
  *
14
- * **Options**
15
- *
16
- * An optional object that can include:
20
+ * The optional configuration object can include:
17
21
  * - `disableErrorReporting`: Turn off automatic error logging.
18
- * - `disablePrettyLogger`: Avoid adding the pretty logger.
19
22
  * - `teardown`: Provide custom finalization logic.
20
23
  *
21
- * **When to Use**
22
- *
23
- * Use this function to run an Effect as your application’s main program, especially
24
- * when you need structured error handling, log management, interrupt support,
25
- * or advanced teardown capabilities.
26
- *
27
- * @since 1.0.0
28
- * @category Run main
24
+ * @category running
25
+ * @since 4.0.0
29
26
  */
30
27
  export declare const runMain: {
31
28
  /**
32
29
  * Helps you run a main effect with built-in error handling, logging, and signal management.
33
30
  *
31
+ * **When to use**
32
+ *
33
+ * Use to run an Effect as your application's main program, especially
34
+ * when you need structured error handling, log management, interrupt support,
35
+ * or advanced teardown capabilities.
36
+ *
34
37
  * **Details**
35
38
  *
36
39
  * This function launches an Effect as the main entry point, setting exit codes
@@ -39,21 +42,12 @@ export declare const runMain: {
39
42
  * behaviors can be turned off. You can also provide custom teardown logic to
40
43
  * finalize resources or produce different exit codes.
41
44
  *
42
- * **Options**
43
- *
44
- * An optional object that can include:
45
+ * The optional configuration object can include:
45
46
  * - `disableErrorReporting`: Turn off automatic error logging.
46
- * - `disablePrettyLogger`: Avoid adding the pretty logger.
47
47
  * - `teardown`: Provide custom finalization logic.
48
48
  *
49
- * **When to Use**
50
- *
51
- * Use this function to run an Effect as your application’s main program, especially
52
- * when you need structured error handling, log management, interrupt support,
53
- * or advanced teardown capabilities.
54
- *
55
- * @since 1.0.0
56
- * @category Run main
49
+ * @category running
50
+ * @since 4.0.0
57
51
  */
58
52
  (options?: {
59
53
  readonly disableErrorReporting?: boolean | undefined;
@@ -62,6 +56,12 @@ export declare const runMain: {
62
56
  /**
63
57
  * Helps you run a main effect with built-in error handling, logging, and signal management.
64
58
  *
59
+ * **When to use**
60
+ *
61
+ * Use to run an Effect as your application's main program, especially
62
+ * when you need structured error handling, log management, interrupt support,
63
+ * or advanced teardown capabilities.
64
+ *
65
65
  * **Details**
66
66
  *
67
67
  * This function launches an Effect as the main entry point, setting exit codes
@@ -70,21 +70,12 @@ export declare const runMain: {
70
70
  * behaviors can be turned off. You can also provide custom teardown logic to
71
71
  * finalize resources or produce different exit codes.
72
72
  *
73
- * **Options**
74
- *
75
- * An optional object that can include:
73
+ * The optional configuration object can include:
76
74
  * - `disableErrorReporting`: Turn off automatic error logging.
77
- * - `disablePrettyLogger`: Avoid adding the pretty logger.
78
75
  * - `teardown`: Provide custom finalization logic.
79
76
  *
80
- * **When to Use**
81
- *
82
- * Use this function to run an Effect as your application’s main program, especially
83
- * when you need structured error handling, log management, interrupt support,
84
- * or advanced teardown capabilities.
85
- *
86
- * @since 1.0.0
87
- * @category Run main
77
+ * @category running
78
+ * @since 4.0.0
88
79
  */
89
80
  <E, A>(effect: Effect<A, E>, options?: {
90
81
  readonly disableErrorReporting?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;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;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;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,10 +1,44 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Node.js process runner for starting an Effect program at the application
3
+ * edge.
4
+ *
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.
9
+ *
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.
29
+ *
30
+ * @since 4.0.0
3
31
  */
4
32
  import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
5
33
  /**
6
34
  * Helps you run a main effect with built-in error handling, logging, and signal management.
7
35
  *
36
+ * **When to use**
37
+ *
38
+ * Use to run an Effect as your application's main program, especially
39
+ * when you need structured error handling, log management, interrupt support,
40
+ * or advanced teardown capabilities.
41
+ *
8
42
  * **Details**
9
43
  *
10
44
  * This function launches an Effect as the main entry point, setting exit codes
@@ -13,21 +47,12 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
13
47
  * behaviors can be turned off. You can also provide custom teardown logic to
14
48
  * finalize resources or produce different exit codes.
15
49
  *
16
- * **Options**
17
- *
18
- * An optional object that can include:
50
+ * The optional configuration object can include:
19
51
  * - `disableErrorReporting`: Turn off automatic error logging.
20
- * - `disablePrettyLogger`: Avoid adding the pretty logger.
21
52
  * - `teardown`: Provide custom finalization logic.
22
53
  *
23
- * **When to Use**
24
- *
25
- * Use this function to run an Effect as your application’s main program, especially
26
- * when you need structured error handling, log management, interrupt support,
27
- * or advanced teardown capabilities.
28
- *
29
- * @since 1.0.0
30
- * @category Run main
54
+ * @category running
55
+ * @since 4.0.0
31
56
  */
32
57
  export const runMain = NodeRuntime.runMain;
33
58
  //# sourceMappingURL=NodeRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,MAAMC,OAAO,GAoEhBD,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,6 +1,39 @@
1
1
  /**
2
- * @since 1.0.0
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.
33
+ *
34
+ * @since 4.0.0
3
35
  */
36
+ import type { Crypto } from "effect/Crypto";
4
37
  import type { FileSystem } from "effect/FileSystem";
5
38
  import * as Layer from "effect/Layer";
6
39
  import type { Path } from "effect/Path";
@@ -8,13 +41,19 @@ import type { Stdio } from "effect/Stdio";
8
41
  import type { Terminal } from "effect/Terminal";
9
42
  import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
10
43
  /**
11
- * @since 1.0.0
44
+ * The union of core services provided by the Node platform layer, including
45
+ * child process spawning, filesystem, path, stdio, and terminal services.
46
+ *
12
47
  * @category models
48
+ * @since 4.0.0
13
49
  */
14
- export type NodeServices = ChildProcessSpawner | FileSystem | Path | Stdio | Terminal;
50
+ export type NodeServices = ChildProcessSpawner | Crypto | FileSystem | Path | Stdio | Terminal;
15
51
  /**
16
- * @since 1.0.0
17
- * @category layer
52
+ * Provides the default Node implementations for child process spawning,
53
+ * filesystem, path, stdio, and terminal services.
54
+ *
55
+ * @category layers
56
+ * @since 4.0.0
18
57
  */
19
58
  export declare const layer: Layer.Layer<NodeServices>;
20
59
  //# sourceMappingURL=NodeServices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,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;AAOtF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;AAErF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAQ3C,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,12 +1,16 @@
1
1
  import * as Layer from "effect/Layer";
2
2
  import * as NodeChildProcessSpawner from "./NodeChildProcessSpawner.js";
3
+ import * as NodeCrypto from "./NodeCrypto.js";
3
4
  import * as NodeFileSystem from "./NodeFileSystem.js";
4
5
  import * as NodePath from "./NodePath.js";
5
6
  import * as NodeStdio from "./NodeStdio.js";
6
7
  import * as NodeTerminal from "./NodeTerminal.js";
7
8
  /**
8
- * @since 1.0.0
9
- * @category layer
9
+ * Provides the default Node implementations for child process spawning,
10
+ * filesystem, path, stdio, and terminal services.
11
+ *
12
+ * @category layers
13
+ * @since 4.0.0
10
14
  */
11
- export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
15
+ export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodeCrypto.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
12
16
  //# sourceMappingURL=NodeServices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,uBAAuB,MAAM,8BAA8B;AACvE,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAQjD;;;;AAIA,OAAO,MAAMC,KAAK,gBAA8BN,KAAK,CAACO,YAAY,CAChEN,uBAAuB,CAACK,KAAK,eAC7BN,KAAK,CAACQ,QAAQ,CACZN,cAAc,CAACI,KAAK,EACpBH,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,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,8 +1,8 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  /**
5
- * @since 1.0.0
5
+ * @since 4.0.0
6
6
  */
7
7
  export * from "@effect/platform-node-shared/NodeSink";
8
8
  //# sourceMappingURL=NodeSink.d.ts.map
package/dist/NodeSink.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  /**
5
- * @since 1.0.0
5
+ * @since 4.0.0
6
6
  */
7
7
  export * from "@effect/platform-node-shared/NodeSink";
8
8
  //# sourceMappingURL=NodeSink.js.map