feat: console help, examples and named loggers (SummerCMS v0.4.0)

Every command gets long help and examples, descriptions in imperative
sentence case, and a warn-only TestCommandsDocumented over bonfire.CheckDocs.
The plugin logs through a diary component logger instead of the process
default logger. Requires SummerCMS v0.4.0; command names and flags unchanged.
This commit is contained in:
Jakub Zych
2026-10-21 17:33:14 +02:00
parent 48d6593692
commit ffa2c8ffb1
12 changed files with 210 additions and 20 deletions

View File

@@ -4,7 +4,6 @@ import (
"embed"
"fmt"
"io/fs"
"log/slog"
"net/http"
"strconv"
"strings"
@@ -72,7 +71,7 @@ func (p *Plugin) wireSiteCache(app *backpack.App) error {
return nil
}
cfg := app.Config
log := slog.Default()
log := pluginLog
aliasURL := cfg.String(classes.SiteCachePurgeURLKey)
aliasToken := cfg.String(classes.SiteCachePurgeTokenKey)
aliasSet := strings.TrimSpace(aliasURL) != "" || aliasToken != ""