feat(04-01): scaffold Winter-shaped plugins with generated registry
Render plugin.go, routes.go, leaf packages and go.mod from embedded templates, emit empty registry accessors, and define job, admin, lang and mail capability contracts so a new plugin compiles before artifacts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
73
internal/build/stubs/registry.tmpl
Normal file
73
internal/build/stubs/registry.tmpl
Normal file
@@ -0,0 +1,73 @@
|
||||
{{define "registry.go"}}// Code generated by summer make. DO NOT EDIT.
|
||||
|
||||
package {{.Package}}
|
||||
|
||||
import (
|
||||
"git.golem15.com/golem15/summercms/bonfire"
|
||||
"git.golem15.com/golem15/summercms/pact"
|
||||
"github.com/go-gormigrate/gormigrate/v2"
|
||||
{{- range .Imports}}
|
||||
{{printf "%q" .}}
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
func generatedModels() []any {
|
||||
{{- if .Models}}
|
||||
return []any{
|
||||
{{- range .Models}}
|
||||
&{{.Package}}.{{.Ident}}{},
|
||||
{{- end}}
|
||||
}
|
||||
{{- else}}
|
||||
return nil
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func generatedMigrations() []*gormigrate.Migration {
|
||||
{{- if .Migrations}}
|
||||
return []*gormigrate.Migration{
|
||||
{{- range .Migrations}}
|
||||
{{.Package}}.{{.Ident}}(),
|
||||
{{- end}}
|
||||
}
|
||||
{{- else}}
|
||||
return nil
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func generatedCommands() []bonfire.Command {
|
||||
{{- if .Commands}}
|
||||
return []bonfire.Command{
|
||||
{{- range .Commands}}
|
||||
{{.Package}}.{{.Ident}}(),
|
||||
{{- end}}
|
||||
}
|
||||
{{- else}}
|
||||
return nil
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func generatedJobs() []pact.Job {
|
||||
{{- if .Jobs}}
|
||||
return []pact.Job{
|
||||
{{- range .Jobs}}
|
||||
{{.Package}}.{{.Ident}}(),
|
||||
{{- end}}
|
||||
}
|
||||
{{- else}}
|
||||
return nil
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
func generatedAdminControllers() []pact.AdminController {
|
||||
{{- if .AdminControllers}}
|
||||
return []pact.AdminController{
|
||||
{{- range .AdminControllers}}
|
||||
{{.Package}}.{{.Ident}}(),
|
||||
{{- end}}
|
||||
}
|
||||
{{- else}}
|
||||
return nil
|
||||
{{- end}}
|
||||
}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user