@cosmicdrift/kumiko-framework 0.130.1 → 0.130.2

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.130.1",
3
+ "version": "0.130.2",
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>",
@@ -189,7 +189,7 @@
189
189
  "zod": "^4.4.3"
190
190
  },
191
191
  "devDependencies": {
192
- "@cosmicdrift/kumiko-dispatcher-live": "0.130.0",
192
+ "@cosmicdrift/kumiko-dispatcher-live": "0.130.2",
193
193
  "bun-types": "^1.3.13",
194
194
  "pino-pretty": "^13.1.3"
195
195
  },
@@ -12,6 +12,7 @@ import {
12
12
  createTextField,
13
13
  defineFeature,
14
14
  from,
15
+ registerEntityCrud,
15
16
  } from "../index";
16
17
 
17
18
  function validateBoot(features: Parameters<typeof validateBootRaw>[0]): void {
@@ -552,6 +553,21 @@ describe("boot-validator", () => {
552
553
  expect(() => validateBoot(features)).toThrow(/a:query:list.*missing an access rule/i);
553
554
  });
554
555
 
556
+ test("registerEntityCrud without access options fails boot (no implicit openToAll)", () => {
557
+ const widgetEntity = createEntity({
558
+ table: "phase0_widgets",
559
+ fields: { name: createTextField({ required: true }) },
560
+ });
561
+ const features = [
562
+ defineFeature("phase0", (r) => {
563
+ registerEntityCrud(r, "widget", widgetEntity);
564
+ }),
565
+ ];
566
+ expect(() => validateBoot(features)).toThrow(
567
+ /phase0:write:widget:create.*missing an access rule/i,
568
+ );
569
+ });
570
+
555
571
  test("accepts role-based access rule", () => {
556
572
  const features = [
557
573
  defineFeature("a", (r) => {
@@ -90,6 +90,9 @@ describe("buildConfigFeatureSchema — structure", () => {
90
90
  expect(sys?.screen).toBeUndefined();
91
91
  expect(sys?.parent).toBeUndefined();
92
92
  expect(ten?.label).toBe("config.settings.tenant");
93
+ expect(sys?.icon).toBe("shield");
94
+ expect(ten?.icon).toBe("building");
95
+ expect(usr?.icon).toBe("user");
93
96
  expect((sys?.order ?? 0) < (ten?.order ?? 0) && (ten?.order ?? 0) < (usr?.order ?? 0)).toBe(
94
97
  true,
95
98
  );
@@ -56,6 +56,11 @@ export type ConfigFeatureSchema = {
56
56
 
57
57
  // Audience-Reihenfolge im Sidebar: Plattform vor Tenant vor Benutzer.
58
58
  const SCOPE_ORDER: Record<ConfigScope, number> = { system: 10, tenant: 20, user: 30 };
59
+ const SCOPE_ICON: Record<ConfigScope, string> = {
60
+ system: "shield",
61
+ tenant: "building",
62
+ user: "user",
63
+ };
59
64
  const SCOPES_BROAD_TO_DEEP: readonly ConfigScope[] = ["system", "tenant", "user"];
60
65
 
61
66
  const audienceNavShortId = (scope: ConfigScope): string => `audience-${scope}`;
@@ -107,6 +112,7 @@ export function buildConfigFeatureSchema(registry: Registry): ConfigFeatureSchem
107
112
  navs.push({
108
113
  id: audienceNavShortId(scope),
109
114
  label: `config.settings.${scope}`,
115
+ icon: SCOPE_ICON[scope],
110
116
  order: SCOPE_ORDER[scope],
111
117
  access: rolesToAccess(visible.flatMap((v) => v.roles)),
112
118
  });