@effect/platform-deno 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 (123) hide show
  1. package/ai-docs/package.json +2 -2
  2. package/ai-docs/tsconfig.json +2 -1
  3. package/dist/DenoAddressResolver.d.ts +13 -0
  4. package/dist/DenoAddressResolver.d.ts.map +1 -0
  5. package/dist/DenoAddressResolver.js +32 -0
  6. package/dist/DenoAddressResolver.js.map +1 -0
  7. package/dist/DenoChildProcessSpawner.d.ts +4 -0
  8. package/dist/DenoChildProcessSpawner.d.ts.map +1 -1
  9. package/dist/DenoChildProcessSpawner.js +2 -0
  10. package/dist/DenoChildProcessSpawner.js.map +1 -1
  11. package/dist/DenoClusterHttp.d.ts +3 -0
  12. package/dist/DenoClusterHttp.d.ts.map +1 -1
  13. package/dist/DenoClusterHttp.js +4 -0
  14. package/dist/DenoClusterHttp.js.map +1 -1
  15. package/dist/DenoClusterSocket.d.ts +5 -0
  16. package/dist/DenoClusterSocket.d.ts.map +1 -1
  17. package/dist/DenoClusterSocket.js +5 -0
  18. package/dist/DenoClusterSocket.js.map +1 -1
  19. package/dist/DenoCrypto.d.ts +3 -0
  20. package/dist/DenoCrypto.d.ts.map +1 -1
  21. package/dist/DenoCrypto.js +3 -0
  22. package/dist/DenoCrypto.js.map +1 -1
  23. package/dist/DenoDatagramSocket.d.ts +208 -0
  24. package/dist/DenoDatagramSocket.d.ts.map +1 -0
  25. package/dist/DenoDatagramSocket.js +423 -0
  26. package/dist/DenoDatagramSocket.js.map +1 -0
  27. package/dist/DenoDns.d.ts +62 -0
  28. package/dist/DenoDns.d.ts.map +1 -0
  29. package/dist/DenoDns.js +144 -0
  30. package/dist/DenoDns.js.map +1 -0
  31. package/dist/DenoFileSystem.d.ts +1 -0
  32. package/dist/DenoFileSystem.d.ts.map +1 -1
  33. package/dist/DenoFileSystem.js +50 -19
  34. package/dist/DenoFileSystem.js.map +1 -1
  35. package/dist/DenoHttpClient.d.ts +1 -0
  36. package/dist/DenoHttpClient.d.ts.map +1 -1
  37. package/dist/DenoHttpClient.js +1 -0
  38. package/dist/DenoHttpClient.js.map +1 -1
  39. package/dist/DenoHttpPlatform.d.ts +2 -0
  40. package/dist/DenoHttpPlatform.d.ts.map +1 -1
  41. package/dist/DenoHttpPlatform.js +3 -0
  42. package/dist/DenoHttpPlatform.js.map +1 -1
  43. package/dist/DenoHttpServer.d.ts +9 -1
  44. package/dist/DenoHttpServer.d.ts.map +1 -1
  45. package/dist/DenoHttpServer.js +15 -4
  46. package/dist/DenoHttpServer.js.map +1 -1
  47. package/dist/DenoHttpServerRequest.d.ts +2 -0
  48. package/dist/DenoHttpServerRequest.d.ts.map +1 -1
  49. package/dist/DenoHttpServerRequest.js +1 -0
  50. package/dist/DenoHttpServerRequest.js.map +1 -1
  51. package/dist/DenoKeyValueStore.d.ts +3 -0
  52. package/dist/DenoKeyValueStore.d.ts.map +1 -1
  53. package/dist/DenoKeyValueStore.js +3 -0
  54. package/dist/DenoKeyValueStore.js.map +1 -1
  55. package/dist/DenoMultipart.d.ts +3 -0
  56. package/dist/DenoMultipart.d.ts.map +1 -1
  57. package/dist/DenoMultipart.js +2 -0
  58. package/dist/DenoMultipart.js.map +1 -1
  59. package/dist/DenoPath.d.ts +4 -0
  60. package/dist/DenoPath.d.ts.map +1 -1
  61. package/dist/DenoPath.js +4 -0
  62. package/dist/DenoPath.js.map +1 -1
  63. package/dist/DenoRuntime.d.ts +4 -0
  64. package/dist/DenoRuntime.d.ts.map +1 -1
  65. package/dist/DenoRuntime.js +2 -0
  66. package/dist/DenoRuntime.js.map +1 -1
  67. package/dist/DenoServices.d.ts +3 -0
  68. package/dist/DenoServices.d.ts.map +1 -1
  69. package/dist/DenoServices.js +1 -0
  70. package/dist/DenoServices.js.map +1 -1
  71. package/dist/DenoSocket.d.ts +10 -0
  72. package/dist/DenoSocket.d.ts.map +1 -1
  73. package/dist/DenoSocket.js +8 -0
  74. package/dist/DenoSocket.js.map +1 -1
  75. package/dist/DenoSocketServer.d.ts +1 -0
  76. package/dist/DenoSocketServer.d.ts.map +1 -1
  77. package/dist/DenoSocketServer.js +1 -0
  78. package/dist/DenoSocketServer.js.map +1 -1
  79. package/dist/DenoStdio.d.ts +1 -0
  80. package/dist/DenoStdio.d.ts.map +1 -1
  81. package/dist/DenoStdio.js +3 -0
  82. package/dist/DenoStdio.js.map +1 -1
  83. package/dist/DenoTerminal.d.ts +6 -3
  84. package/dist/DenoTerminal.d.ts.map +1 -1
  85. package/dist/DenoTerminal.js +7 -3
  86. package/dist/DenoTerminal.js.map +1 -1
  87. package/dist/DenoWorker.d.ts +2 -0
  88. package/dist/DenoWorker.d.ts.map +1 -1
  89. package/dist/DenoWorker.js +3 -0
  90. package/dist/DenoWorker.js.map +1 -1
  91. package/dist/DenoWorkerRunner.d.ts +3 -0
  92. package/dist/DenoWorkerRunner.d.ts.map +1 -1
  93. package/dist/DenoWorkerRunner.js +4 -0
  94. package/dist/DenoWorkerRunner.js.map +1 -1
  95. package/dist/index.d.ts +36 -0
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +36 -0
  98. package/dist/index.js.map +1 -1
  99. package/package.json +8 -6
  100. package/src/DenoAddressResolver.ts +36 -0
  101. package/src/DenoChildProcessSpawner.ts +4 -0
  102. package/src/DenoClusterHttp.ts +4 -0
  103. package/src/DenoClusterSocket.ts +5 -0
  104. package/src/DenoCrypto.ts +3 -0
  105. package/src/DenoDatagramSocket.ts +571 -0
  106. package/src/DenoDns.ts +196 -0
  107. package/src/DenoFileSystem.ts +62 -27
  108. package/src/DenoHttpClient.ts +1 -0
  109. package/src/DenoHttpPlatform.ts +3 -0
  110. package/src/DenoHttpServer.ts +18 -3
  111. package/src/DenoHttpServerRequest.ts +2 -0
  112. package/src/DenoKeyValueStore.ts +3 -0
  113. package/src/DenoMultipart.ts +3 -0
  114. package/src/DenoPath.ts +4 -0
  115. package/src/DenoRuntime.ts +4 -0
  116. package/src/DenoServices.ts +3 -0
  117. package/src/DenoSocket.ts +10 -0
  118. package/src/DenoSocketServer.ts +1 -0
  119. package/src/DenoStdio.ts +3 -0
  120. package/src/DenoTerminal.ts +7 -3
  121. package/src/DenoWorker.ts +3 -0
  122. package/src/DenoWorkerRunner.ts +4 -0
  123. package/src/index.ts +39 -0
package/src/DenoSocket.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  * `keepAlive` options have no effect on Unix connections. A `CloseEvent` always
8
8
  * closes gracefully because Deno has no equivalent of Node's reset-on-close.
9
9
  *
10
+ * @stability unstable
10
11
  * @since 4.0.0
11
12
  */
12
13
  import * as Arr from "effect/Array"
@@ -24,6 +25,7 @@ import * as Socket from "effect/socket/Socket"
24
25
  /**
25
26
  * Options for opening a TCP or Unix connection.
26
27
  *
28
+ * @stability unstable
27
29
  * @category options
28
30
  * @since 4.0.0
29
31
  */
@@ -35,6 +37,7 @@ export type ConnectOptions = (Deno.ConnectOptions | Deno.UnixConnectOptions) & {
35
37
  /**
36
38
  * Options for opening a TCP or Unix connection.
37
39
  *
40
+ * @stability unstable
38
41
  * @category options
39
42
  * @since 4.0.0
40
43
  */
@@ -45,6 +48,7 @@ export type TcpOptions = ConnectOptions & {
45
48
  /**
46
49
  * Service tag for the underlying Deno connection.
47
50
  *
51
+ * @stability unstable
48
52
  * @category services
49
53
  * @since 4.0.0
50
54
  */
@@ -66,6 +70,7 @@ export class Conn extends Context.Service<Conn, Deno.Conn>()(
66
70
  * `rejectUnauthorized` to `false` disables hostname verification only;
67
71
  * certificate-chain validation still applies.
68
72
  *
73
+ * @stability unstable
69
74
  * @category constructors
70
75
  * @since 4.0.0
71
76
  */
@@ -268,6 +273,7 @@ export const fromConn = <RO>(
268
273
  * `Deno.connect` promise. The scope finalizer closes a connection that arrives
269
274
  * after the timeout.
270
275
  *
276
+ * @stability unstable
271
277
  * @category constructors
272
278
  * @since 4.0.0
273
279
  */
@@ -329,6 +335,7 @@ export const makeTcp = (options: TcpOptions): Effect.Effect<Socket.Socket> => {
329
335
  /**
330
336
  * Creates a channel over a native Deno TCP or Unix connection.
331
337
  *
338
+ * @stability unstable
332
339
  * @category constructors
333
340
  * @since 4.0.0
334
341
  */
@@ -345,6 +352,7 @@ export const makeTcpChannel = <IE = never>(
345
352
  /**
346
353
  * Provides a socket by opening a native Deno TCP or Unix connection.
347
354
  *
355
+ * @stability unstable
348
356
  * @category layers
349
357
  * @since 4.0.0
350
358
  */
@@ -356,6 +364,7 @@ export const layerTcp: (options: ConnectOptions) => Layer.Layer<
356
364
  /**
357
365
  * Creates a socket layer connected to a URL with Deno's global WebSocket.
358
366
  *
367
+ * @stability unstable
359
368
  * @category layers
360
369
  * @since 4.0.0
361
370
  */
@@ -371,6 +380,7 @@ export const layerWebSocket = (url: string, options?: {
371
380
  /**
372
381
  * Provides the WebSocket constructor backed by `globalThis.WebSocket`.
373
382
  *
383
+ * @stability unstable
374
384
  * @category layers
375
385
  * @since 4.0.0
376
386
  */
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @stability unstable
2
3
  * @since 4.0.0
3
4
  */
4
5
 
package/src/DenoStdio.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * arguments and Web Streams. Standard input remains open, and standard output
6
6
  * and error output are not closed unless requested through `endOnDone`.
7
7
  *
8
+ * @stability unstable
8
9
  * @since 4.0.0
9
10
  */
10
11
  import * as Effect from "effect/Effect"
@@ -33,6 +34,7 @@ const output = (
33
34
  * Provides the `Stdio` service backed by `Deno.args`, `Deno.stdin`,
34
35
  * `Deno.stdout`, and `Deno.stderr`.
35
36
  *
37
+ * @stability unstable
36
38
  * @category layers
37
39
  * @since 4.0.0
38
40
  */
@@ -42,6 +44,7 @@ export const layer: Layer.Layer<Stdio.Stdio> = Layer.succeed(
42
44
  args: Effect.sync(() => Deno.args),
43
45
  stdinIsTerminal: Effect.sync(() => Deno.stdin.isTerminal()),
44
46
  stdoutIsTerminal: Effect.sync(() => Deno.stdout.isTerminal()),
47
+ stderrIsTerminal: Effect.sync(() => Deno.stderr.isTerminal()),
45
48
  stdout: (options) => output(() => Deno.stdout.writable, "stdout", options),
46
49
  stderr: (options) => output(() => Deno.stderr.writable, "stderr", options),
47
50
  stdin: Stream.fromReadableStream({
@@ -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"
@@ -14,9 +15,11 @@ import type { Scope } from "effect/Scope"
14
15
  import type { Terminal, UserInput } from "effect/Terminal"
15
16
 
16
17
  /**
17
- * Creates a scoped `Terminal` service backed by process stdin/stdout, using the
18
- * optional predicate to decide when key input should end the input stream.
18
+ * Creates a scoped `Terminal` service backed by process stdin/stdout.
19
+ * By default, Esc, Ctrl+C, and Ctrl+D end key input. Supply `shouldQuit` to
20
+ * override these quit keys.
19
21
  *
22
+ * @stability unstable
20
23
  * @category constructors
21
24
  * @since 4.0.0
22
25
  */
@@ -24,8 +27,9 @@ export const make: (shouldQuit?: (input: UserInput) => boolean) => Effect<Termin
24
27
 
25
28
  /**
26
29
  * Provides the default process-backed `Terminal` service, ending key input on
27
- * the default quit keys.
30
+ * bare Esc, Ctrl+C, or Ctrl+D.
28
31
  *
32
+ * @stability unstable
29
33
  * @category layers
30
34
  * @since 4.0.0
31
35
  */
package/src/DenoWorker.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Parent-side Deno platform for Effect workers.
3
3
  *
4
+ * @stability unstable
4
5
  * @since 4.0.0
5
6
  */
6
7
  import * as Deferred from "effect/Deferred"
@@ -13,6 +14,7 @@ import { WorkerError, WorkerReceiveError } from "effect/workers/WorkerError"
13
14
  /**
14
15
  * Creates Deno worker layers by combining the default worker platform with a spawner.
15
16
  *
17
+ * @stability unstable
16
18
  * @category layers
17
19
  * @since 4.0.0
18
20
  */
@@ -27,6 +29,7 @@ export const layer = (
27
29
  /**
28
30
  * Layer that provides the Deno worker platform.
29
31
  *
32
+ * @stability unstable
30
33
  * @category layers
31
34
  * @since 4.0.0
32
35
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Runner-side Deno platform for Effect worker handlers using the standard `MessagePort` API.
3
3
  *
4
+ * @stability unstable
4
5
  * @since 4.0.0
5
6
  */
6
7
  import * as Cause from "effect/Cause"
@@ -26,6 +27,7 @@ if (typeof self !== "undefined" && "onconnect" in self) {
26
27
  /**
27
28
  * Creates a worker runner platform over a `MessagePort`.
28
29
  *
30
+ * @stability unstable
29
31
  * @category constructors
30
32
  * @since 4.0.0
31
33
  */
@@ -158,6 +160,7 @@ export const make = (self: MessagePort): WorkerRunner.WorkerRunnerPlatform["Serv
158
160
  /**
159
161
  * Layer that provides the worker runner platform using the global worker scope.
160
162
  *
163
+ * @stability unstable
161
164
  * @category layers
162
165
  * @since 4.0.0
163
166
  */
@@ -168,6 +171,7 @@ export const layer: Layer.Layer<WorkerRunner.WorkerRunnerPlatform> = Layer.sync(
168
171
  /**
169
172
  * Layer that provides the worker runner platform using the supplied `MessagePort`.
170
173
  *
174
+ * @stability unstable
171
175
  * @category layers
172
176
  * @since 4.0.0
173
177
  */
package/src/index.ts CHANGED
@@ -1,65 +1,96 @@
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 experimental
10
+ * @since 4.0.0
11
+ */
12
+ export * as DenoAddressResolver from "./DenoAddressResolver.ts"
13
+
14
+ /**
15
+ * @stability unstable
8
16
  * @since 4.0.0
9
17
  */
10
18
  export * as DenoChildProcessSpawner from "./DenoChildProcessSpawner.ts"
11
19
 
12
20
  /**
21
+ * @stability unstable
13
22
  * @since 4.0.0
14
23
  */
15
24
  export * as DenoClusterHttp from "./DenoClusterHttp.ts"
16
25
 
17
26
  /**
27
+ * @stability unstable
18
28
  * @since 4.0.0
19
29
  */
20
30
  export * as DenoClusterSocket from "./DenoClusterSocket.ts"
21
31
 
22
32
  /**
33
+ * @stability unstable
23
34
  * @since 4.0.0
24
35
  */
25
36
  export * as DenoCrypto from "./DenoCrypto.ts"
26
37
 
27
38
  /**
39
+ * @stability experimental
40
+ * @since 4.0.0
41
+ */
42
+ export * as DenoDatagramSocket from "./DenoDatagramSocket.ts"
43
+
44
+ /**
45
+ * @stability experimental
46
+ * @since 4.0.0
47
+ */
48
+ export * as DenoDns from "./DenoDns.ts"
49
+
50
+ /**
51
+ * @stability unstable
28
52
  * @since 4.0.0
29
53
  */
30
54
  export * as DenoFileSystem from "./DenoFileSystem.ts"
31
55
 
32
56
  /**
57
+ * @stability unstable
33
58
  * @since 4.0.0
34
59
  */
35
60
  export * as DenoHttpClient from "./DenoHttpClient.ts"
36
61
 
37
62
  /**
63
+ * @stability unstable
38
64
  * @since 4.0.0
39
65
  */
40
66
  export * as DenoHttpPlatform from "./DenoHttpPlatform.ts"
41
67
 
42
68
  /**
69
+ * @stability unstable
43
70
  * @since 4.0.0
44
71
  */
45
72
  export * as DenoHttpServer from "./DenoHttpServer.ts"
46
73
 
47
74
  /**
75
+ * @stability unstable
48
76
  * @since 4.0.0
49
77
  */
50
78
  export * as DenoHttpServerRequest from "./DenoHttpServerRequest.ts"
51
79
 
52
80
  /**
81
+ * @stability unstable
53
82
  * @since 4.0.0
54
83
  */
55
84
  export * as DenoKeyValueStore from "./DenoKeyValueStore.ts"
56
85
 
57
86
  /**
87
+ * @stability unstable
58
88
  * @since 4.0.0
59
89
  */
60
90
  export * as DenoMultipart from "./DenoMultipart.ts"
61
91
 
62
92
  /**
93
+ * @stability unstable
63
94
  * @since 4.0.0
64
95
  */
65
96
  export * as DenoPath from "./DenoPath.ts"
@@ -71,41 +102,49 @@ export * as DenoPath from "./DenoPath.ts"
71
102
  export * as DenoRedis from "./DenoRedis.ts"
72
103
 
73
104
  /**
105
+ * @stability unstable
74
106
  * @since 4.0.0
75
107
  */
76
108
  export * as DenoRuntime from "./DenoRuntime.ts"
77
109
 
78
110
  /**
111
+ * @stability unstable
79
112
  * @since 4.0.0
80
113
  */
81
114
  export * as DenoServices from "./DenoServices.ts"
82
115
 
83
116
  /**
117
+ * @stability unstable
84
118
  * @since 4.0.0
85
119
  */
86
120
  export * as DenoSocket from "./DenoSocket.ts"
87
121
 
88
122
  /**
123
+ * @stability unstable
89
124
  * @since 4.0.0
90
125
  */
91
126
  export * as DenoSocketServer from "./DenoSocketServer.ts"
92
127
 
93
128
  /**
129
+ * @stability unstable
94
130
  * @since 4.0.0
95
131
  */
96
132
  export * as DenoStdio from "./DenoStdio.ts"
97
133
 
98
134
  /**
135
+ * @stability unstable
99
136
  * @since 4.0.0
100
137
  */
101
138
  export * as DenoTerminal from "./DenoTerminal.ts"
102
139
 
103
140
  /**
141
+ * @stability unstable
104
142
  * @since 4.0.0
105
143
  */
106
144
  export * as DenoWorker from "./DenoWorker.ts"
107
145
 
108
146
  /**
147
+ * @stability unstable
109
148
  * @since 4.0.0
110
149
  */
111
150
  export * as DenoWorkerRunner from "./DenoWorkerRunner.ts"