docs(11.1-05): log the scaffolder gaps found while porting the walkthrough

- same-second migrations sort by name and can run out of order
- make:admin-controller output does not boot and names the model after
  the controller
- the DO NOT EDIT header on editable files, and commands that cannot reach
  the application
This commit is contained in:
Jakub Zych
2026-09-30 23:41:26 +02:00
parent 63290c66d3
commit 4e05450f46
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
---
title: make:admin-controller output does not boot and names the model after the controller
date: 2026-09-30
priority: medium
area: summercms.go internal/build
---
`summer make:admin-controller acme.blog Posts` writes a controller and YAML that compile but are not a working admin screen:
- `ModelName()` returns `Posts` and both YAML files say `modelClass: Posts`, the controller name, where WinterCMS uses the model (`Post`). `fields.yaml` and `columns.yaml` go under `models/posts/`, the controller's snake name, not the model's.
- The controller implements only `pact.AdminController`. Without `pact.AdminRecordSource` (`NewRecord`) the admin API answers every record route with a capability error, and without `pact.AdminPermissioned` any signed-in administrator can open it (`cabana.Allows` treats an empty list as "any authenticated principal").
- Neither `make:plugin` nor `make:admin-controller` gives the plugin an `AdminFS` (`pact.AdminAssets`), so once the admin is enabled `cabana.Activate` stops the start-up with "plugin acme.blog has admin controllers but no AdminFS".
- `config_list.yaml` offers only `create`; adding `delete` also needs `showCheckboxes: true`, which cabana enforces.
Found while writing `docs/setup/porting-a-plugin.md` (Phase 11.1 plan 05). The walkthrough fixes each point by hand and the page lists them under "What the scaffolder leaves to you".
Suggested fix: give `make:admin-controller` a model argument or flag (defaulting to the singular of the controller name), write `modelClass` and the model's YAML directory from it, generate `NewRecord` and a `RequiredPermissions` stub with `<vendor>.<plugin>.access_<controller>`, and have `make:plugin` embed `controllers/*/*.yaml models/*/*.yaml` and implement `AdminFS` (with a harmless empty tree until the first controller exists). Update `docs/console/scaffolding.md` and the porting page in the same change. `internal/build` is outside the docs phase boundary, so it is not changed in Phase 11.1.