@datamoc/mw_games 0.24.1 → 0.26.1
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 +140 -0
- package/README.md +15 -0
- package/api-surface.json +14468 -0
- package/dist/actors/StatBlock.d.ts +2 -4
- package/dist/actors/StatBlock.d.ts.map +1 -1
- package/dist/actors/StatBlock.js +2 -4
- package/dist/actors/StatBlock.js.map +1 -1
- package/dist/ai/Heuristics.d.ts +1 -1
- package/dist/ai/Heuristics.js +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/core/Blob.d.ts.map +1 -1
- package/dist/core/Blob.js +2 -8
- package/dist/core/Blob.js.map +1 -1
- package/dist/core/Grid.d.ts +115 -0
- package/dist/core/Grid.d.ts.map +1 -1
- package/dist/core/Grid.js +125 -0
- package/dist/core/Grid.js.map +1 -1
- package/dist/core/Handles.d.ts +42 -0
- package/dist/core/Handles.d.ts.map +1 -0
- package/dist/core/Handles.js +38 -0
- package/dist/core/Handles.js.map +1 -0
- package/dist/core/HttpTransport.d.ts +14 -0
- package/dist/core/HttpTransport.d.ts.map +1 -1
- package/dist/core/HttpTransport.js +14 -0
- package/dist/core/HttpTransport.js.map +1 -1
- package/dist/core/Random.d.ts +54 -13
- package/dist/core/Random.d.ts.map +1 -1
- package/dist/core/Random.js +48 -25
- package/dist/core/Random.js.map +1 -1
- package/dist/core/index.d.ts +8 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -1
- package/dist/headless/index.d.ts +87 -0
- package/dist/headless/index.d.ts.map +1 -0
- package/dist/headless/index.js +87 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/mw_games.global.js +113 -112
- package/dist/mwl/catalog.d.ts +13 -2
- package/dist/mwl/catalog.d.ts.map +1 -1
- package/dist/mwl/catalog.js +14 -5
- package/dist/mwl/catalog.js.map +1 -1
- package/dist/mwl/index.d.ts +3 -1
- package/dist/mwl/index.d.ts.map +1 -1
- package/dist/mwl/index.js +1 -0
- package/dist/mwl/index.js.map +1 -1
- package/dist/mwl/tables.d.ts +93 -0
- package/dist/mwl/tables.d.ts.map +1 -0
- package/dist/mwl/tables.js +87 -0
- package/dist/mwl/tables.js.map +1 -0
- package/dist/roguelike/Level.d.ts +1 -1
- package/dist/roguelike/Level.d.ts.map +1 -1
- package/dist/roguelike/Level.js +3 -21
- package/dist/roguelike/Level.js.map +1 -1
- package/dist/roguelike/Targeting.d.ts.map +1 -1
- package/dist/roguelike/Targeting.js +2 -1
- package/dist/roguelike/Targeting.js.map +1 -1
- package/dist/rpg/index.d.ts +1 -1
- package/dist/rpg/index.d.ts.map +1 -1
- package/dist/simulation/Runtime.d.ts +18 -2
- package/dist/simulation/Runtime.d.ts.map +1 -1
- package/dist/simulation/Runtime.js +7 -3
- package/dist/simulation/Runtime.js.map +1 -1
- package/dist/two-d/pixi-interop.d.ts +24 -1
- package/dist/two-d/pixi-interop.d.ts.map +1 -1
- package/dist/two-d/pixi-interop.js +23 -1
- package/dist/two-d/pixi-interop.js.map +1 -1
- package/dist/two-d/render/index.d.ts +2 -2
- package/dist/two-d/render/index.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +16 -3
- package/sbom.cdx.json +6 -6
- package/tools/audit-adoptions.d.mts +65 -0
- package/tools/audit-adoptions.mjs +252 -0
- package/tools/browser-driver.d.mts +78 -0
- package/tools/browser-driver.mjs +642 -0
|
@@ -82,7 +82,9 @@ export declare function validateSimulationReplay<State, Command, Event, A extend
|
|
|
82
82
|
* automatic-actor loop and fixed-command replay respectively; a game composes both against
|
|
83
83
|
* the same `scheduler` rather than choosing one over the other.
|
|
84
84
|
*
|
|
85
|
-
* Every command and event batch is journalled
|
|
85
|
+
* Every command and event batch is journalled (pass `journal: null` to disable the journal
|
|
86
|
+
* entirely: `dispatch` then skips the append, `snapshot()` exposes an empty journal, and
|
|
87
|
+
* replay/undo have nothing to replay), and with `history` every committed state is
|
|
86
88
|
* checkpointed, all through `structuredClone`: `Command`, `Event` and `State` must be plain data.
|
|
87
89
|
* A command naming its target as a live actor object (one that owns a `ReactionTable`, or any
|
|
88
90
|
* other callback) cannot be copied, so carry the actor's id and resolve it in the rule. A
|
|
@@ -131,6 +133,7 @@ export declare class SimulationRuntime<State, Command, Event, A extends Actor> {
|
|
|
131
133
|
private _scheduler;
|
|
132
134
|
readonly random: Generator;
|
|
133
135
|
readonly journal: ActionJournal<Command, Event>;
|
|
136
|
+
private readonly recordJournal;
|
|
134
137
|
private readonly rule;
|
|
135
138
|
private readonly actorId;
|
|
136
139
|
private readonly history;
|
|
@@ -141,7 +144,14 @@ export declare class SimulationRuntime<State, Command, Event, A extends Actor> {
|
|
|
141
144
|
random: Generator;
|
|
142
145
|
rule: SimulationRuntimeRule<State, Command, Event, A>;
|
|
143
146
|
actorId: (actor: A) => string;
|
|
144
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Where committed commands are recorded. Pass `null` for a journal-free
|
|
149
|
+
* dispatch facade: no append (and no `structuredClone` cost),
|
|
150
|
+
* `snapshot()` carries an empty journal, and replay/undo have nothing
|
|
151
|
+
* to replay. `restore()` always resumes with recording enabled from
|
|
152
|
+
* the snapshot's journal.
|
|
153
|
+
*/
|
|
154
|
+
journal?: ActionJournal<Command, Event> | null;
|
|
145
155
|
history?: SimulationRuntimeHistoryOptions<A>;
|
|
146
156
|
});
|
|
147
157
|
get scheduler(): Scheduler<A>;
|
|
@@ -165,6 +175,12 @@ export declare class SimulationRuntime<State, Command, Event, A extends Actor> {
|
|
|
165
175
|
rule: SimulationRuntimeRule<State, Command, Event, A>;
|
|
166
176
|
actorOf: (id: string) => A;
|
|
167
177
|
actorId: (actor: A) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Adopt this generator instead of creating one: its state is set from
|
|
180
|
+
* the snapshot, so passing the ambient global generator reconciles the
|
|
181
|
+
* two streams and later draws stay in lockstep. Defaults to a new generator.
|
|
182
|
+
*/
|
|
183
|
+
random?: Generator;
|
|
168
184
|
}): SimulationRuntime<State, Command, Event, A>;
|
|
169
185
|
/** `snapshot()` already copies the scheduler, random state and journal; only state is live. */
|
|
170
186
|
private historySnapshot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Runtime.d.ts","sourceRoot":"","sources":["../../src/simulation/Runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;sEACsE;AACtE,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,KAAK;IACjD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB,CAAC,KAAK,EAAE,KAAK;IAC9C,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB;6FACyF;IACzF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,MAAM,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,SAAS,KAAK,IAAI,CAC3E,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,KACzB,iBAAiB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B,CAAC,KAAK,CAAC,GAAG,IAAI,CAMvC;IAED,QAAQ,CAAC,OAAO,SAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAQ/C;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,SAAS,KAAK,EACpD,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,EACnC,OAAO,EAAE;QACR,IAAI,EAAE,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,CAAC,CAAC;QAC3B,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;QAC9B;;;;WAIG;QACH,MAAM,CAAC,EAAE,SAAS,CAAC;KACnB,GACC,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAc7C;IAED,+FAA+F;IAC/F,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,iBAAiB;CAOzB"}
|
|
@@ -86,7 +86,9 @@ export function validateSimulationReplay(initial, entries, options) {
|
|
|
86
86
|
* automatic-actor loop and fixed-command replay respectively; a game composes both against
|
|
87
87
|
* the same `scheduler` rather than choosing one over the other.
|
|
88
88
|
*
|
|
89
|
-
* Every command and event batch is journalled
|
|
89
|
+
* Every command and event batch is journalled (pass `journal: null` to disable the journal
|
|
90
|
+
* entirely: `dispatch` then skips the append, `snapshot()` exposes an empty journal, and
|
|
91
|
+
* replay/undo have nothing to replay), and with `history` every committed state is
|
|
90
92
|
* checkpointed, all through `structuredClone`: `Command`, `Event` and `State` must be plain data.
|
|
91
93
|
* A command naming its target as a live actor object (one that owns a `ReactionTable`, or any
|
|
92
94
|
* other callback) cannot be copied, so carry the actor's id and resolve it in the rule. A
|
|
@@ -137,6 +139,7 @@ export class SimulationRuntime {
|
|
|
137
139
|
this.random = options.random;
|
|
138
140
|
this.rule = options.rule;
|
|
139
141
|
this.actorId = options.actorId;
|
|
142
|
+
this.recordJournal = options.journal !== null;
|
|
140
143
|
this.journal = options.journal ?? new ActionJournal();
|
|
141
144
|
this.actorOf = options.history?.actorOf ?? null;
|
|
142
145
|
this.history = options.history ? new UndoHistory(options.history) : null;
|
|
@@ -158,7 +161,8 @@ export class SimulationRuntime {
|
|
|
158
161
|
try {
|
|
159
162
|
checkpoint = this.history ? cloneData(outcome.state, 'state') : null;
|
|
160
163
|
// Last fallible step, so a refused command or event batch leaves the journal unchanged.
|
|
161
|
-
this.
|
|
164
|
+
if (this.recordJournal)
|
|
165
|
+
this.journal.append(command, outcome.events);
|
|
162
166
|
}
|
|
163
167
|
catch (error) {
|
|
164
168
|
this.random.setState(random);
|
|
@@ -212,7 +216,7 @@ export class SimulationRuntime {
|
|
|
212
216
|
* `Scheduler.restore` does - the runtime has no identity primitive of its own to lean on.
|
|
213
217
|
*/
|
|
214
218
|
static restore(snapshot, options) {
|
|
215
|
-
const random = new Generator();
|
|
219
|
+
const random = options.random ?? new Generator();
|
|
216
220
|
random.setState(snapshot.random);
|
|
217
221
|
const scheduler = Scheduler.restore(snapshot.scheduler, options.actorOf);
|
|
218
222
|
return new SimulationRuntime({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Runtime.js","sourceRoot":"","sources":["../../src/simulation/Runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAA2B,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAA2B,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAsC,MAAM,2BAA2B,CAAC;AA0D1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AAC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AE,EAAE,KAAK,EAAE,CAAC;IACtC,CAAC;IAEO,iBAAiB,CAAC,QAAmC;QAC5D,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC/F,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAkD,CAAC,CAAC;IACjG,CAAC;CACD"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* bundler and tree-shaking configuration the *consumer* uses, not a universal one, and the
|
|
22
22
|
* port whose build tree-shook a pipe away is exactly the case this function is for.
|
|
23
23
|
*
|
|
24
|
+
* Facade-gap accounting (P31): every primitive below already has a facade family, so no new
|
|
25
|
+
* facade coverage was needed - what stays interop-only is the Pixi-typed seam each note
|
|
26
|
+
* names, and a consumer budget justifies a use by pointing at the note instead of merely
|
|
27
|
+
* counting the import.
|
|
28
|
+
*
|
|
24
29
|
* @example
|
|
25
30
|
* ```ts
|
|
26
31
|
* import { registerBuiltinPipes, TilingSprite } from '@datamoc/mw_games/two-d/pixi-interop';
|
|
@@ -31,7 +36,25 @@
|
|
|
31
36
|
* const backdrop = new TilingSprite({ texture: undefined as never, width: 100, height: 100 });
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
|
-
|
|
39
|
+
/** Interop-only: the unadorned scene-graph node behind facade `Container2D`/`Node2D`. The facade subclasses it rather than wrapping it, so a value that never needed the subclass - or a Pixi API typed against the base - still names this. */
|
|
40
|
+
export { Container } from 'pixi.js';
|
|
41
|
+
/** Interop-only: the textured quad behind facade `Sprite2D`/`TintedSprite`/`AnimatedSprite`. Same subclass relationship: reach for this for Pixi sprite behaviour the facade subclasses do not model, not for an ordinary positioned image. */
|
|
42
|
+
export { Sprite } from 'pixi.js';
|
|
43
|
+
/** Interop-only: the GPU image behind facade `Texture2D`/`TextureRegion`. `TextureRegion` still carries one in its `texture` slot, and Pixi constructors (sprites, tilings, nine-slices, render textures) take one - that slot is the seam. */
|
|
44
|
+
export { Texture } from 'pixi.js';
|
|
45
|
+
/** Interop-only: the vector canvas behind facade `Shape2D`. `Shape2D` extends this with the game's fill/stroke vocabulary; a `Graphics` program outside that vocabulary stays here. */
|
|
46
|
+
export { Graphics } from 'pixi.js';
|
|
47
|
+
/** Interop-only: the Pixi rect behind facade `Rect`. Atlas frames, bounds and hit areas arrive as one; `render.rectOf` converts it to a plain `Rect` at the boundary, and code that hands a rect straight back to Pixi keeps this. */
|
|
48
|
+
export { Rectangle } from 'pixi.js';
|
|
49
|
+
/** Interop-only: the text node behind facade `Text2D`. Same subclass relationship as `Sprite`: ordinary labels are `Text2D`; Pixi text behaviour the facade does not model stays here. */
|
|
50
|
+
export { Text } from 'pixi.js';
|
|
51
|
+
/** Interop-only: the gradient behind facade `Gradient` (which is this, aliased). `Shape2D.fill`/`.stroke` accept it directly, so most gradient work never imports it; direct construction of a gradient object does. */
|
|
52
|
+
export { FillGradient } from 'pixi.js';
|
|
53
|
+
/** Interop-only: the repeating texture behind facade `TiledSprite`. `TiledSprite` extends this; tiling behaviour outside the facade's repeat/offset surface stays here (and needs `registerBuiltinPipes` in a tree-shaken build, below). */
|
|
54
|
+
export { TilingSprite } from 'pixi.js';
|
|
55
|
+
/** Interop-only: renderer pipes, not scene content. Only needed when a consumer bundler tree-shook them away; see `registerBuiltinPipes`. */
|
|
56
|
+
export { TilingSpritePipe, NineSliceSpritePipe } from 'pixi.js';
|
|
57
|
+
/** The Pixi sprite construction options, for the rare hand-built interop sprite above. */
|
|
35
58
|
export type { SpriteOptions } from 'pixi.js';
|
|
36
59
|
/**
|
|
37
60
|
* Registers `TilingSpritePipe`/`NineSliceSpritePipe` with Pixi, for a build whose bundler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-interop.d.ts","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pixi-interop.d.ts","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gPAAgP;AAChP,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,+OAA+O;AAC/O,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,+OAA+O;AAC/O,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,uLAAuL;AACvL,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,sOAAsO;AACtO,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,0LAA0L;AAC1L,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,wNAAwN;AACxN,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,4OAA4O;AAC5O,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,6IAA6I;AAC7I,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAChE,0FAA0F;AAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* bundler and tree-shaking configuration the *consumer* uses, not a universal one, and the
|
|
22
22
|
* port whose build tree-shook a pipe away is exactly the case this function is for.
|
|
23
23
|
*
|
|
24
|
+
* Facade-gap accounting (P31): every primitive below already has a facade family, so no new
|
|
25
|
+
* facade coverage was needed - what stays interop-only is the Pixi-typed seam each note
|
|
26
|
+
* names, and a consumer budget justifies a use by pointing at the note instead of merely
|
|
27
|
+
* counting the import.
|
|
28
|
+
*
|
|
24
29
|
* @example
|
|
25
30
|
* ```ts
|
|
26
31
|
* import { registerBuiltinPipes, TilingSprite } from '@datamoc/mw_games/two-d/pixi-interop';
|
|
@@ -31,7 +36,24 @@
|
|
|
31
36
|
* const backdrop = new TilingSprite({ texture: undefined as never, width: 100, height: 100 });
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
|
-
|
|
39
|
+
/** Interop-only: the unadorned scene-graph node behind facade `Container2D`/`Node2D`. The facade subclasses it rather than wrapping it, so a value that never needed the subclass - or a Pixi API typed against the base - still names this. */
|
|
40
|
+
export { Container } from 'pixi.js';
|
|
41
|
+
/** Interop-only: the textured quad behind facade `Sprite2D`/`TintedSprite`/`AnimatedSprite`. Same subclass relationship: reach for this for Pixi sprite behaviour the facade subclasses do not model, not for an ordinary positioned image. */
|
|
42
|
+
export { Sprite } from 'pixi.js';
|
|
43
|
+
/** Interop-only: the GPU image behind facade `Texture2D`/`TextureRegion`. `TextureRegion` still carries one in its `texture` slot, and Pixi constructors (sprites, tilings, nine-slices, render textures) take one - that slot is the seam. */
|
|
44
|
+
export { Texture } from 'pixi.js';
|
|
45
|
+
/** Interop-only: the vector canvas behind facade `Shape2D`. `Shape2D` extends this with the game's fill/stroke vocabulary; a `Graphics` program outside that vocabulary stays here. */
|
|
46
|
+
export { Graphics } from 'pixi.js';
|
|
47
|
+
/** Interop-only: the Pixi rect behind facade `Rect`. Atlas frames, bounds and hit areas arrive as one; `render.rectOf` converts it to a plain `Rect` at the boundary, and code that hands a rect straight back to Pixi keeps this. */
|
|
48
|
+
export { Rectangle } from 'pixi.js';
|
|
49
|
+
/** Interop-only: the text node behind facade `Text2D`. Same subclass relationship as `Sprite`: ordinary labels are `Text2D`; Pixi text behaviour the facade does not model stays here. */
|
|
50
|
+
export { Text } from 'pixi.js';
|
|
51
|
+
/** Interop-only: the gradient behind facade `Gradient` (which is this, aliased). `Shape2D.fill`/`.stroke` accept it directly, so most gradient work never imports it; direct construction of a gradient object does. */
|
|
52
|
+
export { FillGradient } from 'pixi.js';
|
|
53
|
+
/** Interop-only: the repeating texture behind facade `TiledSprite`. `TiledSprite` extends this; tiling behaviour outside the facade's repeat/offset surface stays here (and needs `registerBuiltinPipes` in a tree-shaken build, below). */
|
|
54
|
+
export { TilingSprite } from 'pixi.js';
|
|
55
|
+
/** Interop-only: renderer pipes, not scene content. Only needed when a consumer bundler tree-shook them away; see `registerBuiltinPipes`. */
|
|
56
|
+
export { TilingSpritePipe, NineSliceSpritePipe } from 'pixi.js';
|
|
35
57
|
import { extensions, TilingSpritePipe, NineSliceSpritePipe } from 'pixi.js';
|
|
36
58
|
let registered = false;
|
|
37
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-interop.js","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pixi-interop.js","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gPAAgP;AAChP,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,+OAA+O;AAC/O,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,+OAA+O;AAC/O,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,uLAAuL;AACvL,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,sOAAsO;AACtO,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,0LAA0L;AAC1L,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,wNAAwN;AACxN,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,4OAA4O;AAC5O,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,6IAA6I;AAC7I,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAIhE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5E,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB;IACnC,IAAI,UAAU;QAAE,OAAO;IACvB,UAAU,GAAG,IAAI,CAAC;IAElB,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -32,9 +32,9 @@ export type { FogCell, FogColor, FogLayerOptions } from './FogLayer.ts';
|
|
|
32
32
|
export { Halo, HALO_ANIMATION } from './Halo.ts';
|
|
33
33
|
export type { HaloOptions } from './Halo.ts';
|
|
34
34
|
export { ParticleEmitter } from './Particles.ts';
|
|
35
|
-
export type { Particle, ParticleRange, ParticleEmitterOptions } from './Particles.ts';
|
|
35
|
+
export type { Particle, ParticleRange, ParticleCurve, ParticleSpawnArea, ParticleEmitterOptions } from './Particles.ts';
|
|
36
36
|
export { ScreenEffects } from './ScreenEffects.ts';
|
|
37
|
-
export type { ScreenEffectPhase, ScreenEffectsOptions } from './ScreenEffects.ts';
|
|
37
|
+
export type { ScreenEffectPhase, ScreenEffectStep, ScreenEffectsOptions } from './ScreenEffects.ts';
|
|
38
38
|
export { ActorAnimator } from './ActorAnimator.ts';
|
|
39
39
|
export type { ActorAnimationState, ActorAnimatorOptions } from './ActorAnimator.ts';
|
|
40
40
|
export { StatusVisuals } from './StatusVisuals.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/two-d/render/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AC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnG,YAAY,EACX,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtG,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxG,YAAY,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,kBAAkB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,UAAU,GACV,MAAM,eAAe,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* this from `package.json` automatically, chosen because this project's own build already
|
|
10
10
|
* has no step before `tsc`/`vite` that this would need to run ahead of.
|
|
11
11
|
*/
|
|
12
|
-
export declare const version = "0.
|
|
12
|
+
export declare const version = "0.26.1";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* this from `package.json` automatically, chosen because this project's own build already
|
|
10
10
|
* has no step before `tsc`/`vite` that this would need to run ahead of.
|
|
11
11
|
*/
|
|
12
|
-
export const version = '0.
|
|
12
|
+
export const version = '0.26.1';
|
|
13
13
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datamoc/mw_games",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "A local-file game framework: renderer-free game logic, drawn through PixiJS in 2D or Babylon.js in 3D, with mobile and desktop packaging.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"bin": {
|
|
37
37
|
"mwg-bench": "tools/benchmark-browser.mjs",
|
|
38
|
+
"mwg-audit-adoptions": "tools/audit-adoptions.mjs",
|
|
38
39
|
"mwg-emit": "tools/emit-page.mjs",
|
|
39
40
|
"mwg-extract-rgssad": "tools/extract-rgssad.mjs",
|
|
40
41
|
"mwg-i18n": "tools/i18n-edit.mjs",
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"tools/sbom.mjs",
|
|
73
74
|
"tools/sbom.d.mts",
|
|
74
75
|
"sbom.cdx.json",
|
|
76
|
+
"api-surface.json",
|
|
75
77
|
"tools/single-file.mjs",
|
|
76
78
|
"tools/single-file.d.mts",
|
|
77
79
|
"tools/make-example-assets.mjs",
|
|
@@ -81,6 +83,10 @@
|
|
|
81
83
|
"tools/mwl.mjs",
|
|
82
84
|
"tools/benchmark-browser.mjs",
|
|
83
85
|
"tools/benchmark-browser.d.mts",
|
|
86
|
+
"tools/audit-adoptions.mjs",
|
|
87
|
+
"tools/audit-adoptions.d.mts",
|
|
88
|
+
"tools/browser-driver.mjs",
|
|
89
|
+
"tools/browser-driver.d.mts",
|
|
84
90
|
"tools/benchmark-history.mjs",
|
|
85
91
|
"tools/benchmark-history.d.mts",
|
|
86
92
|
"tools/browser-smoke.mjs",
|
|
@@ -192,6 +198,8 @@
|
|
|
192
198
|
"import": "./dist/threads/index.js"
|
|
193
199
|
},
|
|
194
200
|
"./tools/benchmark-browser": "./tools/benchmark-browser.mjs",
|
|
201
|
+
"./tools/audit-adoptions": "./tools/audit-adoptions.mjs",
|
|
202
|
+
"./tools/browser-driver": "./tools/browser-driver.mjs",
|
|
195
203
|
"./tools/benchmark-history": "./tools/benchmark-history.mjs",
|
|
196
204
|
"./tools/browser-smoke": "./tools/browser-smoke.mjs",
|
|
197
205
|
"./tools/bundle-size": "./tools/bundle-size.mjs",
|
|
@@ -236,6 +244,11 @@
|
|
|
236
244
|
"./world": {
|
|
237
245
|
"types": "./dist/world/index.d.ts",
|
|
238
246
|
"import": "./dist/world/index.js"
|
|
247
|
+
},
|
|
248
|
+
"./api-manifest": "./api-surface.json",
|
|
249
|
+
"./headless": {
|
|
250
|
+
"types": "./dist/headless/index.d.ts",
|
|
251
|
+
"import": "./dist/headless/index.js"
|
|
239
252
|
}
|
|
240
253
|
},
|
|
241
254
|
"scripts": {
|
|
@@ -259,8 +272,8 @@
|
|
|
259
272
|
"example": "vite --config examples/colour-transform/vite.config.ts",
|
|
260
273
|
"example:build": "vite build --config examples/colour-transform/vite.config.ts && node tools/emit-page.mjs examples/colour-transform --assets=examples/assets",
|
|
261
274
|
"test": "node --test \"tests/**/*.test.ts\"",
|
|
262
|
-
"coverage": "node --test --experimental-test-coverage --test-coverage-exclude=src/two-d/Game.ts --test-coverage-exclude=src/two-d/render/ColorTransformBatcher.ts --test-coverage-exclude=src/two-d/render/Minimap.ts --test-coverage-exclude=src/three-d/Vox.ts --test-coverage-exclude=src/two-d/stage/DialogueStage.ts --test-coverage-exclude=src/two-d/
|
|
263
|
-
"coverage:check": "node --test --experimental-test-coverage --test-coverage-lines=88 --test-coverage-branches=89 --test-coverage-functions=82 --test-coverage-exclude=src/two-d/Game.ts --test-coverage-exclude=src/two-d/render/ColorTransformBatcher.ts --test-coverage-exclude=src/two-d/render/Minimap.ts --test-coverage-exclude=src/three-d/Vox.ts --test-coverage-exclude=src/two-d/stage/DialogueStage.ts --test-coverage-exclude=src/two-d/
|
|
275
|
+
"coverage": "node --test --experimental-test-coverage --test-coverage-exclude=src/two-d/Game.ts --test-coverage-exclude=src/two-d/render/ColorTransformBatcher.ts --test-coverage-exclude=src/two-d/render/Minimap.ts --test-coverage-exclude=src/three-d/Vox.ts --test-coverage-exclude=src/two-d/stage/DialogueStage.ts --test-coverage-exclude=src/two-d/ui/EventDialogue.ts --test-coverage-exclude=tools/** \"tests/**/*.test.ts\"",
|
|
276
|
+
"coverage:check": "node --test --experimental-test-coverage --test-coverage-lines=88 --test-coverage-branches=89 --test-coverage-functions=82 --test-coverage-exclude=src/two-d/Game.ts --test-coverage-exclude=src/two-d/render/ColorTransformBatcher.ts --test-coverage-exclude=src/two-d/render/Minimap.ts --test-coverage-exclude=src/three-d/Vox.ts --test-coverage-exclude=src/two-d/stage/DialogueStage.ts --test-coverage-exclude=src/two-d/ui/EventDialogue.ts --test-coverage-exclude=tools/** \"tests/**/*.test.ts\"",
|
|
264
277
|
"assets": "node tools/make-example-assets.mjs",
|
|
265
278
|
"examples:build": "npm run assets && node tools/build-all-examples.mjs",
|
|
266
279
|
"extract:rgssad": "node tools/extract-rgssad.mjs",
|
package/sbom.cdx.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.6",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:46de77d7-ba38-5dc9-90b4-bae4a009db6c",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
7
|
"tools": {
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"type": "application",
|
|
11
11
|
"group": "datamoc",
|
|
12
12
|
"name": "tools/sbom.mjs",
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.26.1"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"component": {
|
|
18
18
|
"type": "library",
|
|
19
|
-
"bom-ref": "pkg:npm/%40datamoc/mw_games@0.
|
|
19
|
+
"bom-ref": "pkg:npm/%40datamoc/mw_games@0.26.1",
|
|
20
20
|
"name": "@datamoc/mw_games",
|
|
21
|
-
"version": "0.
|
|
22
|
-
"purl": "pkg:npm/%40datamoc/mw_games@0.
|
|
21
|
+
"version": "0.26.1",
|
|
22
|
+
"purl": "pkg:npm/%40datamoc/mw_games@0.26.1",
|
|
23
23
|
"description": "A local-file game framework: renderer-free game logic, drawn through PixiJS in 2D or Babylon.js in 3D, with mobile and desktop packaging.",
|
|
24
24
|
"licenses": [
|
|
25
25
|
{
|
|
@@ -4601,7 +4601,7 @@
|
|
|
4601
4601
|
]
|
|
4602
4602
|
},
|
|
4603
4603
|
{
|
|
4604
|
-
"ref": "pkg:npm/%40datamoc/mw_games@0.
|
|
4604
|
+
"ref": "pkg:npm/%40datamoc/mw_games@0.26.1",
|
|
4605
4605
|
"dependsOn": [
|
|
4606
4606
|
"pkg:npm/%40babylonjs/core@9.29.0",
|
|
4607
4607
|
"pkg:npm/%40babylonjs/loaders@9.29.0",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface ManifestEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
kind: string;
|
|
4
|
+
subpath: string;
|
|
5
|
+
declaringModule: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ConsumerImport {
|
|
9
|
+
file: string;
|
|
10
|
+
line: number;
|
|
11
|
+
subpath: string;
|
|
12
|
+
names: string[];
|
|
13
|
+
typeOnly: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface LocalDefinition {
|
|
17
|
+
name: string;
|
|
18
|
+
file: string;
|
|
19
|
+
line: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SourceFile {
|
|
23
|
+
path: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface AdoptionBudget {
|
|
28
|
+
match: string;
|
|
29
|
+
limit: number;
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AuditorConfig {
|
|
34
|
+
reasons: Record<string, string>;
|
|
35
|
+
denySubpaths?: string[];
|
|
36
|
+
typeOnlyDirs?: string[];
|
|
37
|
+
budgets?: AdoptionBudget[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface AdoptionFinding {
|
|
41
|
+
rule: 'unadopted' | 'stale-reason' | 'collision' | 'denied-subpath' | 'type-only' | 'budget';
|
|
42
|
+
message: string;
|
|
43
|
+
file?: string;
|
|
44
|
+
line?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** `<subpath> :: <name>`, the key reasons and adoption are tracked by */
|
|
48
|
+
export function adoptionKey(subpath: string, name: string): string;
|
|
49
|
+
|
|
50
|
+
/** every `@datamoc/mw_games/<sub>` import row in the given files */
|
|
51
|
+
export function scanImports(files: SourceFile[]): ConsumerImport[];
|
|
52
|
+
|
|
53
|
+
/** every top-level interface/type/class/function/const/enum the consumer defines */
|
|
54
|
+
export function scanLocals(files: SourceFile[]): LocalDefinition[];
|
|
55
|
+
|
|
56
|
+
/** every rule over the manifest, the import rows and locals, and the config; empty means fully accounted for */
|
|
57
|
+
export function auditAdoptions(
|
|
58
|
+
manifest: ManifestEntry[],
|
|
59
|
+
imports: ConsumerImport[],
|
|
60
|
+
locals: LocalDefinition[],
|
|
61
|
+
config: AuditorConfig,
|
|
62
|
+
): AdoptionFinding[];
|
|
63
|
+
|
|
64
|
+
/** `file:line: [rule] message`, or `[rule] message` for manifest-level findings */
|
|
65
|
+
export function formatFindings(findings: AdoptionFinding[]): string[];
|