From 6e22dad57f003cd060b01b43cb686922e883b852 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 19 Jan 2026 19:26:50 +0000 Subject: [PATCH] chore: Add Air hot-reload configuration Adds .air.toml for air-verse/air hot-reload during development: - Watches Go files in cmd/, internal/, pkg/ - Excludes tests, vendor, node_modules, frontend - Automatically rebuilds on file changes - Supports Pro build detection via HOT_DEV_USE_PRO env var - Kill delay and graceful shutdown configured --- .air.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .air.toml diff --git a/.air.toml b/.air.toml new file mode 100644 index 000000000..0c56449b4 --- /dev/null +++ b/.air.toml @@ -0,0 +1,47 @@ +# Air configuration for Pulse hot-reload +# https://github.com/air-verse/air + +root = "." +tmp_dir = "tmp" + +[build] +# Build command - uses Pro build if available +cmd = """ +if [ -d /opt/pulse-enterprise ] && [ "${HOT_DEV_USE_PRO:-true}" = "true" ]; then + cd /opt/pulse-enterprise && go build -buildvcs=false -o /opt/pulse/pulse ./cmd/pulse-enterprise +else + go build -o pulse ./cmd/pulse +fi +""" +# Binary to run +bin = "./pulse" +# Watch these directories +include_dir = ["cmd", "internal", "pkg"] +# Exclude these patterns +exclude_dir = ["vendor", "node_modules", "tmp", "frontend-modern", ".git"] +exclude_file = [] +exclude_regex = ["_test\\.go$", "\\.tmp$", "~$"] +exclude_unchanged = true +# File extensions to watch +include_ext = ["go", "tpl", "tmpl", "html"] +# Kill old process before starting new one +kill_delay = "1s" +# Send interrupt signal first, then kill after delay +stop_on_error = false +# Log output +log = "build-errors.log" +# Colorize output +color_main = "yellow" +color_watcher = "cyan" +color_build = "green" +color_runner = "magenta" + +[log] +# Show log time +time = false +# Only show main logs +main_only = false + +[misc] +# Delete tmp directory on exit +clean_on_exit = true