@effectstream/runtime 0.100.15 → 0.100.16

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 (2) hide show
  1. package/README.md +23 -12
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -5,6 +5,11 @@ database, events, and HTTP API together inside an EffectStream node.
5
5
  Boot it with `init()` then drive it with `start(config)` and your node
6
6
  is up.
7
7
 
8
+ - The state-machine runtime that owns an Effectstream node's process model.
9
+ - `init()` once, `start(config)` to run; ties sync, state machine, DB, events, and HTTP API together.
10
+ - Used by every template.
11
+ - Also reachable through `@effectstream/node-sdk/runtime`.
12
+
8
13
  ## Install
9
14
 
10
15
  ```bash
@@ -23,21 +28,27 @@ This package **owns the node's process model**. You don't pick parts of
23
28
  it; you call `init()` once at boot and then `start(config)`. The config
24
29
  brings together everything else:
25
30
 
31
+ `init()` and `start()` are Effection operations, so they must be
32
+ yielded inside an Effection `main()`:
33
+
26
34
  ```typescript
35
+ import { main } from "effection";
27
36
  import { init, start } from "@effectstream/runtime";
28
37
  import { Stm } from "@effectstream/sm";
29
38
  import { config } from "./config.dev.ts";
30
39
 
31
- await init();
40
+ await main(function* () {
41
+ yield* init();
32
42
 
33
- const gameStm = new Stm(grammar);
34
- gameStm.addStateTransition("join", function* () { /* ... */ });
43
+ const gameStm = new Stm(grammar);
44
+ gameStm.addStateTransition("join", function* () { /* ... */ });
35
45
 
36
- await start({
37
- config,
38
- gameStateTransitions: [gameStm],
39
- apiRouter: undefined, // optional Fastify route plugin
40
- dbMigrations: [], // SQL migrations
46
+ yield* start({
47
+ config,
48
+ gameStateTransitions: [gameStm],
49
+ apiRouter: undefined, // optional Fastify route plugin
50
+ migrations: [], // SQL migrations
51
+ });
41
52
  });
42
53
  ```
43
54
 
@@ -74,16 +85,16 @@ Types and helpers re-exported alongside `init` / `start`:
74
85
  ## Examples
75
86
 
76
87
  The templates under
77
- [`templates/`](https://github.com/PaimaStudios/paima-engine/tree/main/templates)
88
+ [`templates/`](https://github.com/effectstream/effectstream/tree/main/templates)
78
89
  are full working `init()` + `start()` examples. The simplest is
79
- [`templates/minimal/`](https://github.com/PaimaStudios/paima-engine/tree/main/templates/minimal).
90
+ [`templates/minimal/`](https://github.com/effectstream/effectstream/tree/main/templates/minimal).
80
91
 
81
92
  End-to-end EVM sync test:
82
- [`e2e/evm/sync/`](https://github.com/PaimaStudios/paima-engine/tree/main/e2e/evm/sync).
93
+ [`e2e/evm/sync/`](https://github.com/effectstream/effectstream/tree/main/e2e/evm/sync).
83
94
 
84
95
  Runnable: [`test/examples.test.ts`](./test/examples.test.ts).
85
96
 
86
97
  ## Links
87
98
 
88
99
  - Docs: https://effectstream.github.io/docs/packages/node/runtime
89
- - Source: https://github.com/PaimaStudios/paima-engine/tree/main/packages/node-sdk/runtime
100
+ - Source: https://github.com/effectstream/effectstream/tree/main/packages/node-sdk/runtime
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effectstream/runtime",
3
- "version": "0.100.15",
3
+ "version": "0.100.16",
4
4
  "license": "MIT",
5
5
  "homepage": "https://effectstream.github.io/docs/",
6
6
  "repository": {
@@ -13,17 +13,17 @@
13
13
  },
14
14
  "exports": "./src/mod.ts",
15
15
  "dependencies": {
16
- "@effectstream/concise": "0.100.15",
17
- "@effectstream/config": "0.100.15",
18
- "@effectstream/coroutine": "0.100.15",
19
- "@effectstream/crypto": "0.100.15",
20
- "@effectstream/db": "0.100.15",
21
- "@effectstream/event-client": "0.100.15",
22
- "@effectstream/event-server": "0.100.15",
23
- "@effectstream/log": "0.100.15",
24
- "@effectstream/sm": "0.100.15",
25
- "@effectstream/sync": "0.100.15",
26
- "@effectstream/utils": "0.100.15",
16
+ "@effectstream/concise": "0.100.16",
17
+ "@effectstream/config": "0.100.16",
18
+ "@effectstream/coroutine": "0.100.16",
19
+ "@effectstream/crypto": "0.100.16",
20
+ "@effectstream/db": "0.100.16",
21
+ "@effectstream/event-client": "0.100.16",
22
+ "@effectstream/event-server": "0.100.16",
23
+ "@effectstream/log": "0.100.16",
24
+ "@effectstream/sm": "0.100.16",
25
+ "@effectstream/sync": "0.100.16",
26
+ "@effectstream/utils": "0.100.16",
27
27
  "@fastify/cors": "^11.0.1",
28
28
  "@metamask/json-rpc-engine": "^10.0.3",
29
29
  "pg": "8.17.2",