build(dev): use air for backend live reload
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2026-05-02 15:39:28 -04:00
parent a865457bbf
commit 64aa000323
6 changed files with 22 additions and 3 deletions

17
.air.toml Normal file
View File

@@ -0,0 +1,17 @@
root = "."
tmp_dir = "_scratch/air"
[build]
cmd = "go build -o ./_scratch/air/antholume ."
full_bin = "./_scratch/air/antholume serve"
delay = 1000
include_ext = ["go", "tpl", "tmpl", "html", "css", "js", "yaml", "yml"]
exclude_dir = ["_scratch", "build", "data", "frontend", "node_modules"]
exclude_file = ["assets/style.css"]
stop_on_error = true
[log]
time = true
[misc]
clean_on_exit = true

1
.gitignore vendored
View File

@@ -2,6 +2,7 @@ TODO.md
.DS_Store
data/
build/
tmp/
.direnv/
cover.html
node_modules

View File

@@ -42,7 +42,7 @@ Regenerate:
### Common commands
- Full dev stack: `make dev` (backend on `:8585` + Vite frontend on `:5173`)
- Backend only: `make dev_backend`
- Backend only: `make dev_backend` (live-reloads with Air)
- Frontend only: `make dev_frontend`
- Direct backend run: `CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true go run main.go serve`
- No-auth dev run: `CONFIG_PATH=./data DATA_PATH=./data REGISTRATION_ENABLED=true DISABLE_AUTH=true DISABLE_AUTH_USER=evan go run main.go serve`

View File

@@ -46,7 +46,7 @@ dev:
$(MAKE) -j2 dev_backend dev_frontend
dev_backend:
$(DEV_ENV) go run main.go serve
$(DEV_ENV) air
dev_frontend:
cd frontend && bun run dev

View File

@@ -138,7 +138,7 @@ Run Development:
make dev
# Or run one side only
make dev_backend
make dev_backend # live-reloads with air
make dev_frontend
```

View File

@@ -20,6 +20,7 @@
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
air
go
golangci-lint
gopls