From d6085b7dbb01943af474921d53afd0c4dcb0fce7 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Thu, 14 May 2026 17:54:35 +0200 Subject: [PATCH] feat(01-01): sqlc config, tailwind input CSS, air live-reload config - sqlc.yaml: postgresql engine, schema points at migrations/ (Pitfall 7), pgx/v5 sql_package - tailwind.input.css: @source globs for templ + internal/web Go files (Pitfall 3), @imports four ui/*.css files per UI-SPEC - .air.toml: watches .go + .templ, excludes generated *_templ.go (Pitfall 5), runs 'templ generate' pre-build - Tailwind watch is NOT wired into air pre_cmd (two-terminal workflow per RESEARCH Open Q2) --- backend/.air.toml | 11 +++++++++++ backend/sqlc.yaml | 12 ++++++++++++ backend/tailwind.input.css | 10 ++++++++++ 3 files changed, 33 insertions(+) create mode 100644 backend/.air.toml create mode 100644 backend/sqlc.yaml create mode 100644 backend/tailwind.input.css diff --git a/backend/.air.toml b/backend/.air.toml new file mode 100644 index 0000000..5bf7a4f --- /dev/null +++ b/backend/.air.toml @@ -0,0 +1,11 @@ +root = "." +tmp_dir = "tmp" + +[build] +cmd = "templ generate && go build -o ./tmp/web ./cmd/web" +bin = "./tmp/web" +include_ext = ["go", "templ"] +exclude_dir = ["tmp", "bin", "static", ".git", "internal/db/sqlc"] +exclude_regex = [".*_templ\\.go$"] +delay = 200 +stop_on_error = true diff --git a/backend/sqlc.yaml b/backend/sqlc.yaml new file mode 100644 index 0000000..9680109 --- /dev/null +++ b/backend/sqlc.yaml @@ -0,0 +1,12 @@ +version: "2" +sql: + - engine: postgresql + schema: "migrations" + queries: "internal/db/queries" + gen: + go: + package: "sqlc" + out: "internal/db/sqlc" + sql_package: "pgx/v5" + emit_json_tags: false + emit_interface: false diff --git a/backend/tailwind.input.css b/backend/tailwind.input.css new file mode 100644 index 0000000..8c4faf8 --- /dev/null +++ b/backend/tailwind.input.css @@ -0,0 +1,10 @@ +@import "tailwindcss"; + +@source "../templates/**/*.templ"; +@source "../internal/web/**/*.templ"; +@source "../internal/web/**/*.go"; + +@import "../internal/web/ui/base.css"; +@import "../internal/web/ui/button.css"; +@import "../internal/web/ui/card.css"; +@import "../internal/web/ui/badge.css";