@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.
- package/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/DenoAddressResolver.d.ts +13 -0
- package/dist/DenoAddressResolver.d.ts.map +1 -0
- package/dist/DenoAddressResolver.js +32 -0
- package/dist/DenoAddressResolver.js.map +1 -0
- package/dist/DenoChildProcessSpawner.d.ts +4 -0
- package/dist/DenoChildProcessSpawner.d.ts.map +1 -1
- package/dist/DenoChildProcessSpawner.js +2 -0
- package/dist/DenoChildProcessSpawner.js.map +1 -1
- package/dist/DenoClusterHttp.d.ts +3 -0
- package/dist/DenoClusterHttp.d.ts.map +1 -1
- package/dist/DenoClusterHttp.js +4 -0
- package/dist/DenoClusterHttp.js.map +1 -1
- package/dist/DenoClusterSocket.d.ts +5 -0
- package/dist/DenoClusterSocket.d.ts.map +1 -1
- package/dist/DenoClusterSocket.js +5 -0
- package/dist/DenoClusterSocket.js.map +1 -1
- package/dist/DenoCrypto.d.ts +3 -0
- package/dist/DenoCrypto.d.ts.map +1 -1
- package/dist/DenoCrypto.js +3 -0
- package/dist/DenoCrypto.js.map +1 -1
- package/dist/DenoDatagramSocket.d.ts +208 -0
- package/dist/DenoDatagramSocket.d.ts.map +1 -0
- package/dist/DenoDatagramSocket.js +423 -0
- package/dist/DenoDatagramSocket.js.map +1 -0
- package/dist/DenoDns.d.ts +62 -0
- package/dist/DenoDns.d.ts.map +1 -0
- package/dist/DenoDns.js +144 -0
- package/dist/DenoDns.js.map +1 -0
- package/dist/DenoFileSystem.d.ts +1 -0
- package/dist/DenoFileSystem.d.ts.map +1 -1
- package/dist/DenoFileSystem.js +50 -19
- package/dist/DenoFileSystem.js.map +1 -1
- package/dist/DenoHttpClient.d.ts +1 -0
- package/dist/DenoHttpClient.d.ts.map +1 -1
- package/dist/DenoHttpClient.js +1 -0
- package/dist/DenoHttpClient.js.map +1 -1
- package/dist/DenoHttpPlatform.d.ts +2 -0
- package/dist/DenoHttpPlatform.d.ts.map +1 -1
- package/dist/DenoHttpPlatform.js +3 -0
- package/dist/DenoHttpPlatform.js.map +1 -1
- package/dist/DenoHttpServer.d.ts +9 -1
- package/dist/DenoHttpServer.d.ts.map +1 -1
- package/dist/DenoHttpServer.js +15 -4
- package/dist/DenoHttpServer.js.map +1 -1
- package/dist/DenoHttpServerRequest.d.ts +2 -0
- package/dist/DenoHttpServerRequest.d.ts.map +1 -1
- package/dist/DenoHttpServerRequest.js +1 -0
- package/dist/DenoHttpServerRequest.js.map +1 -1
- package/dist/DenoKeyValueStore.d.ts +3 -0
- package/dist/DenoKeyValueStore.d.ts.map +1 -1
- package/dist/DenoKeyValueStore.js +3 -0
- package/dist/DenoKeyValueStore.js.map +1 -1
- package/dist/DenoMultipart.d.ts +3 -0
- package/dist/DenoMultipart.d.ts.map +1 -1
- package/dist/DenoMultipart.js +2 -0
- package/dist/DenoMultipart.js.map +1 -1
- package/dist/DenoPath.d.ts +4 -0
- package/dist/DenoPath.d.ts.map +1 -1
- package/dist/DenoPath.js +4 -0
- package/dist/DenoPath.js.map +1 -1
- package/dist/DenoRuntime.d.ts +4 -0
- package/dist/DenoRuntime.d.ts.map +1 -1
- package/dist/DenoRuntime.js +2 -0
- package/dist/DenoRuntime.js.map +1 -1
- package/dist/DenoServices.d.ts +3 -0
- package/dist/DenoServices.d.ts.map +1 -1
- package/dist/DenoServices.js +1 -0
- package/dist/DenoServices.js.map +1 -1
- package/dist/DenoSocket.d.ts +10 -0
- package/dist/DenoSocket.d.ts.map +1 -1
- package/dist/DenoSocket.js +8 -0
- package/dist/DenoSocket.js.map +1 -1
- package/dist/DenoSocketServer.d.ts +1 -0
- package/dist/DenoSocketServer.d.ts.map +1 -1
- package/dist/DenoSocketServer.js +1 -0
- package/dist/DenoSocketServer.js.map +1 -1
- package/dist/DenoStdio.d.ts +1 -0
- package/dist/DenoStdio.d.ts.map +1 -1
- package/dist/DenoStdio.js +3 -0
- package/dist/DenoStdio.js.map +1 -1
- package/dist/DenoTerminal.d.ts +6 -3
- package/dist/DenoTerminal.d.ts.map +1 -1
- package/dist/DenoTerminal.js +7 -3
- package/dist/DenoTerminal.js.map +1 -1
- package/dist/DenoWorker.d.ts +2 -0
- package/dist/DenoWorker.d.ts.map +1 -1
- package/dist/DenoWorker.js +3 -0
- package/dist/DenoWorker.js.map +1 -1
- package/dist/DenoWorkerRunner.d.ts +3 -0
- package/dist/DenoWorkerRunner.d.ts.map +1 -1
- package/dist/DenoWorkerRunner.js +4 -0
- package/dist/DenoWorkerRunner.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/src/DenoAddressResolver.ts +36 -0
- package/src/DenoChildProcessSpawner.ts +4 -0
- package/src/DenoClusterHttp.ts +4 -0
- package/src/DenoClusterSocket.ts +5 -0
- package/src/DenoCrypto.ts +3 -0
- package/src/DenoDatagramSocket.ts +571 -0
- package/src/DenoDns.ts +196 -0
- package/src/DenoFileSystem.ts +62 -27
- package/src/DenoHttpClient.ts +1 -0
- package/src/DenoHttpPlatform.ts +3 -0
- package/src/DenoHttpServer.ts +18 -3
- package/src/DenoHttpServerRequest.ts +2 -0
- package/src/DenoKeyValueStore.ts +3 -0
- package/src/DenoMultipart.ts +3 -0
- package/src/DenoPath.ts +4 -0
- package/src/DenoRuntime.ts +4 -0
- package/src/DenoServices.ts +3 -0
- package/src/DenoSocket.ts +10 -0
- package/src/DenoSocketServer.ts +1 -0
- package/src/DenoStdio.ts +3 -0
- package/src/DenoTerminal.ts +7 -3
- package/src/DenoWorker.ts +3 -0
- package/src/DenoWorkerRunner.ts +4 -0
- package/src/index.ts +39 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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AAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;;GAGG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform-deno",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Platform specific implementations for the Deno runtime",
|
|
7
7
|
"homepage": "https://effect.website",
|
|
@@ -57,19 +57,21 @@
|
|
|
57
57
|
"@std/media-types": "npm:@jsr/std__media-types@^1.1.0",
|
|
58
58
|
"@std/path": "npm:@jsr/std__path@^1.1.6",
|
|
59
59
|
"@std/streams": "npm:@jsr/std__streams@^1.2.0",
|
|
60
|
-
"@effect/platform-node-shared": "^4.0.
|
|
60
|
+
"@effect/platform-node-shared": "^4.0.3"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"effect": "^4.0.
|
|
63
|
+
"effect": "^4.0.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@std/assert": "npm:@jsr/std__assert@^1.0.19",
|
|
67
|
-
"@testcontainers/redis": "^12.
|
|
67
|
+
"@testcontainers/redis": "^12.2.0",
|
|
68
68
|
"@types/deno": "^2.7.0",
|
|
69
|
-
"
|
|
69
|
+
"tinybench": "^6.2.0",
|
|
70
|
+
"effect": "^4.0.3"
|
|
70
71
|
},
|
|
71
72
|
"scripts": {
|
|
72
73
|
"codegen": "effect-utils codegen",
|
|
73
|
-
"check": "deno check"
|
|
74
|
+
"check": "deno check",
|
|
75
|
+
"benchmark:datagram": "deno run -A --unstable-net benchmark/DatagramSocket.ts"
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deno implementation of Effect's `AddressResolver` service.
|
|
3
|
+
*
|
|
4
|
+
* Domain names are looked up with the `Dns` service, and IPv6 literals with a
|
|
5
|
+
* named zone such as `fe80::1%eth0` get their scope ID from
|
|
6
|
+
* `Deno.networkInterfaces()`, queried each time to reflect interface changes.
|
|
7
|
+
*
|
|
8
|
+
* **Gotchas**
|
|
9
|
+
*
|
|
10
|
+
* Listing network interfaces requires the `--allow-sys` permission; without it,
|
|
11
|
+
* resolving a named zone fails with a `NetAddress.NetAddressError`.
|
|
12
|
+
*
|
|
13
|
+
* @stability experimental
|
|
14
|
+
* @since 4.0.0
|
|
15
|
+
*/
|
|
16
|
+
import * as Effect from "effect/Effect"
|
|
17
|
+
import type * as Layer from "effect/Layer"
|
|
18
|
+
import * as AddressResolver from "effect/net/AddressResolver"
|
|
19
|
+
import type * as Dns from "effect/net/Dns"
|
|
20
|
+
import * as NetAddress from "effect/net/NetAddress"
|
|
21
|
+
|
|
22
|
+
const scopeId: AddressResolver.ScopeIdLookup = (name) =>
|
|
23
|
+
Effect.try({
|
|
24
|
+
try: () => NetAddress.scopeIdFromInterface(Deno.networkInterfaces().filter((info) => info.name === name)),
|
|
25
|
+
catch: (cause) => new NetAddress.NetAddressError({ input: name, message: "cannot list network interfaces", cause })
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Layer that provides the Deno `AddressResolver` service using the `Dns`
|
|
30
|
+
* service.
|
|
31
|
+
*
|
|
32
|
+
* @stability experimental
|
|
33
|
+
* @category layers
|
|
34
|
+
* @since 4.0.0
|
|
35
|
+
*/
|
|
36
|
+
export const layer: Layer.Layer<AddressResolver.AddressResolver, never, Dns.Dns> = AddressResolver.layer({ scopeId })
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* detached process groups, so killing a handle terminates only its direct child;
|
|
6
6
|
* descendants spawned by that child are left running.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import type * as Arr from "effect/Array"
|
|
@@ -393,6 +394,7 @@ const make = Effect.gen(function*() {
|
|
|
393
394
|
/**
|
|
394
395
|
* Layer that provides the Deno child process spawner.
|
|
395
396
|
*
|
|
397
|
+
* @stability unstable
|
|
396
398
|
* @category layers
|
|
397
399
|
* @since 4.0.0
|
|
398
400
|
*/
|
|
@@ -401,6 +403,7 @@ export const layer: Layer.Layer<ChildProcessSpawner, never, Path.Path> = Layer.e
|
|
|
401
403
|
/**
|
|
402
404
|
* Result of flattening a pipeline of commands.
|
|
403
405
|
*
|
|
406
|
+
* @stability unstable
|
|
404
407
|
* @category models
|
|
405
408
|
* @since 4.0.0
|
|
406
409
|
*/
|
|
@@ -412,6 +415,7 @@ export interface FlattenedPipeline {
|
|
|
412
415
|
/**
|
|
413
416
|
* Flattens a command into standard commands and their pipe options.
|
|
414
417
|
*
|
|
418
|
+
* @stability unstable
|
|
415
419
|
* @category transforming
|
|
416
420
|
* @since 4.0.0
|
|
417
421
|
*/
|
package/src/DenoClusterHttp.ts
CHANGED
|
@@ -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"
|
|
@@ -38,6 +39,7 @@ export {
|
|
|
38
39
|
/**
|
|
39
40
|
* Layer that provides a Kubernetes HTTP client for runner health checks.
|
|
40
41
|
*
|
|
42
|
+
* @stability unstable
|
|
41
43
|
* @category re-exports
|
|
42
44
|
* @since 4.0.0
|
|
43
45
|
*/
|
|
@@ -47,6 +49,7 @@ export {
|
|
|
47
49
|
/**
|
|
48
50
|
* Layer that provides a native Deno HTTP server for cluster runners.
|
|
49
51
|
*
|
|
52
|
+
* @stability unstable
|
|
50
53
|
* @category layers
|
|
51
54
|
* @since 4.0.0
|
|
52
55
|
*/
|
|
@@ -74,6 +77,7 @@ export const layerHttpServer: Layer.Layer<
|
|
|
74
77
|
* Creates Deno cluster layers for HTTP or WebSocket transport, configuring
|
|
75
78
|
* serialization, storage, runner health, and optional client-only mode.
|
|
76
79
|
*
|
|
80
|
+
* @stability unstable
|
|
77
81
|
* @category layers
|
|
78
82
|
* @since 4.0.0
|
|
79
83
|
*/
|
package/src/DenoClusterSocket.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Deno connections have no native idle-timeout option, so peer connections use
|
|
8
8
|
* only the one-second open timeout.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as K8sHttpClient from "effect/cluster/K8sHttpClient"
|
|
@@ -38,6 +39,7 @@ import * as DenoSocketServer from "./DenoSocketServer.ts"
|
|
|
38
39
|
/**
|
|
39
40
|
* Provides the cluster `RpcClientProtocol` using native Deno TCP sockets.
|
|
40
41
|
*
|
|
42
|
+
* @stability unstable
|
|
41
43
|
* @category layers
|
|
42
44
|
* @since 4.0.0
|
|
43
45
|
*/
|
|
@@ -69,6 +71,7 @@ export const layerClientProtocol: Layer.Layer<
|
|
|
69
71
|
* Provides the socket server used by cluster runners, listening on
|
|
70
72
|
* `ShardingConfig.runnerListenAddress` or `runnerAddress`.
|
|
71
73
|
*
|
|
74
|
+
* @stability unstable
|
|
72
75
|
* @category layers
|
|
73
76
|
* @since 4.0.0
|
|
74
77
|
*/
|
|
@@ -92,6 +95,7 @@ export const layerSocketServer: Layer.Layer<
|
|
|
92
95
|
* Creates Deno socket cluster layers, configuring serialization, storage,
|
|
93
96
|
* runner health, and optional client-only mode.
|
|
94
97
|
*
|
|
98
|
+
* @stability unstable
|
|
95
99
|
* @category layers
|
|
96
100
|
* @since 4.0.0
|
|
97
101
|
*/
|
|
@@ -172,6 +176,7 @@ export const layer = <
|
|
|
172
176
|
* Layer that provides `K8sHttpClient`, using a scoped native Deno HTTP client
|
|
173
177
|
* with the Kubernetes service-account CA certificate when it is available.
|
|
174
178
|
*
|
|
179
|
+
* @stability unstable
|
|
175
180
|
* @category layers
|
|
176
181
|
* @since 4.0.0
|
|
177
182
|
*/
|
package/src/DenoCrypto.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module uses Deno's global Web Crypto API.
|
|
5
5
|
*
|
|
6
|
+
* @stability unstable
|
|
6
7
|
* @since 4.0.0
|
|
7
8
|
*/
|
|
8
9
|
import * as Context from "effect/Context"
|
|
@@ -14,6 +15,7 @@ import * as PlatformError from "effect/PlatformError"
|
|
|
14
15
|
/**
|
|
15
16
|
* Provides the Web Crypto API used by the Crypto service implementation.
|
|
16
17
|
*
|
|
18
|
+
* @stability unstable
|
|
17
19
|
* @category services
|
|
18
20
|
* @since 4.0.0
|
|
19
21
|
*/
|
|
@@ -24,6 +26,7 @@ export const WebCrypto = Context.Reference<Crypto>("@effect/platform-deno/Crypto
|
|
|
24
26
|
/**
|
|
25
27
|
* A layer that provides Effect's Crypto service using Deno's Web Crypto API.
|
|
26
28
|
*
|
|
29
|
+
* @stability unstable
|
|
27
30
|
* @category layers
|
|
28
31
|
* @since 4.0.0
|
|
29
32
|
*/
|