@effect/platform-bun 4.0.1 → 4.0.3

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 (128) hide show
  1. package/ai-docs/package.json +2 -2
  2. package/ai-docs/tsconfig.json +2 -1
  3. package/dist/BunAddressResolver.d.ts +15 -0
  4. package/dist/BunAddressResolver.d.ts.map +1 -0
  5. package/dist/BunAddressResolver.js +15 -0
  6. package/dist/BunAddressResolver.js.map +1 -0
  7. package/dist/BunChildProcessSpawner.d.ts +1 -0
  8. package/dist/BunChildProcessSpawner.d.ts.map +1 -1
  9. package/dist/BunChildProcessSpawner.js +1 -0
  10. package/dist/BunChildProcessSpawner.js.map +1 -1
  11. package/dist/BunClusterHttp.d.ts +3 -0
  12. package/dist/BunClusterHttp.d.ts.map +1 -1
  13. package/dist/BunClusterHttp.js +4 -0
  14. package/dist/BunClusterHttp.js.map +1 -1
  15. package/dist/BunClusterSocket.d.ts +5 -0
  16. package/dist/BunClusterSocket.d.ts.map +1 -1
  17. package/dist/BunClusterSocket.js +5 -0
  18. package/dist/BunClusterSocket.js.map +1 -1
  19. package/dist/BunCrypto.d.ts +1 -0
  20. package/dist/BunCrypto.d.ts.map +1 -1
  21. package/dist/BunCrypto.js +2 -0
  22. package/dist/BunCrypto.js.map +1 -1
  23. package/dist/BunDatagramSocket.d.ts +227 -0
  24. package/dist/BunDatagramSocket.d.ts.map +1 -0
  25. package/dist/BunDatagramSocket.js +502 -0
  26. package/dist/BunDatagramSocket.js.map +1 -0
  27. package/dist/BunDns.d.ts +72 -0
  28. package/dist/BunDns.d.ts.map +1 -0
  29. package/dist/BunDns.js +66 -0
  30. package/dist/BunDns.js.map +1 -0
  31. package/dist/BunFileSystem.d.ts +1 -0
  32. package/dist/BunFileSystem.d.ts.map +1 -1
  33. package/dist/BunFileSystem.js +2 -0
  34. package/dist/BunFileSystem.js.map +1 -1
  35. package/dist/BunHttpClient.d.ts +1 -0
  36. package/dist/BunHttpClient.d.ts.map +1 -1
  37. package/dist/BunHttpClient.js +1 -0
  38. package/dist/BunHttpClient.js.map +1 -1
  39. package/dist/BunHttpPlatform.d.ts +1 -0
  40. package/dist/BunHttpPlatform.d.ts.map +1 -1
  41. package/dist/BunHttpPlatform.js +2 -0
  42. package/dist/BunHttpPlatform.js.map +1 -1
  43. package/dist/BunHttpServer.d.ts +10 -1
  44. package/dist/BunHttpServer.d.ts.map +1 -1
  45. package/dist/BunHttpServer.js +16 -2
  46. package/dist/BunHttpServer.js.map +1 -1
  47. package/dist/BunHttpServerRequest.d.ts +2 -0
  48. package/dist/BunHttpServerRequest.d.ts.map +1 -1
  49. package/dist/BunHttpServerRequest.js +1 -0
  50. package/dist/BunHttpServerRequest.js.map +1 -1
  51. package/dist/BunMultipart.d.ts +3 -0
  52. package/dist/BunMultipart.d.ts.map +1 -1
  53. package/dist/BunMultipart.js +2 -0
  54. package/dist/BunMultipart.js.map +1 -1
  55. package/dist/BunPath.d.ts +3 -0
  56. package/dist/BunPath.d.ts.map +1 -1
  57. package/dist/BunPath.js +4 -0
  58. package/dist/BunPath.js.map +1 -1
  59. package/dist/BunRuntime.d.ts +3 -0
  60. package/dist/BunRuntime.d.ts.map +1 -1
  61. package/dist/BunRuntime.js +2 -0
  62. package/dist/BunRuntime.js.map +1 -1
  63. package/dist/BunServices.d.ts +3 -0
  64. package/dist/BunServices.d.ts.map +1 -1
  65. package/dist/BunServices.js +1 -0
  66. package/dist/BunServices.js.map +1 -1
  67. package/dist/BunSink.d.ts +1 -0
  68. package/dist/BunSink.d.ts.map +1 -1
  69. package/dist/BunSink.js +1 -0
  70. package/dist/BunSink.js.map +1 -1
  71. package/dist/BunSocket.d.ts +7 -2
  72. package/dist/BunSocket.d.ts.map +1 -1
  73. package/dist/BunSocket.js +18 -6
  74. package/dist/BunSocket.js.map +1 -1
  75. package/dist/BunSocketServer.d.ts +1 -0
  76. package/dist/BunSocketServer.d.ts.map +1 -1
  77. package/dist/BunSocketServer.js +1 -0
  78. package/dist/BunSocketServer.js.map +1 -1
  79. package/dist/BunStdio.d.ts +1 -0
  80. package/dist/BunStdio.d.ts.map +1 -1
  81. package/dist/BunStdio.js +2 -0
  82. package/dist/BunStdio.js.map +1 -1
  83. package/dist/BunStream.d.ts +1 -0
  84. package/dist/BunStream.d.ts.map +1 -1
  85. package/dist/BunStream.js +2 -0
  86. package/dist/BunStream.js.map +1 -1
  87. package/dist/BunTerminal.d.ts +6 -3
  88. package/dist/BunTerminal.d.ts.map +1 -1
  89. package/dist/BunTerminal.js +7 -3
  90. package/dist/BunTerminal.js.map +1 -1
  91. package/dist/BunWorker.d.ts +2 -0
  92. package/dist/BunWorker.d.ts.map +1 -1
  93. package/dist/BunWorker.js +3 -0
  94. package/dist/BunWorker.js.map +1 -1
  95. package/dist/BunWorkerRunner.d.ts +1 -0
  96. package/dist/BunWorkerRunner.d.ts.map +1 -1
  97. package/dist/BunWorkerRunner.js +2 -1
  98. package/dist/BunWorkerRunner.js.map +1 -1
  99. package/dist/index.d.ts +37 -0
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +37 -0
  102. package/dist/index.js.map +1 -1
  103. package/package.json +7 -5
  104. package/src/BunAddressResolver.ts +15 -0
  105. package/src/BunChildProcessSpawner.ts +1 -0
  106. package/src/BunClusterHttp.ts +4 -0
  107. package/src/BunClusterSocket.ts +5 -0
  108. package/src/BunCrypto.ts +2 -0
  109. package/src/BunDatagramSocket.ts +666 -0
  110. package/src/BunDns.ts +82 -0
  111. package/src/BunFileSystem.ts +2 -0
  112. package/src/BunHttpClient.ts +1 -0
  113. package/src/BunHttpPlatform.ts +2 -0
  114. package/src/BunHttpServer.ts +19 -1
  115. package/src/BunHttpServerRequest.ts +2 -0
  116. package/src/BunMultipart.ts +3 -0
  117. package/src/BunPath.ts +4 -0
  118. package/src/BunRuntime.ts +4 -0
  119. package/src/BunServices.ts +3 -0
  120. package/src/BunSink.ts +1 -0
  121. package/src/BunSocket.ts +28 -6
  122. package/src/BunSocketServer.ts +1 -0
  123. package/src/BunStdio.ts +2 -0
  124. package/src/BunStream.ts +2 -0
  125. package/src/BunTerminal.ts +7 -3
  126. package/src/BunWorker.ts +3 -0
  127. package/src/BunWorkerRunner.ts +2 -1
  128. package/src/index.ts +40 -0
package/dist/index.js CHANGED
@@ -1,48 +1,75 @@
1
1
  /**
2
+ * @stability unstable
2
3
  * @since 4.0.0
3
4
  */
4
5
  // @barrel: Auto-generated exports. Do not edit manually.
5
6
  /**
7
+ * @stability experimental
8
+ * @since 4.0.0
9
+ */
10
+ export * as BunAddressResolver from "./BunAddressResolver.js";
11
+ /**
12
+ * @stability unstable
6
13
  * @since 4.0.0
7
14
  */
8
15
  export * as BunChildProcessSpawner from "./BunChildProcessSpawner.js";
9
16
  /**
17
+ * @stability unstable
10
18
  * @since 4.0.0
11
19
  */
12
20
  export * as BunClusterHttp from "./BunClusterHttp.js";
13
21
  /**
22
+ * @stability unstable
14
23
  * @since 4.0.0
15
24
  */
16
25
  export * as BunClusterSocket from "./BunClusterSocket.js";
17
26
  /**
27
+ * @stability unstable
18
28
  * @since 1.0.0
19
29
  */
20
30
  export * as BunCrypto from "./BunCrypto.js";
21
31
  /**
32
+ * @stability experimental
33
+ * @since 4.0.0
34
+ */
35
+ export * as BunDatagramSocket from "./BunDatagramSocket.js";
36
+ /**
37
+ * @stability experimental
38
+ * @since 4.0.0
39
+ */
40
+ export * as BunDns from "./BunDns.js";
41
+ /**
42
+ * @stability unstable
22
43
  * @since 4.0.0
23
44
  */
24
45
  export * as BunFileSystem from "./BunFileSystem.js";
25
46
  /**
47
+ * @stability unstable
26
48
  * @since 4.0.0
27
49
  */
28
50
  export * as BunHttpClient from "./BunHttpClient.js";
29
51
  /**
52
+ * @stability unstable
30
53
  * @since 4.0.0
31
54
  */
32
55
  export * as BunHttpPlatform from "./BunHttpPlatform.js";
33
56
  /**
57
+ * @stability unstable
34
58
  * @since 4.0.0
35
59
  */
36
60
  export * as BunHttpServer from "./BunHttpServer.js";
37
61
  /**
62
+ * @stability unstable
38
63
  * @since 4.0.0
39
64
  */
40
65
  export * as BunHttpServerRequest from "./BunHttpServerRequest.js";
41
66
  /**
67
+ * @stability unstable
42
68
  * @since 4.0.0
43
69
  */
44
70
  export * as BunMultipart from "./BunMultipart.js";
45
71
  /**
72
+ * @stability unstable
46
73
  * @since 4.0.0
47
74
  */
48
75
  export * as BunPath from "./BunPath.js";
@@ -52,42 +79,52 @@ export * as BunPath from "./BunPath.js";
52
79
  */
53
80
  export * as BunRedis from "./BunRedis.js";
54
81
  /**
82
+ * @stability unstable
55
83
  * @since 4.0.0
56
84
  */
57
85
  export * as BunRuntime from "./BunRuntime.js";
58
86
  /**
87
+ * @stability unstable
59
88
  * @since 4.0.0
60
89
  */
61
90
  export * as BunServices from "./BunServices.js";
62
91
  /**
92
+ * @stability unstable
63
93
  * @since 4.0.0
64
94
  */
65
95
  export * as BunSink from "./BunSink.js";
66
96
  /**
97
+ * @stability unstable
67
98
  * @since 4.0.0
68
99
  */
69
100
  export * as BunSocket from "./BunSocket.js";
70
101
  /**
102
+ * @stability unstable
71
103
  * @since 4.0.0
72
104
  */
73
105
  export * as BunSocketServer from "./BunSocketServer.js";
74
106
  /**
107
+ * @stability unstable
75
108
  * @since 4.0.0
76
109
  */
77
110
  export * as BunStdio from "./BunStdio.js";
78
111
  /**
112
+ * @stability unstable
79
113
  * @since 4.0.0
80
114
  */
81
115
  export * as BunStream from "./BunStream.js";
82
116
  /**
117
+ * @stability unstable
83
118
  * @since 4.0.0
84
119
  */
85
120
  export * as BunTerminal from "./BunTerminal.js";
86
121
  /**
122
+ * @stability unstable
87
123
  * @since 4.0.0
88
124
  */
89
125
  export * as BunWorker from "./BunWorker.js";
90
126
  /**
127
+ * @stability unstable
91
128
  * @since 4.0.0
92
129
  */
93
130
  export * as BunWorkerRunner from "./BunWorkerRunner.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourc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2
  "name": "@effect/platform-bun",
3
3
  "type": "module",
4
- "version": "4.0.1",
4
+ "version": "4.0.3",
5
5
  "license": "MIT",
6
6
  "description": "Platform specific implementations for the Bun runtime",
7
7
  "homepage": "https://effect.website",
@@ -49,19 +49,21 @@
49
49
  "provenance": true
50
50
  },
51
51
  "peerDependencies": {
52
- "effect": "^4.0.1"
52
+ "effect": "^4.0.3"
53
53
  },
54
54
  "dependencies": {
55
- "@effect/platform-node-shared": "^4.0.1"
55
+ "@effect/platform-node-shared": "^4.0.3"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/bun": "^1.4.2",
59
- "effect": "^4.0.1"
59
+ "tinybench": "^6.2.0",
60
+ "effect": "^4.0.3"
60
61
  },
61
62
  "scripts": {
62
63
  "codegen": "effect-utils codegen",
63
64
  "build": "tsc -b tsconfig.json && pnpm babel",
64
65
  "babel": "babel dist --plugins annotate-pure-calls --out-dir dist --source-maps",
65
- "check": "tsc -b tsconfig.json"
66
+ "check": "tsc -b tsconfig.json",
67
+ "benchmark:datagram": "bun benchmark/DatagramSocket.ts"
66
68
  }
67
69
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Bun implementation of Effect's `AddressResolver` service.
3
+ *
4
+ * IPv6 literals with a named zone such as `fe80::1%eth0` get their scope ID
5
+ * from `os.networkInterfaces()`, listed each time a named zone is resolved.
6
+ *
7
+ * @stability experimental
8
+ * @since 4.0.0
9
+ */
10
+
11
+ /**
12
+ * @stability experimental
13
+ * @since 4.0.0
14
+ */
15
+ export * from "@effect/platform-node-shared/NodeAddressResolver"
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Bun implementation of `ChildProcessSpawner`.
3
3
  *
4
+ * @stability unstable
4
5
  * @since 4.0.0
5
6
  */
6
7
  export * from "@effect/platform-node-shared/NodeChildProcessSpawner"
@@ -6,6 +6,7 @@
6
6
  * choosing serialization, runner health checks, runner storage, message
7
7
  * storage, and optional client-only mode from the supplied options.
8
8
  *
9
+ * @stability unstable
9
10
  * @since 4.0.0
10
11
  */
11
12
  import * as HttpRunner from "effect/cluster/HttpRunner"
@@ -39,6 +40,7 @@ export {
39
40
  /**
40
41
  * Layer that provides a Kubernetes HTTP client for runner health checks.
41
42
  *
43
+ * @stability unstable
42
44
  * @category re-exports
43
45
  * @since 4.0.0
44
46
  */
@@ -48,6 +50,7 @@ export {
48
50
  /**
49
51
  * Layer that provides a Bun HTTP server for cluster runners.
50
52
  *
53
+ * @stability unstable
51
54
  * @category layers
52
55
  * @since 4.0.0
53
56
  */
@@ -94,6 +97,7 @@ export const layerHttpServer: Layer.Layer<
94
97
  * @see {@link layerHttpServer} for the server layer used by non-client-only transports
95
98
  * @see {@link layerK8sHttpClient} for Kubernetes runner health support
96
99
  *
100
+ * @stability unstable
97
101
  * @category layers
98
102
  * @since 4.0.0
99
103
  */
@@ -7,6 +7,7 @@
7
7
  * re-exports the shared socket client and server protocol layers and provides
8
8
  * `layerK8sHttpClient` for Kubernetes runner health checks.
9
9
  *
10
+ * @stability unstable
10
11
  * @since 4.0.0
11
12
  */
12
13
  import { layerClientProtocol, layerSocketServer } from "@effect/platform-node-shared/NodeClusterSocket"
@@ -36,6 +37,7 @@ export {
36
37
  * Provides the cluster `RpcClientProtocol` using the shared socket client
37
38
  * implementation.
38
39
  *
40
+ * @stability unstable
39
41
  * @category re-exports
40
42
  * @since 4.0.0
41
43
  */
@@ -44,6 +46,7 @@ export {
44
46
  * Provides the socket server used by Bun cluster runners through the shared
45
47
  * socket server implementation.
46
48
  *
49
+ * @stability unstable
47
50
  * @category re-exports
48
51
  * @since 4.0.0
49
52
  */
@@ -53,6 +56,7 @@ export {
53
56
  /**
54
57
  * Creates Bun socket cluster layers, configuring serialization, storage, runner health, and optional client-only mode.
55
58
  *
59
+ * @stability unstable
56
60
  * @category layers
57
61
  * @since 4.0.0
58
62
  */
@@ -134,6 +138,7 @@ export const layer = <
134
138
  /**
135
139
  * Layer that provides `K8sHttpClient`, using the Kubernetes service-account CA certificate when it is available.
136
140
  *
141
+ * @stability unstable
137
142
  * @category layers
138
143
  * @since 4.0.0
139
144
  */
package/src/BunCrypto.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  * present for interoperability with existing protocols, not for new
10
10
  * security-sensitive designs.
11
11
  *
12
+ * @stability unstable
12
13
  * @since 1.0.0
13
14
  */
14
15
  import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto"
@@ -18,6 +19,7 @@ import type * as Layer from "effect/Layer"
18
19
  /**
19
20
  * Layer that provides the Bun Crypto service implementation.
20
21
  *
22
+ * @stability unstable
21
23
  * @category layers
22
24
  * @since 1.0.0
23
25
  */