feat(kiosk): resolve constant plugin IDs, overrides and the CheckT helper
- kiosk.ReadIdentity: ID()/Requires() as literals or constants across packages and modules, read with go/parser, never run - plugin minimums from go.mod requires; v0.0.0 is an error, a pseudo-version warns - kiosk.Validate, kiosk.CheckT (no testing import) - plugin:add reads IDs through kiosk.ReadIdentity, so const-ID plugins register
This commit is contained in:
3
modules/kiosk/testdata/other/README.md
vendored
Normal file
3
modules/kiosk/testdata/other/README.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Other
|
||||
|
||||
A plugin in another module that the consts fixture requires.
|
||||
7
modules/kiosk/testdata/other/go.mod
vendored
Normal file
7
modules/kiosk/testdata/other/go.mod
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
module example.test/sm-other-plugin
|
||||
|
||||
go 1.27.0
|
||||
|
||||
require git.golem15.com/golem15/summercms v0.5.3
|
||||
|
||||
replace git.golem15.com/golem15/summercms => ../framework
|
||||
15
modules/kiosk/testdata/other/plugin.go
vendored
Normal file
15
modules/kiosk/testdata/other/plugin.go
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Package other is a test fixture: a plugin in its own module that the
|
||||
// consts fixture requires. It is never built.
|
||||
package other
|
||||
|
||||
// PluginID is the plugin ID.
|
||||
const PluginID = "acme.other"
|
||||
|
||||
// Plugin is the fixture plugin.
|
||||
type Plugin struct{}
|
||||
|
||||
// ID returns PluginID.
|
||||
func (*Plugin) ID() string { return PluginID }
|
||||
|
||||
// Requires returns no plugins.
|
||||
func (*Plugin) Requires() []string { return []string{} }
|
||||
Reference in New Issue
Block a user