@moku-labs/game 0.15.161 → 0.15.163
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/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +1 -1
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-CLhKYlot.d.mts → commands-CAvCuLaL.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-3zxu6rIq.d.mts → define-DSOTwTUY.d.mts} +2 -2
- package/dist/{headless-DFkrIVO4.d.mts → headless-PANjNy6-.d.mts} +1 -1
- package/dist/{index-CVmEBBm5.d.mts → index-oS9wiCoO.d.mts} +12 -12
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +6 -6
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-CI8p6sVn.d.mts → runtime-Bb5sNTGb.d.mts} +1 -1
- package/dist/{sources-D9Fk3Z4d.mjs → sources-DRP-bS6e.mjs} +2 -1
- package/dist/{src-qeTzNTZA.mjs → src-DBhsppmi.mjs} +1075 -308
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-CM7Ng3EN.d.mts → types-BuN6rLDs.d.mts} +2 -2
- package/dist/{types-Bl9jyah_.d.mts → types-C4d1Ptfc.d.mts} +1881 -39
- package/dist/{types-D1xdKk_t.d.mts → types-DTkhpupa.d.mts} +91 -22
- package/dist/{types-DHWjH6p9.d.mts → types-SUCTOeQZ.d.mts} +4 -4
- package/dist/types-dSup2_q9.d.mts +1841 -0
- package/dist/{visual-D_4mmn1u.d.mts → visual-BZrQT1r1.d.mts} +5 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +1 -1
- package/package.json +3 -3
- package/dist/types-D-vnlN3n.d.mts +0 -3632
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as commands } from "./commands-CLhKYlot.mjs";
|
|
1
|
+
import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-DTkhpupa.mjs";
|
|
2
|
+
import { L as InputApi, nt as AnimApi, s as UiApi } from "./types-C4d1Ptfc.mjs";
|
|
3
|
+
import { r as Repro } from "./headless-PANjNy6-.mjs";
|
|
4
|
+
import { i as ControlApp, o as InputOf } from "./types-BuN6rLDs.mjs";
|
|
5
|
+
import { t as commands } from "./commands-CAvCuLaL.mjs";
|
|
7
6
|
|
|
8
7
|
//#region src/visual/types.d.ts
|
|
9
8
|
/** The base commands of the `/control` door, keyed by their short names. */
|
package/dist/visual.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-
|
|
1
|
+
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-BZrQT1r1.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/dist/visual.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
|
|
2
|
-
import { n as read, t as sources } from "./sources-
|
|
2
|
+
import { n as read, t as sources } from "./sources-DRP-bS6e.mjs";
|
|
3
3
|
import { n as commands, t as run } from "./run-B4imG5Lu.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
package/llms.txt
CHANGED
|
@@ -583,7 +583,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
583
583
|
- `Tappable({ intent, payload, point: true })`: a finger tap answers `{ intent, payload: { ...payload, point: { x, y } } }`, the press-down point in the view's own units (a ui `button` with `point`: (0, 0) its top-left corner); `app.input.tap(target, point?)` hands a point already in those units to a flagged view. No `point` key without the flag, without a point (Enter, Escape, `tap(target)`) or on a long press; `point` absent by default, so a `Tappable` serialises as before. Type: `TapValue` (the component's value, `IntentValue & { point?: true }`).
|
|
584
584
|
- `Draggable({ payload, carry?, aim? })`: `aim: { x, y }`, a point of the view in its own units, moves the hover and the drop lookup from the finger to that point of the view in the hand; `null` (default) is the finger.
|
|
585
585
|
- `pluginConfigs.renderer.onDemand: true` draws a frame only when something visible changed (a written view, a filter value, a resize, a wake, a capture); `app.renderer.stats().drawn` is the frames drawn per second (`fps` without it); a game that writes into its own `Display` object calls `app.renderer.invalidate(entity)` before the write; `renderer.sync.debug.verifyFrames(true)` (dev/debug) checks skipped frames by pixels and logs `renderer:missed-frame`; a dev build warns `renderer:missed-mark` for a write without the call.
|
|
586
|
-
- `app.renderer.stats()` adds `textureMbSplit: { art, targets, kept }` (MiB). `app.renderer.host.resolution()` is the resolution drawn at: `override ?? min(devicePixelRatio, maxResolution)`; `maxResolution` is a number (default 2), a change of `devicePixelRatio` is followed from the next frame, and `app.renderer.monitor.setResolution(n | undefined)` overrides it in every build, the way to apply a player's graphics setting from an effect (0.5 to 4, else a `RangeError`).
|
|
586
|
+
- `app.renderer.stats()` adds `textureMbSplit: { art, text, targets, kept, other, idle: { targets, kept } }` (MiB, 2 decimals, 0 while inert): art is what `sync.textures.create` made, text the font pages of `sync.fonts.install`, targets the render targets, kept the pictures the engine keeps, other the rest (what Pixi made itself); the five add up to `textureMb`, and `idle` is the share of targets and kept waiting in a pool. `app.renderer.host.resolution()` is the resolution drawn at: `override ?? min(devicePixelRatio, maxResolution)`; `maxResolution` is a number (default 2), a change of `devicePixelRatio` is followed from the next frame, and `app.renderer.monitor.setResolution(n | undefined)` overrides it in every build, the way to apply a player's graphics setting from an effect (0.5 to 4, else a `RangeError`).
|
|
587
587
|
- `app.renderer.monitor` (agent builds; nothing otherwise): `stream(listener)` the performance log, one frozen JSON line at a time (`PerfLogLine`, `v` = `PERF_LOG_VERSION` = 1, `t` page epoch ms, `build`): `header`, `startup`, a `sample` a second, `spike` (a frame over its budget, with its passes, GPU time, systems, compiles, filters per kind, long frames), `longFrame`, `event`, `mark`, `thermal`; `frames()` the frame ring (typed-array columns, `read(into, cursor)` copies without allocating; `frameAt(ring, age)` gives one record); `mark(label)`; `event(name, detail?)`; `beginAgent()`/`endAgent()` for engine plugins. Config `renderer.monitor: { budgetMs: "rate", frames: 1024 }`: `"rate"` makes the spike budget one frame of the frame's rate (8.33 ms at 120 fps, 16.7 at 60). The engine sends nothing anywhere. The types of the log and of its ring are exported from the root for tools that read it: `PerfLogLine` and its lines `PerfHeaderLine`, `PerfStartupLine`, `PerfSampleLine`, `PerfSpikeLine`, `PerfLongFrameLine`, `PerfEventLine`, `PerfMarkLine`, `PerfThermalLine`, `PerfCollectorLine`, with `PerfEventName`, `PerfChange`, `PerfChangeEntry`, `PerfCause`, `PerfDisplay`, `PerfMeasured`, `LongFrameEntry`, `PassKind`, `PassRecord`, `ProblemRule`, `ShaderWhat`, `OverlayWhat`, `OverlayEventDetail`, `PoolTrimDetail`, `WarmDetail`; the ring `FrameRing`, `FrameRecord`, `FrameColumns`, `FrameReadout`, `FrameReadResult`; the sections `MonitorSections`, `MonitorCounts`, `MonitorConfig`; and the constant lists `PERF_CAUSES` (bit order of the `causes` column), `PERF_GAP_BUCKETS`, `MONITOR_SECTIONS` and `DEMAND_REASONS` (the `reason` column's index into it).
|
|
588
588
|
- The telemetry of a debug build (0.15, PerfLog still `v: 1`, every field additive): the header carries `app: { id }` (`__MOKU_GAME_APP__`, `"com.mokulabs.timber.debug"` in a native debug build, else `null`) and `debug: { overdraw }`. The pass ring (`frames().passes`) gains `owner` (the entity whose filter drew the pass, 0 none), `kind2` (the filter kind, 1-based: `frames().kindNames[kind2 - 1]`, 0 none), `drawsAt` (the frame's draws when the pass began; WebGPU), `format` and `resolution` of its target; `frames().systemNames` names `sysIdx` (a new array when a system registers). A spike's `passes[]` add `owner`, `view` (the owner's view label), `filter`, `draws`, `format`, `resolution`, `kept`. Root exports `PASS_KINDS` (`passes.kind` by index), `SHADER_WHATS`, `PROBLEM_RULES`, types `ShaderEventDetail`, `ProblemEventDetail`, `PerfCounts`. Event `shader` `{ what: "compile" | "module", label, ms, frame, boot, during: { pass, filter, owner, view } }`, one per pipeline or shader module, written at the flush, boot compiles included (`boot: true`); the old `compile { frame, count }` stays. Event `problem` once per crossing, judged once a second: `filter-still` (a filtered view the kept cache does not keep stood still `stillFrames` drawn frames, filtered in every one over `stillMpx`; `reason: "budget" | "not-eligible"`), `target-churn` (render targets made and dropped `churnPerSecond` a second for `churnSeconds`, or made while idle, or within `churnAfterTrimMs` after a pool trim; `reason: "rate" | "idle" | "after-trim"`), `retakes` (a kept view taken again 3 times in 2 s; `value` per second); `{ rule, cleared: true, owner, view }` when it stops. Thresholds are flat keys of `renderer.monitor`: `stillFrames: 60, stillMpx: 0.25, churnPerSecond: 4, churnSeconds: 3, churnAfterTrimMs: 1000`. A `sample` adds `counts: { entities, views, timers, frameListeners, clockListeners, …registered }` (`timers` = `clock.pending()`; input registers `inputListeners`) and `targets: { created, destroyed }` (WebGPU, else `null`); `stats().counts` reads the same. `monitor.counts.register(name, read)` adds a count (agent builds; at most 16, the 17th throws `[game] Monitor count table is full (16).`; the renderer's `onStop` drops them). Event `debug { overdraw }` marks the overdraw switch. The editor's collector writes `telemetry` and `gap` lines into its copy of a log (`PerfTelemetryLine`, `PerfGapLine`); the engine never does.
|
|
589
589
|
- Overdraw heat map (dev and debug builds): `app.renderer.sync.debug.overdraw(true)` (or `game.debug { overdraw: true }`) draws every frame so a pixel's brightness counts the layers drawn there: 1/16 white a layer, white at sixteen. While on, every frame is drawn (also with `onDemand`), kept pictures draw live and filters are off; only the stage pass changes, the tree between frames stays the game's, and off draws the game again from the next frame. Texels a texture leaves transparent count nothing.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moku-labs/game",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.163",
|
|
4
4
|
"description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"test:unit": "bun --bun vitest run --project unit",
|
|
107
107
|
"test:integration": "bun --bun vitest run --project integration",
|
|
108
108
|
"test:coverage": "bun --bun vitest run --project unit --project integration --coverage",
|
|
109
|
-
"test:perf": "node ./node_modules/vitest/vitest.mjs run --project perf",
|
|
109
|
+
"test:perf": "node ./node_modules/vitest/vitest.mjs run --project perf --project perf-cold",
|
|
110
110
|
"bench:perf": "node ./node_modules/vitest/vitest.mjs bench --run --project perf",
|
|
111
111
|
"build": "tsdown",
|
|
112
112
|
"mini:pack": "bun tests/fixtures/moku-game.ts pack --root tests/fixtures/mini-game",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"@moku-labs/ci": "1.5.8",
|
|
163
163
|
"@moku-labs/common": "0.3.12",
|
|
164
164
|
"@moku-labs/core": "1.7.6",
|
|
165
|
-
"@moku-labs/native": "0.3.
|
|
165
|
+
"@moku-labs/native": "0.3.16",
|
|
166
166
|
"@moku-labs/system": "0.3.8",
|
|
167
167
|
"@types/bun": "1.4.2",
|
|
168
168
|
"@vitest/coverage-istanbul": "4.0.18",
|