@cosmicdrift/kumiko-framework 0.229.0 → 0.230.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-framework",
3
- "version": "0.229.0",
3
+ "version": "0.230.0",
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>",
@@ -198,7 +198,7 @@
198
198
  "./package.json": "./package.json"
199
199
  },
200
200
  "dependencies": {
201
- "@cosmicdrift/kumiko-types": "0.229.0",
201
+ "@cosmicdrift/kumiko-types": "0.230.0",
202
202
  "bullmq": "^5.76.7",
203
203
  "bun-types": "^1.3.13",
204
204
  "hono": "^4.13.1",
@@ -214,7 +214,7 @@
214
214
  "zod": "^4.4.3"
215
215
  },
216
216
  "devDependencies": {
217
- "@cosmicdrift/kumiko-dispatcher-live": "0.229.0",
217
+ "@cosmicdrift/kumiko-dispatcher-live": "0.230.0",
218
218
  "bun-types": "^1.3.13",
219
219
  "pino-pretty": "^13.1.3"
220
220
  },
@@ -0,0 +1,102 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import type {
3
+ CustomScreenDefinition,
4
+ DashboardScreenDefinition,
5
+ DashboardStatPanel,
6
+ ProjectionDetailScreenDefinition,
7
+ ProjectionListScreenDefinition,
8
+ RowFieldExtractor,
9
+ ScreenNavSugar,
10
+ UnitKey,
11
+ } from "@cosmicdrift/kumiko-framework/engine";
12
+ import { requiredKeysFromScreen, screenTitleKey } from "../../i18n/required-surface-keys";
13
+
14
+ // fw#2519: the engine barrel exported ScreenDefinition (the union) but not
15
+ // its individual members — apps splitting screens out of feature.ts into
16
+ // their own module (kumiko-guard-ui's 300-line limit) could only type the
17
+ // union, losing per-kind checking. Every type imported below comes from the
18
+ // public "@cosmicdrift/kumiko-framework/engine" subpath, not an internal
19
+ // ../types path — an internal import would pass before the fix too, since
20
+ // the internal barrel already had these.
21
+ //
22
+ // The import above is `import type`, erased at runtime — this file guards
23
+ // the barrel at compile time only (tsc, via `check-wt.sh`/CI), not via
24
+ // `bun test`. If a type export regresses, `tsc --build` fails; this suite
25
+ // still passes green.
26
+ describe("engine barrel exports the per-screen definition types", () => {
27
+ test("ProjectionListScreenDefinition is assignable and feeds requiredKeysFromScreen", () => {
28
+ const screen: ProjectionListScreenDefinition = {
29
+ id: "recent-jobs",
30
+ type: "projectionList",
31
+ query: "jobs:query:recent",
32
+ columns: [{ field: "status", label: "publicstatus:column.status" }],
33
+ };
34
+ const keys = requiredKeysFromScreen("publicstatus", screen);
35
+ expect(keys).toContain(screenTitleKey("recent-jobs"));
36
+ expect(keys).toContain("publicstatus:column.status");
37
+ });
38
+
39
+ test("ProjectionDetailScreenDefinition is assignable and feeds requiredKeysFromScreen", () => {
40
+ const screen: ProjectionDetailScreenDefinition = {
41
+ id: "job-detail",
42
+ type: "projectionDetail",
43
+ query: "jobs:query:detail",
44
+ layout: {
45
+ sections: [{ title: "publicstatus:section.job", fields: ["runId"] }],
46
+ },
47
+ };
48
+ const keys = requiredKeysFromScreen("publicstatus", screen);
49
+ expect(keys).toContain("publicstatus:section.job");
50
+ expect(keys).toContain("publicstatus:entity:__projection-detail__:field:runId");
51
+ });
52
+
53
+ test("DashboardScreenDefinition + DashboardStatPanel are assignable and feed requiredKeysFromScreen", () => {
54
+ const panel: DashboardStatPanel = {
55
+ kind: "stat",
56
+ id: "open-incidents",
57
+ label: "publicstatus:panel.openIncidents",
58
+ query: "publicstatus:query:incidents:openCount",
59
+ valueField: "count",
60
+ };
61
+ const screen: DashboardScreenDefinition = {
62
+ id: "ops-dashboard",
63
+ type: "dashboard",
64
+ panels: [panel],
65
+ };
66
+ const keys = requiredKeysFromScreen("publicstatus", screen);
67
+ expect(keys).toContain("publicstatus:panel.openIncidents");
68
+ });
69
+
70
+ test("CustomScreenDefinition standalone carries nav/detailFor directly", () => {
71
+ const nav: ScreenNavSugar = { label: "publicstatus:nav.componentDetail", order: 1 };
72
+ const screen: CustomScreenDefinition = {
73
+ id: "component-detail",
74
+ type: "custom",
75
+ renderer: { react: {} },
76
+ nav,
77
+ detailFor: "component",
78
+ };
79
+ expect(screen.nav?.label).toBe("publicstatus:nav.componentDetail");
80
+ expect(screen.detailFor).toBe("component");
81
+ });
82
+
83
+ test("ProjectionListScreenDefinition also carries nav/detailFor directly, not just via ScreenDefinition", () => {
84
+ const screen: ProjectionListScreenDefinition = {
85
+ id: "job-list",
86
+ type: "projectionList",
87
+ query: "jobs:query:list",
88
+ columns: ["status"],
89
+ nav: { label: "publicstatus:nav.jobList" },
90
+ detailFor: "job",
91
+ };
92
+ expect(screen.nav?.label).toBe("publicstatus:nav.jobList");
93
+ expect(screen.detailFor).toBe("job");
94
+ });
95
+
96
+ test("UnitKey / RowFieldExtractor are exported and usable standalone", () => {
97
+ const unit: UnitKey = "km";
98
+ const extractor: RowFieldExtractor = { pick: ["id", "version"] };
99
+ expect(unit).toBe("km");
100
+ expect(extractor).toEqual({ pick: ["id", "version"] });
101
+ });
102
+ });
@@ -320,6 +320,16 @@ export type {
320
320
  CreateUserSeedOptions,
321
321
  CustomScreenDefinition,
322
322
  CustomScreenRoute,
323
+ DashboardChartPanel,
324
+ DashboardCustomPanel,
325
+ DashboardFeedPanel,
326
+ DashboardFilterDefinition,
327
+ DashboardListPanel,
328
+ DashboardPanelDefinition,
329
+ DashboardProgressListPanel,
330
+ DashboardScreenDefinition,
331
+ DashboardStatGroupPanel,
332
+ DashboardStatPanel,
323
333
  DateFieldDef,
324
334
  DecimalFieldDef,
325
335
  DeleteContext,
@@ -331,6 +341,7 @@ export type {
331
341
  EditFieldSpec,
332
342
  EditFieldsSection,
333
343
  EditLayout,
344
+ EditRelatedListSection,
334
345
  EditSectionSpec,
335
346
  EntityDefinition,
336
347
  EntityEditScreenDefinition,
@@ -344,10 +355,14 @@ export type {
344
355
  FieldAccess,
345
356
  FieldCondition,
346
357
  FieldDefinition,
358
+ FieldFormatRegistry,
359
+ FieldIconKey,
347
360
  FieldRenderer,
348
361
  FileFieldDef,
349
362
  FilesFieldDef,
350
363
  Findability,
364
+ FormatSpec,
365
+ FormWidth,
351
366
  HandlerContext,
352
367
  HasManyRelation,
353
368
  HookMap,
@@ -364,6 +379,10 @@ export type {
364
379
  KumikoHandlerResultMap,
365
380
  LifecycleHookType,
366
381
  ListColumnSpec,
382
+ ListFacetSpec,
383
+ ListPaginationMode,
384
+ ListSortDir,
385
+ ListSortSpec,
367
386
  LongTextFindability,
368
387
  ManyToManyRelation,
369
388
  MspErrorMode,
@@ -395,19 +414,29 @@ export type {
395
414
  PreQueryHookFn,
396
415
  PreSaveHookFn,
397
416
  ProjectionDefinition,
417
+ ProjectionDetailScreenDefinition,
418
+ ProjectionListScreenDefinition,
398
419
  ProjectionTable,
399
420
  QualifiedEventName,
400
421
  QueryEvent,
401
422
  QueryHandlerDef,
402
423
  QueryHandlerFn,
424
+ RecordHeaderSpec,
403
425
  ReferenceDataDef,
404
426
  Registry,
405
427
  RelationDefinition,
406
428
  ResolvedPiiFlags,
407
429
  RetentionDef,
408
430
  RowAction,
431
+ RowActionNavigate,
432
+ RowActionNavigateBase,
433
+ RowActionWriteHandler,
434
+ RowFieldExtractor,
409
435
  SaveContext,
410
436
  ScreenDefinition,
437
+ ScreenFilter,
438
+ ScreenFilterOp,
439
+ ScreenNavSugar,
411
440
  ScreenSlots,
412
441
  SecretKeyHandle,
413
442
  SelectFieldDef,
@@ -427,6 +456,7 @@ export type {
427
456
  TreeChildrenSubscribe,
428
457
  TreeNode,
429
458
  TreeNodeState,
459
+ UnitKey,
430
460
  UnsafeAppendEventFn,
431
461
  ValidationError,
432
462
  ValidationHookFn,
@@ -84,6 +84,8 @@ export type {
84
84
  UiHintOption,
85
85
  UiHints,
86
86
  } from "@cosmicdrift/kumiko-types/feature";
87
+ // Closed field-icon vocabulary — used by `EditFieldSpec.icon`.
88
+ export type { FieldIconKey } from "@cosmicdrift/kumiko-types/field-icon";
87
89
  export type {
88
90
  AnyFileFieldDef,
89
91
  BigIntFieldDef,
@@ -267,6 +269,7 @@ export type {
267
269
  EditFieldSpec,
268
270
  EditFieldsSection,
269
271
  EditLayout,
272
+ EditRelatedListSection,
270
273
  EditSectionSpec,
271
274
  EntityEditScreenDefinition,
272
275
  EntityListScreenDefinition,
@@ -274,19 +277,28 @@ export type {
274
277
  FieldFormatRegistry,
275
278
  FieldRenderer,
276
279
  FormatSpec,
280
+ FormWidth,
277
281
  ListColumnSpec,
278
282
  ListFacetSpec,
283
+ ListPaginationMode,
284
+ ListSortDir,
285
+ ListSortSpec,
279
286
  PlatformComponent,
280
287
  ProjectionDetailScreenDefinition,
281
288
  ProjectionListScreenDefinition,
289
+ RecordHeaderSpec,
282
290
  RowAction,
283
291
  RowActionNavigate,
292
+ RowActionNavigateBase,
284
293
  RowActionWriteHandler,
294
+ RowFieldExtractor,
285
295
  ScreenDefinition,
286
296
  ScreenFilter,
287
297
  ScreenFilterOp,
298
+ ScreenNavSugar,
288
299
  ScreenSlots,
289
300
  ToolbarAction,
301
+ UnitKey,
290
302
  } from "@cosmicdrift/kumiko-types/screen";
291
303
  export type { TargetRef } from "@cosmicdrift/kumiko-types/target-ref";
292
304
  export type {