@typeonce/ritmo-devtools 0.20.0 → 0.22.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @typeonce/ritmo-devtools
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [82a11f4]
8
+ - @typeonce/ritmo@0.22.0
9
+ - @typeonce/ritmo-netcode@0.22.0
10
+
11
+ ## 0.21.0
12
+
13
+ ### Minor Changes
14
+
15
+ - d1d864d: **Breaking: the packages require Node 22 or newer (Node 20 reached end of life on 2026-04-30).** `engines.node` is `>=22` for `@typeonce/ritmo`, `-browser`, `-render`, `-pixi`, `-math`, and `-netcode`; `>=22.12` for `@typeonce/oxlint-plugin-ritmo` (oxlint's own floor); `>=22.15` for `@typeonce/ritmo-devtools` (unchanged); and `>=22.19` for `@typeonce/ritmo-tools` (what `@effect/platform-node` needs). On Node 20, upgrade Node: `nvm install 22` (or 24), or `"node": ">=22"` in your CI's setup step.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [50597a8]
20
+ - Updated dependencies [15e5aa9]
21
+ - Updated dependencies [6b7df96]
22
+ - Updated dependencies [d1d864d]
23
+ - Updated dependencies [f30c9c6]
24
+ - Updated dependencies [d989c0b]
25
+ - Updated dependencies [027634b]
26
+ - Updated dependencies [87466e9]
27
+ - @typeonce/ritmo@0.21.0
28
+ - @typeonce/ritmo-netcode@0.21.0
29
+
3
30
  ## 0.20.0
4
31
 
5
32
  ### Patch Changes
package/README.md CHANGED
@@ -102,14 +102,14 @@ const runtime = Game.Runtime.make({ services, resources, machines, debug: { host
102
102
  const HealthNeverNegative = Invariant.fromInspector(Game.Inspector("health >= 0", {
103
103
  queries: { player: Game.Query({ selection: { health: Game.Query.read(Health) }, with: [Player] }) }
104
104
  }, ({ queries }) => {
105
- const health = queries.player.each().map((match) => match.data.health.get())
105
+ const health = queries.player.each().map((entity) => queries.player.data.health.get(entity))
106
106
  return health.some((value) => value < 0) ? `health ${health.join(", ")}` : undefined
107
107
  }))
108
108
  // Labels name entities in every line: `player e12` instead of `e12`. An
109
109
  // inspector returning entity id -> label; any other return does not compile.
110
110
  const Labels = Game.Inspector("labels", {
111
111
  queries: { players: Game.Query({ selection: { player: Game.Query.read(Player) } }) }
112
- }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
112
+ }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
113
113
 
114
114
  const session = Session.make(runtime, {
115
115
  hostClock, // times run(); the runtime's clock
package/dist/Desync.d.ts CHANGED
@@ -20,7 +20,7 @@
20
20
  * declare const input: { dx: number }
21
21
  * const Labels = Game.Inspector("labels", {
22
22
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
23
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
23
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
24
24
  * // ---cut---
25
25
  * const left = sessions[0].advance(input)
26
26
  * const right = sessions[1].advance(input)
package/dist/Fuzz.d.ts CHANGED
@@ -37,7 +37,7 @@
37
37
  * declare const make: (playback: Replay.Playback) => Replay.Target<typeof Game.schema, typeof Root, { readonly setup: typeof setup; readonly update: typeof update }>
38
38
  * const InsideArena = Invariant.fromInspector(Game.Inspector("inside arena", {
39
39
  * queries: { bodies: Game.Query({ selection: { position: Game.Query.read(Position) } }) }
40
- * }, ({ queries }) => queries.bodies.each().some(({ data }) => data.position.get().x < 0) ? "left the arena" : undefined))
40
+ * }, ({ queries }) => queries.bodies.each().some((entity) => queries.bodies.data.position.get(entity).x < 0) ? "left the arena" : undefined))
41
41
  * declare const sink: Replay.Sink
42
42
  * // ---cut---
43
43
  * const Move = Fuzz.input(Input, {
package/dist/Fuzz.js CHANGED
@@ -37,7 +37,7 @@
37
37
  * declare const make: (playback: Replay.Playback) => Replay.Target<typeof Game.schema, typeof Root, { readonly setup: typeof setup; readonly update: typeof update }>
38
38
  * const InsideArena = Invariant.fromInspector(Game.Inspector("inside arena", {
39
39
  * queries: { bodies: Game.Query({ selection: { position: Game.Query.read(Position) } }) }
40
- * }, ({ queries }) => queries.bodies.each().some(({ data }) => data.position.get().x < 0) ? "left the arena" : undefined))
40
+ * }, ({ queries }) => queries.bodies.each().some((entity) => queries.bodies.data.position.get(entity).x < 0) ? "left the arena" : undefined))
41
41
  * declare const sink: Replay.Sink
42
42
  * // ---cut---
43
43
  * const Move = Fuzz.input(Input, {
@@ -27,8 +27,9 @@
27
27
  * const PlayerInsideWorld = Invariant.fromInspector(Game.Inspector("player inside world", {
28
28
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
29
29
  * }, ({ queries }) => {
30
- * for (const { entity, data } of queries.players.each()) {
31
- * const { x } = data.position.get()
30
+ * const { data } = queries.players
31
+ * for (const entity of queries.players.each()) {
32
+ * const { x } = data.position.get(entity)
32
33
  * if (x < 0 || x > WORLD_WIDTH) return `e${entity.id} at x=${x}`
33
34
  * }
34
35
  * return undefined
@@ -1 +1 @@
1
- {"version":3,"file":"Invariant.d.ts","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,KAAK,SAAS,MAAM,2BAA2B,CAAA;AAE3D,yBAAiB,SAAS,CAAC;IACzB,0FAA0F;IAC1F,KAAY,cAAc,GAAG,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CACnG;AAED,sEAAsE;AACtE,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,cAAc;IACtF,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IACxB,yFAAyF;IACzF,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,cAAc,aAAa,CAAC,KAAG,SAAS,CAAC,CAAC,CAGhG,CAAA"}
1
+ {"version":3,"file":"Invariant.d.ts","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,KAAK,SAAS,MAAM,2BAA2B,CAAA;AAE3D,yBAAiB,SAAS,CAAC;IACzB,0FAA0F;IAC1F,KAAY,cAAc,GAAG,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;CACnG;AAED,sEAAsE;AACtE,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,cAAc;IACtF,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IACxB,yFAAyF;IACzF,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAA;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,cAAc,aAAa,CAAC,KAAG,SAAS,CAAC,CAAC,CAGhG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Invariant.js","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"AAsDA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAA2C,SAAY,EAAgB,EAAE,CAAC,CAAC;IACtG,IAAI,EAAE,SAAS,CAAC,IAAI;IACpB,SAAS;CACV,CAAC,CAAA"}
1
+ {"version":3,"file":"Invariant.js","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"AAuDA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAA2C,SAAY,EAAgB,EAAE,CAAC,CAAC;IACtG,IAAI,EAAE,SAAS,CAAC,IAAI;IACpB,SAAS;CACV,CAAC,CAAA"}
package/dist/Replay.d.ts CHANGED
@@ -65,7 +65,7 @@ import * as Rendered from "./Rendered.ts";
65
65
  import * as Session from "./Session.ts";
66
66
  type AnySchedule<S extends Schema.Any, Root> = ExecutableScheduleDefinition<S, any, Root, any, any>;
67
67
  /** The `@typeonce/ritmo-devtools` version written into replay files. */
68
- export declare const version = "0.20.0";
68
+ export declare const version = "0.22.0";
69
69
  type ServiceNeeds<Schedule> = Extract<Requirement.Of<Schedule>, Descriptor<"service", string, any>>;
70
70
  type UnrecordableService<Need> = Need extends Descriptor<"service", infer Name, infer Value> ? Value extends Source<infer Data> ? IsPlain<Data> extends true ? never : `${Name}: its snapshot() returns data that is not plain (no functions, maps, or class instances), so it cannot be saved` : IsPlain<Value> extends true ? never : `${Name} is neither a snapshot() source of plain data nor plain data: give the simulation its input through a source, and its effects on the host through events or resources` : never;
71
71
  /**
package/dist/Session.d.ts CHANGED
@@ -42,10 +42,10 @@
42
42
  * ```ts
43
43
  * const PlayerInsideWorld = Invariant.fromInspector(Game.Inspector("player inside world", {
44
44
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
45
- * }, ({ queries }) => queries.players.each().some(({ data }) => data.position.get().x < 0) ? "left the world" : undefined))
45
+ * }, ({ queries }) => queries.players.each().some((entity) => queries.players.data.position.get(entity).x < 0) ? "left the world" : undefined))
46
46
  * const Labels = Game.Inspector("labels", {
47
47
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
48
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
48
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
49
49
  * // ---cut---
50
50
  * const session = Session.make(runtime, {
51
51
  * hostClock: HostClock.test(),
@@ -105,7 +105,7 @@ export type ValidateInvariants<Invariants extends ReadonlyArray<Invariant>, Serv
105
105
  * ```ts
106
106
  * const Labels = Game.Inspector("labels", {
107
107
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
108
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
108
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
109
109
  * Session.make(runtime, { hostClock: HostClock.test(), schedules: { update }, labels: Labels })
110
110
  * ```
111
111
  */
package/dist/Session.js CHANGED
@@ -42,10 +42,10 @@
42
42
  * ```ts
43
43
  * const PlayerInsideWorld = Invariant.fromInspector(Game.Inspector("player inside world", {
44
44
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
45
- * }, ({ queries }) => queries.players.each().some(({ data }) => data.position.get().x < 0) ? "left the world" : undefined))
45
+ * }, ({ queries }) => queries.players.each().some((entity) => queries.players.data.position.get(entity).x < 0) ? "left the world" : undefined))
46
46
  * const Labels = Game.Inspector("labels", {
47
47
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
48
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
48
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
49
49
  * // ---cut---
50
50
  * const session = Session.make(runtime, {
51
51
  * hostClock: HostClock.test(),
@@ -3,5 +3,5 @@
3
3
  * `package.json` by `scripts/sync-version.ts` (run by \`pnpm version-packages\`)
4
4
  * and checked by a test.
5
5
  */
6
- export declare const libraryVersion = "0.20.0";
6
+ export declare const libraryVersion = "0.22.0";
7
7
  //# sourceMappingURL=version.d.ts.map
@@ -3,5 +3,5 @@
3
3
  * `package.json` by `scripts/sync-version.ts` (run by \`pnpm version-packages\`)
4
4
  * and checked by a test.
5
5
  */
6
- export const libraryVersion = "0.20.0";
6
+ export const libraryVersion = "0.22.0";
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeonce/ritmo-devtools",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Headless debug sessions, trace history, text reports, replays, and fuzzing for Ritmo runtimes",
5
5
  "author": "Sandro Maglione",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/typeonce-dev/ritmo/issues"
14
14
  },
15
- "homepage": "https://github.com/typeonce-dev/ritmo#readme",
15
+ "homepage": "https://ritmo.typeonce.dev",
16
16
  "keywords": [
17
17
  "ecs",
18
18
  "gamedev",
@@ -51,8 +51,8 @@
51
51
  "provenance": true
52
52
  },
53
53
  "dependencies": {
54
- "@typeonce/ritmo": "^0.20.0",
55
- "@typeonce/ritmo-netcode": "^0.20.0"
54
+ "@typeonce/ritmo": "^0.22.0",
55
+ "@typeonce/ritmo-netcode": "^0.22.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "oxlint": ">=1.86.0",
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "devDependencies": {
78
78
  "playwright": "^1.64.1",
79
- "vite": "^8.0.3"
79
+ "vite": "^8.3.5"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.15"
package/src/Desync.ts CHANGED
@@ -20,7 +20,7 @@
20
20
  * declare const input: { dx: number }
21
21
  * const Labels = Game.Inspector("labels", {
22
22
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
23
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
23
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
24
24
  * // ---cut---
25
25
  * const left = sessions[0].advance(input)
26
26
  * const right = sessions[1].advance(input)
package/src/Format.ts CHANGED
@@ -29,7 +29,7 @@ export interface ValueOptions {
29
29
  * `Desync.compare`.
30
30
  */
31
31
  export interface Labels {
32
- // A method, so a map keyed by branded entity ids (`match.entity.id`) is labels too.
32
+ // A method, so a map keyed by branded entity ids (`entity.id`) is labels too.
33
33
  get(entity: number): string | undefined
34
34
  }
35
35
 
package/src/Fuzz.ts CHANGED
@@ -37,7 +37,7 @@
37
37
  * declare const make: (playback: Replay.Playback) => Replay.Target<typeof Game.schema, typeof Root, { readonly setup: typeof setup; readonly update: typeof update }>
38
38
  * const InsideArena = Invariant.fromInspector(Game.Inspector("inside arena", {
39
39
  * queries: { bodies: Game.Query({ selection: { position: Game.Query.read(Position) } }) }
40
- * }, ({ queries }) => queries.bodies.each().some(({ data }) => data.position.get().x < 0) ? "left the arena" : undefined))
40
+ * }, ({ queries }) => queries.bodies.each().some((entity) => queries.bodies.data.position.get(entity).x < 0) ? "left the arena" : undefined))
41
41
  * declare const sink: Replay.Sink
42
42
  * // ---cut---
43
43
  * const Move = Fuzz.input(Input, {
package/src/Invariant.ts CHANGED
@@ -27,8 +27,9 @@
27
27
  * const PlayerInsideWorld = Invariant.fromInspector(Game.Inspector("player inside world", {
28
28
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
29
29
  * }, ({ queries }) => {
30
- * for (const { entity, data } of queries.players.each()) {
31
- * const { x } = data.position.get()
30
+ * const { data } = queries.players
31
+ * for (const entity of queries.players.each()) {
32
+ * const { x } = data.position.get(entity)
32
33
  * if (x < 0 || x > WORLD_WIDTH) return `e${entity.id} at x=${x}`
33
34
  * }
34
35
  * return undefined
package/src/Session.ts CHANGED
@@ -42,10 +42,10 @@
42
42
  * ```ts
43
43
  * const PlayerInsideWorld = Invariant.fromInspector(Game.Inspector("player inside world", {
44
44
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
45
- * }, ({ queries }) => queries.players.each().some(({ data }) => data.position.get().x < 0) ? "left the world" : undefined))
45
+ * }, ({ queries }) => queries.players.each().some((entity) => queries.players.data.position.get(entity).x < 0) ? "left the world" : undefined))
46
46
  * const Labels = Game.Inspector("labels", {
47
47
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
48
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
48
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
49
49
  * // ---cut---
50
50
  * const session = Session.make(runtime, {
51
51
  * hostClock: HostClock.test(),
@@ -129,7 +129,7 @@ export type ValidateInvariants<
129
129
  * ```ts
130
130
  * const Labels = Game.Inspector("labels", {
131
131
  * queries: { players: Game.Query({ selection: { position: Game.Query.read(Position) }, with: [Player] }) }
132
- * }, ({ queries }) => new Map(queries.players.each().map((match) => [match.entity.id, "player"] as const)))
132
+ * }, ({ queries }) => new Map(queries.players.each().map((entity) => [entity.id, "player"] as const)))
133
133
  * Session.make(runtime, { hostClock: HostClock.test(), schedules: { update }, labels: Labels })
134
134
  * ```
135
135
  */
@@ -3,4 +3,4 @@
3
3
  * `package.json` by `scripts/sync-version.ts` (run by \`pnpm version-packages\`)
4
4
  * and checked by a test.
5
5
  */
6
- export const libraryVersion = "0.20.0"
6
+ export const libraryVersion = "0.22.0"