test(14.3-04): pin every file summer new writes with golden files

- new_golden_test.go: -update flag, fixed 0x00..0x1f key, sibling summercms symlink
- testdata/new (16 files + next steps) and testdata/new-no-plugin (6)
- plugin go.mod replace and absent root go.sum asserted instead of pinned
This commit is contained in:
Jakub Zych
2026-10-08 12:12:34 +02:00
parent 9f56dc7eff
commit eed24b8ad1
24 changed files with 526 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
# CLAUDE.md
Guidance for AI coding agents working in this repository. `AGENTS.md` is a symlink to this file.
## What this is
`sm-demo-app` is a SummerCMS application: a Go program built on the SummerCMS framework, module `git.golem15.com/golem15/summercms`. `go.mod` replaces the framework with the local checkout at `../summercms`. That checkout is shared with every other application next to it: do not edit the framework from here. Change this application, or report the framework problem.
Framework documentation for agents:
- https://summercms.io/docs/llms.txt (index)
- https://summercms.io/docs/llms-full.txt (full text in one file)
## Commands
Run them from this directory.
```sh
docker compose up -d --wait # start PostgreSQL 16 on 127.0.0.1:54320
summer build # generate main.go and plugins.gen.go, build bin/demo
summer dev # watch sources and rebuild
summer migrate # run plugin migrations
summer serve # start the HTTP server
summer make:plugin golem15.<name> # scaffold a plugin module under plugins/<name>
summer plugin:add plugins/<name> # register it in summer.yaml, go.mod and go.work
```
## Layout
- `summer.yaml`: the application manifest (module path, binary name, ordered plugin list).
- `plugins/`: local plugin modules.
- `config/`: YAML configuration (`app.yaml`, `database.yaml`, `http.yaml`, `storage.yaml`). Any key can be overridden with a `SUMMER_` environment variable, a double underscore separating path segments (`SUMMER_DATABASE__DSN` sets `database.dsn`).
- `.env`: local secrets (database DSN, application key). Never commit it; `.gitignore` excludes it. `.env.example` lists the variables.
- `compose.yaml`: the local PostgreSQL 16.
- `main.go`, `plugins.gen.go`: generated by `summer build` from `summer.yaml`. Do not edit them by hand; they are committed.
- `go.work`: the workspace that joins the application and its plugin modules.
Plugins are Go modules compiled into the binary at build time; there is no runtime plugin loading. Add a plugin with `summer make:plugin` and `summer plugin:add`, then run `summer build`.
## Naming convention
- `sm-<name>-app`: an application, like this repository.
- `sm-<name>-plugin`: a standalone plugin module.
- `sm-<name>-theme`: a Nuxt/Vue frontend.

View File

@@ -0,0 +1,9 @@
module git.golem15.com/golem15/sm-demo-app
go 1.27.0
toolchain go1.27.0
require git.golem15.com/golem15/summercms v0.0.0
replace git.golem15.com/golem15/summercms => ../summercms

View File

@@ -0,0 +1,7 @@
go 1.27.0
toolchain go1.27.0
use (
.
)

View File

@@ -0,0 +1,10 @@
created <parent>/sm-demo-app
Next steps, inside sm-demo-app:
docker compose up -d --wait
summer build
summer migrate
summer serve
The app has no plugins yet. Add one with summer make:plugin golem15.<name>
and summer plugin:add plugins/<name>, then run summer build again.

View File

@@ -0,0 +1,6 @@
// Code generated by summer build. DO NOT EDIT.
package main
// PluginIDs is the ordered plugin list from summer.yaml.
var PluginIDs = []string{}

View File

@@ -0,0 +1,3 @@
module: git.golem15.com/golem15/sm-demo-app
binary: demo
plugins: