@effect/platform-node 0.98.3 → 0.99.0

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 (52) hide show
  1. package/NodeClusterHttp/package.json +6 -0
  2. package/NodeClusterSocket/package.json +6 -0
  3. package/dist/cjs/{NodeClusterRunnerHttp.js → NodeClusterHttp.js} +12 -7
  4. package/dist/cjs/NodeClusterHttp.js.map +1 -0
  5. package/dist/cjs/NodeClusterSocket.js +76 -0
  6. package/dist/cjs/NodeClusterSocket.js.map +1 -0
  7. package/dist/cjs/index.js +5 -9
  8. package/dist/dts/{NodeClusterRunnerHttp.d.ts → NodeClusterHttp.d.ts} +10 -5
  9. package/dist/dts/NodeClusterHttp.d.ts.map +1 -0
  10. package/dist/dts/NodeClusterSocket.d.ts +52 -0
  11. package/dist/dts/NodeClusterSocket.d.ts.map +1 -0
  12. package/dist/dts/index.d.ts +2 -10
  13. package/dist/dts/index.d.ts.map +1 -1
  14. package/dist/esm/NodeClusterHttp.js +47 -0
  15. package/dist/esm/NodeClusterHttp.js.map +1 -0
  16. package/dist/esm/NodeClusterSocket.js +65 -0
  17. package/dist/esm/NodeClusterSocket.js.map +1 -0
  18. package/dist/esm/index.js +2 -10
  19. package/dist/esm/index.js.map +1 -1
  20. package/package.json +19 -35
  21. package/src/{NodeClusterRunnerHttp.ts → NodeClusterHttp.ts} +52 -22
  22. package/src/NodeClusterSocket.ts +150 -0
  23. package/src/index.ts +2 -12
  24. package/NodeClusterRunnerHttp/package.json +0 -6
  25. package/NodeClusterRunnerSocket/package.json +0 -6
  26. package/NodeClusterShardManagerHttp/package.json +0 -6
  27. package/NodeClusterShardManagerSocket/package.json +0 -6
  28. package/dist/cjs/NodeClusterRunnerHttp.js.map +0 -1
  29. package/dist/cjs/NodeClusterRunnerSocket.js +0 -17
  30. package/dist/cjs/NodeClusterRunnerSocket.js.map +0 -1
  31. package/dist/cjs/NodeClusterShardManagerHttp.js +0 -41
  32. package/dist/cjs/NodeClusterShardManagerHttp.js.map +0 -1
  33. package/dist/cjs/NodeClusterShardManagerSocket.js +0 -17
  34. package/dist/cjs/NodeClusterShardManagerSocket.js.map +0 -1
  35. package/dist/dts/NodeClusterRunnerHttp.d.ts.map +0 -1
  36. package/dist/dts/NodeClusterRunnerSocket.d.ts +0 -9
  37. package/dist/dts/NodeClusterRunnerSocket.d.ts.map +0 -1
  38. package/dist/dts/NodeClusterShardManagerHttp.d.ts +0 -28
  39. package/dist/dts/NodeClusterShardManagerHttp.d.ts.map +0 -1
  40. package/dist/dts/NodeClusterShardManagerSocket.d.ts +0 -9
  41. package/dist/dts/NodeClusterShardManagerSocket.d.ts.map +0 -1
  42. package/dist/esm/NodeClusterRunnerHttp.js +0 -42
  43. package/dist/esm/NodeClusterRunnerHttp.js.map +0 -1
  44. package/dist/esm/NodeClusterRunnerSocket.js +0 -9
  45. package/dist/esm/NodeClusterRunnerSocket.js.map +0 -1
  46. package/dist/esm/NodeClusterShardManagerHttp.js +0 -32
  47. package/dist/esm/NodeClusterShardManagerHttp.js.map +0 -1
  48. package/dist/esm/NodeClusterShardManagerSocket.js +0 -9
  49. package/dist/esm/NodeClusterShardManagerSocket.js.map +0 -1
  50. package/src/NodeClusterRunnerSocket.ts +0 -9
  51. package/src/NodeClusterShardManagerHttp.ts +0 -73
  52. package/src/NodeClusterShardManagerSocket.ts +0 -9
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeClusterShardManagerSocket.js","names":[],"sources":["../../src/NodeClusterShardManagerSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;;;;AAIA,cAAc,4DAA4D","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- /**
2
- * @since 1.0.0
3
- */
4
-
5
- /**
6
- * @since 1.0.0
7
- * @category Re-exports
8
- */
9
- export * from "@effect/platform-node-shared/NodeClusterRunnerSocket"
@@ -1,73 +0,0 @@
1
- /**
2
- * @since 1.0.0
3
- */
4
- import * as HttpShardManager from "@effect/cluster/HttpShardManager"
5
- import * as ShardingConfig from "@effect/cluster/ShardingConfig"
6
- import * as ShardManager from "@effect/cluster/ShardManager"
7
- import * as ShardStorage from "@effect/cluster/ShardStorage"
8
- import * as SqlShardStorage from "@effect/cluster/SqlShardStorage"
9
- import type * as Etag from "@effect/platform/Etag"
10
- import type { HttpPlatform } from "@effect/platform/HttpPlatform"
11
- import type { HttpServer } from "@effect/platform/HttpServer"
12
- import type { ServeError } from "@effect/platform/HttpServerError"
13
- import * as RpcSerialization from "@effect/rpc/RpcSerialization"
14
- import type { SqlClient } from "@effect/sql/SqlClient"
15
- import type { SqlError } from "@effect/sql/SqlError"
16
- import type { ConfigError } from "effect/ConfigError"
17
- import * as Effect from "effect/Effect"
18
- import * as Layer from "effect/Layer"
19
- import { createServer } from "node:http"
20
- import type { NodeContext } from "./NodeContext.js"
21
- import * as NodeHttpClient from "./NodeHttpClient.js"
22
- import * as NodeHttpServer from "./NodeHttpServer.js"
23
- import * as NodeSocket from "./NodeSocket.js"
24
-
25
- /**
26
- * @since 1.0.0
27
- * @category Layers
28
- */
29
- export const layerHttpServer: Layer.Layer<
30
- | HttpPlatform
31
- | Etag.Generator
32
- | NodeContext
33
- | HttpServer,
34
- ServeError,
35
- ShardingConfig.ShardingConfig
36
- > = Effect.gen(function*() {
37
- const config = yield* ShardingConfig.ShardingConfig
38
- return NodeHttpServer.layer(createServer, config.shardManagerAddress)
39
- }).pipe(Layer.unwrapEffect)
40
-
41
- /**
42
- * @since 1.0.0
43
- * @category Layers
44
- */
45
- export const layer = <const Storage extends "sql" | "noop" = never>(options: {
46
- readonly transport: "http" | "websocket"
47
- readonly serialization?: "msgpack" | "ndjson" | undefined
48
- readonly shardingConfig?: Partial<ShardingConfig.ShardingConfig["Type"]> | undefined
49
- readonly storage?: Storage | undefined
50
- readonly config?: Partial<ShardManager.Config["Type"]> | undefined
51
- }): Layer.Layer<
52
- ShardManager.ShardManager,
53
- ServeError | ConfigError | ("sql" extends Storage ? SqlError : never),
54
- "sql" extends Storage ? SqlClient : never
55
- > => {
56
- const layer: Layer.Layer<any, any, any> = options.transport === "http" ?
57
- HttpShardManager.layerHttp.pipe(
58
- Layer.provide([HttpShardManager.layerRunnerHealthHttp, layerHttpServer]),
59
- Layer.provide(NodeHttpClient.layerUndici)
60
- ) :
61
- HttpShardManager.layerWebsocket.pipe(
62
- Layer.provide([HttpShardManager.layerRunnerHealthWebsocket, layerHttpServer]),
63
- Layer.provide(NodeSocket.layerWebSocketConstructor)
64
- )
65
- return layer.pipe(
66
- Layer.provide(options?.storage === "sql" ? SqlShardStorage.layer : ShardStorage.layerNoop),
67
- Layer.provide([
68
- ShardingConfig.layerFromEnv(options.shardingConfig),
69
- ShardManager.layerConfigFromEnv(options?.config),
70
- options?.serialization === "ndjson" ? RpcSerialization.layerNdjson : RpcSerialization.layerMsgPack
71
- ])
72
- )
73
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * @since 1.0.0
3
- */
4
-
5
- /**
6
- * @since 1.0.0
7
- * @category Re-exports
8
- */
9
- export * from "@effect/platform-node-shared/NodeClusterShardManagerSocket"