identifier-normalization, no-hardcoded-vendors, vendor-installer-verification, and build-version-display follow the go-database split: rules in contract.md, snippets in README.md. Routed contract reads get cheaper; examples stay available on demand. Lint now also rejects stale kit/patterns references. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
522 B
522 B
Build Version Display Pattern Notes
This file keeps examples. The normative rules live in contract.md.
Frontend (JS/TS build tools)
// vite.config.ts / webpack.config.js
define: {
__APP_VERSION__: JSON.stringify(process.env.APP_VERSION ?? "dev"),
}
// Footer component
<footer>v{__APP_VERSION__}</footer>
Go (server-rendered HTML)
// main.go
var Version = "dev"
// Build: go build -ldflags "-X main.Version=1.4.2"
<!-- base template -->
<footer>v{{ .Version }}</footer>