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:39:11 +02:00
parent f7eddd5572
commit 86564746de
9 changed files with 169 additions and 6 deletions

View File

@@ -195,6 +195,9 @@ Configure it once for the application with the framework keys `site_cache.purge_
- Dropped with their subtree, one report line each: `page` entries (Winter.Pages is not ported), entries whose type is neither built-in, registered nor mapped, and registry entries whose reference is not among the type's current references. Every remapped entry is reported too.
- Kept entries are made to pass the admin save rules, one report line each: a URL `classes.AllowedURL` refuses is trimmed when only surrounding whitespace is wrong and cleared otherwise; a target other than `_self` or `_blank` is cleared; an entry whose parent is in another menu is copied as a top-level entry of its own menu (with its own children), so it is not left out of the public tree.
- Tables that already hold rows are refused unless `--force`, which replaces them in the same transaction. `--dry-run` prints the report and writes nothing. An empty file writes nothing and reports zero.
- Ends with `Copied N menus, N entries kept, N remapped, N dropped.`
Example: `./bin/acme menu:import-winter --menus menus.jsonl --entries menu-entries.jsonl --dry-run`. `./bin/acme help menu:import-winter` shows the long help and more examples. The plugin logs through the component `menu` (`log.components.menu` in `config/log.yaml`).
## Winter adaptations
@@ -209,7 +212,7 @@ Configure it once for the application with the framework keys `site_cache.purge_
## Dependencies
- SummerCMS modules: backpack, bonfire, cabana, cooler, lagoon, pact, party, signpost, surf, wire.
- SummerCMS v0.4.0 modules: backpack, bonfire, cabana, cooler, diary, lagoon, pact, party, signpost, surf, wire.
- Compiled plugins: none.
- Third-party: `gorm.io/gorm`, `github.com/go-gormigrate/gormigrate/v2`. Test-only: `github.com/testcontainers/testcontainers-go` with its Postgres module, `github.com/jackc/pgx/v5`.
@@ -222,3 +225,5 @@ go test ./... # TestMenuAdminSmoke, TestMenuImportSmoke, TestMenuAPISm
```
The smoke tests register a fake content plugin with the types `acme-page` (with references), `acme-list` (a list type) and `all-journal-categories`, so the plugin needs no content plugin to test.
`TestCommandsDocumented` (Docker-free) logs, without failing, each command whose help lacks a description, long help, examples or an option description (`bonfire.CheckDocs`).