@cosmicdrift/kumiko-dev-server 0.156.0 → 0.156.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.156.0",
3
+ "version": "0.156.1",
4
4
  "description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding, codegen. Not shipped into production node_modules — see @cosmicdrift/kumiko-server-runtime for the prod boot path.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -54,9 +54,9 @@
54
54
  "kumiko-schema-check": "./bin/kumiko-schema-check.ts"
55
55
  },
56
56
  "dependencies": {
57
- "@cosmicdrift/kumiko-bundled-features": "0.156.0",
58
- "@cosmicdrift/kumiko-framework": "0.156.0",
59
- "@cosmicdrift/kumiko-server-runtime": "0.156.0",
57
+ "@cosmicdrift/kumiko-bundled-features": "0.156.1",
58
+ "@cosmicdrift/kumiko-framework": "0.156.1",
59
+ "@cosmicdrift/kumiko-server-runtime": "0.156.1",
60
60
  "ts-morph": "^28.0.0"
61
61
  },
62
62
  "publishConfig": {
@@ -121,6 +121,7 @@ describe("scaffoldApp", () => {
121
121
  expect(client).toContain(">my-shop</span>");
122
122
  expect(client).toContain('from "@cosmicdrift/kumiko-renderer-web"');
123
123
  expect(client).toContain('from "@cosmicdrift/kumiko-bundled-features/auth-email-password/web"');
124
+ expect(client).toContain("tasksClient");
124
125
  });
125
126
 
126
127
  test(".env.example carries KUMIKO_DEV_DB_NAME default so reboots are persistent", async () => {
@@ -26,7 +26,9 @@ import {
26
26
  createDemoTasksFeature,
27
27
  renderDemoSeedFile,
28
28
  renderDemoTasksFeatureFile,
29
+ renderDemoTasksI18n,
29
30
  renderDemoTasksIndex,
31
+ renderDemoTasksWebIndex,
30
32
  } from "./scaffold-demo-tasks";
31
33
  import { scaffoldDeploy } from "./scaffold-deploy";
32
34
 
@@ -101,11 +103,18 @@ export async function scaffoldApp(options: ScaffoldAppOptions): Promise<Scaffold
101
103
  write(join(destination, "src", "run-config.ts"), renderRunConfig(options.features));
102
104
  files.push("src/run-config.ts");
103
105
 
104
- mkdirSync(join(destination, "src", "features", "tasks"), { recursive: true });
106
+ mkdirSync(join(destination, "src", "features", "tasks", "web"), { recursive: true });
105
107
  write(join(destination, "src", "features", "tasks", "feature.ts"), renderDemoTasksFeatureFile());
106
108
  files.push("src/features/tasks/feature.ts");
109
+ write(join(destination, "src", "features", "tasks", "i18n.ts"), renderDemoTasksI18n());
110
+ files.push("src/features/tasks/i18n.ts");
107
111
  write(join(destination, "src", "features", "tasks", "index.ts"), renderDemoTasksIndex());
108
112
  files.push("src/features/tasks/index.ts");
113
+ write(
114
+ join(destination, "src", "features", "tasks", "web", "index.ts"),
115
+ renderDemoTasksWebIndex(),
116
+ );
117
+ files.push("src/features/tasks/web/index.ts");
109
118
  write(join(destination, "src", "seed.ts"), renderDemoSeedFile());
110
119
  files.push("src/seed.ts");
111
120
 
@@ -608,6 +617,7 @@ function renderClient(appName: string): string {
608
617
  "// here — symmetric to APP_FEATURES on the server side.",
609
618
  "",
610
619
  'import { emailPasswordClient } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/web";',
620
+ 'import { tasksClient } from "./features/tasks/web";',
611
621
  'import { type AppSchema, createKumikoApp, DefaultAppShell } from "@cosmicdrift/kumiko-renderer-web";',
612
622
  'import type { ReactNode } from "react";',
613
623
  "",
@@ -622,7 +632,7 @@ function renderClient(appName: string): string {
622
632
  "",
623
633
  "createKumikoApp({",
624
634
  " shell: AppShell,",
625
- " clientFeatures: [emailPasswordClient()],",
635
+ " clientFeatures: [emailPasswordClient(), tasksClient],",
626
636
  "});",
627
637
  "",
628
638
  ].join("\n");
@@ -101,6 +101,7 @@ import type {
101
101
  EntityEditScreenDefinition,
102
102
  EntityListScreenDefinition,
103
103
  } from "@cosmicdrift/kumiko-framework/ui-types";
104
+ import { tasksTranslationKeys } from "./i18n";
104
105
 
105
106
  const taskEntity = createEntity({
106
107
  fields: {
@@ -131,17 +132,8 @@ const editScreen: EntityEditScreenDefinition = {
131
132
 
132
133
  const open = { access: { openToAll: true } } as const;
133
134
 
134
- const TASKS_I18N = {
135
- "screen:task-list.title": { de: "Aufgaben", en: "Tasks" },
136
- "screen:task-edit.title": { de: "Aufgabe", en: "Task" },
137
- "tasks:entity:task:field:title": { de: "Titel", en: "Title" },
138
- "tasks:entity:task:field:status": { de: "Status", en: "Status" },
139
- "tasks:entity:task:field:priority": { de: "Priorität", en: "Priority" },
140
- "tasks:entity:task:field:isUrgent": { de: "Dringend", en: "Urgent" },
141
- } as const;
142
-
143
135
  export const tasksFeature = defineFeature("tasks", (r) => {
144
- r.translations({ keys: TASKS_I18N });
136
+ r.translations({ keys: tasksTranslationKeys });
145
137
  r.entity("task", taskEntity);
146
138
  r.writeHandler(defineEntityCreateHandler("task", taskEntity, open));
147
139
  r.writeHandler(defineEntityUpdateHandler("task", taskEntity, open));
@@ -162,6 +154,52 @@ export const tasksFeature = defineFeature("tasks", (r) => {
162
154
  `;
163
155
  }
164
156
 
157
+ export function renderDemoTasksI18n(): string {
158
+ return `// Server-side translation keys for the demo tasks feature.
159
+
160
+ import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
161
+
162
+ export const tasksTranslationKeys = {
163
+ "screen:task-list.title": { de: "Aufgaben", en: "Tasks" },
164
+ "screen:task-edit.title": { de: "Aufgabe", en: "Task" },
165
+ "tasks:entity:task:field:title": { de: "Titel", en: "Title" },
166
+ "tasks:entity:task:field:status": { de: "Status", en: "Status" },
167
+ "tasks:entity:task:field:priority": { de: "Priorität", en: "Priority" },
168
+ "tasks:entity:task:field:isUrgent": { de: "Dringend", en: "Urgent" },
169
+ } as const;
170
+
171
+ export const tasksTranslations: TranslationsByLocale = {
172
+ de: {
173
+ "screen:task-list.title": "Aufgaben",
174
+ "screen:task-edit.title": "Aufgabe",
175
+ "tasks:entity:task:field:title": "Titel",
176
+ "tasks:entity:task:field:status": "Status",
177
+ "tasks:entity:task:field:priority": "Priorität",
178
+ "tasks:entity:task:field:isUrgent": "Dringend",
179
+ },
180
+ en: {
181
+ "screen:task-list.title": "Tasks",
182
+ "screen:task-edit.title": "Task",
183
+ "tasks:entity:task:field:title": "Title",
184
+ "tasks:entity:task:field:status": "Status",
185
+ "tasks:entity:task:field:priority": "Priority",
186
+ "tasks:entity:task:field:isUrgent": "Urgent",
187
+ },
188
+ };
189
+ `;
190
+ }
191
+
192
+ export function renderDemoTasksWebIndex(): string {
193
+ return `import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer-web";
194
+ import { tasksTranslations } from "../i18n";
195
+
196
+ export const tasksClient: ClientFeatureDefinition = {
197
+ name: "tasks",
198
+ translations: tasksTranslations,
199
+ };
200
+ `;
201
+ }
202
+
165
203
  export function renderDemoTasksIndex(): string {
166
204
  return `export { tasksFeature } from "./feature";
167
205
  `;