feat(build): bake plugin metadata and the framework version into plugins.gen.go

- party.Info, party.Installed, party.Describe (additive; Plugin and Activate unchanged)
- summer build resolves plugin dirs with one go list, reads plugin.yaml, versions per D-07 (module version, git describe without --dirty, none for in-app plugins)
- build.EffectiveFramework: newest tag of a locally replaced or used framework checkout, else the go.mod require
- generated main calls party.Describe(app, PluginInfo, FrameworkVersion) before Activate; metadata failures warn and fall back to IDs
- summer new goldens and examples/hello regenerated
This commit is contained in:
Jakub Zych
2026-10-29 17:12:13 +01:00
parent 4916ee3d43
commit e8d3d724f5
15 changed files with 770 additions and 15 deletions

View File

@@ -2,5 +2,16 @@
package main
import (
"git.golem15.com/golem15/summercms/modules/party"
)
// PluginIDs is the ordered plugin list from summer.yaml.
var PluginIDs = []string{}
// PluginInfo is each plugin's metadata in summer.yaml order: name and
// description from its plugin.yaml, version and source from summer build.
var PluginInfo = []party.Info{}
// FrameworkVersion is the framework version the app was built against.
const FrameworkVersion = ""

View File

@@ -34,6 +34,9 @@ func run(args []string, out io.Writer) int {
return bonfire.Fail(os.Stderr, "demo", err, g)
}
app := backpack.New(cfg)
if err := party.Describe(app, PluginInfo, FrameworkVersion); err != nil {
return bonfire.Fail(os.Stderr, "demo", err, g)
}
plugins, err := party.Activate(app, PluginIDs)
if err != nil {
return bonfire.Fail(os.Stderr, "demo", err, g)

View File

@@ -4,9 +4,20 @@ package main
import (
_ "git.golem15.com/golem15/sm-demo-app/plugins/golem15/demo"
"git.golem15.com/golem15/summercms/modules/party"
)
// PluginIDs is the ordered plugin list from summer.yaml.
var PluginIDs = []string{
"golem15.demo",
}
// PluginInfo is each plugin's metadata in summer.yaml order: name and
// description from its plugin.yaml, version and source from summer build.
var PluginInfo = []party.Info{
{ID: "golem15.demo"},
}
// FrameworkVersion is the framework version the app was built against.
const FrameworkVersion = ""