@cosmicdrift/kumiko-dev-server 0.13.0 → 0.15.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.
Files changed (34) hide show
  1. package/package.json +11 -14
  2. package/src/__tests__/build-prod-bundle.integration.ts +1 -1
  3. package/src/__tests__/build-prod-bundle.test.ts +1 -1
  4. package/src/__tests__/cache-headers.test.ts +1 -1
  5. package/src/__tests__/classify-change.test.ts +1 -1
  6. package/src/__tests__/compose-features-wiring.integration.ts +10 -9
  7. package/src/__tests__/compose-features.test.ts +1 -1
  8. package/src/__tests__/config-seed-boot.integration.ts +5 -4
  9. package/src/__tests__/crash-tracker.test.ts +1 -1
  10. package/src/__tests__/create-kumiko-server.integration.ts +5 -5
  11. package/src/__tests__/env-schema.integration.ts +1 -1
  12. package/src/__tests__/env-schema.test.ts +1 -1
  13. package/src/__tests__/few-shot-corpus.test.ts +1 -1
  14. package/src/__tests__/inject-schema.test.ts +1 -1
  15. package/src/__tests__/resolve-stylesheet.test.ts +11 -7
  16. package/src/__tests__/resolve-tailwind-cli.test.ts +1 -1
  17. package/src/__tests__/run-prod-app-spec.test.ts +1 -1
  18. package/src/__tests__/run-prod-app.integration.ts +6 -6
  19. package/src/__tests__/scaffold-app-feature.test.ts +1 -1
  20. package/src/__tests__/scaffold-app.test.ts +1 -1
  21. package/src/__tests__/scaffold-deploy.test.ts +1 -1
  22. package/src/__tests__/scaffold-feature.test.ts +1 -1
  23. package/src/__tests__/try-hono-first.test.ts +1 -1
  24. package/src/__tests__/walkthrough.integration.ts +118 -0
  25. package/src/codegen/__tests__/run-codegen.test.ts +1 -1
  26. package/src/codegen/__tests__/strict-mode-diagnostics.test.ts +1 -1
  27. package/src/codegen/__tests__/watch.test.ts +1 -1
  28. package/src/scaffold-app-feature.ts +2 -1
  29. package/src/scaffold-app.ts +139 -76
  30. package/src/{drizzle-tables-auth-mode.ts → schema-tables-auth-mode.ts} +1 -1
  31. package/templates/deploy/Dockerfile.template +15 -47
  32. package/CHANGELOG.md +0 -632
  33. package/src/drizzle-config.ts +0 -44
  34. /package/src/{drizzle-tables-minimal.ts → schema-tables-minimal.ts} +0 -0
package/CHANGELOG.md DELETED
@@ -1,632 +0,0 @@
1
- # @cosmicdrift/kumiko-dev-server
2
-
3
- ## 0.13.0
4
-
5
- ### Minor Changes
6
-
7
- - 7bd5c88: `KUMIKO_DRY_RUN_ENV=boot` mode for runProdApp — runs env-validation +
8
- composeFeatures + validateBoot + createRegistry without DB/Redis
9
- connect, exits with status 0 on success. Used by the
10
- `samples/apps/use-all-bundled` smoke-app (Sprint 9.8 Phase C / Empfehlung
11
- 1 / canonical bug-catcher) and downstream by enterprise's
12
- `use-all-features` mirror. Render-modes (human|json|pulumi|k8s|1)
13
- behavior unchanged.
14
- - 575752f: `scaffoldAppFeature` + `kumiko add feature <name>` — DX-2 aus DX-Roadmap.
15
- Scaffolded ein neues Feature in `src/features/<name>/` einer bereits via
16
- `kumiko new app` scaffolded App + **auto-mountet** es in `src/run-config.ts`
17
- via ts-morph (import + `APP_FEATURES`-array-entry, idempotent).
18
-
19
- User-Promise "defineFeature → nichts woanders eintragen" erfüllt für die
20
- run-config-Seite. FEATURE_IMPORT_REGISTRY in drizzle/generate.ts ist
21
- DX-4's Refactor — bei DX-1+DX-2-App noch nicht vorhanden.
22
-
23
- Usage (in einer DX-1-gescaffoldeten App):
24
-
25
- ```sh
26
- bunx kumiko add feature product-catalog
27
- # → src/features/product-catalog/{feature.ts,index.ts}
28
- # → src/run-config.ts auto-edited: import + APP_FEATURES-entry
29
- ```
30
-
31
- - 3d5e9ef: `kumiko-schema-check` CLI — Empfehlung 3 aus Sprint-9.8-Retro
32
- (`luminous-watching-moler.md`). Diff't APP_FEATURES (runtime, aus
33
- `src/run-config.ts`) gegen FEATURE_IMPORT_REGISTRY (statisch, aus
34
- `drizzle/generate.ts`). Fängt Studio's 9.8-Drama: registry 18 features
35
- hinter APP_FEATURES → migrations fehlten für mounted features.
36
-
37
- Usage (im app-workspace):
38
-
39
- ```sh
40
- bunx kumiko-schema-check
41
- # or with custom paths:
42
- bunx kumiko-schema-check --run-config src/run-config.ts --generate drizzle/generate.ts
43
- ```
44
-
45
- Plus: 5 bundled-features hatten camelCase feature-names statt kebab-case
46
- (Memory `feedback_kebab_aggregates`) — aufgedeckt durch den schema-check
47
- gegen use-all-bundled. Fix: `channelEmail` → `channel-email`,
48
- `channelInApp` → `channel-in-app`, `channelPush` → `channel-push`,
49
- `rateLimiting` → `rate-limiting`, `rendererSimple` → `renderer-simple`.
50
-
51
- Plus `CHANNEL_IN_APP_FEATURE` und `RATE_LIMITING_FEATURE` Konstanten
52
- angepasst (waren intern auf camelCase, jetzt kebab-case).
53
-
54
- - 46b84d0: `scaffoldApp` + `kumiko new app <name>` — DX-1.0 aus DX-Roadmap. Generiert
55
- ein lauffähiges App-Skelett (package.json, tsconfig, run-config mit
56
- secrets+sessions, bin/main.ts mit auth-admin-stub + deterministische
57
- tenant-UUID, .env.example, README) in `<cwd>/<name>/`.
58
-
59
- Boot-Pfad: `KUMIKO_DRY_RUN_ENV=boot bun bin/main.ts` läuft ohne DB/Redis.
60
-
61
- Held-back für spätere DX-Phasen: drizzle-setup (DX-1.1, blocked-by DX-4
62
- auto-registry), Dockerfile (existing `kumiko init-deploy`), first feature
63
- scaffold (existing `kumiko create` bzw. DX-2 `kumiko add feature`).
64
-
65
- Usage:
66
-
67
- ```sh
68
- bunx kumiko new app my-shop
69
- cd my-shop && yarn install
70
- cp .env.example .env # JWT_SECRET + KUMIKO_SECRETS_MASTER_KEY_V1 setzen
71
- bun run boot # → boot validation OK
72
- ```
73
-
74
- ### Patch Changes
75
-
76
- - 2bd60c1: `buildServerBundle` BUILD_ONLY_EXTERNALS erweitert um drizzle-kit's
77
- dialect-resolver dynamic-imports: `@planetscale/database`, `@libsql/client`,
78
- `better-sqlite3`, `@neondatabase/serverless`, `@vercel/postgres`, `mysql2`.
79
-
80
- Aufgedeckt durch C1 Empfehlung 4 (bundle-smoke). Bisher schlug
81
- `bun build` an dynamic-imports im drizzle-kit auch wenn der App nur
82
- postgres nutzt. Externalisieren = build durchläuft + tree-shake wirft
83
- die ungenutzten driver-modules eh raus.
84
-
85
- - 8bfb284: Dockerfile.template setzt `YARN_ENABLE_SCRIPTS=false` im Build-Stage. Fixt msgpackr-extract native-build-Failures (ARM, CI) und generell jeden transitiven Native-Dep — der Build-Stage bundlet nur JS via `bun build`, Runtime-Native-Deps werden separat im Runtime-Stage via `bun install --production` installiert. Apps die bisher per-package-Workarounds via `dependenciesMeta.<pkg>.built=false` in der App-package.json brauchten (studio, enterprise) können diese Entries nach Upgrade auf diese dev-server-Version entfernen.
86
- - cc0ddc0: `Dockerfile.template` emits an inline `start.sh` for createBunServer command-override target.
87
-
88
- `infra/pulumi/bun-server.ts`'s `createBunServer` overrides the container command with `exec ./start.sh` after injecting DATABASE_URL from the init-container. Apps deployed via createBunServer crashed with `./start.sh: not found` until each one added a per-app `start.sh` in repo root (= studio's PR #22).
89
-
90
- Now the Dockerfile-template emits the file inline (`RUN printf … > ./start.sh && chmod +x`). Apps no longer need to ship one — the runtime stage generates it. Apps that don't go through createBunServer's command-override still boot via the bottom CMD; start.sh is dead-code in that case.
91
-
92
- - Updated dependencies [7f56b2f]
93
- - Updated dependencies [68b8118]
94
- - Updated dependencies [9121928]
95
- - Updated dependencies [72518fa]
96
- - Updated dependencies [0a00e7b]
97
- - Updated dependencies [aca1443]
98
- - Updated dependencies [c6cb96c]
99
- - Updated dependencies [3d5e9ef]
100
- - @cosmicdrift/kumiko-framework@0.13.0
101
- - @cosmicdrift/kumiko-bundled-features@0.13.0
102
-
103
- ## 0.12.2
104
-
105
- ### Patch Changes
106
-
107
- - Updated dependencies [597de52]
108
- - @cosmicdrift/kumiko-framework@0.12.2
109
- - @cosmicdrift/kumiko-bundled-features@0.12.2
110
-
111
- ## 0.12.1
112
-
113
- ### Patch Changes
114
-
115
- - Updated dependencies [f2ad7c4]
116
- - @cosmicdrift/kumiko-framework@0.12.1
117
- - @cosmicdrift/kumiko-bundled-features@0.12.1
118
-
119
- ## 0.12.0
120
-
121
- ### Patch Changes
122
-
123
- - Updated dependencies [0c1ebe5]
124
- - @cosmicdrift/kumiko-bundled-features@0.12.0
125
- - @cosmicdrift/kumiko-framework@0.12.0
126
-
127
- ## 0.11.2
128
-
129
- ### Patch Changes
130
-
131
- - Updated dependencies [92a84f0]
132
- - @cosmicdrift/kumiko-framework@0.11.2
133
- - @cosmicdrift/kumiko-bundled-features@0.11.2
134
-
135
- ## 0.11.1
136
-
137
- ### Patch Changes
138
-
139
- - Updated dependencies [e6f702f]
140
- - @cosmicdrift/kumiko-bundled-features@0.11.1
141
- - @cosmicdrift/kumiko-framework@0.11.1
142
-
143
- ## 0.11.0
144
-
145
- ### Patch Changes
146
-
147
- - Updated dependencies [30ea981]
148
- - Updated dependencies [9347212]
149
- - @cosmicdrift/kumiko-framework@0.11.0
150
- - @cosmicdrift/kumiko-bundled-features@0.11.0
151
-
152
- ## 0.10.0
153
-
154
- ### Patch Changes
155
-
156
- - Updated dependencies [d06f029]
157
- - Updated dependencies [753d392]
158
- - @cosmicdrift/kumiko-framework@0.10.0
159
- - @cosmicdrift/kumiko-bundled-features@0.10.0
160
-
161
- ## 0.9.0
162
-
163
- ### Minor Changes
164
-
165
- - 51e22f5: Add deploy-template scaffolding (Sprint 9.6).
166
-
167
- **New API:**
168
-
169
- - `scaffoldDeploy({ appName, port?, githubOrg?, destination?, force? })` exported from `@cosmicdrift/kumiko-dev-server`. Generates `deploy/Dockerfile`, `deploy/Dockerfile.dockerignore`, and `deploy/migrate-step.sh` from canonical templates shipped with the package. Substitutes `{{appName}}`, `{{port}}`, `{{githubOrg}}` placeholders.
170
- - New CLI command: `kumiko init-deploy --app <name> [--port <n>] [--github-org <org>] [--out <dir>] [--force]`.
171
-
172
- The templates are extracted from publicstatus's production-tested `deploy/Dockerfile` (node-alpine build stage → bun-alpine runtime, drizzle migrations baked in, healthcheck wired). Refuses to overwrite existing files unless `--force` is passed so a tuned per-app Dockerfile isn't clobbered.
173
-
174
- **Templates are a starting point, not a contract.** Apps should review and adjust:
175
-
176
- - **Image tag** is hardcoded `:latest` in `migrate-step.sh.template`. Swap to `:${BUILD_SHA}` for atomic deploys.
177
- - **DB defaults** in `migrate-step.sh.template` assume `db user = db name = appName`, host `db`, port `5432`. Adjust to your stack.
178
- - **`COPY /app/seeds`** assumes the app uses ES-Operations seed migrations. Comment out if your app has no `seeds/` directory (otherwise `docker build` fails).
179
- - **`docker build`-smoke-test:** the templates run untested against a non-publicstatus app-tree. Verify locally before pushing to CI.
180
-
181
- **Deferred to Sprint 9.7+:** `.github/workflows/build-image.yml.suggested`, `pulumi/secrets-bootstrap.sh`, `pulumi/extraEnv.snippet.ts`.
182
-
183
- **Plan-Doc drift (for 9.9 update):** Plan-Doc-Tabelle nennt `start.sh` (in-container migrate-then-run); diese Implementation liefert `migrate-step.sh` (host-side deploy-pipeline). Beide Konzepte sind gültig — Plan-Doc-Update sollte das klarstellen.
184
-
185
- - 37fe758: `scaffoldDeploy()` inspects the app source-tree and emits Dockerfile blocks conditionally (Sprint 9.6 follow-up).
186
-
187
- **Why this exists:** Sprint 9.6's first Dockerfile.template hardcoded `COPY --from=build /app/seeds ./seeds` with a "comment out if you don't use it" note in the changeset. Apps without a `seeds/` directory (e.g. studio.kumiko.so) crashed in Docker-build with `failed to compute cache key: "/app/seeds": not found`. Root-cause was a framework issue (template too rigid), not a per-app symptom — the framework should detect what the app actually has.
188
-
189
- **Detection:**
190
-
191
- - `hasSeeds` — `exists(sourceDir/seeds)`. Drives the ES-Ops `COPY ./seeds` block in the runtime stage.
192
- - `hasPrivateGhPackages` — scan `package.json` `dependencies` + `devDependencies` for any `@cosmicdriftgamestudio/*` entry. Drives the `ARG GITHUB_TOKEN` blocks (multi-stage with explicit re-declaration inside the build-stage) and the `ENV GITHUB_TOKEN=${GITHUB_TOKEN}` re-export before `yarn install --immutable`.
193
-
194
- **Template syntax:** mustache-style block conditionals `{{#flag}}…{{/flag}}` (multi-line via `[\s\S]`, surrounding line stripped on falsy). Plain `{{key}}` placeholder substitution is unchanged.
195
-
196
- **New API:**
197
-
198
- - `ScaffoldDeployOptions.sourceDir?: string` — defaults to `destination`. Lets the caller scaffold into one dir while detecting optional surfaces in another (rare).
199
- - `ScaffoldDeployResult.detected: { hasSeeds, hasPrivateGhPackages }` — surfaced so the CLI can report what was emitted.
200
-
201
- **6 new tests:** seeds detection (with + without), GH-Packages detection (private + public-only + malformed package.json).
202
-
203
- Sprint 9.6's "starting point not contract" disclaimer in the original changeset is now obsolete for these two surfaces — apps no longer need to manually comment out lines.
204
-
205
- ### Patch Changes
206
-
207
- - Updated dependencies [51e22f5]
208
- - @cosmicdrift/kumiko-framework@0.9.0
209
- - @cosmicdrift/kumiko-bundled-features@0.9.0
210
-
211
- ## 0.8.1
212
-
213
- ### Patch Changes
214
-
215
- - Updated dependencies [4b5f91e]
216
- - @cosmicdrift/kumiko-framework@0.8.1
217
- - @cosmicdrift/kumiko-bundled-features@0.8.1
218
-
219
- ## 0.8.0
220
-
221
- ### Minor Changes
222
-
223
- - f34af9a: Add framework-core env-schema (Sprint 9.2, Migration Phase 1).
224
-
225
- **New API:**
226
-
227
- - `frameworkCoreEnvSchema` exported from `@cosmicdrift/kumiko-dev-server` — Zod-object covering the vars read by framework-core: `PORT` (default `"3000"`), `DATABASE_URL`, `REDIS_URL`, `KUMIKO_INSTANCE_ID`, `KUMIKO_SKIP_ES_OPS`. `DATABASE_URL` + `REDIS_URL` carry `.meta({ kumiko: { pulumi: { secret: true } } })` so `KUMIKO_DRY_RUN_ENV=pulumi` emits `--secret` flags. Plus `FrameworkCoreEnv` type via `z.infer`. `NODE_ENV` is excluded: build-prod-bundle inlines it as a literal at build-time (esbuild define), so runtime env-validation can't observe it.
228
- - `composeEnvSchema({ core, features, extend, optionalFeatures })` accepts a new `core?` option. Keys from `core` are tagged with source `"framework-core"` in the resulting sources map and in `KumikoBootError.format()` output. Conflict detection runs across core/features/extend — a feature or `extend` block that re-declares a core var throws `KumikoBootError` at compose-time.
229
-
230
- **Why:** Phase 1 of the Sprint 9 env-schema migration (`kumiko-studio/docs/plans/sprint-9-env-schemas.md`). Apps wire `composeEnvSchema({ core: frameworkCoreEnvSchema, features, extend })` into `runProdApp` to get aggregated boot-validation for the vars that framework-core reads. `KUMIKO_DRY_RUN_ENV=pulumi|k8s` then enumerates them with source attribution per row — operators see "(framework-core)" next to `DATABASE_URL` rather than guessing whether the framework or the app is the consumer.
231
-
232
- **Backward-compat:** Purely additive. `runProdApp`'s existing `requireEnv("DATABASE_URL")` / `process.env["KUMIKO_INSTANCE_ID"]` reads remain unchanged. Apps that don't pass `envSchema` behave exactly as before.
233
-
234
- **Feature-specific vars (Phase 2):** `JWT_SECRET` (auth-email-password), `KUMIKO_SECRETS_MASTER_KEY_*` (secrets), `SMTP_*` (channel-email-smtp), `STRIPE_*` / `MOLLIE_*` (subscription-\*) stay scoped to their owning feature's `r.envSchema()` and are NOT in `frameworkCoreEnvSchema`.
235
-
236
- - dff4123: Add Zod-based env-schema declarations and boot-time validation (Sprint 9.1).
237
-
238
- **New API:**
239
-
240
- - `r.envSchema(z.object({...}))` — declare per-feature env-vars at registration time.
241
- - `@cosmicdrift/kumiko-framework/env`: `composeEnvSchema({features, extend, optionalFeatures})` merges feature schemas into one app-wide schema, returning `{schema, sources}`. `parseEnv(schema, env, {sources, pulumiPrefix})` validates `process.env` and throws `KumikoBootError` listing ALL problems at once (aggregated, not first-fail).
242
- - `@cosmicdrift/kumiko-framework/env/dry-run`: `renderDryRun(composed, mode, opts)` for `human|json|pulumi|k8s` introspection of the required env-vars without booting.
243
- - `runProdApp({envSchema, pulumiPrefix, bootErrorReporter, envSource})` runs schema validation before any DB/Redis connection. `KUMIKO_DRY_RUN_ENV=1|human|json|pulumi|k8s` prints the inventory and exits.
244
- - Per-var metadata via Zod's `.meta({ kumiko: { pulumi: { name, generator, secret } } })` for deploy-time tooling overrides.
245
-
246
- **Backward-compat:** Apps without `envSchema` keep working — existing `requireEnv("DATABASE_URL")` calls in `runProdApp` are untouched. Sprint-9.2-9.5 migrates framework + bundled-features + apps to schema-only env handling.
247
-
248
- **Why:** 2026-05-21 Studio deploy stacked 7 hacks chasing missing env-vars (10+ pipeline-fail iterations, ended in rollback). Schema-first boot validation surfaces ALL misconfigs upfront with `pulumi config set …` suggestions, replacing the discover-by-failing loop with a single dry-run + secrets-bootstrap pass.
249
-
250
- ### Patch Changes
251
-
252
- - Updated dependencies [145b8df]
253
- - Updated dependencies [f34af9a]
254
- - Updated dependencies [dff4123]
255
- - @cosmicdrift/kumiko-bundled-features@0.8.0
256
- - @cosmicdrift/kumiko-framework@0.8.0
257
-
258
- ## 0.7.0
259
-
260
- ### Minor Changes
261
-
262
- - bcf43b6: es-ops: `SeedMembershipRow` exposes `streamTenantId` (stream-tenant aus `kumiko_events.v1`) neben dem payload-`tenantId`. Seed-Authors müssen den `kumiko_events`-JOIN nicht mehr selbst bauen — `m.streamTenantId` ist der korrekte Wert für `systemWriteAs`'s `tenantIdOverride` wenn das Aggregate von einem fremden Executor angelegt wurde (typisches `seedTenantMembership(by=systemAdmin)`-Pattern).
263
-
264
- ### Patch Changes
265
-
266
- - Updated dependencies [bcf43b6]
267
- - @cosmicdrift/kumiko-framework@0.7.0
268
- - @cosmicdrift/kumiko-bundled-features@0.7.0
269
-
270
- ## 0.6.0
271
-
272
- ### Minor Changes
273
-
274
- - 8489d18: feat(es-ops): Phase 1.5 — tenantIdOverride + dry-run-validator + E2E-Test + Doku
275
-
276
- Phase 1.5 schließt die Lücken aus Phase 1 die den ersten Driver-Use-Case
277
- (publicstatus admin-roles) blockten. Siehe Retro:
278
- `kumiko-platform/docs/plans/features/es-ops-phase1-retro.md` (PR #9).
279
-
280
- **A1 — tenantIdOverride:**
281
- `SeedMigrationContext.systemWriteAs(qn, payload, tenantIdOverride?)`.
282
- Default SYSTEM_TENANT_ID (unverändert für System-scope-Aggregates wie
283
- config-values). Mit override: `createSystemUser(tenantIdOverride)` als
284
- Executor, damit der Event-Store-Executor den Aggregate-Stream im
285
- richtigen Tenant findet. Fix für die `version_conflict`-Klasse-Bug
286
- (Memory `feedback_event_store_tenant_consistency.md`).
287
-
288
- **A2 — dry-run-validator:**
289
- Runner parsed seed-files vor `migration.run()` per regex
290
- `systemWriteAs\(["']([^"']+)["']`, sammelt handler-QNs, validiert
291
- gegen `registry.getWriteHandler(qn)`. Fail-fast mit klarer Message
292
-
293
- - Datei + QN statt zur Runtime "handler not found". Catched camelCase-
294
- typos (kebab-case-vs-camelCase Drift) + andere QN-Drift zur Boot-Zeit.
295
- runProdApp reicht den richtigen Registry rein (`registry` neu in
296
- RunPendingSeedMigrationsArgs).
297
-
298
- **A3 — E2E-Test:**
299
- `packages/bundled-features/src/__tests__/es-ops-e2e.integration.ts`
300
- mit `setupTestStack`-Pattern: tenant+config Features echt geladen,
301
- echtes Membership-Aggregate via TenantHandlers.addMember im Demo-Tenant,
302
- seed-migration ruft update-member-roles mit tenantIdOverride → write
303
- geht durch, Marker landed, Event in Store, Read-Model aktualisiert.
304
- Plus typo-Test: seed mit camelCase fail-t Dry-Run mit
305
- `/dry-run found.*unknown handler-QN/`. **TDD-First**: ohne A1+A2 wäre
306
- der test rot.
307
-
308
- **A4 — Doku:**
309
- `framework/src/es-ops/README.md` erweitert um „Wann brauche ich
310
- tenantIdOverride?" + „Deployment-Anforderungen" (Docker COPY, Idempotenz,
311
- Multi-Replica) + „Lokaler Smoke vor Push". Recipe-README + seed-files
312
- auf neue API aktualisiert.
313
-
314
- **A5 — Smoke-Skript-Template:**
315
- `samples/recipes/seed-migration/scripts/smoke.ts` als copy-paste-Template
316
- für App-Authors: Bun-runnable, offline (read-only, kein DB-Write),
317
- validiert Module-Load + QN-Resolution + System-User-Access. Recipe-
318
- README dokumentiert Pflicht-Pattern.
319
-
320
- **Bonus-Fix:**
321
- `tenant:write:create`-access auf `["system", "SystemAdmin"]` erweitert
322
- (symmetrisch zu update-member-roles). Aufgedeckt durch Recipe-Smoke +
323
- initial-tenants-Seed. Pinning-Test in `tenant.integration.ts` updated.
324
-
325
- **Test-State:** 45/45 grün (Pre-Push). Typecheck clean. Biome clean.
326
- as-cast-Audit clean. Guard-silent-skip clean. Recipe-Smoke clean.
327
-
328
- **Folge-Step (separater PR):** publicstatus driver-sample reaktivieren
329
- mit lokalem Pre-Push-Smoke gegen publicstatus' echtes Feature-Set.
330
-
331
- ### Patch Changes
332
-
333
- - Updated dependencies [8489d18]
334
- - @cosmicdrift/kumiko-framework@0.6.0
335
- - @cosmicdrift/kumiko-bundled-features@0.6.0
336
-
337
- ## 0.5.2
338
-
339
- ### Patch Changes
340
-
341
- - 4f0d781: fix(tenant): updateMemberRoles erlaubt "system"-Rolle (symmetrisch zu create)
342
-
343
- Drift innerhalb des tenant-Features: `tenant:write:create` akzeptierte
344
- `["system", "SystemAdmin"]`, `tenant:write:update-member-roles` aber
345
- nur `["SystemAdmin"]`. Konsequenz: ops-tooling und seed-migrations
346
- (`createSystemUser` mit `roles: ["system"]`) konnten den Handler nicht
347
- aufrufen — `access_denied`.
348
-
349
- Live entdeckt beim ersten Driver-Sample der es-ops Phase 1: publicstatus
350
- seed `2026-05-20-fix-admin-roles.ts` rief `update-member-roles` via
351
- `systemWriteAs` → access_denied → Pod CrashLoopBackOff.
352
-
353
- Plus access-rule-Pinning-Test in `tenant.integration.ts`-scenario-7.
354
-
355
- - Updated dependencies [4f0d781]
356
- - @cosmicdrift/kumiko-framework@0.5.2
357
- - @cosmicdrift/kumiko-bundled-features@0.5.2
358
-
359
- ## 0.5.1
360
-
361
- ### Patch Changes
362
-
363
- - 0e00015: fix(es-ops): path.resolve statt path.join für seedsDir → seed-files
364
-
365
- Bun's `await import()` braucht absolute Pfade. Wenn der App-Author
366
- `runProdApp({ seedsDir: "./seeds" })` setzt (relativ), würde
367
- `path.join("./seeds", "foo.ts")` einen relativen Pfad liefern → Bun's
368
- Import-Resolver such relativ zum `runner.ts`-Modul (nicht zum
369
- `process.cwd()`) → `Cannot find module 'seeds/...' from '<runner-path>'`.
370
-
371
- `path.resolve` löst gegen `process.cwd()` auf → absolute Pfade →
372
- Import funktioniert. Aufgedeckt beim ersten Live-Boot der publicstatus-
373
- Driver-Migration (Pod CrashLoopBackOff).
374
-
375
- - Updated dependencies [0e00015]
376
- - @cosmicdrift/kumiko-framework@0.5.1
377
- - @cosmicdrift/kumiko-bundled-features@0.5.1
378
-
379
- ## 0.5.0
380
-
381
- ### Minor Changes
382
-
383
- - 7ff69ab: feat(es-ops): Phase 1 — file-based seed-migrations
384
-
385
- Neues first-class Operations-Pattern fürs Framework. Liefert `seed-migrations`
386
- als drizzle-migrate-equivalent für Event-Sourcing-Aggregate-Updates die
387
- idempotent-Seeder nicht erfassen können (z.B. „Member hat schon eine
388
- Rolle, aber jetzt soll noch eine dazukommen").
389
-
390
- Public-API:
391
-
392
- - `runProdApp({ seedsDir })` — Auto-apply pending Migrations beim Boot
393
- - `SeedMigration`-Interface (default-Export einer `seeds/<id>.ts`-File)
394
- - `SeedMigrationContext` mit `systemWriteAs` (ruft existing write-handler
395
- als System-User) + Read-Helpers (`findUserByEmail`,
396
- `findMembershipsOfUser`, `findTenants`)
397
- - CLI: `bunx kumiko ops seed:new|status|apply`
398
- - Tracking-Table `kumiko_es_operations` mit `operation_type`-Discriminator
399
- (vorbereitet auf Phase 2+ Operations: projection-rebuild, event-replay,
400
- stream-migration, ...)
401
- - Env-Flags: `KUMIKO_SKIP_ES_OPS=1` (alle skippen für Recovery),
402
- `KUMIKO_SKIP_ES_OPS_<ID>=1` (einzelne kaputte skippen)
403
-
404
- Garantien: single-run via tracking, atomic via per-migration-Tx,
405
- chronological order via filename-prefix, fail-stop bei Failure (kein
406
- Partial-Apply), ES-konform via Handler-Dispatch.
407
-
408
- Sub-path-Export: `@cosmicdrift/kumiko-framework/es-ops`
409
-
410
- Plan-Doc: `kumiko-platform/docs/plans/features/es-ops.md`
411
- Recipe: `samples/recipes/seed-migration/`
412
- Driver-Use-Case: publicstatus admin-roles-drift (parallel-Branch
413
- `feat/es-ops-driver-admin-roles`).
414
-
415
- Phase 2+ skizziert + offen markiert — Implementation pro Use-Case.
416
-
417
- ### Patch Changes
418
-
419
- - Updated dependencies [7ff69ab]
420
- - @cosmicdrift/kumiko-framework@0.5.0
421
- - @cosmicdrift/kumiko-bundled-features@0.5.0
422
-
423
- ## 0.4.1
424
-
425
- ### Patch Changes
426
-
427
- - 010b410: feat(auth-email-password): "Bestätigungs-Mail erneut senden" im LoginScreen
428
-
429
- LoginScreen bietet bei reason=email_not_verified jetzt einen Resend-Link
430
- im Fehler-Banner — der existierende `requestEmailVerification`-Endpoint
431
- wird direkt aufgerufen, der Banner wechselt nach Erfolg zum Info-Variant
432
- ("Wir haben dir eine neue Bestätigungs-Mail geschickt.").
433
-
434
- UX-Details:
435
-
436
- - Bei 429 → inline-Hint "Bitte warte kurz und versuche es erneut."
437
- - Bei Netzwerk/sonstigen Fehlern → inline-Hint "Konnte nicht senden."
438
- - Anti-Typo-Gate: ändert der User die Email-Eingabe nach dem Login-Fail,
439
- verschwindet der Resend-Link — sonst würde Resend silent-success an die
440
- geänderte (potentiell typoed) Adresse gehen ohne User-Feedback.
441
- - Andere Failure-Codes (invalid_credentials etc.) zeigen weiterhin keinen
442
- Resend-Link.
443
-
444
- i18n: 4 neue Keys (DE+EN) im `auth.login.resend*`-Namespace, additive.
445
- Apps die ihre Translations override-en müssen nichts ändern.
446
-
447
- Additive UI-Feature — keine API-Breaks, keine Schema-Migration.
448
-
449
- - Updated dependencies [010b410]
450
- - @cosmicdrift/kumiko-framework@0.4.1
451
- - @cosmicdrift/kumiko-bundled-features@0.4.1
452
-
453
- ## 0.4.0
454
-
455
- ### Minor Changes
456
-
457
- - 825e7d2: Visual-Tree V.1.4 → V.1.6 — Feature-complete Editor + Folder-Hierarchy + Roving-tabindex.
458
-
459
- **V.1.4** — explicit `folder?: string` Schema-Field auf text-block-entity. Slug bleibt
460
- kebab-only validiert, Folder explizit gesetzt. Tree gruppiert via `groupBlocksByFolder`
461
- (ersetzt `groupBlocksBySlugPrefix`). `Subscribe<T>` Signature um optional `emitError`
462
- erweitert für explicit async-error-Pfade. ProviderBranch zeigt Error-Banner mit
463
- Retry-Button. Drift-Test pinnt seedTextBlock-vs-set.write Slug-Validation.
464
-
465
- **V.1.4b** — URL-State-Routing für Editor-Target via `nav.searchParams`. F5 + Back-Button
466
- stellen den Editor-State wieder her. Format: `?t=text-content:edit&a_slug=...&a_lang=...`.
467
- Plus `useDispatchTarget` hook ersetzt globalen `dispatchTarget` als empfohlenen Production-
468
- Pfad (legacy bleibt für Test-Hooks).
469
-
470
- **V.1.5** — Arrow-Key-Navigation (`<aside role="tree">`, ARIA-tree-Pattern) + SSE-driven
471
- Tree-Refresh. `ClientFeatureDefinition.treeEntities?: string[]` listet Entity-Namen pro
472
- Provider; live-events triggern provider-re-mount → Stale-Tree-state="stub"→"filled"
473
- flippt nach save automatisch.
474
-
475
- **V.1.5c+d** — Active-Node-Highlight (explicit blue + 2px border-l + scrollIntoView),
476
- VS-Code-Polish (compact spacing, focus-visible, folder-icon-color text-amber, indent-
477
- guides per ancestor-depth), Folder-Wrapper für legal-pages ("📁 Legal" + slug-first
478
- Verschachtelung) und text-content ("📁 Content").
479
-
480
- **V.1.6** — Multi-level Folder-Splitting (`folder="page/marketing"` → nested folders,
481
- walk-or-create-pattern, folder/leaf-collision-tolerant). Roving-tabindex (nur focused-
482
- treeitem hat tabIndex=0, Tab cyclt aus dem Tree raus).
483
-
484
- 35/35 kumiko check PASS, 13/13 group-blocks + 22/22 text-content integration tests grün.
485
- Browser + Keyboard lokal validated.
486
-
487
- **Breaking**: `TreeContext` Type entfernt (V.1.2 SR2-Rip — war nie genutzt). Provider sind
488
- session-bound: `TreeChildrenSubscribe = () => Subscribe<T>` statt `(ctx) => Subscribe<T>`.
489
-
490
- **V.1.7-Followups**: useEffect-deps in VisualTree-focus-init (Performance), Cancellation-
491
- Token in TreeProvider's fetch (emit-after-unmount-warning), inline-rename, drag-drop,
492
- file-icons per slug-extension, parent-jump bei ArrowLeft auf collapsed-item.
493
-
494
- ### Patch Changes
495
-
496
- - Updated dependencies [825e7d2]
497
- - @cosmicdrift/kumiko-framework@0.4.0
498
- - @cosmicdrift/kumiko-bundled-features@0.4.0
499
-
500
- ## 0.3.0
501
-
502
- ### Minor Changes
503
-
504
- - 0.3.0 bringt zwei neue Subsysteme (Step-Engine Tier-3 + Visual-Tree) plus
505
- eine AST-Codemod-Pipeline als Vorarbeit für den L2-AI-Layer.
506
-
507
- ### Breaking Changes
508
-
509
- - `skipTransitionGuard` → `unsafeSkipTransitionGuard` (Rename in
510
- feature-ast + engine). Der `unsafe`-Prefix macht die Tragweite des
511
- Casts sichtbar und ist konsistent zur `unsafeProjectionUpsert`- und
512
- `r.rawTable`-Konvention. Migration: 1:1-Ersetzung, keine Verhaltens-Änderung.
513
-
514
- ### Features
515
-
516
- - **Step-Engine M.4 — Tier-3 Workflow-Engine.** Neue Step-Vocabulary
517
- `wait`, `waitForEvent`, `retry` ermöglicht persistierte Long-Running-Flows
518
- über Job-Boundaries hinweg. Q7 Snapshot-at-Start hängt jedem Step-Run
519
- einen SHA-256-Fingerprint des Aggregat-Zustands an, sodass Replays
520
- deterministisch gegen den ursprünglichen Eingangszustand laufen.
521
- - **Visual-Tree V.1.x — Tree-API + Editor-Panel.** Neue `VisualTree`-
522
- Component plus TreeProvider-Pattern; erste TreeProviders für
523
- `text-content` und `legal-pages` (CMS-light + Impressum/Privacy).
524
- Fundament für den späteren No-Code-Designer (~3000 LOC, 98 Tests).
525
- - **Codemod-Pipeline.** AST-basierte Patcher-Module für strukturelle
526
- Feature-Edits — wird vom kommenden L2-AI-Layer als Tool-Surface
527
- verwendet, ist aber eigenständig nutzbar für ts-morph-style Migrationen.
528
- - **user-data-rights Sample-Recipe.** DSGVO Art. 15/17/18/20 vollständig
529
- als Sample-Recipe (`samples/recipes/`) inklusive README — zeigt die
530
- Export- und Forget-Pipeline gegen den `compliance-profiles`-Default
531
- (`eu-dsgvo`).
532
-
533
- ### Fixes
534
-
535
- - `tier-engine`: auto-default-tier-Hook benutzt jetzt `ctx.db.raw` für
536
- Event-Store-Operationen (#37, vorher: stiller Bug, 22 Tage live).
537
- - `engine`: unsafe-projection-upsert nutzt `as never` statt `as any` —
538
- schmaler Cast-Surface, weniger Compiler-Knebel.
539
- - `visual-tree`: runtime-isolation marker für client-konsumierte Files,
540
- damit der Multi-Entry-Build den richtigen Bundle-Split bekommt.
541
- - `feature-ast`: vollständiger `unsafeSkipTransitionGuard`-Rename (war
542
- in zwei Modulen noch der alte Name).
543
- - `framework`: Error-Reasons + `noConsole`-Lint + No-Date-API-Guard
544
- wieder push-ready.
545
-
546
- ### Library-Updates
547
-
548
- hono 4.12, jose 6.2, stripe 22.1, meilisearch 0.58, marked 18,
549
- bun-types 1.3.13, lucide-react 1.14, bullmq 5.76, ioredis 5.10,
550
- i18next 26.0, react + radix-ui-primitives auf aktuelle Minors.
551
-
552
- ### Patch Changes
553
-
554
- - Updated dependencies
555
- - @cosmicdrift/kumiko-framework@0.3.0
556
- - @cosmicdrift/kumiko-bundled-features@0.3.0
557
-
558
- ## 0.2.3
559
-
560
- ### Patch Changes
561
-
562
- - Updated dependencies [1dbd038]
563
- - @cosmicdrift/kumiko-bundled-features@0.2.3
564
- - @cosmicdrift/kumiko-framework@0.2.3
565
-
566
- ## 0.2.2
567
-
568
- ### Patch Changes
569
-
570
- - 7a7da3e: Re-publish 0.2.1 → 0.2.2 mit korrekt aufgelösten cross-package-Versionen.
571
- 0.2.1 hatte `workspace:*` als Wert in den dependencies (npm publish ohne
572
- yarn-pack rewrite), Konsumenten bekamen "Workspace not found".
573
-
574
- publish-with-oidc.sh nutzt jetzt `yarn pack` (rewrited workspace:\*) +
575
- `npm publish <tarball>` (OIDC + provenance).
576
-
577
- - Updated dependencies [7a7da3e]
578
- - @cosmicdrift/kumiko-framework@0.2.2
579
- - @cosmicdrift/kumiko-bundled-features@0.2.2
580
-
581
- ## 0.2.1
582
-
583
- ### Patch Changes
584
-
585
- - 48b7f6a: CI: switch publish to npm-CLI with OIDC Trusted Publishing + provenance.
586
- No source changes — verifies the new publish path produces a verified-
587
- provenance attestation on npmjs.com instead of token-based publish.
588
- - Updated dependencies [48b7f6a]
589
- - @cosmicdrift/kumiko-framework@0.2.1
590
- - @cosmicdrift/kumiko-bundled-features@0.2.1
591
-
592
- ## 0.2.0
593
-
594
- ### Minor Changes
595
-
596
- - 6c70b6f: fix(tenant): seedTenant idempotent gegen Event-Store-Projection-Drift.
597
-
598
- Verhindert version_conflict beim App-Boot wenn Aggregat existiert aber
599
- Projection-Row fehlt (rebuild-drift, async-lag, manueller DB-Eingriff).
600
-
601
- ### Patch Changes
602
-
603
- - Updated dependencies [6c70b6f]
604
- - @cosmicdrift/kumiko-framework@0.2.0
605
- - @cosmicdrift/kumiko-bundled-features@0.2.0
606
-
607
- ## 0.1.0
608
-
609
- ### Minor Changes
610
-
611
- - 59ba6d7: Initial public release of Kumiko — AI-native backend builder.
612
-
613
- What ships in 0.1.0:
614
-
615
- - **Engine** (`@cosmicdrift/kumiko-framework`): `defineFeature`, `r.entity`, `r.writeHandler`, `r.queryHandler`, `r.projection`, `r.multiStreamProjection`, `r.hook`, `r.translations`, `r.crud`, `r.referenceData`, `r.screen`, `r.nav`, `r.authClaims`, full lifecycle pipeline with field-level access checks
616
- - **Pipeline** (`@cosmicdrift/kumiko-framework`): `createDispatcher`, JWT auth via jose, Zod schema validation, role-based access checks, command/write/query split
617
- - **DB** (`@cosmicdrift/kumiko-framework`): Drizzle helpers (`buildDrizzleTable`, `applyCursorQuery`), CRUD executor, Postgres dialect, optimistic locking, soft delete, multi-tenant scoping
618
- - **Event sourcing** (`@cosmicdrift/kumiko-framework`): aggregate streams, single + multi-stream projections, event upcasters, asOf queries, archive support, AsyncDaemon-pattern dispatcher
619
- - **Bundled features** (`@cosmicdrift/kumiko-bundled-features`): auth-email-password, sessions, tenants, users, jobs, secrets, file-provider-s3, mail-transport-smtp/inmemory, billing-foundation, cap-counter, channel-in-app, delivery, feature-toggles, legal-pages
620
- - **Renderer** (`@cosmicdrift/kumiko-renderer`, `@cosmicdrift/kumiko-renderer-web`): schema-driven CRUD UI for React + Expo Web, override paths, list debounce, theme tokens
621
- - **Headless** (`@cosmicdrift/kumiko-headless`): view-models for list/edit screens, locale-aware
622
- - **Dev server** (`@cosmicdrift/kumiko-dev-server`): `runDevApp`, `runProdApp`, `kumiko-build` for production bundles (client + server), Docker-ready
623
- - **Realtime** (`@cosmicdrift/kumiko-dispatcher-live`): SSE broadcast across tenants, Redis Pub/Sub backend
624
- - **CLI** (`bin/kumiko.ts`): interactive dev menu, test runners, check pipeline (Biome + TypeScript + 18 guards + Vitest)
625
-
626
- This is a pre-1.0 release — APIs may change between minor versions. Breaking changes will be documented per release.
627
-
628
- ### Patch Changes
629
-
630
- - Updated dependencies [59ba6d7]
631
- - @cosmicdrift/kumiko-framework@0.1.0
632
- - @cosmicdrift/kumiko-bundled-features@0.1.0
@@ -1,44 +0,0 @@
1
- // kumikoDrizzleConfig — Convention-Helper für drizzle.config.ts in App-
2
- // Workspaces. Convention-driven Defaults statt Boilerplate-Copy:
3
- //
4
- // import { kumikoDrizzleConfig } from "@cosmicdrift/kumiko-dev-server/drizzle-config";
5
- // export default kumikoDrizzleConfig();
6
- //
7
- // Default-Pfade:
8
- // schema: "./drizzle/schema.ts"
9
- // out: "./drizzle/migrations"
10
- // db url: process.env[DATABASE_URL] (override via options)
11
- // dialect: "postgresql"
12
- // verbose + strict: true (drizzle-kit-Defaults für Production-Workflow)
13
- //
14
- // Apps mit untypischer Verzeichnis-Struktur können einzelne Werte
15
- // überschreiben, der Rest bleibt Convention.
16
-
17
- import { defineConfig } from "drizzle-kit";
18
-
19
- export type KumikoDrizzleConfigOptions = {
20
- /** Pfad zum Schema-Barrel relativ zum App-Root. Default: "./drizzle/schema.ts". */
21
- readonly schemaPath?: string;
22
- /** Migrations-Out-Folder relativ zum App-Root. Default: "./drizzle/migrations". */
23
- readonly outDir?: string;
24
- /** Env-Var-Name für die Database-URL. Default: "DATABASE_URL". */
25
- readonly databaseUrlEnv?: string;
26
- /** Fallback-URL wenn die Env-Var leer ist (für lokale Dev-Setups).
27
- * Default: postgres://kumiko:kumiko@localhost:15432/kumiko_dev (kumiko dev-stack). */
28
- readonly fallbackDatabaseUrl?: string;
29
- };
30
-
31
- export function kumikoDrizzleConfig(options: KumikoDrizzleConfigOptions = {}) {
32
- const envName = options.databaseUrlEnv ?? "DATABASE_URL";
33
- const fallback =
34
- options.fallbackDatabaseUrl ?? "postgres://kumiko:kumiko@localhost:15432/kumiko_dev";
35
- const url = process.env[envName] ?? fallback;
36
- return defineConfig({
37
- schema: options.schemaPath ?? "./drizzle/schema.ts",
38
- out: options.outDir ?? "./drizzle/migrations",
39
- dialect: "postgresql",
40
- dbCredentials: { url },
41
- verbose: true,
42
- strict: true,
43
- });
44
- }