@cosmicdrift/kumiko-framework 0.156.1 → 0.156.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.156.
|
|
3
|
+
"version": "0.156.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>",
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
"zod": "^4.4.3"
|
|
194
194
|
},
|
|
195
195
|
"devDependencies": {
|
|
196
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.156.
|
|
196
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.156.2",
|
|
197
197
|
"bun-types": "^1.3.13",
|
|
198
198
|
"pino-pretty": "^13.1.3"
|
|
199
199
|
},
|
|
@@ -216,6 +216,27 @@ describe("buildAppSchema", () => {
|
|
|
216
216
|
expect(fields["name"]?.["filterable"]).toBeUndefined();
|
|
217
217
|
});
|
|
218
218
|
|
|
219
|
+
test("searchable kommt ins Client-Schema (steuert den EntityList-Default, #1194)", () => {
|
|
220
|
+
const entity = {
|
|
221
|
+
fields: {
|
|
222
|
+
title: { type: "text", searchable: true },
|
|
223
|
+
name: { type: "text" },
|
|
224
|
+
},
|
|
225
|
+
} as unknown as EntityDefinition;
|
|
226
|
+
const f = defineFeature("ent", (r) => {
|
|
227
|
+
r.entity("thing", entity);
|
|
228
|
+
});
|
|
229
|
+
const app = buildAppSchema(createRegistry([f]));
|
|
230
|
+
const fields = (
|
|
231
|
+
app.features[0]?.entities["thing"] as unknown as {
|
|
232
|
+
fields: Record<string, Record<string, unknown>>;
|
|
233
|
+
}
|
|
234
|
+
).fields;
|
|
235
|
+
expect(fields["title"]?.["searchable"]).toBe(true);
|
|
236
|
+
// Fields without searchable don't carry the key (no false-litter).
|
|
237
|
+
expect(fields["name"]?.["searchable"]).toBeUndefined();
|
|
238
|
+
});
|
|
239
|
+
|
|
219
240
|
test("AppSchema ist via JSON.stringify roundtrip-sicher", () => {
|
|
220
241
|
// Echter Smoke-Test des Vertrags — wenn jemand in den project-
|
|
221
242
|
// Helper eine Function reinschmuggelt, würde das hier brennen.
|
|
@@ -348,6 +348,7 @@ function projectField(fieldDef: FieldDefinition): FieldDefinition {
|
|
|
348
348
|
// filterable steuert die Faceted-Filter-Dropdowns im Renderer (select/
|
|
349
349
|
// boolean) — muss daher ins Client-Schema.
|
|
350
350
|
if (typeof def["filterable"] === "boolean") out["filterable"] = def["filterable"];
|
|
351
|
+
if (typeof def["searchable"] === "boolean") out["searchable"] = def["searchable"];
|
|
351
352
|
if (isLiteral(def["default"])) out["default"] = def["default"];
|
|
352
353
|
// Select: options-Liste ist plain JSON, durchschicken.
|
|
353
354
|
if (Array.isArray(def["options"])) out["options"] = def["options"];
|