@effect/platform-bun 4.0.1 → 4.0.2
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.
- package/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/BunChildProcessSpawner.d.ts +1 -0
- package/dist/BunChildProcessSpawner.d.ts.map +1 -1
- package/dist/BunChildProcessSpawner.js +1 -0
- package/dist/BunChildProcessSpawner.js.map +1 -1
- package/dist/BunClusterHttp.d.ts +3 -0
- package/dist/BunClusterHttp.d.ts.map +1 -1
- package/dist/BunClusterHttp.js +4 -0
- package/dist/BunClusterHttp.js.map +1 -1
- package/dist/BunClusterSocket.d.ts +5 -0
- package/dist/BunClusterSocket.d.ts.map +1 -1
- package/dist/BunClusterSocket.js +5 -0
- package/dist/BunClusterSocket.js.map +1 -1
- package/dist/BunCrypto.d.ts +1 -0
- package/dist/BunCrypto.d.ts.map +1 -1
- package/dist/BunCrypto.js +2 -0
- package/dist/BunCrypto.js.map +1 -1
- package/dist/BunFileSystem.d.ts +1 -0
- package/dist/BunFileSystem.d.ts.map +1 -1
- package/dist/BunFileSystem.js +2 -0
- package/dist/BunFileSystem.js.map +1 -1
- package/dist/BunHttpClient.d.ts +1 -0
- package/dist/BunHttpClient.d.ts.map +1 -1
- package/dist/BunHttpClient.js +1 -0
- package/dist/BunHttpClient.js.map +1 -1
- package/dist/BunHttpPlatform.d.ts +1 -0
- package/dist/BunHttpPlatform.d.ts.map +1 -1
- package/dist/BunHttpPlatform.js +2 -0
- package/dist/BunHttpPlatform.js.map +1 -1
- package/dist/BunHttpServer.d.ts +10 -1
- package/dist/BunHttpServer.d.ts.map +1 -1
- package/dist/BunHttpServer.js +16 -2
- package/dist/BunHttpServer.js.map +1 -1
- package/dist/BunHttpServerRequest.d.ts +2 -0
- package/dist/BunHttpServerRequest.d.ts.map +1 -1
- package/dist/BunHttpServerRequest.js +1 -0
- package/dist/BunHttpServerRequest.js.map +1 -1
- package/dist/BunMultipart.d.ts +3 -0
- package/dist/BunMultipart.d.ts.map +1 -1
- package/dist/BunMultipart.js +2 -0
- package/dist/BunMultipart.js.map +1 -1
- package/dist/BunPath.d.ts +3 -0
- package/dist/BunPath.d.ts.map +1 -1
- package/dist/BunPath.js +4 -0
- package/dist/BunPath.js.map +1 -1
- package/dist/BunRuntime.d.ts +3 -0
- package/dist/BunRuntime.d.ts.map +1 -1
- package/dist/BunRuntime.js +2 -0
- package/dist/BunRuntime.js.map +1 -1
- package/dist/BunServices.d.ts +3 -0
- package/dist/BunServices.d.ts.map +1 -1
- package/dist/BunServices.js +1 -0
- package/dist/BunServices.js.map +1 -1
- package/dist/BunSink.d.ts +1 -0
- package/dist/BunSink.d.ts.map +1 -1
- package/dist/BunSink.js +1 -0
- package/dist/BunSink.js.map +1 -1
- package/dist/BunSocket.d.ts +3 -0
- package/dist/BunSocket.d.ts.map +1 -1
- package/dist/BunSocket.js +2 -0
- package/dist/BunSocket.js.map +1 -1
- package/dist/BunSocketServer.d.ts +1 -0
- package/dist/BunSocketServer.d.ts.map +1 -1
- package/dist/BunSocketServer.js +1 -0
- package/dist/BunSocketServer.js.map +1 -1
- package/dist/BunStdio.d.ts +1 -0
- package/dist/BunStdio.d.ts.map +1 -1
- package/dist/BunStdio.js +2 -0
- package/dist/BunStdio.js.map +1 -1
- package/dist/BunStream.d.ts +1 -0
- package/dist/BunStream.d.ts.map +1 -1
- package/dist/BunStream.js +2 -0
- package/dist/BunStream.js.map +1 -1
- package/dist/BunTerminal.d.ts +2 -0
- package/dist/BunTerminal.d.ts.map +1 -1
- package/dist/BunTerminal.js +3 -0
- package/dist/BunTerminal.js.map +1 -1
- package/dist/BunWorker.d.ts +2 -0
- package/dist/BunWorker.d.ts.map +1 -1
- package/dist/BunWorker.js +3 -0
- package/dist/BunWorker.js.map +1 -1
- package/dist/BunWorkerRunner.d.ts +1 -0
- package/dist/BunWorkerRunner.d.ts.map +1 -1
- package/dist/BunWorkerRunner.js +2 -0
- package/dist/BunWorkerRunner.js.map +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/BunChildProcessSpawner.ts +1 -0
- package/src/BunClusterHttp.ts +4 -0
- package/src/BunClusterSocket.ts +5 -0
- package/src/BunCrypto.ts +2 -0
- package/src/BunFileSystem.ts +2 -0
- package/src/BunHttpClient.ts +1 -0
- package/src/BunHttpPlatform.ts +2 -0
- package/src/BunHttpServer.ts +19 -1
- package/src/BunHttpServerRequest.ts +2 -0
- package/src/BunMultipart.ts +3 -0
- package/src/BunPath.ts +4 -0
- package/src/BunRuntime.ts +4 -0
- package/src/BunServices.ts +3 -0
- package/src/BunSink.ts +1 -0
- package/src/BunSocket.ts +3 -0
- package/src/BunSocketServer.ts +1 -0
- package/src/BunStdio.ts +2 -0
- package/src/BunStream.ts +2 -0
- package/src/BunTerminal.ts +3 -0
- package/src/BunWorker.ts +3 -0
- package/src/BunWorkerRunner.ts +2 -0
- package/src/index.ts +22 -0
package/src/BunServices.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* and terminal services. Use the layer when a Bun program wants the standard
|
|
7
7
|
* platform services from one place.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import type { Crypto } from "effect/Crypto"
|
|
@@ -26,6 +27,7 @@ import * as BunTerminal from "./BunTerminal.ts"
|
|
|
26
27
|
* The union of core services provided by the Bun platform layer, including child
|
|
27
28
|
* process spawning, filesystem, path, stdio, and terminal services.
|
|
28
29
|
*
|
|
30
|
+
* @stability unstable
|
|
29
31
|
* @category models
|
|
30
32
|
* @since 4.0.0
|
|
31
33
|
*/
|
|
@@ -35,6 +37,7 @@ export type BunServices = ChildProcessSpawner | Crypto | FileSystem | Path | Ter
|
|
|
35
37
|
* Provides the default Bun implementations for child process spawning,
|
|
36
38
|
* filesystem, path, stdio, and terminal services.
|
|
37
39
|
*
|
|
40
|
+
* @stability unstable
|
|
38
41
|
* @category layers
|
|
39
42
|
* @since 4.0.0
|
|
40
43
|
*/
|
package/src/BunSink.ts
CHANGED
package/src/BunSocket.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* It also provides Bun WebSocket layers using `globalThis.WebSocket`, including
|
|
7
7
|
* a constructor layer and a `Socket.Socket` layer for a WebSocket URL.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import type * as Duration from "effect/Duration"
|
|
@@ -23,6 +24,7 @@ export * from "@effect/platform-node-shared/NodeSocket"
|
|
|
23
24
|
* Provides a `Socket.WebSocketConstructor` backed by Bun's global
|
|
24
25
|
* `WebSocket` implementation.
|
|
25
26
|
*
|
|
27
|
+
* @stability unstable
|
|
26
28
|
* @category layers
|
|
27
29
|
* @since 4.0.0
|
|
28
30
|
*/
|
|
@@ -40,6 +42,7 @@ export const layerWebSocketConstructor: Layer.Layer<
|
|
|
40
42
|
* `WebSocket` constructor, honoring protocol, open-timeout, and
|
|
41
43
|
* high-water-mark options.
|
|
42
44
|
*
|
|
45
|
+
* @stability unstable
|
|
43
46
|
* @category layers
|
|
44
47
|
* @since 4.0.0
|
|
45
48
|
*/
|
package/src/BunSocketServer.ts
CHANGED
package/src/BunStdio.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* is read from `process.stdin`, and output and error output write to
|
|
7
7
|
* `process.stdout` and `process.stderr`.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import * as NodeStdio from "@effect/platform-node-shared/NodeStdio"
|
|
@@ -16,6 +17,7 @@ import type { Stdio } from "effect/Stdio"
|
|
|
16
17
|
* Provides the `Stdio` service backed by the current process arguments,
|
|
17
18
|
* stdin, stdout, and stderr streams.
|
|
18
19
|
*
|
|
20
|
+
* @stability unstable
|
|
19
21
|
* @category layers
|
|
20
22
|
* @since 4.0.0
|
|
21
23
|
*/
|
package/src/BunStream.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* `ReadableStream` adapter that uses Bun's `readMany` reader method to pull
|
|
8
8
|
* batches of values into an Effect `Stream`.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as Arr from "effect/Array"
|
|
@@ -27,6 +28,7 @@ export * from "@effect/platform-node-shared/NodeStream"
|
|
|
27
28
|
* Creates a stream from a `ReadableStream` using Bun's optimized `.readMany`
|
|
28
29
|
* API.
|
|
29
30
|
*
|
|
31
|
+
* @stability unstable
|
|
30
32
|
* @category constructors
|
|
31
33
|
* @since 4.0.0
|
|
32
34
|
*/
|
package/src/BunTerminal.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* creates a scoped process-backed `Terminal` service, and `layer` provides the
|
|
6
6
|
* default terminal service with the standard quit behavior for key input.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import * as NodeTerminal from "@effect/platform-node-shared/NodeTerminal"
|
|
@@ -17,6 +18,7 @@ import type { Terminal, UserInput } from "effect/Terminal"
|
|
|
17
18
|
* Creates a scoped `Terminal` service backed by process stdin/stdout, using the
|
|
18
19
|
* optional predicate to decide when key input should end the input stream.
|
|
19
20
|
*
|
|
21
|
+
* @stability unstable
|
|
20
22
|
* @category constructors
|
|
21
23
|
* @since 4.0.0
|
|
22
24
|
*/
|
|
@@ -26,6 +28,7 @@ export const make: (shouldQuit?: (input: UserInput) => boolean) => Effect<Termin
|
|
|
26
28
|
* Provides the default process-backed `Terminal` service, ending key input on
|
|
27
29
|
* the default quit keys.
|
|
28
30
|
*
|
|
31
|
+
* @stability unstable
|
|
29
32
|
* @category layers
|
|
30
33
|
* @since 4.0.0
|
|
31
34
|
*/
|
package/src/BunWorker.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* asks workers to close on scope finalization, and terminates them if graceful
|
|
9
9
|
* shutdown times out.
|
|
10
10
|
*
|
|
11
|
+
* @stability unstable
|
|
11
12
|
* @since 4.0.0
|
|
12
13
|
*/
|
|
13
14
|
import * as Deferred from "effect/Deferred"
|
|
@@ -22,6 +23,7 @@ import { WorkerError, WorkerUnknownError } from "effect/workers/WorkerError"
|
|
|
22
23
|
* Provides the Bun `WorkerPlatform` together with a `Worker.Spawner` created
|
|
23
24
|
* from the supplied worker spawning function.
|
|
24
25
|
*
|
|
26
|
+
* @stability unstable
|
|
25
27
|
* @category layers
|
|
26
28
|
* @since 4.0.0
|
|
27
29
|
*/
|
|
@@ -38,6 +40,7 @@ export const layer = (
|
|
|
38
40
|
* Effect workers and requesting graceful worker shutdown during scope
|
|
39
41
|
* finalization before terminating on timeout.
|
|
40
42
|
*
|
|
43
|
+
* @stability unstable
|
|
41
44
|
* @category layers
|
|
42
45
|
* @since 4.0.0
|
|
43
46
|
*/
|
package/src/BunWorkerRunner.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* responses through the worker `postMessage` channel, and closes when the
|
|
8
8
|
* parent sends the close message.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as Cause from "effect/Cause"
|
|
@@ -27,6 +28,7 @@ declare const self: MessagePort
|
|
|
27
28
|
* routing parent messages to the registered handler and sending responses back
|
|
28
29
|
* through the worker port.
|
|
29
30
|
*
|
|
31
|
+
* @stability unstable
|
|
30
32
|
* @category layers
|
|
31
33
|
* @since 4.0.0
|
|
32
34
|
*/
|
package/src/index.ts
CHANGED
|
@@ -1,60 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @stability unstable
|
|
2
3
|
* @since 4.0.0
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
7
|
|
|
7
8
|
/**
|
|
9
|
+
* @stability unstable
|
|
8
10
|
* @since 4.0.0
|
|
9
11
|
*/
|
|
10
12
|
export * as BunChildProcessSpawner from "./BunChildProcessSpawner.ts"
|
|
11
13
|
|
|
12
14
|
/**
|
|
15
|
+
* @stability unstable
|
|
13
16
|
* @since 4.0.0
|
|
14
17
|
*/
|
|
15
18
|
export * as BunClusterHttp from "./BunClusterHttp.ts"
|
|
16
19
|
|
|
17
20
|
/**
|
|
21
|
+
* @stability unstable
|
|
18
22
|
* @since 4.0.0
|
|
19
23
|
*/
|
|
20
24
|
export * as BunClusterSocket from "./BunClusterSocket.ts"
|
|
21
25
|
|
|
22
26
|
/**
|
|
27
|
+
* @stability unstable
|
|
23
28
|
* @since 1.0.0
|
|
24
29
|
*/
|
|
25
30
|
export * as BunCrypto from "./BunCrypto.ts"
|
|
26
31
|
|
|
27
32
|
/**
|
|
33
|
+
* @stability unstable
|
|
28
34
|
* @since 4.0.0
|
|
29
35
|
*/
|
|
30
36
|
export * as BunFileSystem from "./BunFileSystem.ts"
|
|
31
37
|
|
|
32
38
|
/**
|
|
39
|
+
* @stability unstable
|
|
33
40
|
* @since 4.0.0
|
|
34
41
|
*/
|
|
35
42
|
export * as BunHttpClient from "./BunHttpClient.ts"
|
|
36
43
|
|
|
37
44
|
/**
|
|
45
|
+
* @stability unstable
|
|
38
46
|
* @since 4.0.0
|
|
39
47
|
*/
|
|
40
48
|
export * as BunHttpPlatform from "./BunHttpPlatform.ts"
|
|
41
49
|
|
|
42
50
|
/**
|
|
51
|
+
* @stability unstable
|
|
43
52
|
* @since 4.0.0
|
|
44
53
|
*/
|
|
45
54
|
export * as BunHttpServer from "./BunHttpServer.ts"
|
|
46
55
|
|
|
47
56
|
/**
|
|
57
|
+
* @stability unstable
|
|
48
58
|
* @since 4.0.0
|
|
49
59
|
*/
|
|
50
60
|
export * as BunHttpServerRequest from "./BunHttpServerRequest.ts"
|
|
51
61
|
|
|
52
62
|
/**
|
|
63
|
+
* @stability unstable
|
|
53
64
|
* @since 4.0.0
|
|
54
65
|
*/
|
|
55
66
|
export * as BunMultipart from "./BunMultipart.ts"
|
|
56
67
|
|
|
57
68
|
/**
|
|
69
|
+
* @stability unstable
|
|
58
70
|
* @since 4.0.0
|
|
59
71
|
*/
|
|
60
72
|
export * as BunPath from "./BunPath.ts"
|
|
@@ -66,51 +78,61 @@ export * as BunPath from "./BunPath.ts"
|
|
|
66
78
|
export * as BunRedis from "./BunRedis.ts"
|
|
67
79
|
|
|
68
80
|
/**
|
|
81
|
+
* @stability unstable
|
|
69
82
|
* @since 4.0.0
|
|
70
83
|
*/
|
|
71
84
|
export * as BunRuntime from "./BunRuntime.ts"
|
|
72
85
|
|
|
73
86
|
/**
|
|
87
|
+
* @stability unstable
|
|
74
88
|
* @since 4.0.0
|
|
75
89
|
*/
|
|
76
90
|
export * as BunServices from "./BunServices.ts"
|
|
77
91
|
|
|
78
92
|
/**
|
|
93
|
+
* @stability unstable
|
|
79
94
|
* @since 4.0.0
|
|
80
95
|
*/
|
|
81
96
|
export * as BunSink from "./BunSink.ts"
|
|
82
97
|
|
|
83
98
|
/**
|
|
99
|
+
* @stability unstable
|
|
84
100
|
* @since 4.0.0
|
|
85
101
|
*/
|
|
86
102
|
export * as BunSocket from "./BunSocket.ts"
|
|
87
103
|
|
|
88
104
|
/**
|
|
105
|
+
* @stability unstable
|
|
89
106
|
* @since 4.0.0
|
|
90
107
|
*/
|
|
91
108
|
export * as BunSocketServer from "./BunSocketServer.ts"
|
|
92
109
|
|
|
93
110
|
/**
|
|
111
|
+
* @stability unstable
|
|
94
112
|
* @since 4.0.0
|
|
95
113
|
*/
|
|
96
114
|
export * as BunStdio from "./BunStdio.ts"
|
|
97
115
|
|
|
98
116
|
/**
|
|
117
|
+
* @stability unstable
|
|
99
118
|
* @since 4.0.0
|
|
100
119
|
*/
|
|
101
120
|
export * as BunStream from "./BunStream.ts"
|
|
102
121
|
|
|
103
122
|
/**
|
|
123
|
+
* @stability unstable
|
|
104
124
|
* @since 4.0.0
|
|
105
125
|
*/
|
|
106
126
|
export * as BunTerminal from "./BunTerminal.ts"
|
|
107
127
|
|
|
108
128
|
/**
|
|
129
|
+
* @stability unstable
|
|
109
130
|
* @since 4.0.0
|
|
110
131
|
*/
|
|
111
132
|
export * as BunWorker from "./BunWorker.ts"
|
|
112
133
|
|
|
113
134
|
/**
|
|
135
|
+
* @stability unstable
|
|
114
136
|
* @since 4.0.0
|
|
115
137
|
*/
|
|
116
138
|
export * as BunWorkerRunner from "./BunWorkerRunner.ts"
|