@cosmicdrift/kumiko-framework 0.11.1 → 0.12.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 +18 -0
- package/package.json +2 -2
- package/src/engine/registry.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @cosmicdrift/kumiko-framework
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f2ad7c4: `mergeHookList` (the entity-hook variant) also tolerates undefined slots — same fix as `mergeHookListQualified` in 0.11.2 but for the second function. defineFeature leaves `entityHooks.postSave`/`preDelete`/`postDelete`/`postQuery` undefined when not declared; `createRegistry` crashed on `Object.entries(undefined)`.
|
|
8
|
+
|
|
9
|
+
## 0.12.0
|
|
10
|
+
|
|
11
|
+
## 0.11.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 92a84f0: `mergeHookListQualified` tolerates undefined hook-slots.
|
|
16
|
+
|
|
17
|
+
`defineFeature` leaves `feature.hooks.preSave`/`postSave`/etc. undefined when no hooks of that type are declared. `createRegistry` called `Object.entries(undefined)` and crashed with `Object.entries requires that input parameter not be null or undefined`.
|
|
18
|
+
|
|
19
|
+
Now `mergeHookListQualified` short-circuits on undefined source. Surfaced in studio's production-bundle boot.
|
|
20
|
+
|
|
3
21
|
## 0.11.1
|
|
4
22
|
|
|
5
23
|
## 0.11.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"zod": "^4.4.3"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.
|
|
175
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.12.1",
|
|
176
176
|
"@types/uuid": "^11.0.0",
|
|
177
177
|
"bun-types": "^1.3.13",
|
|
178
178
|
"drizzle-kit": "^0.31.10",
|
package/src/engine/registry.ts
CHANGED
|
@@ -271,8 +271,11 @@ export function createRegistry(features: readonly FeatureDefinition[]): Registry
|
|
|
271
271
|
// bookkeeping — just append.
|
|
272
272
|
function mergeHookList<T>(
|
|
273
273
|
map: Map<string, T[]>,
|
|
274
|
-
source: Readonly<Record<string, readonly T[]
|
|
274
|
+
source: Readonly<Record<string, readonly T[]>> | undefined,
|
|
275
275
|
): void {
|
|
276
|
+
// skip: optionaler entityHook-slot — features ohne postSave/preDelete/
|
|
277
|
+
// postDelete/postQuery lassen das slot undefined.
|
|
278
|
+
if (!source) return;
|
|
276
279
|
for (const [name, fns] of Object.entries(source)) {
|
|
277
280
|
const existing = map.get(name) ?? [];
|
|
278
281
|
existing.push(...fns);
|
|
@@ -285,10 +288,14 @@ export function createRegistry(features: readonly FeatureDefinition[]): Registry
|
|
|
285
288
|
// The hookQnType indicates whether the targeted handler is a write or query handler.
|
|
286
289
|
function mergeHookListQualified<T>(
|
|
287
290
|
map: Map<string, T[]>,
|
|
288
|
-
source: Readonly<Record<string, readonly T[]
|
|
291
|
+
source: Readonly<Record<string, readonly T[]>> | undefined,
|
|
289
292
|
featureName: string,
|
|
290
293
|
hookQnType: QnType,
|
|
291
294
|
): void {
|
|
295
|
+
// skip: optionaler hook-slot — defineFeature lässt das slot undefined
|
|
296
|
+
// wenn das feature keine hooks dieses typs hat. Behandeln wie leeres
|
|
297
|
+
// record statt Object.entries(undefined)-crash.
|
|
298
|
+
if (!source) return;
|
|
292
299
|
for (const [name, fns] of Object.entries(source)) {
|
|
293
300
|
const qualified = qualify(featureName, hookQnType, name);
|
|
294
301
|
const existing = map.get(qualified) ?? [];
|