chore: gitignore generated _templ.go files, track .templ sources
Some checks failed
CI / Deploy / test (pull_request) Failing after 13s
CI / Deploy / lint (pull_request) Failing after 24s
CI / Deploy / deploy (pull_request) Has been skipped

Generated _templ.go files are deterministic output from .templ sources,
same as output.css from input.css. Remove them from version control to
reduce diff noise and merge conflicts. Add build:templ and live:templ
tasks to the Taskfile so generation happens as part of the build.
This commit is contained in:
Ryan Hamamura
2026-03-02 15:27:38 -10:00
parent 4f1ee11fa3
commit 2bea5bb489
27 changed files with 1044 additions and 3236 deletions

View File

@@ -6,12 +6,22 @@ tasks:
cmds:
- go run cmd/downloader/main.go
build:templ:
desc: Compile .templ files to Go
cmds:
- go tool templ generate
sources:
- "**/*.templ"
generates:
- "**/*_templ.go"
build:styles:
desc: Build TailwindCSS styles
cmds:
- go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify
sources:
- "assets/css/input.css"
- "**/*.templ"
- "**/*.go"
generates:
- "assets/css/output.css"
@@ -21,8 +31,14 @@ tasks:
cmds:
- go build -o bin/c4 .
deps:
- build:templ
- build:styles
live:templ:
desc: Watch and recompile .templ files
cmds:
- go tool templ generate -watch
live:styles:
desc: Watch and rebuild TailwindCSS styles
cmds:
@@ -36,12 +52,13 @@ tasks:
-build.cmd "go build -tags=dev -o tmp/bin/c4 ." \
-build.bin "tmp/bin/c4" \
-build.exclude_dir "data,bin,tmp,deploy" \
-build.include_ext "go" \
-build.include_ext "go,templ" \
-misc.clean_on_exit "true"
live:
desc: Dev mode with hot-reload
deps:
- live:templ
- live:styles
- live:server