How maddymadhesh77/hotreload works
hotreload is a Go CLI that watches a project, filters and debounces file changes, then rebuilds and restarts the configured server. Its CLI resolves explicit build/run settings or infers a runnable Go target; the engine owns the rebuild lifecycle and invokes the watcher, builder, and runner. The graph also preserves platform-specific process control. Relationships are based on the README and excerpted source; the demo server is an example application, not part of the hotreload runtime.
Main entry points: engine.go Lifecycle engine · watcher.go Recursive watcher · runner.go Server process manager · builder.go Build command runner
Components 11
CLI configuration
- CLI and target resolution
cmd/hotreload/main.go
Change detection
- Recursive watcher
internal/watcher/watcher.go - Path filter
internal/filter/filter.go - Event debouncer
internal/debouncer/debouncer.go
Rebuild lifecycle
- Lifecycle engine
internal/engine/engine.go - Build command runner
internal/builder/builder.go - Server process manager
internal/runner/runner.go
Process management
- Build process setup
internal/builder/process_unix.go - Unix process control
internal/runner/process_unix.go - Windows process control
internal/runner/process_windows.go
Other components
- Project developer
Connections 11
- Project developer → Recursive watcher: edits watched files
README.md - CLI and target resolution → Lifecycle engine: configures and starts
cmd/hotreload/main.go - Lifecycle engine → Recursive watcher: creates and starts
internal/engine/engine.go - Recursive watcher → Path filter: checks paths
internal/watcher/watcher.go - Recursive watcher → Lifecycle engine: emits file events
internal/engine/engine.go - Lifecycle engine → Event debouncer: triggers and receives
internal/engine/engine.go - Lifecycle engine → Build command runner: runs rebuilds
internal/engine/engine.go - Lifecycle engine → Server process manager: stops and starts server
internal/engine/engine.go - Build command runner → Build process setup: sets process group
internal/builder/builder.go - Server process manager → Unix process control: delegates process control
internal/runner/runner.go - Server process manager → Windows process control: delegates process control
internal/runner/runner.go