From 605c64ef92f0710b532c766019f0dcd86a66d002 Mon Sep 17 00:00:00 2001 From: Tim Wundenberg Date: Tue, 6 May 2025 20:00:57 +0200 Subject: [PATCH] feat: replace air with templ hot reload --- .air.toml | 15 --------------- db/account.go | 3 +-- dev.sh | 6 ++++++ 3 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 .air.toml create mode 100755 dev.sh diff --git a/.air.toml b/.air.toml deleted file mode 100644 index 6346c58..0000000 --- a/.air.toml +++ /dev/null @@ -1,15 +0,0 @@ -root = "." -tmp_dir = "tmp" - -[build] - bin = "./tmp/main" - cmd = "templ generate && go build -o ./tmp/main ." - exclude_dir = ["static", "migrations", "node_modules", "tmp"] - exclude_regex = ["_test.go", "_templ.go"] - include_ext = ["go", "templ"] - send_interrupt = true - kill_delay = "5s" - stop_on_error = true - -[misc] - clean_on_exit = true diff --git a/db/account.go b/db/account.go index fa14b53..5079e5e 100644 --- a/db/account.go +++ b/db/account.go @@ -4,9 +4,8 @@ import ( "spend-sparrow/log" "spend-sparrow/types" - "github.com/jmoiron/sqlx" - "github.com/google/uuid" + "github.com/jmoiron/sqlx" ) type Account interface { diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..3df34be --- /dev/null +++ b/dev.sh @@ -0,0 +1,6 @@ +templ generate --watch --proxy="http://localhost:8080" --cmd="go run ." & +npm run watch & + +read -n1 -s +kill $(jobs -p) +