@effect/platform-bun 4.0.0-beta.65 → 4.0.0-beta.67

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 (101) hide show
  1. package/dist/BunChildProcessSpawner.d.ts +1 -1
  2. package/dist/BunChildProcessSpawner.js +1 -1
  3. package/dist/BunClusterHttp.d.ts +41 -4
  4. package/dist/BunClusterHttp.d.ts.map +1 -1
  5. package/dist/BunClusterHttp.js +7 -3
  6. package/dist/BunClusterHttp.js.map +1 -1
  7. package/dist/BunClusterSocket.d.ts +44 -5
  8. package/dist/BunClusterSocket.d.ts.map +1 -1
  9. package/dist/BunClusterSocket.js +44 -5
  10. package/dist/BunClusterSocket.js.map +1 -1
  11. package/dist/BunFileSystem.d.ts +3 -1
  12. package/dist/BunFileSystem.d.ts.map +1 -1
  13. package/dist/BunFileSystem.js +26 -2
  14. package/dist/BunFileSystem.js.map +1 -1
  15. package/dist/BunHttpClient.d.ts +2 -2
  16. package/dist/BunHttpClient.js +2 -2
  17. package/dist/BunHttpPlatform.d.ts +3 -1
  18. package/dist/BunHttpPlatform.d.ts.map +1 -1
  19. package/dist/BunHttpPlatform.js +4 -2
  20. package/dist/BunHttpPlatform.js.map +1 -1
  21. package/dist/BunHttpServer.d.ts +53 -8
  22. package/dist/BunHttpServer.d.ts.map +1 -1
  23. package/dist/BunHttpServer.js +19 -7
  24. package/dist/BunHttpServer.js.map +1 -1
  25. package/dist/BunHttpServerRequest.d.ts +26 -2
  26. package/dist/BunHttpServerRequest.d.ts.map +1 -1
  27. package/dist/BunHttpServerRequest.js +3 -1
  28. package/dist/BunHttpServerRequest.js.map +1 -1
  29. package/dist/BunMultipart.d.ts +26 -3
  30. package/dist/BunMultipart.d.ts.map +1 -1
  31. package/dist/BunMultipart.js +6 -2
  32. package/dist/BunMultipart.js.map +1 -1
  33. package/dist/BunPath.d.ts +9 -3
  34. package/dist/BunPath.d.ts.map +1 -1
  35. package/dist/BunPath.js +27 -4
  36. package/dist/BunPath.js.map +1 -1
  37. package/dist/BunRedis.d.ts +34 -4
  38. package/dist/BunRedis.d.ts.map +1 -1
  39. package/dist/BunRedis.js +35 -5
  40. package/dist/BunRedis.js.map +1 -1
  41. package/dist/BunRuntime.d.ts +3 -3
  42. package/dist/BunRuntime.d.ts.map +1 -1
  43. package/dist/BunRuntime.js +18 -2
  44. package/dist/BunRuntime.js.map +1 -1
  45. package/dist/BunServices.d.ts +29 -3
  46. package/dist/BunServices.d.ts.map +1 -1
  47. package/dist/BunServices.js +4 -1
  48. package/dist/BunServices.js.map +1 -1
  49. package/dist/BunSink.d.ts +2 -2
  50. package/dist/BunSink.js +2 -2
  51. package/dist/BunSocket.d.ts +30 -4
  52. package/dist/BunSocket.d.ts.map +1 -1
  53. package/dist/BunSocket.js +10 -3
  54. package/dist/BunSocket.js.map +1 -1
  55. package/dist/BunSocketServer.d.ts +2 -2
  56. package/dist/BunSocketServer.js +2 -2
  57. package/dist/BunStdio.d.ts +4 -1
  58. package/dist/BunStdio.d.ts.map +1 -1
  59. package/dist/BunStdio.js +23 -2
  60. package/dist/BunStdio.js.map +1 -1
  61. package/dist/BunStream.d.ts +2 -2
  62. package/dist/BunStream.d.ts.map +1 -1
  63. package/dist/BunStream.js +24 -3
  64. package/dist/BunStream.js.map +1 -1
  65. package/dist/BunTerminal.d.ts +8 -2
  66. package/dist/BunTerminal.d.ts.map +1 -1
  67. package/dist/BunTerminal.js +23 -3
  68. package/dist/BunTerminal.js.map +1 -1
  69. package/dist/BunWorker.d.ts +9 -2
  70. package/dist/BunWorker.d.ts.map +1 -1
  71. package/dist/BunWorker.js +29 -4
  72. package/dist/BunWorker.js.map +1 -1
  73. package/dist/BunWorkerRunner.d.ts +5 -1
  74. package/dist/BunWorkerRunner.d.ts.map +1 -1
  75. package/dist/BunWorkerRunner.js +26 -4
  76. package/dist/BunWorkerRunner.js.map +1 -1
  77. package/dist/index.d.ts +22 -22
  78. package/dist/index.js +22 -22
  79. package/package.json +5 -5
  80. package/src/BunChildProcessSpawner.ts +1 -1
  81. package/src/BunClusterHttp.ts +41 -4
  82. package/src/BunClusterSocket.ts +44 -5
  83. package/src/BunFileSystem.ts +26 -2
  84. package/src/BunHttpClient.ts +2 -2
  85. package/src/BunHttpPlatform.ts +27 -3
  86. package/src/BunHttpServer.ts +54 -9
  87. package/src/BunHttpServerRequest.ts +26 -2
  88. package/src/BunMultipart.ts +26 -3
  89. package/src/BunPath.ts +27 -4
  90. package/src/BunRedis.ts +35 -5
  91. package/src/BunRuntime.ts +20 -4
  92. package/src/BunServices.ts +29 -3
  93. package/src/BunSink.ts +2 -2
  94. package/src/BunSocket.ts +30 -4
  95. package/src/BunSocketServer.ts +2 -2
  96. package/src/BunStdio.ts +23 -2
  97. package/src/BunStream.ts +24 -3
  98. package/src/BunTerminal.ts +23 -3
  99. package/src/BunWorker.ts +29 -4
  100. package/src/BunWorkerRunner.ts +26 -4
  101. package/src/index.ts +22 -22
@@ -1 +1 @@
1
- {"version":3,"file":"BunWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Scope","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","layer","succeed","WorkerRunnerPlatform","start","fnUntraced","self","reason","message","port","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","event","data","result","isEffect","fiber","addObserver","close","doneUnsafe","void","onMessageError","error","asEffect","onError","addFinalizer","sync","removeEventListener","addEventListener","postMessage","await","sendUnsafe","_portId","transfer","send"],"sources":["../src/BunWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cA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CAAC;MACnD,CAAC,CAAC,CACH;MACDhC,IAAI,CAACoC,gBAAgB,CAAC,SAAS,EAAEjB,SAAS,CAAC;MAC3CnB,IAAI,CAACoC,gBAAgB,CAAC,cAAc,EAAEP,cAAc,CAAC;MACrD7B,IAAI,CAACqC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;MAErB,OAAO,OAAOxD,QAAQ,CAACyD,KAAK,CAACjC,UAAU,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEL,MAAMkC,UAAU,GAAGA,CAACC,OAAe,EAAEzC,OAAU,EAAE0C,QAAiC,KAChFzC,IAAI,CAACqC,WAAW,CAAC,CAAC,CAAC,EAAEtC,OAAO,CAAC,EAAE;MAC7B0C,QAAQ,EAAEA;KACX,CAAC;IACJ,MAAMC,IAAI,GAAGA,CAACF,OAAe,EAAEzC,OAAU,EAAE0C,QAAiC,KAC1E3D,MAAM,CAACoD,IAAI,CAAC,MAAMK,UAAU,CAAC,CAAC,EAAExC,OAAO,EAAE0C,QAAQ,CAAC,CAAC;IACrD,OAAOxD,QAAQ,CAAsC;MAAEgB,GAAG;MAAEyC,IAAI;MAAEH;IAAU,CAAE,CAAC;EACjF,CAAC;CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"BunWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","identity","Layer","Scope","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","layer","succeed","WorkerRunnerPlatform","start","fnUntraced","self","reason","message","port","run","handler","scopedWith","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","onMessage","event","data","result","isEffect","fiber","addObserver","close","doneUnsafe","void","onMessageError","error","onError","addFinalizer","sync","removeEventListener","addEventListener","postMessage","await","sendUnsafe","_portId","transfer","send"],"sources":["../src/BunWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,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IAAI,CAAC,MAAK;QACfjC,IAAI,CAACkC,mBAAmB,CAAC,SAAS,EAAEf,SAAS,CAAC;QAC9CnB,IAAI,CAACkC,mBAAmB,CAAC,cAAc,EAAEH,OAAO,CAAC;MACnD,CAAC,CAAC,CACH;MACD/B,IAAI,CAACmC,gBAAgB,CAAC,SAAS,EAAEhB,SAAS,CAAC;MAC3CnB,IAAI,CAACmC,gBAAgB,CAAC,cAAc,EAAEN,cAAc,CAAC;MACrD7B,IAAI,CAACoC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;MAErB,OAAO,OAAOvD,QAAQ,CAACwD,KAAK,CAAChC,UAAU,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEL,MAAMiC,UAAU,GAAGA,CAACC,OAAe,EAAExC,OAAU,EAAEyC,QAAiC,KAChFxC,IAAI,CAACoC,WAAW,CAAC,CAAC,CAAC,EAAErC,OAAO,CAAC,EAAE;MAC7ByC,QAAQ,EAAEA;KACX,CAAC;IACJ,MAAMC,IAAI,GAAGA,CAACF,OAAe,EAAExC,OAAU,EAAEyC,QAAiC,KAC1E1D,MAAM,CAACmD,IAAI,CAAC,MAAMK,UAAU,CAAC,CAAC,EAAEvC,OAAO,EAAEyC,QAAQ,CAAC,CAAC;IACrD,OAAOvD,QAAQ,CAAsC;MAAEgB,GAAG;MAAEwC,IAAI;MAAEH;IAAU,CAAE,CAAC;EACjF,CAAC;CACF,CAAC","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -1,90 +1,90 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  /**
5
5
  * Node.js implementation of `ChildProcessSpawner`.
6
6
  *
7
- * @since 1.0.0
7
+ * @since 4.0.0
8
8
  */
9
9
  export * as BunChildProcessSpawner from "./BunChildProcessSpawner.ts";
10
10
  /**
11
- * @since 1.0.0
11
+ * @since 4.0.0
12
12
  */
13
13
  export * as BunClusterHttp from "./BunClusterHttp.ts";
14
14
  /**
15
- * @since 1.0.0
15
+ * @since 4.0.0
16
16
  */
17
17
  export * as BunClusterSocket from "./BunClusterSocket.ts";
18
18
  /**
19
- * @since 1.0.0
19
+ * @since 4.0.0
20
20
  */
21
21
  export * as BunFileSystem from "./BunFileSystem.ts";
22
22
  /**
23
- * @since 1.0.0
23
+ * @since 4.0.0
24
24
  */
25
25
  export * as BunHttpClient from "./BunHttpClient.ts";
26
26
  /**
27
- * @since 1.0.0
27
+ * @since 4.0.0
28
28
  */
29
29
  export * as BunHttpPlatform from "./BunHttpPlatform.ts";
30
30
  /**
31
- * @since 1.0.0
31
+ * @since 4.0.0
32
32
  */
33
33
  export * as BunHttpServer from "./BunHttpServer.ts";
34
34
  /**
35
- * @since 1.0.0
35
+ * @since 4.0.0
36
36
  */
37
37
  export * as BunHttpServerRequest from "./BunHttpServerRequest.ts";
38
38
  /**
39
- * @since 1.0.0
39
+ * @since 4.0.0
40
40
  */
41
41
  export * as BunMultipart from "./BunMultipart.ts";
42
42
  /**
43
- * @since 1.0.0
43
+ * @since 4.0.0
44
44
  */
45
45
  export * as BunPath from "./BunPath.ts";
46
46
  /**
47
- * @since 1.0.0
47
+ * @since 4.0.0
48
48
  */
49
49
  export * as BunRedis from "./BunRedis.ts";
50
50
  /**
51
- * @since 1.0.0
51
+ * @since 4.0.0
52
52
  */
53
53
  export * as BunRuntime from "./BunRuntime.ts";
54
54
  /**
55
- * @since 1.0.0
55
+ * @since 4.0.0
56
56
  */
57
57
  export * as BunServices from "./BunServices.ts";
58
58
  /**
59
- * @since 1.0.0
59
+ * @since 4.0.0
60
60
  */
61
61
  export * as BunSink from "./BunSink.ts";
62
62
  /**
63
- * @since 1.0.0
63
+ * @since 4.0.0
64
64
  */
65
65
  export * as BunSocket from "./BunSocket.ts";
66
66
  /**
67
- * @since 1.0.0
67
+ * @since 4.0.0
68
68
  */
69
69
  export * as BunSocketServer from "./BunSocketServer.ts";
70
70
  /**
71
- * @since 1.0.0
71
+ * @since 4.0.0
72
72
  */
73
73
  export * as BunStdio from "./BunStdio.ts";
74
74
  /**
75
- * @since 1.0.0
75
+ * @since 4.0.0
76
76
  */
77
77
  export * as BunStream from "./BunStream.ts";
78
78
  /**
79
- * @since 1.0.0
79
+ * @since 4.0.0
80
80
  */
81
81
  export * as BunTerminal from "./BunTerminal.ts";
82
82
  /**
83
- * @since 1.0.0
83
+ * @since 4.0.0
84
84
  */
85
85
  export * as BunWorker from "./BunWorker.ts";
86
86
  /**
87
- * @since 1.0.0
87
+ * @since 4.0.0
88
88
  */
89
89
  export * as BunWorkerRunner from "./BunWorkerRunner.ts";
90
90
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,91 +1,91 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  // @barrel: Auto-generated exports. Do not edit manually.
5
5
  /**
6
6
  * Node.js implementation of `ChildProcessSpawner`.
7
7
  *
8
- * @since 1.0.0
8
+ * @since 4.0.0
9
9
  */
10
10
  export * as BunChildProcessSpawner from "./BunChildProcessSpawner.js";
11
11
  /**
12
- * @since 1.0.0
12
+ * @since 4.0.0
13
13
  */
14
14
  export * as BunClusterHttp from "./BunClusterHttp.js";
15
15
  /**
16
- * @since 1.0.0
16
+ * @since 4.0.0
17
17
  */
18
18
  export * as BunClusterSocket from "./BunClusterSocket.js";
19
19
  /**
20
- * @since 1.0.0
20
+ * @since 4.0.0
21
21
  */
22
22
  export * as BunFileSystem from "./BunFileSystem.js";
23
23
  /**
24
- * @since 1.0.0
24
+ * @since 4.0.0
25
25
  */
26
26
  export * as BunHttpClient from "./BunHttpClient.js";
27
27
  /**
28
- * @since 1.0.0
28
+ * @since 4.0.0
29
29
  */
30
30
  export * as BunHttpPlatform from "./BunHttpPlatform.js";
31
31
  /**
32
- * @since 1.0.0
32
+ * @since 4.0.0
33
33
  */
34
34
  export * as BunHttpServer from "./BunHttpServer.js";
35
35
  /**
36
- * @since 1.0.0
36
+ * @since 4.0.0
37
37
  */
38
38
  export * as BunHttpServerRequest from "./BunHttpServerRequest.js";
39
39
  /**
40
- * @since 1.0.0
40
+ * @since 4.0.0
41
41
  */
42
42
  export * as BunMultipart from "./BunMultipart.js";
43
43
  /**
44
- * @since 1.0.0
44
+ * @since 4.0.0
45
45
  */
46
46
  export * as BunPath from "./BunPath.js";
47
47
  /**
48
- * @since 1.0.0
48
+ * @since 4.0.0
49
49
  */
50
50
  export * as BunRedis from "./BunRedis.js";
51
51
  /**
52
- * @since 1.0.0
52
+ * @since 4.0.0
53
53
  */
54
54
  export * as BunRuntime from "./BunRuntime.js";
55
55
  /**
56
- * @since 1.0.0
56
+ * @since 4.0.0
57
57
  */
58
58
  export * as BunServices from "./BunServices.js";
59
59
  /**
60
- * @since 1.0.0
60
+ * @since 4.0.0
61
61
  */
62
62
  export * as BunSink from "./BunSink.js";
63
63
  /**
64
- * @since 1.0.0
64
+ * @since 4.0.0
65
65
  */
66
66
  export * as BunSocket from "./BunSocket.js";
67
67
  /**
68
- * @since 1.0.0
68
+ * @since 4.0.0
69
69
  */
70
70
  export * as BunSocketServer from "./BunSocketServer.js";
71
71
  /**
72
- * @since 1.0.0
72
+ * @since 4.0.0
73
73
  */
74
74
  export * as BunStdio from "./BunStdio.js";
75
75
  /**
76
- * @since 1.0.0
76
+ * @since 4.0.0
77
77
  */
78
78
  export * as BunStream from "./BunStream.js";
79
79
  /**
80
- * @since 1.0.0
80
+ * @since 4.0.0
81
81
  */
82
82
  export * as BunTerminal from "./BunTerminal.js";
83
83
  /**
84
- * @since 1.0.0
84
+ * @since 4.0.0
85
85
  */
86
86
  export * as BunWorker from "./BunWorker.js";
87
87
  /**
88
- * @since 1.0.0
88
+ * @since 4.0.0
89
89
  */
90
90
  export * as BunWorkerRunner from "./BunWorkerRunner.js";
91
91
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@effect/platform-bun",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.65",
4
+ "version": "4.0.0-beta.67",
5
5
  "license": "MIT",
6
6
  "description": "Platform specific implementations for the Bun runtime",
7
7
  "homepage": "https://effect.website",
@@ -45,14 +45,14 @@
45
45
  "provenance": true
46
46
  },
47
47
  "peerDependencies": {
48
- "effect": "^4.0.0-beta.65"
48
+ "effect": "^4.0.0-beta.67"
49
49
  },
50
50
  "dependencies": {
51
- "@effect/platform-node-shared": "^4.0.0-beta.65"
51
+ "@effect/platform-node-shared": "^4.0.0-beta.67"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/bun": "^1.3.12",
55
- "effect": "^4.0.0-beta.65"
54
+ "@types/bun": "^1.3.13",
55
+ "effect": "^4.0.0-beta.67"
56
56
  },
57
57
  "scripts": {
58
58
  "codegen": "effect-utils codegen",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Node.js implementation of `ChildProcessSpawner`.
3
3
  *
4
- * @since 1.0.0
4
+ * @since 4.0.0
5
5
  */
6
6
  export * from "@effect/platform-node-shared/NodeChildProcessSpawner"
@@ -1,5 +1,38 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * The `BunClusterHttp` module provides the Bun HTTP and WebSocket transports
3
+ * for Effect Cluster runners. It wires `HttpRunner` to the Bun HTTP server,
4
+ * supplies Fetch and Bun WebSocket client protocols, and builds a complete
5
+ * sharding layer with serialization, runner health, runner storage, and message
6
+ * storage.
7
+ *
8
+ * **Common tasks**
9
+ *
10
+ * - Run a Bun process as a cluster runner over HTTP or WebSocket with
11
+ * {@link layer}
12
+ * - Connect a client-only process to an existing HTTP cluster without starting
13
+ * a runner server
14
+ * - Use SQL-backed storage for durable multi-process clusters, `local` storage
15
+ * for short-lived development, or `byo` storage when the deployment owns the
16
+ * persistence boundary
17
+ * - Check runner health with protocol pings or Kubernetes pod readiness through
18
+ * {@link layerK8sHttpClient}
19
+ *
20
+ * **Gotchas**
21
+ *
22
+ * - `runnerAddress` is the host and port advertised to other runners; set
23
+ * `runnerListenAddress` when the local bind address differs from the
24
+ * externally reachable address
25
+ * - The HTTP and WebSocket transports serve runner RPCs at the default
26
+ * `HttpRunner` route, so proxies and load balancers must preserve the path
27
+ * and allow WebSocket upgrades when `transport` is `"websocket"`
28
+ * - `clientOnly` does not start an HTTP server or receive shard assignments
29
+ * - SQL storage is the default; `local` storage is in-memory/noop and `byo`
30
+ * requires the surrounding application to provide both runner and message
31
+ * storage services
32
+ * - Ping health checks use the selected transport and serialization, so route,
33
+ * port, proxy, or codec mismatches can make a runner appear unhealthy
34
+ *
35
+ * @since 4.0.0
3
36
  */
4
37
  import type * as Config from "effect/Config"
5
38
  import * as Effect from "effect/Effect"
@@ -29,15 +62,17 @@ import * as BunSocket from "./BunSocket.ts"
29
62
 
30
63
  export {
31
64
  /**
32
- * @since 1.0.0
33
65
  * @category Re-exports
66
+ * @since 4.0.0
34
67
  */
35
68
  layerK8sHttpClient
36
69
  }
37
70
 
38
71
  /**
39
- * @since 1.0.0
72
+ * Bun HTTP server layer for cluster runners, using `ShardingConfig.runnerListenAddress` or `runnerAddress` as the listen address.
73
+ *
40
74
  * @category Layers
75
+ * @since 4.0.0
41
76
  */
42
77
  export const layerHttpServer: Layer.Layer<
43
78
  | HttpPlatform
@@ -56,8 +91,10 @@ export const layerHttpServer: Layer.Layer<
56
91
  }).pipe(Layer.unwrap)
57
92
 
58
93
  /**
59
- * @since 1.0.0
94
+ * Creates Bun cluster layers for HTTP or WebSocket transport, configuring serialization, storage, runner health, and optional client-only mode.
95
+ *
60
96
  * @category Layers
97
+ * @since 4.0.0
61
98
  */
62
99
  export const layer = <
63
100
  const ClientOnly extends boolean = false,
@@ -1,5 +1,40 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * The `BunClusterSocket` module provides the Bun socket transport for Effect
3
+ * Cluster runners. It wires `SocketRunner` to Bun-compatible TCP sockets,
4
+ * supplies RPC client and server protocol layers, and builds a complete
5
+ * sharding layer with serialization, runner health, runner storage, and message
6
+ * storage.
7
+ *
8
+ * **Common tasks**
9
+ *
10
+ * - Run a Bun process as a cluster runner over raw TCP sockets with
11
+ * {@link layer}
12
+ * - Connect a client-only process to an existing socket cluster without
13
+ * starting a runner server
14
+ * - Use SQL-backed storage for durable multi-process clusters, `local` storage
15
+ * for short-lived development, or `byo` storage when the deployment owns the
16
+ * persistence boundary
17
+ * - Check runner health with socket pings or Kubernetes pod readiness through
18
+ * {@link layerK8sHttpClient}
19
+ *
20
+ * **Gotchas**
21
+ *
22
+ * - `runnerAddress` is the host and port advertised to other runners; set
23
+ * `runnerListenAddress` when the local bind address differs from the
24
+ * externally reachable address
25
+ * - The socket transport is point-to-point RPC, not cluster gossip: runner
26
+ * membership, shard ownership, and persisted delivery are coordinated through
27
+ * `RunnerStorage`, `MessageStorage`, and `RunnerHealth`
28
+ * - `clientOnly` does not start a socket server or receive shard assignments
29
+ * - SQL storage is the default; `local` storage is in-memory/noop and `byo`
30
+ * requires the surrounding application to provide both runner and message
31
+ * storage services
32
+ * - Ping health checks use the same socket protocol, so unreachable ports,
33
+ * firewalls, or serialization mismatches can make a runner appear unhealthy
34
+ * - Kubernetes health checks use Bun's Fetch-backed HTTP client and the service
35
+ * account CA certificate when it is available
36
+ *
37
+ * @since 4.0.0
3
38
  */
4
39
  import { layerClientProtocol, layerSocketServer } from "@effect/platform-node-shared/NodeClusterSocket"
5
40
  import type * as Config from "effect/Config"
@@ -24,20 +59,22 @@ import * as BunFileSystem from "./BunFileSystem.ts"
24
59
 
25
60
  export {
26
61
  /**
27
- * @since 1.0.0
28
62
  * @category Re-exports
63
+ * @since 4.0.0
29
64
  */
30
65
  layerClientProtocol,
31
66
  /**
32
- * @since 1.0.0
33
67
  * @category Re-exports
68
+ * @since 4.0.0
34
69
  */
35
70
  layerSocketServer
36
71
  }
37
72
 
38
73
  /**
39
- * @since 1.0.0
74
+ * Creates Bun socket cluster layers, configuring serialization, storage, runner health, and optional client-only mode.
75
+ *
40
76
  * @category Layers
77
+ * @since 4.0.0
41
78
  */
42
79
  export const layer = <
43
80
  const ClientOnly extends boolean = false,
@@ -110,8 +147,10 @@ export const layer = <
110
147
  }
111
148
 
112
149
  /**
113
- * @since 1.0.0
150
+ * Layer that provides `K8sHttpClient`, using the Kubernetes service-account CA certificate when it is available.
151
+ *
114
152
  * @category Layers
153
+ * @since 4.0.0
115
154
  */
116
155
  export const layerK8sHttpClient: Layer.Layer<K8sHttpClient.K8sHttpClient> = K8sHttpClient.layer.pipe(
117
156
  Layer.provide(Layer.unwrap(Effect.gen(function*() {
@@ -1,12 +1,36 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun layer for Effect's `FileSystem` service.
3
+ *
4
+ * Use this module at the edge of Bun applications, CLIs, scripts, and tests
5
+ * that need real local filesystem access through `effect/FileSystem`: reading
6
+ * and writing files, creating directories and temporary files, inspecting
7
+ * metadata, managing links, or watching paths for changes. It exposes only the
8
+ * Bun `FileSystem` layer; the operations themselves are accessed from the
9
+ * `FileSystem` service once the layer is provided, or from `BunServices.layer`
10
+ * when the program also needs the standard Bun path, stdio, terminal, and child
11
+ * process services.
12
+ *
13
+ * Bun supports Node-compatible filesystem APIs, so this layer reuses the shared
14
+ * Node filesystem implementation. Paths therefore follow the current process and
15
+ * host platform rules: relative paths are resolved from the current working
16
+ * directory, separators and drive/UNC behavior are platform-dependent, and
17
+ * request URLs should be decoded and validated before being mapped to local
18
+ * paths. The service works with bytes, scoped file handles, and Effect
19
+ * streams/sinks; use `FileSystem.stream` for large files instead of
20
+ * `readFile`, and remember that stream offsets and lengths are byte positions.
21
+ * Bun `File` and `Blob` values are not filesystem handles here; path-based HTTP
22
+ * file responses are handled by the Bun HTTP platform adapter with `Bun.file`.
23
+ *
24
+ * @since 4.0.0
3
25
  */
4
26
  import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem"
5
27
  import type { FileSystem } from "effect/FileSystem"
6
28
  import type * as Layer from "effect/Layer"
7
29
 
8
30
  /**
9
- * @since 1.0.0
31
+ * Layer that provides the `FileSystem` service for Bun using the shared Node file-system implementation.
32
+ *
10
33
  * @category layer
34
+ * @since 4.0.0
11
35
  */
12
36
  export const layer: Layer.Layer<FileSystem, never, never> = NodeFileSystem.layer
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
 
5
5
  /**
6
- * @since 1.0.0
7
6
  * @category re-exports
7
+ * @since 4.0.0
8
8
  */
9
9
  export * from "effect/unstable/http/FetchHttpClient"
@@ -1,5 +1,27 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun implementation of the Effect HTTP platform service.
3
+ *
4
+ * This module connects the portable `HttpPlatform` file response helpers to
5
+ * Bun's Web-compatible runtime. `BunHttpServer` provides this layer when
6
+ * applications serve local files, public assets, downloads, byte ranges, or
7
+ * Web `File` values from Effect `HttpServerResponse` constructors.
8
+ *
9
+ * Path-based responses are backed by `Bun.file`, and Web `File` responses are
10
+ * returned directly as raw response bodies. The shared `HttpPlatform` service
11
+ * still computes file metadata such as ETags and last-modified headers, while
12
+ * this adapter lets Bun's `Response` implementation handle the platform body.
13
+ *
14
+ * Because the Bun server adapter sits on top of Web `Request` and `Response`,
15
+ * request bodies follow the usual single-consumption rules: choose the
16
+ * streamed, text, URL-encoded, or multipart view that matches the route. For
17
+ * `FormData` responses, let the `Response` constructor create the multipart
18
+ * content type and boundary unless you intentionally override it. File
19
+ * responses take filesystem paths, not request URLs; Bun request URLs are
20
+ * absolute at the runtime edge, and route paths are normalized by
21
+ * `BunHttpServer`, so decode and validate URL pathnames before mapping them to
22
+ * files.
23
+ *
24
+ * @since 4.0.0
3
25
  */
4
26
  import type { Effect } from "effect"
5
27
  import type { FileSystem } from "effect/FileSystem"
@@ -10,8 +32,8 @@ import * as Response from "effect/unstable/http/HttpServerResponse"
10
32
  import * as BunFileSystem from "./BunFileSystem.ts"
11
33
 
12
34
  /**
13
- * @since 1.0.0
14
35
  * @category constructors
36
+ * @since 4.0.0
15
37
  */
16
38
  const make: Effect.Effect<
17
39
  Platform.HttpPlatform["Service"],
@@ -31,8 +53,10 @@ const make: Effect.Effect<
31
53
  })
32
54
 
33
55
  /**
34
- * @since 1.0.0
56
+ * Layer that provides the Bun `HttpPlatform`, including file responses backed by `Bun.file`.
57
+ *
35
58
  * @category Layers
59
+ * @since 4.0.0
36
60
  */
37
61
  export const layer = Layer.effect(Platform.HttpPlatform)(make).pipe(
38
62
  Layer.provide(BunFileSystem.layer),
@@ -1,5 +1,36 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun implementation of the Effect `HttpServer`.
3
+ *
4
+ * This module builds an Effect HTTP server from `Bun.serve`, translating Bun's
5
+ * Web `Request` objects into `HttpServerRequest` values and Effect
6
+ * `HttpServerResponse` values back into Web `Response` objects. It is the Bun
7
+ * runtime entry point for serving `HttpApp`s, streaming responses, file
8
+ * responses through `BunHttpPlatform`, multipart requests, and websocket
9
+ * endpoints through `HttpServerRequest.upgrade`.
10
+ *
11
+ * Common use cases include using {@link layer} or {@link layerConfig} to serve
12
+ * an application from Bun configuration, {@link layerServer} when only the
13
+ * `HttpServer` service is needed, and {@link layerTest} for tests that need an
14
+ * ephemeral Bun listener and fetch-compatible client.
15
+ *
16
+ * Bun supplies absolute request URLs and Web-standard request bodies. This
17
+ * adapter stores the normalized path-and-query URL on `HttpServerRequest.url`,
18
+ * while the underlying `Request` still follows Web body rules: pick the
19
+ * streamed, text, JSON, URL-encoded, or multipart view that matches the route
20
+ * instead of consuming the same body in incompatible ways. Because `Bun.serve`
21
+ * has a single active `fetch` handler, each `serve` call reloads that handler
22
+ * and restores the previous one when the serve scope finalizes.
23
+ *
24
+ * WebSocket upgrades must happen from the Bun request handler. The
25
+ * `HttpServerRequest.upgrade` effect calls `server.upgrade`, fails when Bun says
26
+ * the request is not upgradeable, buffers messages that arrive before the
27
+ * Effect socket handler is installed, and maps non-normal close codes into
28
+ * `Socket` errors. The server is stopped with `server.stop()` when its
29
+ * acquisition scope closes; unless preemptive shutdown is disabled, finalizing
30
+ * a serve scope also starts that stop with the configured graceful shutdown
31
+ * timeout or the default timeout.
32
+ *
33
+ * @since 4.0.0
3
34
  */
4
35
  import type { Server as BunServer, ServerWebSocket } from "bun"
5
36
  import * as Config from "effect/Config"
@@ -44,8 +75,10 @@ import * as BunServices from "./BunServices.ts"
44
75
  import * as BunStream from "./BunStream.ts"
45
76
 
46
77
  /**
47
- * @since 1.0.0
78
+ * Bun serve options accepted by the HTTP server, extended with typed route definitions.
79
+ *
48
80
  * @category Options
81
+ * @since 4.0.0
49
82
  */
50
83
  export type ServeOptions<R extends string> =
51
84
  & (
@@ -55,8 +88,10 @@ export type ServeOptions<R extends string> =
55
88
  & { readonly routes?: Bun.Serve.Routes<WebSocketContext, R> }
56
89
 
57
90
  /**
58
- * @since 1.0.0
91
+ * Creates a scoped Bun `HttpServer` from `Bun.serve` options, stopping the server on scope finalization with optional graceful shutdown settings.
92
+ *
59
93
  * @category Constructors
94
+ * @since 4.0.0
60
95
  */
61
96
  export const make = Effect.fnUntraced(
62
97
  function*<R extends string>(
@@ -210,8 +245,10 @@ const makeResponse = (
210
245
  }
211
246
 
212
247
  /**
213
- * @since 1.0.0
248
+ * Layer that provides only `HttpServer` by constructing a scoped Bun server from the supplied serve options.
249
+ *
214
250
  * @category Layers
251
+ * @since 4.0.0
215
252
  */
216
253
  export const layerServer: <R extends string>(
217
254
  options: ServeOptions<R> & {
@@ -221,8 +258,10 @@ export const layerServer: <R extends string>(
221
258
  ) => Layer.Layer<Server.HttpServer> = flow(make, Layer.effect(Server.HttpServer)) as any
222
259
 
223
260
  /**
224
- * @since 1.0.0
261
+ * Layer that provides Bun HTTP support services: `HttpPlatform`, weak ETag generation, and `BunServices`.
262
+ *
225
263
  * @category Layers
264
+ * @since 4.0.0
226
265
  */
227
266
  export const layerHttpServices: Layer.Layer<
228
267
  | HttpPlatform
@@ -235,8 +274,10 @@ export const layerHttpServices: Layer.Layer<
235
274
  )
236
275
 
237
276
  /**
238
- * @since 1.0.0
277
+ * Layer that provides a Bun `HttpServer` together with the Bun HTTP platform, ETag generator, and Bun services.
278
+ *
239
279
  * @category Layers
280
+ * @since 4.0.0
240
281
  */
241
282
  export const layer = <R extends string>(
242
283
  options: ServeOptions<R> & {
@@ -251,8 +292,10 @@ export const layer = <R extends string>(
251
292
  > => Layer.mergeAll(layerServer(options), layerHttpServices)
252
293
 
253
294
  /**
254
- * @since 1.0.0
295
+ * Test layer that starts a Bun HTTP server on an ephemeral port and provides the HTTP test client dependencies.
296
+ *
255
297
  * @category Layers
298
+ * @since 4.0.0
256
299
  */
257
300
  export const layerTest: Layer.Layer<
258
301
  Server.HttpServer | HttpPlatform | FileSystem.FileSystem | Etag.Generator | Path.Path | HttpClient
@@ -264,8 +307,10 @@ export const layerTest: Layer.Layer<
264
307
  )
265
308
 
266
309
  /**
267
- * @since 1.0.0
310
+ * Creates the Bun HTTP server and support-services layer from configurable serve options.
311
+ *
268
312
  * @category Layers
313
+ * @since 4.0.0
269
314
  */
270
315
  export const layerConfig = <R extends string>(
271
316
  options: Config.Wrap<
@@ -279,7 +324,7 @@ export const layerConfig = <R extends string>(
279
324
  ConfigError
280
325
  > =>
281
326
  Layer.mergeAll(
282
- Layer.effect(Server.HttpServer)(Effect.flatMap(Config.unwrap(options).asEffect(), make)),
327
+ Layer.effect(Server.HttpServer)(Effect.flatMap(Config.unwrap(options), make)),
283
328
  layerHttpServices
284
329
  )
285
330