@effect/platform-bun 4.0.0-beta.9 → 4.0.0-beta.91

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 (108) hide show
  1. package/dist/BunChildProcessSpawner.d.ts +1 -1
  2. package/dist/BunChildProcessSpawner.js +1 -1
  3. package/dist/BunClusterHttp.d.ts +44 -7
  4. package/dist/BunClusterHttp.d.ts.map +1 -1
  5. package/dist/BunClusterHttp.js +41 -10
  6. package/dist/BunClusterHttp.js.map +1 -1
  7. package/dist/BunClusterSocket.d.ts +27 -9
  8. package/dist/BunClusterSocket.d.ts.map +1 -1
  9. package/dist/BunClusterSocket.js +27 -9
  10. package/dist/BunClusterSocket.js.map +1 -1
  11. package/dist/BunCrypto.d.ts +10 -0
  12. package/dist/BunCrypto.d.ts.map +1 -0
  13. package/dist/BunCrypto.js +22 -0
  14. package/dist/BunCrypto.js.map +1 -0
  15. package/dist/BunFileSystem.d.ts +4 -2
  16. package/dist/BunFileSystem.d.ts.map +1 -1
  17. package/dist/BunFileSystem.js +11 -3
  18. package/dist/BunFileSystem.js.map +1 -1
  19. package/dist/BunHttpClient.d.ts +2 -2
  20. package/dist/BunHttpClient.js +2 -2
  21. package/dist/BunHttpPlatform.d.ts +4 -2
  22. package/dist/BunHttpPlatform.d.ts.map +1 -1
  23. package/dist/BunHttpPlatform.js +5 -3
  24. package/dist/BunHttpPlatform.js.map +1 -1
  25. package/dist/BunHttpServer.d.ts +57 -20
  26. package/dist/BunHttpServer.d.ts.map +1 -1
  27. package/dist/BunHttpServer.js +63 -36
  28. package/dist/BunHttpServer.js.map +1 -1
  29. package/dist/BunHttpServerRequest.d.ts +11 -3
  30. package/dist/BunHttpServerRequest.d.ts.map +1 -1
  31. package/dist/BunHttpServerRequest.js +4 -2
  32. package/dist/BunHttpServerRequest.js.map +1 -1
  33. package/dist/BunMultipart.d.ts +16 -5
  34. package/dist/BunMultipart.d.ts.map +1 -1
  35. package/dist/BunMultipart.js +15 -5
  36. package/dist/BunMultipart.js.map +1 -1
  37. package/dist/BunPath.d.ts +12 -6
  38. package/dist/BunPath.d.ts.map +1 -1
  39. package/dist/BunPath.js +20 -7
  40. package/dist/BunPath.js.map +1 -1
  41. package/dist/BunRedis.d.ts +23 -9
  42. package/dist/BunRedis.d.ts.map +1 -1
  43. package/dist/BunRedis.js +26 -12
  44. package/dist/BunRedis.js.map +1 -1
  45. package/dist/BunRuntime.d.ts +21 -30
  46. package/dist/BunRuntime.d.ts.map +1 -1
  47. package/dist/BunRuntime.js +14 -11
  48. package/dist/BunRuntime.js.map +1 -1
  49. package/dist/BunServices.d.ts +19 -5
  50. package/dist/BunServices.d.ts.map +1 -1
  51. package/dist/BunServices.js +7 -3
  52. package/dist/BunServices.js.map +1 -1
  53. package/dist/BunSink.d.ts +2 -2
  54. package/dist/BunSink.js +2 -2
  55. package/dist/BunSocket.d.ts +18 -4
  56. package/dist/BunSocket.d.ts.map +1 -1
  57. package/dist/BunSocket.js +10 -3
  58. package/dist/BunSocket.js.map +1 -1
  59. package/dist/BunSocketServer.d.ts +2 -2
  60. package/dist/BunSocketServer.js +2 -2
  61. package/dist/BunStdio.d.ts +5 -2
  62. package/dist/BunStdio.d.ts.map +1 -1
  63. package/dist/BunStdio.js +13 -3
  64. package/dist/BunStdio.js.map +1 -1
  65. package/dist/BunStream.d.ts +5 -4
  66. package/dist/BunStream.d.ts.map +1 -1
  67. package/dist/BunStream.js +14 -5
  68. package/dist/BunStream.js.map +1 -1
  69. package/dist/BunTerminal.d.ts +8 -2
  70. package/dist/BunTerminal.d.ts.map +1 -1
  71. package/dist/BunTerminal.js +15 -3
  72. package/dist/BunTerminal.js.map +1 -1
  73. package/dist/BunWorker.d.ts +9 -2
  74. package/dist/BunWorker.d.ts.map +1 -1
  75. package/dist/BunWorker.js +20 -4
  76. package/dist/BunWorker.js.map +1 -1
  77. package/dist/BunWorkerRunner.d.ts +5 -1
  78. package/dist/BunWorkerRunner.d.ts.map +1 -1
  79. package/dist/BunWorkerRunner.js +17 -5
  80. package/dist/BunWorkerRunner.js.map +1 -1
  81. package/dist/index.d.ts +25 -23
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +25 -23
  84. package/dist/index.js.map +1 -1
  85. package/package.json +5 -5
  86. package/src/BunChildProcessSpawner.ts +1 -1
  87. package/src/BunClusterHttp.ts +49 -11
  88. package/src/BunClusterSocket.ts +27 -9
  89. package/src/BunCrypto.ts +24 -0
  90. package/src/BunFileSystem.ts +11 -3
  91. package/src/BunHttpClient.ts +2 -2
  92. package/src/BunHttpPlatform.ts +14 -4
  93. package/src/BunHttpServer.ts +108 -57
  94. package/src/BunHttpServerRequest.ts +11 -3
  95. package/src/BunMultipart.ts +24 -6
  96. package/src/BunPath.ts +20 -7
  97. package/src/BunRedis.ts +28 -14
  98. package/src/BunRuntime.ts +28 -31
  99. package/src/BunServices.ts +21 -5
  100. package/src/BunSink.ts +2 -2
  101. package/src/BunSocket.ts +18 -4
  102. package/src/BunSocketServer.ts +2 -2
  103. package/src/BunStdio.ts +13 -3
  104. package/src/BunStream.ts +14 -5
  105. package/src/BunTerminal.ts +15 -3
  106. package/src/BunWorker.ts +20 -4
  107. package/src/BunWorkerRunner.ts +17 -5
  108. package/src/index.ts +26 -23
package/dist/BunPath.js CHANGED
@@ -1,20 +1,33 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun-backed layers for Effect's {@link Path} service.
3
+ *
4
+ * This module provides the `Path` service for Bun programs by reusing the
5
+ * shared Node-compatible path implementation. Provide one of these layers when
6
+ * Bun code should receive path operations from the Effect environment instead
7
+ * of importing runtime path helpers directly.
8
+ *
9
+ * @since 4.0.0
3
10
  */
4
11
  import * as NodePath from "@effect/platform-node-shared/NodePath";
5
12
  /**
6
- * @since 1.0.0
7
- * @category layer
13
+ * Layer that provides the default `Path` service for Bun using the shared Node path implementation.
14
+ *
15
+ * @category layers
16
+ * @since 4.0.0
8
17
  */
9
18
  export const layer = NodePath.layer;
10
19
  /**
11
- * @since 1.0.0
12
- * @category layer
20
+ * Layer that provides the POSIX `Path` service for Bun using the shared Node path implementation.
21
+ *
22
+ * @category layers
23
+ * @since 4.0.0
13
24
  */
14
25
  export const layerPosix = NodePath.layerPosix;
15
26
  /**
16
- * @since 1.0.0
17
- * @category layer
27
+ * Layer that provides the Win32 `Path` service for Bun using the shared Node path implementation.
28
+ *
29
+ * @category layers
30
+ * @since 4.0.0
18
31
  */
19
32
  export const layerWin32 = NodePath.layerWin32;
20
33
  //# sourceMappingURL=BunPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunPath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/BunPath.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":"BunPath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/BunPath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;;;AAMA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;;;AAMA,OAAO,MAAMC,UAAU,GAAsBH,QAAQ,CAACG,UAAU","ignoreList":[]}
@@ -1,32 +1,46 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun Redis integration backed by Bun's built-in `RedisClient`.
3
+ *
4
+ * This module creates scoped Bun `RedisClient` connections and exposes them as
5
+ * both the portable `Redis` service and the Bun-specific `BunRedis` service for
6
+ * direct access to the raw client. The `layer` helper accepts Redis options
7
+ * directly, while `layerConfig` reads them from Effect config. Both close the
8
+ * underlying client when the layer scope finalizes.
9
+ *
10
+ * @since 4.0.0
3
11
  */
4
12
  import { RedisClient, type RedisOptions } from "bun";
5
13
  import * as Config from "effect/Config";
14
+ import * as Context from "effect/Context";
6
15
  import * as Effect from "effect/Effect";
7
16
  import * as Layer from "effect/Layer";
8
- import * as ServiceMap from "effect/ServiceMap";
9
17
  import * as Redis from "effect/unstable/persistence/Redis";
10
- declare const BunRedis_base: ServiceMap.ServiceClass<BunRedis, "@effect/platform-bun/BunRedis", {
18
+ declare const BunRedis_base: Context.ServiceClass<BunRedis, "@effect/platform-bun/BunRedis", {
11
19
  readonly client: RedisClient;
12
20
  readonly use: <A>(f: (client: RedisClient) => Promise<A>) => Effect.Effect<A, Redis.RedisError>;
13
21
  }>;
14
22
  /**
15
- * @since 1.0.0
16
- * @category Service
23
+ * Service tag for Bun Redis integration, exposing the raw `RedisClient` and a `use` helper that maps client promise failures to `RedisError`.
24
+ *
25
+ * @category services
26
+ * @since 4.0.0
17
27
  */
18
28
  export declare class BunRedis extends BunRedis_base {
19
29
  }
20
30
  /**
21
- * @since 1.0.0
22
- * @category Layers
31
+ * Creates scoped Bun Redis layers for `Redis.Redis` and `BunRedis`, closing the underlying client when the scope finalizes.
32
+ *
33
+ * @category layers
34
+ * @since 4.0.0
23
35
  */
24
36
  export declare const layer: (options?: ({
25
37
  readonly url?: string;
26
38
  } & RedisOptions) | undefined) => Layer.Layer<Redis.Redis | BunRedis>;
27
39
  /**
28
- * @since 1.0.0
29
- * @category Layers
40
+ * Creates scoped Bun Redis layers from configurable Redis options, closing the underlying client when the scope finalizes.
41
+ *
42
+ * @category layers
43
+ * @since 4.0.0
30
44
  */
31
45
  export declare const layerConfig: (options: Config.Wrap<{
32
46
  readonly url?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"BunRedis.d.ts","sourceRoot":"","sources":["../src/BunRedis.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AACpD,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;;qBAOvC,WAAW;kBACd,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;;AANjG;;;GAGG;AACH,qBAAa,QAAS,SAAQ,aAGO;CAAG;AAmCxC;;;GAGG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,CAAC;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GAAG,SAAS,KAC/D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAwC,CAAA;AAE7E;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,CAAC,IAAI,CAAC;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,KAC7D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,EAAE,MAAM,CAAC,WAAW,CAKtD,CAAA"}
1
+ {"version":3,"file":"BunRedis.d.ts","sourceRoot":"","sources":["../src/BunRedis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AACpD,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;;qBASvC,WAAW;kBACd,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;;AARjG;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,aAGO;CAAG;AAmCxC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,UAAU,CAAC;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,GAAG,SAAS,KAC/D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAuC,CAAA;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,CAAC,IAAI,CAAC;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAAC,KAC7D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,EAAE,MAAM,CAAC,WAAW,CAKtD,CAAA"}
package/dist/BunRedis.js CHANGED
@@ -1,19 +1,29 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun Redis integration backed by Bun's built-in `RedisClient`.
3
+ *
4
+ * This module creates scoped Bun `RedisClient` connections and exposes them as
5
+ * both the portable `Redis` service and the Bun-specific `BunRedis` service for
6
+ * direct access to the raw client. The `layer` helper accepts Redis options
7
+ * directly, while `layerConfig` reads them from Effect config. Both close the
8
+ * underlying client when the layer scope finalizes.
9
+ *
10
+ * @since 4.0.0
3
11
  */
4
12
  import { RedisClient } from "bun";
5
13
  import * as Config from "effect/Config";
14
+ import * as Context from "effect/Context";
6
15
  import * as Effect from "effect/Effect";
7
16
  import * as Fn from "effect/Function";
8
17
  import * as Layer from "effect/Layer";
9
18
  import * as Scope from "effect/Scope";
10
- import * as ServiceMap from "effect/ServiceMap";
11
19
  import * as Redis from "effect/unstable/persistence/Redis";
12
20
  /**
13
- * @since 1.0.0
14
- * @category Service
21
+ * Service tag for Bun Redis integration, exposing the raw `RedisClient` and a `use` helper that maps client promise failures to `RedisError`.
22
+ *
23
+ * @category services
24
+ * @since 4.0.0
15
25
  */
16
- export class BunRedis extends /*#__PURE__*/ServiceMap.Service()("@effect/platform-bun/BunRedis") {}
26
+ export class BunRedis extends /*#__PURE__*/Context.Service()("@effect/platform-bun/BunRedis") {}
17
27
  const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
18
28
  const scope = yield* Effect.scope;
19
29
  yield* Scope.addFinalizer(scope, Effect.sync(() => client.close()));
@@ -36,16 +46,20 @@ const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
36
46
  client,
37
47
  use
38
48
  });
39
- return ServiceMap.make(BunRedis, bunRedis).pipe(ServiceMap.add(Redis.Redis, redis));
49
+ return Context.make(BunRedis, bunRedis).pipe(Context.add(Redis.Redis, redis));
40
50
  });
41
51
  /**
42
- * @since 1.0.0
43
- * @category Layers
52
+ * Creates scoped Bun Redis layers for `Redis.Redis` and `BunRedis`, closing the underlying client when the scope finalizes.
53
+ *
54
+ * @category layers
55
+ * @since 4.0.0
44
56
  */
45
- export const layer = options => Layer.effectServices(make(options));
57
+ export const layer = options => Layer.effectContext(make(options));
46
58
  /**
47
- * @since 1.0.0
48
- * @category Layers
59
+ * Creates scoped Bun Redis layers from configurable Redis options, closing the underlying client when the scope finalizes.
60
+ *
61
+ * @category layers
62
+ * @since 4.0.0
49
63
  */
50
- export const layerConfig = options => Layer.effectServices(Config.unwrap(options).asEffect().pipe(Effect.flatMap(make)));
64
+ export const layerConfig = options => Layer.effectContext(Config.unwrap(options).pipe(Effect.flatMap(make)));
51
65
  //# sourceMappingURL=BunRedis.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunRedis.js","names":["RedisClient","Config","Effect","Fn","Layer","Scope","ServiceMap","Redis","BunRedis","Service","make","fnUntraced","options","scope","addFinalizer","sync","client","close","url","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","bunRedis","identity","pipe","add","layer","effectServices","layerConfig","unwrap","asEffect","flatMap"],"sources":["../src/BunRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,WAAW,QAA2B,KAAK;AACpD,OAAO,KAAKC,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;AAE1D;;;;AAIA,OAAM,MAAOC,QAAS,sBAAQF,UAAU,CAACG,OAAO,EAG5C,CAAC,+BAA+B,CAAC;AAErC,MAAMC,IAAI,gBAAGR,MAAM,CAACS,UAAU,CAAC,WAC7BC,OAEgB;EAEhB,MAAMC,KAAK,GAAG,OAAOX,MAAM,CAACW,KAAK;EACjC,OAAOR,KAAK,CAACS,YAAY,CAACD,KAAK,EAAEX,MAAM,CAACa,IAAI,CAAC,MAAMC,MAAM,CAACC,KAAK,EAAE,CAAC,CAAC;EACnE,MAAMD,MAAM,GAAG,IAAIhB,WAAW,CAACY,OAAO,EAAEM,GAAG,EAAEN,OAAO,CAAC;EAErD,MAAMO,GAAG,GAAOC,CAAsC,IACpDlB,MAAM,CAACmB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMF,CAAC,CAACJ,MAAM,CAAC;IACpBO,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;MAAED;IAAK,CAAE;GACjD,CAAC;EAEJ,MAAME,KAAK,GAAG,OAAOnB,KAAK,CAACG,IAAI,CAAC;IAC9BiB,IAAI,EAAEA,CAAcC,OAAe,EAAE,GAAGC,IAA2B,KACjE3B,MAAM,CAACmB,UAAU,CAAC;MAChBC,GAAG,EAAEA,CAAA,KAAMN,MAAM,CAACW,IAAI,CAACC,OAAO,EAAEC,IAAqB,CAAe;MACpEN,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;QAAED;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMM,QAAQ,GAAG3B,EAAE,CAAC4B,QAAQ,CAAsB;IAChDf,MAAM;IACNG;GACD,CAAC;EAEF,OAAOb,UAAU,CAACI,IAAI,CAACF,QAAQ,EAAEsB,QAAQ,CAAC,CAACE,IAAI,CAC7C1B,UAAU,CAAC2B,GAAG,CAAC1B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CACnC;AACH,CAAC,CAAC;AAEF;;;;AAIA,OAAO,MAAMQ,KAAK,GAChBtB,OAAgE,IACxBR,KAAK,CAAC+B,cAAc,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE7E;;;;AAIA,OAAO,MAAMwB,WAAW,GACtBxB,OAA8D,IAE9DR,KAAK,CAAC+B,cAAc,CAClBlC,MAAM,CAACoC,MAAM,CAACzB,OAAO,CAAC,CAAC0B,QAAQ,EAAE,CAACN,IAAI,CACpC9B,MAAM,CAACqC,OAAO,CAAC7B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
1
+ {"version":3,"file":"BunRedis.js","names":["RedisClient","Config","Context","Effect","Fn","Layer","Scope","Redis","BunRedis","Service","make","fnUntraced","options","scope","addFinalizer","sync","client","close","url","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","bunRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/BunRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,WAAW,QAA2B,KAAK;AACpD,OAAO,KAAKC,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;AAE1D;;;;;;AAMA,OAAM,MAAOC,QAAS,sBAAQN,OAAO,CAACO,OAAO,EAGzC,CAAC,+BAA+B,CAAC;AAErC,MAAMC,IAAI,gBAAGP,MAAM,CAACQ,UAAU,CAAC,WAC7BC,OAEgB;EAEhB,MAAMC,KAAK,GAAG,OAAOV,MAAM,CAACU,KAAK;EACjC,OAAOP,KAAK,CAACQ,YAAY,CAACD,KAAK,EAAEV,MAAM,CAACY,IAAI,CAAC,MAAMC,MAAM,CAACC,KAAK,EAAE,CAAC,CAAC;EACnE,MAAMD,MAAM,GAAG,IAAIhB,WAAW,CAACY,OAAO,EAAEM,GAAG,EAAEN,OAAO,CAAC;EAErD,MAAMO,GAAG,GAAOC,CAAsC,IACpDjB,MAAM,CAACkB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMF,CAAC,CAACJ,MAAM,CAAC;IACpBO,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;MAAED;IAAK,CAAE;GACjD,CAAC;EAEJ,MAAME,KAAK,GAAG,OAAOnB,KAAK,CAACG,IAAI,CAAC;IAC9BiB,IAAI,EAAEA,CAAcC,OAAe,EAAE,GAAGC,IAA2B,KACjE1B,MAAM,CAACkB,UAAU,CAAC;MAChBC,GAAG,EAAEA,CAAA,KAAMN,MAAM,CAACW,IAAI,CAACC,OAAO,EAAEC,IAAqB,CAAe;MACpEN,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;QAAED;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMM,QAAQ,GAAG1B,EAAE,CAAC2B,QAAQ,CAAsB;IAChDf,MAAM;IACNG;GACD,CAAC;EAEF,OAAOjB,OAAO,CAACQ,IAAI,CAACF,QAAQ,EAAEsB,QAAQ,CAAC,CAACE,IAAI,CAC1C9B,OAAO,CAAC+B,GAAG,CAAC1B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CAChC;AACH,CAAC,CAAC;AAEF;;;;;;AAMA,OAAO,MAAMQ,KAAK,GAChBtB,OAAgE,IACxBP,KAAK,CAAC8B,aAAa,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE5E;;;;;;AAMA,OAAO,MAAMwB,WAAW,GACtBxB,OAA8D,IAE9DP,KAAK,CAAC8B,aAAa,CACjBlC,MAAM,CAACoC,MAAM,CAACzB,OAAO,CAAC,CAACoB,IAAI,CACzB7B,MAAM,CAACmC,OAAO,CAAC5B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
@@ -3,6 +3,11 @@ import type { Teardown } 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 a Bun application's main Effect with structured error handling,
9
+ * log management, interrupt support, or advanced teardown capabilities.
10
+ *
6
11
  * **Details**
7
12
  *
8
13
  * This function launches an Effect as the main entry point, setting exit codes
@@ -11,26 +16,23 @@ import type { Teardown } from "effect/Runtime";
11
16
  * behaviors can be turned off. You can also provide custom teardown logic to
12
17
  * finalize resources or produce different exit codes.
13
18
  *
14
- * **Options**
15
- *
16
19
  * An optional object that can include:
17
20
  * - `disableErrorReporting`: Turn off automatic error logging.
18
21
  * - `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 a Bun application's main Effect with structured error handling,
34
+ * log management, interrupt support, or advanced teardown capabilities.
35
+ *
34
36
  * **Details**
35
37
  *
36
38
  * This function launches an Effect as the main entry point, setting exit codes
@@ -39,21 +41,13 @@ export declare const runMain: {
39
41
  * behaviors can be turned off. You can also provide custom teardown logic to
40
42
  * finalize resources or produce different exit codes.
41
43
  *
42
- * **Options**
43
- *
44
44
  * An optional object that can include:
45
45
  * - `disableErrorReporting`: Turn off automatic error logging.
46
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,11 @@ 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 a Bun application's main Effect with structured error handling,
62
+ * log management, interrupt support, or advanced teardown capabilities.
63
+ *
65
64
  * **Details**
66
65
  *
67
66
  * This function launches an Effect as the main entry point, setting exit codes
@@ -70,21 +69,13 @@ export declare const runMain: {
70
69
  * behaviors can be turned off. You can also provide custom teardown logic to
71
70
  * finalize resources or produce different exit codes.
72
71
  *
73
- * **Options**
74
- *
75
72
  * An optional object that can include:
76
73
  * - `disableErrorReporting`: Turn off automatic error logging.
77
74
  * - `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":"BunRuntime.d.ts","sourceRoot":"","sources":["../src/BunRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,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,QAAQ,GAAG,SAAS,CAAA;KACzC,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,QAAQ,GAAG,SAAS,CAAA;KACzC,GACA,IAAI,CAAA;CACc,CAAA"}
1
+ {"version":3,"file":"BunRuntime.d.ts","sourceRoot":"","sources":["../src/BunRuntime.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,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,QAAQ,GAAG,SAAS,CAAA;KACzC,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,QAAQ,GAAG,SAAS,CAAA;KACzC,GACA,IAAI,CAAA;CACc,CAAA"}
@@ -1,10 +1,21 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun process runner for Effect programs.
3
+ *
4
+ * This module exports `runMain`, which runs one Effect as the main process
5
+ * fiber in Bun. It reuses the shared Node runtime runner, including its error
6
+ * reporting, signal handling, and optional teardown behavior.
7
+ *
8
+ * @since 4.0.0
3
9
  */
4
10
  import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
5
11
  /**
6
12
  * Helps you run a main effect with built-in error handling, logging, and signal management.
7
13
  *
14
+ * **When to use**
15
+ *
16
+ * Use to run a Bun application's main Effect with structured error handling,
17
+ * log management, interrupt support, or advanced teardown capabilities.
18
+ *
8
19
  * **Details**
9
20
  *
10
21
  * This function launches an Effect as the main entry point, setting exit codes
@@ -13,21 +24,13 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
13
24
  * behaviors can be turned off. You can also provide custom teardown logic to
14
25
  * finalize resources or produce different exit codes.
15
26
  *
16
- * **Options**
17
- *
18
27
  * An optional object that can include:
19
28
  * - `disableErrorReporting`: Turn off automatic error logging.
20
29
  * - `disablePrettyLogger`: Avoid adding the pretty logger.
21
30
  * - `teardown`: Provide custom finalization logic.
22
31
  *
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
32
+ * @category running
33
+ * @since 4.0.0
31
34
  */
32
35
  export const runMain = NodeRuntime.runMain;
33
36
  //# sourceMappingURL=BunRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/BunRuntime.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":"BunRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/BunRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
@@ -1,6 +1,14 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Aggregate Bun platform services layer.
3
+ *
4
+ * This module defines the `BunServices` union and a single `layer` that
5
+ * provides Bun-backed child process spawning, crypto, filesystem, path, stdio,
6
+ * and terminal services. Use the layer when a Bun program wants the standard
7
+ * platform services from one place.
8
+ *
9
+ * @since 4.0.0
3
10
  */
11
+ import type { Crypto } from "effect/Crypto";
4
12
  import type { FileSystem } from "effect/FileSystem";
5
13
  import * as Layer from "effect/Layer";
6
14
  import type { Path } from "effect/Path";
@@ -8,13 +16,19 @@ import type { Stdio } from "effect/Stdio";
8
16
  import type { Terminal } from "effect/Terminal";
9
17
  import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
10
18
  /**
11
- * @since 1.0.0
19
+ * The union of core services provided by the Bun platform layer, including child
20
+ * process spawning, filesystem, path, stdio, and terminal services.
21
+ *
12
22
  * @category models
23
+ * @since 4.0.0
13
24
  */
14
- export type BunServices = ChildProcessSpawner | FileSystem | Path | Terminal | Stdio;
25
+ export type BunServices = ChildProcessSpawner | Crypto | FileSystem | Path | Terminal | Stdio;
15
26
  /**
16
- * @since 1.0.0
17
- * @category layer
27
+ * Provides the default Bun implementations for child process spawning,
28
+ * filesystem, path, stdio, and terminal services.
29
+ *
30
+ * @category layers
31
+ * @since 4.0.0
18
32
  */
19
33
  export declare const layer: Layer.Layer<BunServices>;
20
34
  //# sourceMappingURL=BunServices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunServices.d.ts","sourceRoot":"","sources":["../src/BunServices.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,WAAW,GAAG,mBAAmB,GAAG,UAAU,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEpF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAO1C,CAAA"}
1
+ {"version":3,"file":"BunServices.d.ts","sourceRoot":"","sources":["../src/BunServices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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,WAAW,GAAG,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAQ1C,CAAA"}
@@ -1,12 +1,16 @@
1
1
  import * as Layer from "effect/Layer";
2
2
  import * as BunChildProcessSpawner from "./BunChildProcessSpawner.js";
3
+ import * as BunCrypto from "./BunCrypto.js";
3
4
  import * as BunFileSystem from "./BunFileSystem.js";
4
5
  import * as BunPath from "./BunPath.js";
5
6
  import * as BunStdio from "./BunStdio.js";
6
7
  import * as BunTerminal from "./BunTerminal.js";
7
8
  /**
8
- * @since 1.0.0
9
- * @category layer
9
+ * Provides the default Bun 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__*/BunChildProcessSpawner.layer.pipe(/*#__PURE__*/Layer.provideMerge(/*#__PURE__*/Layer.mergeAll(BunFileSystem.layer, BunPath.layer, BunStdio.layer, BunTerminal.layer)));
15
+ export const layer = /*#__PURE__*/BunChildProcessSpawner.layer.pipe(/*#__PURE__*/Layer.provideMerge(/*#__PURE__*/Layer.mergeAll(BunFileSystem.layer, BunCrypto.layer, BunPath.layer, BunStdio.layer, BunTerminal.layer)));
12
16
  //# sourceMappingURL=BunServices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunServices.js","names":["Layer","BunChildProcessSpawner","BunFileSystem","BunPath","BunStdio","BunTerminal","layer","pipe","provideMerge","mergeAll"],"sources":["../src/BunServices.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,sBAAsB,MAAM,6BAA6B;AACrE,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAQ/C;;;;AAIA,OAAO,MAAMC,KAAK,gBAA6BL,sBAAsB,CAACK,KAAK,CAACC,IAAI,cAC9EP,KAAK,CAACQ,YAAY,cAACR,KAAK,CAACS,QAAQ,CAC/BP,aAAa,CAACI,KAAK,EACnBH,OAAO,CAACG,KAAK,EACbF,QAAQ,CAACE,KAAK,EACdD,WAAW,CAACC,KAAK,CAClB,CAAC,CACH","ignoreList":[]}
1
+ {"version":3,"file":"BunServices.js","names":["Layer","BunChildProcessSpawner","BunCrypto","BunFileSystem","BunPath","BunStdio","BunTerminal","layer","pipe","provideMerge","mergeAll"],"sources":["../src/BunServices.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,sBAAsB,MAAM,6BAA6B;AACrE,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,WAAW,MAAM,kBAAkB;AAW/C;;;;;;;AAOA,OAAO,MAAMC,KAAK,gBAA6BN,sBAAsB,CAACM,KAAK,CAACC,IAAI,cAC9ER,KAAK,CAACS,YAAY,cAACT,KAAK,CAACU,QAAQ,CAC/BP,aAAa,CAACI,KAAK,EACnBL,SAAS,CAACK,KAAK,EACfH,OAAO,CAACG,KAAK,EACbF,QAAQ,CAACE,KAAK,EACdD,WAAW,CAACC,KAAK,CAClB,CAAC,CACH","ignoreList":[]}
package/dist/BunSink.d.ts 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=BunSink.d.ts.map
package/dist/BunSink.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=BunSink.js.map
@@ -1,22 +1,36 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun platform socket entry point for Effect sockets.
3
+ *
4
+ * This module re-exports the shared Node socket constructors for TCP clients,
5
+ * Unix domain socket clients, and adapters from existing Node `Duplex` streams.
6
+ * It also provides Bun WebSocket layers using `globalThis.WebSocket`, including
7
+ * a constructor layer and a `Socket.Socket` layer for a WebSocket URL.
8
+ *
9
+ * @since 4.0.0
3
10
  */
4
11
  import type * as Duration from "effect/Duration";
5
12
  import type { Effect } from "effect/Effect";
6
13
  import * as Layer from "effect/Layer";
7
14
  import * as Socket from "effect/unstable/socket/Socket";
8
15
  /**
9
- * @since 1.0.0
16
+ * @since 4.0.0
10
17
  */
11
18
  export * from "@effect/platform-node-shared/NodeSocket";
12
19
  /**
13
- * @since 1.0.0
20
+ * Provides a `Socket.WebSocketConstructor` backed by Bun's global
21
+ * `WebSocket` implementation.
22
+ *
14
23
  * @category layers
24
+ * @since 4.0.0
15
25
  */
16
26
  export declare const layerWebSocketConstructor: Layer.Layer<Socket.WebSocketConstructor>;
17
27
  /**
18
- * @since 1.0.0
28
+ * Creates a `Socket.Socket` layer for a WebSocket URL using Bun's global
29
+ * `WebSocket` constructor, honoring protocol, open-timeout, and close-code
30
+ * error options.
31
+ *
19
32
  * @category layers
33
+ * @since 4.0.0
20
34
  */
21
35
  export declare const layerWebSocket: (url: string | Effect<string>, options?: {
22
36
  readonly closeCodeIsError?: ((code: number) => boolean) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"BunSocket.d.ts","sourceRoot":"","sources":["../src/BunSocket.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAEvD;;GAEG;AACH,cAAc,yCAAyC,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,KAAK,CACjD,MAAM,CAAC,oBAAoB,CAG5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,CAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACxD,GAAG,SAAS,KACV,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAI3C,CAAA"}
1
+ {"version":3,"file":"BunSocket.d.ts","sourceRoot":"","sources":["../src/BunSocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAEvD;;GAEG;AACH,cAAc,yCAAyC,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,KAAK,CACjD,MAAM,CAAC,oBAAoB,CAG5B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,CAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACxD,GAAG,SAAS,KACV,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAI3C,CAAA"}
package/dist/BunSocket.js CHANGED
@@ -2,17 +2,24 @@ import { flow } from "effect/Function";
2
2
  import * as Layer from "effect/Layer";
3
3
  import * as Socket from "effect/unstable/socket/Socket";
4
4
  /**
5
- * @since 1.0.0
5
+ * @since 4.0.0
6
6
  */
7
7
  export * from "@effect/platform-node-shared/NodeSocket";
8
8
  /**
9
- * @since 1.0.0
9
+ * Provides a `Socket.WebSocketConstructor` backed by Bun's global
10
+ * `WebSocket` implementation.
11
+ *
10
12
  * @category layers
13
+ * @since 4.0.0
11
14
  */
12
15
  export const layerWebSocketConstructor = /*#__PURE__*/Layer.succeed(Socket.WebSocketConstructor)((url, protocols) => new globalThis.WebSocket(url, protocols));
13
16
  /**
14
- * @since 1.0.0
17
+ * Creates a `Socket.Socket` layer for a WebSocket URL using Bun's global
18
+ * `WebSocket` constructor, honoring protocol, open-timeout, and close-code
19
+ * error options.
20
+ *
15
21
  * @category layers
22
+ * @since 4.0.0
16
23
  */
17
24
  export const layerWebSocket = /*#__PURE__*/flow(Socket.makeWebSocket, /*#__PURE__*/Layer.effect(Socket.Socket), /*#__PURE__*/Layer.provide(layerWebSocketConstructor));
18
25
  //# sourceMappingURL=BunSocket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunSocket.js","names":["flow","Layer","Socket","layerWebSocketConstructor","succeed","WebSocketConstructor","url","protocols","globalThis","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/BunSocket.ts"],"sourcesContent":[null],"mappings":"AAKA,SAASA,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;AAIA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,OAAO,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIC,UAAU,CAACC,SAAS,CAACH,GAAG,EAAEC,SAAS,CAAC,CAC7D;AAED;;;;AAIA,OAAO,MAAMG,cAAc,gBAOqBV,IAAI,CAClDE,MAAM,CAACS,aAAa,eACpBV,KAAK,CAACW,MAAM,CAACV,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACY,OAAO,CAACV,yBAAyB,CAAC,CACzC","ignoreList":[]}
1
+ {"version":3,"file":"BunSocket.js","names":["flow","Layer","Socket","layerWebSocketConstructor","succeed","WebSocketConstructor","url","protocols","globalThis","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/BunSocket.ts"],"sourcesContent":[null],"mappings":"AAYA,SAASA,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,OAAO,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIC,UAAU,CAACC,SAAS,CAACH,GAAG,EAAEC,SAAS,CAAC,CAC7D;AAED;;;;;;;;AAQA,OAAO,MAAMG,cAAc,gBAOqBV,IAAI,CAClDE,MAAM,CAACS,aAAa,eACpBV,KAAK,CAACW,MAAM,CAACV,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACY,OAAO,CAACV,yBAAyB,CAAC,CACzC","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/NodeSocketServer";
8
8
  //# sourceMappingURL=BunSocketServer.d.ts.map
@@ -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/NodeSocketServer";
8
8
  //# sourceMappingURL=BunSocketServer.js.map
@@ -1,8 +1,11 @@
1
1
  import type * as Layer from "effect/Layer";
2
2
  import type { Stdio } from "effect/Stdio";
3
3
  /**
4
- * @since 1.0.0
5
- * @category layer
4
+ * Provides the `Stdio` service backed by the current process arguments,
5
+ * stdin, stdout, and stderr streams.
6
+ *
7
+ * @category layers
8
+ * @since 4.0.0
6
9
  */
7
10
  export declare const layer: Layer.Layer<Stdio>;
8
11
  //# sourceMappingURL=BunStdio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunStdio.d.ts","sourceRoot":"","sources":["../src/BunStdio.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}
1
+ {"version":3,"file":"BunStdio.d.ts","sourceRoot":"","sources":["../src/BunStdio.ts"],"names":[],"mappings":"AAWA,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"}
package/dist/BunStdio.js CHANGED
@@ -1,10 +1,20 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Process stdio for Bun applications.
3
+ *
4
+ * This module provides the Bun layer for Effect's `Stdio` service by using the
5
+ * shared Node stdio implementation. Arguments come from `process.argv`, input
6
+ * is read from `process.stdin`, and output and error output write to
7
+ * `process.stdout` and `process.stderr`.
8
+ *
9
+ * @since 4.0.0
3
10
  */
4
11
  import * as NodeStdio from "@effect/platform-node-shared/NodeStdio";
5
12
  /**
6
- * @since 1.0.0
7
- * @category layer
13
+ * Provides the `Stdio` service backed by the current process arguments,
14
+ * stdin, stdout, and stderr streams.
15
+ *
16
+ * @category layers
17
+ * @since 4.0.0
8
18
  */
9
19
  export const layer = NodeStdio.layer;
10
20
  //# sourceMappingURL=BunStdio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BunStdio.js","names":["NodeStdio","layer"],"sources":["../src/BunStdio.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;AAIA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"BunStdio.js","names":["NodeStdio","layer"],"sources":["../src/BunStdio.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
@@ -1,14 +1,15 @@
1
1
  import type { LazyArg } from "effect/Function";
2
2
  import * as Stream from "effect/Stream";
3
3
  /**
4
- * @since 1.0.0
4
+ * @since 4.0.0
5
5
  */
6
6
  export * from "@effect/platform-node-shared/NodeStream";
7
7
  /**
8
- * An optimized version of `Stream.fromReadableStream` that uses the Bun
9
- * .readMany API to read multiple values at once from a `ReadableStream`.
8
+ * Creates a stream from a `ReadableStream` using Bun's optimized `.readMany`
9
+ * API.
10
10
  *
11
- * @since 1.0.0
11
+ * @category constructors
12
+ * @since 4.0.0
12
13
  */
13
14
  export declare const fromReadableStream: <A, E>(options: {
14
15
  readonly evaluate: LazyArg<ReadableStream<A>>;