feat(build): scaffold working admin controllers with model, AdminFS and delete (quick-261028-pq8)

- make:admin-controller edits the singular of its name (--model overrides):
  ModelName, modelClass and the YAML under models/<model>/
- NewRecord returns &models.<Model>{} when the model exists; otherwise the
  nil body stays and the command says to run make:model
- config_list.yaml offers create and delete with showCheckboxes
- registry.gen.go embeds controllers/*/*.yaml and models/*/*.yaml once they
  exist and exposes generatedAdminFS(); scaffolded plugins implement
  pact.AdminAssets through it, and a plugin without AdminFS gets a note
- blog example moves its YAML to models/post; docs and help text follow
This commit is contained in:
Jakub Zych
2026-10-28 19:15:23 +01:00
parent 70e4b4183c
commit 8bc18c90b6
22 changed files with 491 additions and 84 deletions

View File

@@ -139,6 +139,11 @@ func TestMakeCommandsViaCLI(t *testing.T) {
t.Fatalf("make:job output missing reindex.go:\n%s", out)
}
out = runSummer("make:admin-controller", "golem15.demo", "People", "--model", "Person")
if !strings.Contains(out, filepath.Join("models", "person", "fields.yaml")) {
t.Fatalf("make:admin-controller --model output missing models/person:\n%s", out)
}
t.Chdir(pluginDir)
out = runSummer("make:command", "Purge")
if !strings.Contains(out, filepath.Join("console", "purge.go")) {