@typeonce/ritmo-devtools 0.20.0 → 0.21.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 +19 -0
- package/README.md +2 -2
- package/dist/Desync.d.ts +1 -1
- package/dist/Fuzz.d.ts +1 -1
- package/dist/Fuzz.js +1 -1
- package/dist/Invariant.d.ts +3 -2
- package/dist/Invariant.d.ts.map +1 -1
- package/dist/Invariant.js.map +1 -1
- package/dist/Replay.d.ts +1 -1
- package/dist/Session.d.ts +3 -3
- package/dist/Session.js +2 -2
- package/dist/internal/version.d.ts +1 -1
- package/dist/internal/version.js +1 -1
- package/package.json +5 -5
- package/src/Desync.ts +1 -1
- package/src/Format.ts +1 -1
- package/src/Fuzz.ts +1 -1
- package/src/Invariant.ts +3 -2
- package/src/Session.ts +3 -3
- package/src/internal/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @typeonce/ritmo-devtools
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [50597a8]
|
|
12
|
+
- Updated dependencies [15e5aa9]
|
|
13
|
+
- Updated dependencies [6b7df96]
|
|
14
|
+
- Updated dependencies [d1d864d]
|
|
15
|
+
- Updated dependencies [f30c9c6]
|
|
16
|
+
- Updated dependencies [d989c0b]
|
|
17
|
+
- Updated dependencies [027634b]
|
|
18
|
+
- Updated dependencies [87466e9]
|
|
19
|
+
- @typeonce/ritmo@0.21.0
|
|
20
|
+
- @typeonce/ritmo-netcode@0.21.0
|
|
21
|
+
|
|
3
22
|
## 0.20.0
|
|
4
23
|
|
|
5
24
|
### 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((
|
|
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((
|
|
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((
|
|
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((
|
|
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((
|
|
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/Invariant.d.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
|
-
*
|
|
31
|
-
*
|
|
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/dist/Invariant.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invariant.d.ts","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
package/dist/Invariant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invariant.js","sourceRoot":"","sources":["../src/Invariant.ts"],"names":[],"mappings":"
|
|
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.
|
|
68
|
+
export declare const version = "0.21.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((
|
|
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((
|
|
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((
|
|
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((
|
|
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((
|
|
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(),
|
package/dist/internal/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typeonce/ritmo-devtools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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://
|
|
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.
|
|
55
|
-
"@typeonce/ritmo-netcode": "^0.
|
|
54
|
+
"@typeonce/ritmo": "^0.21.0",
|
|
55
|
+
"@typeonce/ritmo-netcode": "^0.21.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.
|
|
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((
|
|
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 (`
|
|
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((
|
|
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
|
-
*
|
|
31
|
-
*
|
|
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((
|
|
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((
|
|
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((
|
|
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
|
*/
|
package/src/internal/version.ts
CHANGED