← All changes

SummerCMS 0.4.0

v0.4.03 min readFramework

Highlights

  • An Artisan-style console. list groups commands by namespace, help <command> shows a long description and worked examples, and every command accepts the same global options: -v, -vv and -vvv, -q, --ansi and --no-ansi, -n and --env.
  • Logging with components and daily files. The new diary module sends every log record through a named component (http, db, river, serve, queue and one per plugin), redacts secrets on the console and writes warnings and up to storage/logs/summer-YYYY-MM-DD.log, kept for 14 days. Configure it in config/log.yaml.
  • Startup summaries and shutdown reports. serve opens with a compact block (version, environment, URL, admin, database host and migration state, plugins, queue, scheduler, mail, cache, realtime and search) and closes on Ctrl+C with a report of requests served and drained, worker jobs and uptime. queue:work and schedule:run do the same.

Added

  • list --format=json and help with examples for every framework command and every summer tool command.
  • Error blocks with a hint where the framework knows the fix: an empty or unreachable database, an invalid app.key, a missing uploads bucket, pending migrations, and running an application binary or a summer make: command from the wrong directory.
  • --json on migrate:status, key:generate, route:list, admin:token:create, admin:token:list, admin:token:scopes and websockets:health.
  • --pretend on migrate, migrate:rollback and deferred:purge, which show what would change without writing.
  • --force on migrate, migrate:rollback, deferred:purge and queue:clear, which skips the production confirmation.
  • Result lines: Applied N migrations or Nothing to migrate, Rolled back <id> of <plugin>, Cleared N jobs from <queue>, Built bin/<app> in <time> and Created <path> for each scaffolded file.
  • Spinners, progress bars and prompts behind the console output, so they disappear under -q and off a terminal.
  • For plugin authors: bonfire.Example, Command.Long, Command.Examples and Command.Hidden; bonfire.CheckDocs to test that commands are documented; bonfire.WithHint, bonfire.Reported and bonfire.Usage for errors; diary.For("<component>") for a plugin's own logger.

Changed

  • Run summer build after you move to 0.4: the generated main.go now sets up logging before the configuration is read, parses the global options and returns the new exit codes.
  • Two commands with the same name, or a command flag named like a global option, stop the binary at start-up with an error naming it.
  • Daily log files are on by default. The storage/logs directory must be writable; set log.default: console to keep console-only logging.
  • The request log is on by default: one record per request with the route pattern (never the path), status, duration and request id. Silence it with components: {http: warn} or turn it off with http.access_log: false.
  • GORM logs through component db and no longer logs record-not-found; River logs through component river, warnings and up by default.
  • A failed command exits 1 and a usage error (unknown command or flag, wrong number of arguments) exits 2.
  • -q hides information lines, spinners and progress bars, but still prints the data a command exists to produce: tokens, keys and --json output.
  • migrate, migrate:rollback, deferred:purge and queue:clear ask for confirmation in production on an interactive terminal only; deploy scripts over SSH run as before.
  • Off a terminal, serve logs a startup summary record and keeps the listening on <addr> line that scripts wait for.

Fixed

  • summer dev now runs bin/<app> serve; before, it started the binary without a command, which printed the help and stopped.
  • summer dev stops the old server before it starts the rebuilt one, so the restart no longer fails on a busy port.
  • summer dev exits 0 after Ctrl+C with a short report instead of printing the cancellation as an error.

See "Upgrading to 0.4" in the upgrading guide for the full list.

Subscribe via RSS