feat(09-03): scaffold Winter admin controller layout

- config_form.yaml and config_list.yaml point at models/<name>/fields.yaml and columns.yaml
- Duplicate model or controller assets fail before any new file is written
This commit is contained in:
Jakub Zych
2026-09-24 18:25:20 +02:00
parent af8e58a038
commit 68715fc260
3 changed files with 67 additions and 24 deletions

View File

@@ -714,10 +714,12 @@ func TestScaffoldAllArtifacts(t *testing.T) {
}
wantAdmin := []string{
filepath.Join(pluginDir, "controllers", "albums.go"),
filepath.Join(pluginDir, "controllers", "albums", "fields.yaml"),
filepath.Join(pluginDir, "controllers", "albums", "columns.yaml"),
filepath.Join(pluginDir, "controllers", "albums", "config_form.yaml"),
filepath.Join(pluginDir, "controllers", "albums", "config_list.yaml"),
filepath.Join(pluginDir, "models", "albums", "fields.yaml"),
filepath.Join(pluginDir, "models", "albums", "columns.yaml"),
}
if len(admin.Files) != 3 {
if len(admin.Files) != len(wantAdmin) {
t.Fatalf("make:admin-controller files = %v", admin.Files)
}
for i, want := range wantAdmin {
@@ -739,8 +741,8 @@ func TestScaffoldAllArtifacts(t *testing.T) {
}
}
for _, rel := range []string{
filepath.Join("controllers", "albums", "fields.yaml"),
filepath.Join("controllers", "albums", "columns.yaml"),
filepath.Join("models", "albums", "fields.yaml"),
filepath.Join("models", "albums", "columns.yaml"),
} {
body, err := os.ReadFile(filepath.Join(pluginDir, rel))
if err != nil {