fix(template): ship a go.sum, and stop the templ generator drifting from the library

Closes #8.

`task check` did not pass on a clean checkout of this template, and had not
for some time. Three defects in a chain, each hiding the next:

1. No go.sum at all. `go build ./...` failed on missing sum entries, so
   nothing downstream of it ever ran.

2. With that fixed, the real skew appeared: CI installs the templ GENERATOR
   as @latest while go.mod pinned the templ LIBRARY at v0.2.778. The v0.3
   generator emits calls to templruntime.WriteString, which v0.2.778 does not
   have -- so generated code could not compile against the pinned runtime.
   Library moved to v0.3.1020 and the CI install now derives its version from
   go.mod, so generator and library cannot drift apart again.

3. .gitignore carried `*.templ.go`. templ writes `<name>_templ.go` -- an
   underscore, not a dot -- so the pattern matched nothing. Generated files
   were kept out of git by luck rather than by the ignore rule.

None of this was visible from this repo's CI, which has been green
throughout, because the guard job skips `check` here entirely (#12). A
template whose gate cannot run is a template whose defects are found by its
children.

Verified on a clean checkout: `go build ./...` clean, `task check` exit 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 18:04:13 +02:00
co-authored by Claude Opus 5
parent b9bbbae3bb
commit b40db025cc
4 changed files with 17 additions and 5 deletions
+1 -3
View File
@@ -2,6 +2,4 @@ module __MODULE_PATH__
go 1.26
require (
github.com/a-h/templ v0.2.778
)
require github.com/a-h/templ v0.3.1020