@moku-labs/game 0.1.0 → 0.3.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/README.md +121 -775
- package/bin/moku-game-assets.mjs +4 -0
- package/dist/assets.d.mts +181 -22
- package/dist/assets.mjs +1186 -160
- package/dist/{commands-C0BljsM5.d.mts → commands-DYO22lzi.d.mts} +22 -5
- package/dist/control.d.mts +3 -3
- package/dist/control.mjs +3 -3
- package/dist/{define-CjP_4H0G.d.mts → define-BKWjWgyQ.d.mts} +1 -1
- package/dist/dev-CQYJPmcD.mjs +1183 -0
- package/dist/flatten-BkXuscAV.mjs +100 -0
- package/dist/index.d.mts +88 -32
- package/dist/index.mjs +3238 -500
- package/dist/{session-DmAxY6Ll.mjs → input-CK4nxBO1.mjs} +41 -12
- package/dist/inspect.d.mts +32 -9
- package/dist/inspect.mjs +2 -2
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{run-tlcn1w7y.mjs → run-BfuMLahc.mjs} +489 -213
- package/dist/{runtime-Bn5TXNxP.d.mts → runtime-Bhu442L8.d.mts} +1 -1
- package/dist/{runtime-DRlwxkIv.mjs → runtime-CBZgWgzx.mjs} +1 -57
- package/dist/{sources-BooL2MsX.mjs → sources-C1uGjz4l.mjs} +198 -21
- package/dist/testing.d.mts +5 -5
- package/dist/testing.mjs +5 -4
- package/dist/{types-CxZy7Pi4.d.mts → types-BnWH-75b.d.mts} +95 -21
- package/dist/{types-CqkrEY06.d.mts → types-CVUHPvMB.d.mts} +5 -434
- package/dist/{types-DmhTHRVW.d.mts → types-DtmFVCHf.d.mts} +1 -1
- package/dist/{types-BZ1OLf24.d.mts → types-Dy1xB68L.d.mts} +2318 -1169
- package/dist/{types-X9jXjka3.d.mts → types-VErbiEXy.d.mts} +867 -198
- package/dist/{visual-NPrDkvUk.mjs → visual-DUvvPPCt.mjs} +51 -1
- package/fonts/LICENSE.txt +105 -0
- package/fonts/font-body.fnt +372 -0
- package/fonts/font-body.png +0 -0
- package/llms.txt +536 -0
- package/package.json +13 -6
- package/dist/component-DGg5DqKK.mjs +0 -44
- package/dist/dev-CcwFrwok.mjs +0 -413
- package/dist/types-C47fKNcn.d.mts +0 -695
|
@@ -67,23 +67,33 @@ function defineCommand(command) {
|
|
|
67
67
|
return Object.freeze(command);
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
70
|
-
//#region src/plugins/
|
|
71
|
-
/** The input of a call that passed none. */
|
|
72
|
-
const noInput = Object.freeze({});
|
|
70
|
+
//#region src/plugins/input/target.ts
|
|
73
71
|
/**
|
|
74
|
-
*
|
|
75
|
-
* the input out only when every field of the schema is optional, so `{}` is an input of that
|
|
76
|
-
* schema.
|
|
72
|
+
* Tells whether the JSON a command got names a view by its projection key.
|
|
77
73
|
*
|
|
78
|
-
* @param
|
|
79
|
-
* @returns
|
|
74
|
+
* @param value - The JSON.
|
|
75
|
+
* @returns True for an object with a string `projection` and a string `key`.
|
|
80
76
|
* @example
|
|
81
77
|
* ```ts
|
|
82
|
-
*
|
|
78
|
+
* isProjectionTarget({ projection: "board.items", key: "i5" }); // true
|
|
83
79
|
* ```
|
|
84
80
|
*/
|
|
85
|
-
function
|
|
86
|
-
return
|
|
81
|
+
function isProjectionTarget(value) {
|
|
82
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && typeof value.projection === "string" && typeof value.key === "string";
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Reads the projection key of a view out of the JSON a command got.
|
|
86
|
+
*
|
|
87
|
+
* @param value - The JSON: `{ projection, key }`.
|
|
88
|
+
* @returns The target, a fresh object.
|
|
89
|
+
* @throws {Error} When the JSON is not an object with a string `projection` and a string `key`.
|
|
90
|
+
*/
|
|
91
|
+
function readTarget(value) {
|
|
92
|
+
if (isProjectionTarget(value)) return {
|
|
93
|
+
projection: value.projection,
|
|
94
|
+
key: value.key
|
|
95
|
+
};
|
|
96
|
+
throw new Error("[game] The target is not a projection key.\n Pass a view like { projection: \"board.items\", key: \"i5\" }.");
|
|
87
97
|
}
|
|
88
98
|
//#endregion
|
|
89
99
|
//#region src/plugins/flow/doors/session.ts
|
|
@@ -142,4 +152,23 @@ function recordCheat(app, id, input, frame) {
|
|
|
142
152
|
sessions.set(app, session);
|
|
143
153
|
}
|
|
144
154
|
//#endregion
|
|
145
|
-
|
|
155
|
+
//#region src/plugins/flow/doors/input.ts
|
|
156
|
+
/** The input of a call that passed none. */
|
|
157
|
+
const noInput = Object.freeze({});
|
|
158
|
+
/**
|
|
159
|
+
* Hands the given input on, or an empty one. `InputArguments` and `WatchInput` let a call leave
|
|
160
|
+
* the input out only when every field of the schema is optional, so `{}` is an input of that
|
|
161
|
+
* schema.
|
|
162
|
+
*
|
|
163
|
+
* @param input - The input of the call, if any.
|
|
164
|
+
* @returns The input to pass to the descriptor.
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* inputOrEmpty<{ last: "number?" }>(undefined); // {}
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
function inputOrEmpty(input) {
|
|
171
|
+
return input ?? noInput;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
export { isProjectionTarget as a, defineSource as c, recordCheat as i, cheatsOf as n, readTarget as o, isTainted as r, defineCommand as s, inputOrEmpty as t };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { _ as EffectsApi, a as SoundEntry, t as AudioApi, v as EffectsStats } from "./types-CxZy7Pi4.mjs";
|
|
1
|
+
import { At as JournalEntry, H as EntitySnapshot, Ot as FlowGraph, R as ComponentSchema, U as FrameDiff, Ut as Api, f as Usage, gt as Position, j as Explained, k as Api$1, m as Api$2, t as Api$3, tn as Snapshot, w as RenderStats, x as Under } from "./types-Dy1xB68L.mjs";
|
|
2
|
+
import { a as InputOf, c as Source, d as HeadlessApp, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-DtmFVCHf.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-VErbiEXy.mjs";
|
|
4
|
+
import { A as UiApi } from "./types-CVUHPvMB.mjs";
|
|
5
|
+
import { n as defineSource } from "./define-BKWjWgyQ.mjs";
|
|
6
|
+
import { _ as EffectsApi, a as SoundEntry, t as AudioApi, v as EffectsStats } from "./types-BnWH-75b.mjs";
|
|
8
7
|
|
|
9
8
|
//#region src/plugins/flow/doors/read.d.ts
|
|
10
9
|
/**
|
|
@@ -76,8 +75,9 @@ declare const sources: Readonly<{
|
|
|
76
75
|
ui: Source<{}, UiNode, HeadlessApp & {
|
|
77
76
|
readonly ui: UiApi;
|
|
78
77
|
}>;
|
|
79
|
-
|
|
80
|
-
key: "string";
|
|
78
|
+
locate: Source<{
|
|
79
|
+
key: "string?";
|
|
80
|
+
target: "json?";
|
|
81
81
|
}, {
|
|
82
82
|
x: number;
|
|
83
83
|
y: number;
|
|
@@ -86,6 +86,8 @@ declare const sources: Readonly<{
|
|
|
86
86
|
} | undefined, HeadlessApp & {
|
|
87
87
|
readonly ui: UiApi;
|
|
88
88
|
readonly renderer: Api$2;
|
|
89
|
+
} & {
|
|
90
|
+
readonly world: Api$1;
|
|
89
91
|
}>;
|
|
90
92
|
render: Source<{}, RenderStats, HeadlessApp & {
|
|
91
93
|
readonly renderer: Api$2;
|
|
@@ -106,6 +108,27 @@ declare const sources: Readonly<{
|
|
|
106
108
|
}, readonly import("@moku-labs/common/browser").LogEntry[], HeadlessApp & {
|
|
107
109
|
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
108
110
|
}>;
|
|
111
|
+
explain: Source<{
|
|
112
|
+
entity: "number";
|
|
113
|
+
}, Explained | undefined, HeadlessApp & {
|
|
114
|
+
readonly world: Api$1;
|
|
115
|
+
}>;
|
|
116
|
+
diff: Source<{
|
|
117
|
+
from: "number";
|
|
118
|
+
to: "number";
|
|
119
|
+
}, FrameDiff, HeadlessApp & {
|
|
120
|
+
readonly world: Api$1;
|
|
121
|
+
}>;
|
|
122
|
+
schema: Source<{}, readonly ComponentSchema[], HeadlessApp & {
|
|
123
|
+
readonly world: Api$1;
|
|
124
|
+
}>;
|
|
125
|
+
at: Source<{
|
|
126
|
+
x: "number";
|
|
127
|
+
y: "number";
|
|
128
|
+
}, readonly Under[], HeadlessApp & {
|
|
129
|
+
readonly renderer: Api$2;
|
|
130
|
+
readonly world: Api$1;
|
|
131
|
+
}>;
|
|
109
132
|
}>;
|
|
110
133
|
//#endregion
|
|
111
134
|
export { type InputOf, type InputSchema, type Source, defineSource, read, sources, watch };
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
1
|
+
import { c as defineSource } from "./input-CK4nxBO1.mjs";
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-C1uGjz4l.mjs";
|
|
3
3
|
export { defineSource, read, sources, watch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-Bhu442L8.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxDEV, jsxs };
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as jsxs, n as jsx, r as jsxDEV, t as Fragment } from "./runtime-
|
|
1
|
+
import { i as jsxs, n as jsx, r as jsxDEV, t as Fragment } from "./runtime-CBZgWgzx.mjs";
|
|
2
2
|
export { Fragment, jsx, jsxDEV, jsxs };
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-Bhu442L8.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as jsxs, n as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { i as jsxs, n as jsx, t as Fragment } from "./runtime-CBZgWgzx.mjs";
|
|
2
2
|
export { Fragment, jsx, jsxs };
|