@moku-labs/game 0.8.0 → 0.10.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 +88 -26
- package/bin/moku-game.mjs +4 -0
- package/dist/app/page.d.mts +41 -0
- package/dist/app/page.mjs +376 -0
- package/dist/app/system.d.mts +129 -0
- package/dist/app/system.mjs +307 -0
- package/dist/app.d.mts +37 -0
- package/dist/app.mjs +235 -0
- package/dist/assets-BHwTLVta.mjs +7391 -0
- package/dist/assets.d.mts +97 -33
- package/dist/assets.mjs +1 -7150
- package/dist/{capture-BX5Gfoty.mjs → capture-fpd83Mi5.mjs} +384 -1
- package/dist/cli.d.mts +70 -0
- package/dist/cli.mjs +1650 -0
- package/dist/{commands-C1kIfOG5.d.mts → commands-C4QlqijJ.d.mts} +5 -6
- package/dist/config-CdARrrhU.mjs +81 -0
- package/dist/control.d.mts +11 -10
- package/dist/control.mjs +3 -3
- package/dist/{define-BPpZcpxW.d.mts → define-CCc0ozKe.d.mts} +2 -2
- package/dist/{dev-wKLgOw7c.mjs → dev-Cc50Dk7H.mjs} +1 -1
- package/dist/{memory-CvgdnsQO.mjs → drafts-BawpSaVp.mjs} +1 -104
- package/dist/fake-MpzwZhIZ.mjs +87 -0
- package/dist/{headless-CvamCUcR.mjs → headless-BsNdJs9W.mjs} +1 -1
- package/dist/{headless-q98SwADR.d.mts → headless-G4nuZ-xz.d.mts} +1 -1
- package/dist/hot.d.mts +8 -8
- package/dist/hot.mjs +15 -14
- package/dist/index-xxSxKJJW.d.mts +1611 -0
- package/dist/index.d.mts +6 -1597
- package/dist/index.mjs +4 -34343
- package/dist/inspect-la_KkjCS.mjs +1 -0
- package/dist/inspect.d.mts +7 -8
- package/dist/inspect.mjs +3 -2
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/lint.d.mts +55 -4
- package/dist/lint.mjs +999 -42
- package/dist/memory-CWlqhS7l.mjs +136 -0
- package/dist/memory-DwDhfFWK.d.mts +50 -0
- package/dist/project.d.mts +29 -13
- package/dist/project.mjs +1120 -631
- package/dist/{run-CUPSFM85.mjs → run-wYty_Lwo.mjs} +4 -4
- package/dist/{runtime-CvDZZg1S.d.mts → runtime-DOBYM6g4.d.mts} +1 -1
- package/dist/{input-z_35Jwfn.mjs → session-DgukhR_7.mjs} +20 -20
- package/dist/{sources-BBUd15vQ.mjs → sources-Duzj6lhV.mjs} +3 -3
- package/dist/src-DSl1eNB1.mjs +34366 -0
- package/dist/testing.d.mts +115 -34
- package/dist/testing.mjs +175 -70
- package/dist/{types-DlgsfOmW.d.mts → types-BM4shh8K.d.mts} +300 -263
- package/dist/{types-DgdMLZnV.d.mts → types-BUwDHKXm.d.mts} +1372 -1373
- package/dist/{types-DF5kkW-C.d.mts → types-CefgYzFt.d.mts} +4 -5
- package/dist/{types-CDSKa0vl.d.mts → types-DAdwEJMp.d.mts} +2 -2
- package/dist/{types-BWzCSRM2.d.mts → types-ZQLYXo5X.d.mts} +2983 -20
- package/dist/types-hQgI_wrq.d.mts +544 -0
- package/dist/{visual-DUvvPPCt.mjs → visual-dMW8iqAE.mjs} +8 -4
- package/dist/visual.d.mts +10 -11
- package/dist/visual.mjs +5 -5
- package/llms.txt +170 -57
- package/package.json +30 -2
- package/dist/registry-DlpRCibU.mjs +0 -384
- package/dist/types-ERb2Y9U5.d.mts +0 -2967
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import { n as defineSource } from "./define-
|
|
8
|
-
import { n as EffectsApi, r as EffectsStats } from "./types-DF5kkW-C.mjs";
|
|
1
|
+
import { A as Api$1, At as FlowGraph, M as Explained, Mt as JournalEntry, S as Under, T as RenderStats, U as EntitySnapshot, W as FrameDiff, _t as Position, an as Snapshot, h as Api$2, p as Usage, qt as Api, t as Api$3, z as ComponentSchema } from "./types-ZQLYXo5X.mjs";
|
|
2
|
+
import { a as AudioApi, r as UiApi, u as SoundEntry } from "./types-BM4shh8K.mjs";
|
|
3
|
+
import { n as EffectsApi, r as EffectsStats } from "./types-CefgYzFt.mjs";
|
|
4
|
+
import { c as UiNode } from "./types-BUwDHKXm.mjs";
|
|
5
|
+
import { t as HeadlessApp } from "./headless-G4nuZ-xz.mjs";
|
|
6
|
+
import { a as InputOf, c as Source, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-DAdwEJMp.mjs";
|
|
7
|
+
import { n as defineSource } from "./define-CCc0ozKe.mjs";
|
|
9
8
|
|
|
10
9
|
//#region src/plugins/flow/doors/read.d.ts
|
|
11
10
|
/**
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { c as defineSource } from "./
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
1
|
+
import { c as defineSource } from "./session-DgukhR_7.mjs";
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-Duzj6lhV.mjs";
|
|
3
|
+
import "./inspect-la_KkjCS.mjs";
|
|
3
4
|
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-DOBYM6g4.mjs";
|
|
2
2
|
export { Fragment, type JSX, 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-DOBYM6g4.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
package/dist/lint.d.mts
CHANGED
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
//#region src/lint.d.ts
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The options every rule takes: which files it checks. A key given replaces the rule's default.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```json
|
|
7
|
+
* "moku-game/determinism": ["error", { "files": ["src/logic/**"], "ignores": ["src/logic/*.dev.ts"] }]
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
3
10
|
type GameLintOptions = {
|
|
4
11
|
/** Globs of the files the rule checks, relative to the directory oxlint runs in. */files?: string[]; /** Globs of the files the rule skips, even when `files` matches them. */
|
|
5
12
|
ignores?: string[];
|
|
6
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* The options of the layout rules `layer-imports`, `feature-door` and `rules-siblings`: the files,
|
|
16
|
+
* where the layers sit and which tsconfig names the aliases.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```json
|
|
20
|
+
* "moku-game/layer-imports": ["error", { "root": "src", "tsconfig": "tsconfig.game.json" }]
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
type GameLintLayoutOptions = GameLintOptions & {
|
|
24
|
+
/** The folder of `core/`, `shared/`, `features/`, `plugins/` and `game.ts`, relative to the directory oxlint runs in. Default `.`. */root?: string; /** The tsconfig whose `paths` name the aliases, relative to the directory oxlint runs in. Default `tsconfig.json`. */
|
|
25
|
+
tsconfig?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The options of `test-suffix`: the files, the game root and the suffix of each test kind folder.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```json
|
|
32
|
+
* "moku-game/test-suffix": ["error", { "root": "src", "suffixes": { "tests/e2e/": ".spec.ts" } }]
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
type GameLintSuffixOptions = GameLintOptions & {
|
|
36
|
+
/** The folder whose test files the rule reads, relative to the directory oxlint runs in. Default `.`. */root?: string; /** Kind folder to the suffix of its files, as `{ "tests/e2e/": ".e2e.ts" }`. Replaces the default table. */
|
|
37
|
+
suffixes?: Record<string, string>;
|
|
38
|
+
};
|
|
7
39
|
/** The part of an ESTree node the rules read. oxlint and ESLint hand over full nodes. */
|
|
8
40
|
type GameLintNode = {
|
|
9
41
|
readonly type: string; /** A string on an `Identifier`; the `JSXIdentifier` node on a `JSXAttribute`. */
|
|
@@ -67,7 +99,7 @@ type GameLintRule = {
|
|
|
67
99
|
};
|
|
68
100
|
create(context: GameLintContext): GameLintListeners;
|
|
69
101
|
};
|
|
70
|
-
/** The plugin object: `moku-game` and its
|
|
102
|
+
/** The plugin object: `moku-game` and its ten rules. */
|
|
71
103
|
type GameLintPlugin = {
|
|
72
104
|
readonly meta: {
|
|
73
105
|
readonly name: "moku-game";
|
|
@@ -75,7 +107,7 @@ type GameLintPlugin = {
|
|
|
75
107
|
readonly rules: Readonly<Record<GameLintRuleName, GameLintRule>>;
|
|
76
108
|
};
|
|
77
109
|
/** The rule names, without the `moku-game/` prefix. */
|
|
78
|
-
type GameLintRuleName = "lazy-imports" | "native-imports" | "dev-imports" | "no-module-state" | "determinism" | "rules-siblings" | "static-keys";
|
|
110
|
+
type GameLintRuleName = "lazy-imports" | "native-imports" | "dev-imports" | "no-module-state" | "determinism" | "rules-siblings" | "static-keys" | "layer-imports" | "feature-door" | "test-suffix";
|
|
79
111
|
/**
|
|
80
112
|
* Turn a glob into an anchored regular expression: `**`, `*`, `?` and one level of `{a,b}`.
|
|
81
113
|
*
|
|
@@ -87,6 +119,25 @@ type GameLintRuleName = "lazy-imports" | "native-imports" | "dev-imports" | "no-
|
|
|
87
119
|
* ```
|
|
88
120
|
*/
|
|
89
121
|
declare function globToRegExp(glob: string): RegExp;
|
|
122
|
+
/**
|
|
123
|
+
* The files a module specifier names through the aliases the layout rules read: the nearest
|
|
124
|
+
* `paths` of the tsconfig and the configs it extends by relative path, else the v15 aliases under
|
|
125
|
+
* the game root. A specifier is matched as TypeScript matches it; `@moku-labs/game` is a package
|
|
126
|
+
* even when the paths map it. The project index maps a specifier the same way, and a unit test
|
|
127
|
+
* keeps the two in step.
|
|
128
|
+
*
|
|
129
|
+
* @param tsconfig - The absolute path of the tsconfig.
|
|
130
|
+
* @param root - The absolute folder of the layers; the v15 aliases resolve against it.
|
|
131
|
+
* @param specifier - The module specifier as written.
|
|
132
|
+
* @returns The absolute targets in the order of the tsconfig; `[]` for a relative specifier, the
|
|
133
|
+
* engine and a package.
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* // A game without a tsconfig reads the v15 aliases.
|
|
137
|
+
* aliasTargetsOf("/game/tsconfig.json", "/game", "@features/orders"); // ["/game/features/orders/index.ts"]
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare function aliasTargetsOf(tsconfig: string, root: string, specifier: string): string[];
|
|
90
141
|
/**
|
|
91
142
|
* The `moku-game` oxlint plugin. A game loads it by package name and turns its rules on.
|
|
92
143
|
*
|
|
@@ -97,4 +148,4 @@ declare function globToRegExp(glob: string): RegExp;
|
|
|
97
148
|
*/
|
|
98
149
|
declare const plugin: GameLintPlugin;
|
|
99
150
|
//#endregion
|
|
100
|
-
export { GameLintContext, GameLintDefinition, GameLintListeners, GameLintNode, GameLintOptions, GameLintPlugin, GameLintRule, GameLintRuleName, GameLintScope, plugin as default, globToRegExp };
|
|
151
|
+
export { GameLintContext, GameLintDefinition, GameLintLayoutOptions, GameLintListeners, GameLintNode, GameLintOptions, GameLintPlugin, GameLintRule, GameLintRuleName, GameLintScope, GameLintSuffixOptions, aliasTargetsOf, plugin as default, globToRegExp };
|