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:
@@ -111,6 +111,9 @@ A FAQ create, update or delete in the admin sends one purge request (`{"kind":"f
|
||||
- Ids are kept and the id sequence is moved past them with `setval`. One transaction.
|
||||
- A table that already holds rows is 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.
|
||||
- HTML is copied as stored; the API sanitizes it on output.
|
||||
- Ends with `Copied N FAQs.`
|
||||
|
||||
Example: `./bin/acme faq:import-winter --file faqs.jsonl --dry-run`. `./bin/acme help faq:import-winter` shows the long help and more examples. The plugin logs through the component `faq` (`log.components.faq` in `config/log.yaml`).
|
||||
|
||||
## Winter adaptations
|
||||
|
||||
@@ -123,7 +126,7 @@ A FAQ create, update or delete in the admin sends one purge request (`{"kind":"f
|
||||
|
||||
## Dependencies
|
||||
|
||||
- SummerCMS modules: backpack, bonfire, cabana, cooler, lagoon, pact, party, seaglass, surf, wire.
|
||||
- SummerCMS v0.4.0 modules: backpack, bonfire, cabana, cooler, diary, lagoon, pact, party, seaglass, surf, wire.
|
||||
- Compiled plugin: `golem15.translate` (`git.golem15.com/golem15/sm-translate-plugin`).
|
||||
- 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`.
|
||||
|
||||
@@ -134,3 +137,5 @@ go vet ./...
|
||||
go test -short ./... # no Docker
|
||||
go test ./... # TestFaqAdminSmoke, TestFaqImportSmoke, TestFaqAPISmoke, TestFaqAdminPurgesSiteCache on a Postgres container
|
||||
```
|
||||
|
||||
`TestCommandsDocumented` (Docker-free) logs, without failing, each command whose help lacks a description, long help, examples or an option description (`bonfire.CheckDocs`).
|
||||
|
||||
Reference in New Issue
Block a user