@moku-labs/game 0.14.11 → 0.14.13
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/README.md +13 -12
- package/dist/app/page.d.mts +8 -3
- package/dist/app/page.mjs +57 -12
- package/dist/app/system.d.mts +5 -3
- package/dist/app/system.mjs +2 -0
- package/dist/app.d.mts +15 -7
- package/dist/app.mjs +131 -27
- package/dist/{assets-BrKSg1O6.mjs → assets-CEMfBogh.mjs} +471 -120
- package/dist/assets.d.mts +30 -13
- package/dist/assets.mjs +1 -1
- package/dist/cli.d.mts +105 -8
- package/dist/cli.mjs +1036 -128
- package/dist/{commands-d5Zlh9hf.d.mts → commands-DAETmK86.d.mts} +43 -7
- package/dist/{config-CdARrrhU.mjs → config-B87aFTW-.mjs} +25 -4
- package/dist/control.d.mts +130 -17
- package/dist/control.mjs +4 -4
- package/dist/{define-BN15lAWb.d.mts → define-BASd9ZUh.d.mts} +32 -4
- package/dist/dev-DbHgx-R-.mjs +89 -0
- package/dist/{fake-MpzwZhIZ.mjs → fake-6mazmHK3.mjs} +20 -2
- package/dist/features-DowEilZm.mjs +266 -0
- package/dist/{headless-CrhefcLu.d.mts → headless-cFveciuY.d.mts} +1 -1
- package/dist/hot.d.mts +4 -2
- package/dist/hot.mjs +7 -4
- package/dist/{index-0GIP3tgm.d.mts → index-DedbED3T.d.mts} +317 -69
- package/dist/index.d.mts +5 -6
- package/dist/index.mjs +3 -3
- package/dist/inspect.d.mts +12 -7
- package/dist/inspect.mjs +2 -2
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/lint.d.mts +8 -3
- package/dist/lint.mjs +432 -20
- package/dist/project.d.mts +15 -1
- package/dist/project.mjs +1 -1
- package/dist/{run-Bf2hKyjZ.mjs → run-BbipFRc6.mjs} +250 -51
- package/dist/{runtime-aLkoeoGj.d.mts → runtime-DoSlRx8X.d.mts} +1 -1
- package/dist/{session-DgukhR_7.mjs → session-CeKgO2hy.mjs} +30 -2
- package/dist/{sources-Duzj6lhV.mjs → sources-Cdvb0rOS.mjs} +33 -6
- package/dist/{src-Do697seR.mjs → src-BEbJ_sSx.mjs} +29154 -11121
- package/dist/testing.d.mts +119 -14
- package/dist/testing.mjs +97 -7
- package/dist/{types-BZa187kz.d.mts → types-7GXcXxxv.d.mts} +196 -242
- package/dist/{types-BT9S_Lo2.d.mts → types-BGcda5Le.d.mts} +4464 -735
- package/dist/{types-yiHtzg1Y.d.mts → types-C73hbmxi.d.mts} +129 -17
- package/dist/{types-Bc9AvZVO.d.mts → types-DngFQJro.d.mts} +43 -5
- package/dist/{types-kNiV7iFj.d.mts → types-GHE4J5Uf.d.mts} +1027 -192
- package/dist/{visual-dMW8iqAE.mjs → visual-2m4wJL_z.mjs} +111 -7
- package/dist/visual-_XhoGeIC.d.mts +345 -0
- package/dist/visual.d.mts +1 -332
- package/dist/visual.mjs +130 -20
- package/dist/{watch-CWI_on4T.mjs → watch-BEdrp80i.mjs} +149 -30
- package/llms.txt +103 -51
- package/package.json +8 -6
- package/dist/dev-Cc50Dk7H.mjs +0 -47
- package/dist/memory-DR1ibF_s.d.mts +0 -50
- package/dist/types-DMoi447V.d.mts +0 -656
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moku-labs/game",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.13",
|
|
4
4
|
"description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"lint": "biome check . && eslint .",
|
|
102
102
|
"lint:fix": "biome check --write . && eslint --fix .",
|
|
103
103
|
"format": "biome format --write .",
|
|
104
|
-
"typecheck": "tsc --noEmit",
|
|
104
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tests/fixtures/episodes-game",
|
|
105
105
|
"test": "bun --bun vitest run",
|
|
106
106
|
"test:unit": "bun --bun vitest run --project unit",
|
|
107
107
|
"test:integration": "bun --bun vitest run --project integration",
|
|
@@ -110,6 +110,8 @@
|
|
|
110
110
|
"mini:pack": "bun tests/fixtures/moku-game.ts pack --root tests/fixtures/mini-game",
|
|
111
111
|
"mini:dev": "bun tests/fixtures/moku-game.ts dev --root tests/fixtures/mini-game",
|
|
112
112
|
"mini:visual": "bun tests/visual/run.ts",
|
|
113
|
+
"sheets:visual": "bun tests/visual-sheets/run.ts",
|
|
114
|
+
"filters:visual": "bun tests/visual/filter-inputs.visual.ts",
|
|
113
115
|
"validate": "publint && (attw --pack . --profile esm-only --quiet || attw --pack . --profile esm-only)",
|
|
114
116
|
"release:setup": "moku-release setup",
|
|
115
117
|
"release:doctor": "moku-release doctor",
|
|
@@ -123,9 +125,9 @@
|
|
|
123
125
|
"peerDependencies": {
|
|
124
126
|
"@moku-labs/common": "^0.3.4",
|
|
125
127
|
"@moku-labs/core": "^1.7.1",
|
|
126
|
-
"@moku-labs/native": "^0.3.
|
|
128
|
+
"@moku-labs/native": "^0.3.9",
|
|
127
129
|
"@moku-labs/system": "^0.3.1",
|
|
128
|
-
"pixi.js": "^8.
|
|
130
|
+
"pixi.js": "^8.22.0",
|
|
129
131
|
"playwright-core": ">=1.50.0",
|
|
130
132
|
"sharp": "^0.34.0",
|
|
131
133
|
"typescript": ">=5.5"
|
|
@@ -158,7 +160,7 @@
|
|
|
158
160
|
"@moku-labs/ci": "1.5.7",
|
|
159
161
|
"@moku-labs/common": "0.3.10",
|
|
160
162
|
"@moku-labs/core": "1.7.6",
|
|
161
|
-
"@moku-labs/native": "0.3.
|
|
163
|
+
"@moku-labs/native": "0.3.9",
|
|
162
164
|
"@moku-labs/system": "0.3.7",
|
|
163
165
|
"@types/bun": "1.4.2",
|
|
164
166
|
"@vitest/coverage-istanbul": "4.0.18",
|
|
@@ -171,7 +173,7 @@
|
|
|
171
173
|
"jiti": "2.6.1",
|
|
172
174
|
"lefthook": "2.1.1",
|
|
173
175
|
"oxlint": "1.86.0",
|
|
174
|
-
"pixi.js": "8.
|
|
176
|
+
"pixi.js": "8.22.0",
|
|
175
177
|
"playwright-core": "1.60.0",
|
|
176
178
|
"publint": "0.3.21",
|
|
177
179
|
"sharp": "0.34.5",
|
package/dist/dev-Cc50Dk7H.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/flow/doors/dev.ts
|
|
2
|
-
/**
|
|
3
|
-
* Reads the dev flag at call time. Undefined means off: production is the default.
|
|
4
|
-
*
|
|
5
|
-
* @returns True only when `__MOKU_GAME_DEV__` is exactly `true`.
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* // The dev page set the flag in .moku/dev.ts before the engine started.
|
|
9
|
-
* globalThis.__MOKU_GAME_DEV__ = true;
|
|
10
|
-
* isDev(); // true
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
function isDev() {
|
|
14
|
-
return typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__ === true;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Builds the error a control command throws outside a dev build.
|
|
18
|
-
*
|
|
19
|
-
* @returns The error, ready to throw.
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* // A production build called a /control command.
|
|
23
|
-
* controlRefused().message; // "[game] Control commands run in dev builds only.\n Define __MOKU_GAME_DEV__ as true in the dev build."
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
function controlRefused() {
|
|
27
|
-
return /* @__PURE__ */ new Error("[game] Control commands run in dev builds only.\n Define __MOKU_GAME_DEV__ as true in the dev build.");
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Builds the error a door source or command throws when the opt-in plugin it uses is not
|
|
31
|
-
* installed.
|
|
32
|
-
*
|
|
33
|
-
* @param id - The id of the source or the command.
|
|
34
|
-
* @param plugin - The export name of the plugin it uses.
|
|
35
|
-
* @param kind - What the door descriptor is. A source by default.
|
|
36
|
-
* @returns The error, ready to throw.
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* notInstalled("game.sounds", "audioPlugin").message; // "[game] The source game.sounds needs audioPlugin.\n Add audioPlugin to createApp({ plugins })."
|
|
40
|
-
* notInstalled("game.mute", "audioPlugin", "command").message; // "[game] The command game.mute needs audioPlugin.\n Add audioPlugin to createApp({ plugins })."
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
function notInstalled(id, plugin, kind = "source") {
|
|
44
|
-
return /* @__PURE__ */ new Error(`[game] The ${kind} ${id} needs ${plugin}.\n Add ${plugin} to createApp({ plugins }).`);
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { isDev as n, notInstalled as r, controlRefused as t };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Xt as Json, nn as ProviderCall, rn as SaveDoc, tn as PlayerStateProvider } from "./types-BT9S_Lo2.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/plugins/model/store/providers/memory.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Creates an in-memory provider that keeps what it was committed and records every call.
|
|
6
|
-
* It is the default when a game configures no `playerProvider`, and the double every test uses:
|
|
7
|
-
* `provider.calls` is the whole persistence protocol of one run, in order. The document lives as
|
|
8
|
-
* long as the provider does, so a second app over the same instance reads what the first one
|
|
9
|
-
* wrote, and nothing survives the process.
|
|
10
|
-
*
|
|
11
|
-
* `load()` reads the fixture, or everything committed since; without either, the player is new.
|
|
12
|
-
* `commitDurable()` resolves at once: there is no disk behind it.
|
|
13
|
-
*
|
|
14
|
-
* @param fixture - The save `load()` starts from. Omitted: a new player.
|
|
15
|
-
* @param fixture.state - The saved document.
|
|
16
|
-
* @param fixture.version - Schema version of the saved document.
|
|
17
|
-
* @returns A provider that keeps its document and records its calls.
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* // A new player is saved at once. One roll reaches the provider at the next rest node.
|
|
21
|
-
* const provider = memory();
|
|
22
|
-
* const game = await createHeadless(createGame(provider));
|
|
23
|
-
*
|
|
24
|
-
* await game.walk([{ at: "home", intent: "roll" }]);
|
|
25
|
-
* provider.calls.map(call => call.method); // ["load", "commit", "commit"]
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
declare function memory(fixture?: {
|
|
29
|
-
state: SaveDoc;
|
|
30
|
-
version: number;
|
|
31
|
-
}): PlayerStateProvider & {
|
|
32
|
-
calls: ProviderCall[];
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Builds a save document from a player tree, with no rng streams drawn yet.
|
|
36
|
-
* Short fixtures in tests read as `saveOf({ coins: 5 })` instead of spelling out the rng branch.
|
|
37
|
-
*
|
|
38
|
-
* @param player - Player tree of the save.
|
|
39
|
-
* @param seed - Rng seed of the save.
|
|
40
|
-
* @returns The save document.
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* // A returning player with 5 coins. The test starts from this save, not from `initialPlayer`.
|
|
44
|
-
* saveOf({ coins: 5 }, 42); // { player: { coins: 5 }, rng: { seed: 42, streams: {} } }
|
|
45
|
-
* const provider = memory({ state: saveOf({ coins: 5 }, 42), version: 1 });
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
declare function saveOf(player: Json, seed?: number): SaveDoc;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { saveOf as n, memory as t };
|