1.7 KiB
1.7 KiB
Update Strategy
When the DSL changes, regeneration must preserve the default auth-enabled runtime rather than falling back to CRUD-only output.
Required regeneration sequence
- Regenerate
prisma/schema.prisma. - Run
npx prisma migrate dev. - Regenerate NestJS entity modules, DTOs, controllers, and services.
- Regenerate backend auth infrastructure:
AuthModule- guards
- decorators
- typed authenticated principal
- typed config validation
- CRUD RBAC decorations
- Regenerate React Admin resources.
- Regenerate frontend auth infrastructure:
src/config/env.tssrc/auth/keycloak.tssrc/auth/authProvider.ts- authenticated
dataProvider.ts App.tsxauth wiringmain.tsxinit-before-render flow
- Regenerate backend and frontend
.env.examplefiles so the auth env contract stays in sync. - Regenerate the root-level Keycloak realm import artifact. The repository default example filename is
toir-realm.json, but the generator must allow a project-specific equivalent. - Re-run post-generation validation, including:
- auth dependency checks
- fail-fast env checks
/healthpublic check- unauthenticated protected route ->
401 - insufficient role ->
403 - realm-template validation
Guardrails
- Regeneration must not strip auth back out of the project.
- Auth remains outside the DSL grammar, but it is part of the default generated runtime.
- If a DSL change affects entities or routes, the generator must re-apply the default CRUD RBAC rules automatically.
- If a DSL change affects runtime topology or naming, the generator must keep backend/frontend env examples, CORS rules, and the generated realm import artifact aligned with the generated app.