diff --git a/docs/contributing.md b/docs/contributing.md index e2d222d..f897c29 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -66,8 +66,8 @@ go generate ./... ``` The `//go:generate` directives in `examples/gastro/generate.go` invoke -`tailwindcss` followed by `gastro generate`. CI runs the same command -and fails if the result differs from what's committed. +`tailwindcss` followed by `go tool gastro generate`. CI runs the same +command and fails if the result differs from what's committed. For a hot-reload dev loop that rebuilds CSS, regenerates the gastro tree, and restarts the binary on every change: diff --git a/examples/gastro/generate.go b/examples/gastro/generate.go index 9fce001..8c953f1 100644 --- a/examples/gastro/generate.go +++ b/examples/gastro/generate.go @@ -5,20 +5,23 @@ // 1. Compile Tailwind CSS source (tailwind.css) into the embedded // stylesheet at static/styles.css. Output is minified for parity // with what ships in the binary. -// 2. Run `gastro generate` to regenerate the .gastro/ package tree -// against any .gastro template changes. +// 2. Run `go tool gastro generate` to regenerate the .gastro/ package +// tree against any .gastro template changes. The `go tool gastro` +// form resolves through the `tool` directive in go.mod, so we +// don't need a `gastro` binary on PATH (CI has the mise-managed +// tailwindcss binary on PATH but doesn't separately install +// gastro — the tool directive covers that case). // // `go generate` runs directives top-to-bottom within a single file, so // the freshly-built CSS is on disk before gastro generate's //go:embed // snapshot of static/ is taken. // -// Both commands must be on PATH. mise satisfies this once contributors -// run `mise install` from the repo root (see mise.toml). -// // CI gate: `go generate ./... && git diff --exit-code` from this -// directory catches drift in either the CSS or the .gastro/ tree. +// directory catches Tailwind CSS drift. The .gastro/ tree is +// gitignored, so codegen drift is covered separately by `gastro check` +// where it runs. //go:generate tailwindcss -i tailwind.css -o static/styles.css --minify -//go:generate gastro generate +//go:generate go tool gastro generate package main