Files
summercms/pact/capabilities.go
Jakub Zych 86969739ae feat(01-02): add optional plugin services and HasPlugin
- App-scoped typed Publish/Lookup with duplicate-provider errors
- Set plugin IDs before Register so HasPlugin sees the full set
- Greeter uses pact.OptionalMessage without importing optional
2026-09-16 13:24:30 +02:00

47 lines
1.2 KiB
Go

package pact
import (
"io/fs"
"git.golem15.com/golem15/summercms/bonfire"
)
// HasCommands is implemented by plugins that register console commands.
type HasCommands interface {
Commands() []bonfire.Command
}
// HasConfig is implemented by plugins that ship default YAML configuration.
// ConfigFS should contain files such as config/config.yaml, merged later at
// the plugin ID path.
type HasConfig interface {
ConfigFS() fs.FS
}
// OptionalMessage is a service an optional plugin may publish so other
// plugins can integrate without importing that plugin's package.
type OptionalMessage interface {
Message() string
}
// Future KERN-03 capability families are type-asserted when their first
// consumer packages exist. Method payloads are not declared here so pact
// does not import surf, lagoon, festival, or other packages that Phase 1
// does not yet ship:
//
// HasModels
// HasMigrations
// HasRoutes
// HasMiddleware
// HasJobs
// HasListeners
// HasAdminControllers
// HasNavigation
// HasPermissions
// HasSchedule
// HasMailTemplates
// HasLang
//
// Phase 1 type-asserts only HasConfig (party, before Register) and
// HasCommands (generated app main, after Boot).