Skip to content

dev: hot reload on file change #23

Description

@I-am-nothing

Goal

`mirrorstack dev` watches `.go` and `sql/**/.sql` in the module dir; on change, kills the Go process and respawns `go run .` with the same env. The whole point of `dev` is iteration, so this should be the default behavior with a `--no-watch` opt-out.

Sketch

  • Use the `notify` crate for cross-platform fs events
  • Debounce ~250ms (editors do multi-write saves)
  • Globs to watch: `/*.go`, `sql//*.sql`. Skip `vendor/`, `testdata/`, `.git/`
  • On change: send SIGTERM (or SIGKILL fallback) to the existing child, wait, respawn
  • Keep docker-compose + (future) tunnel handle alive across reloads — only the Go process restarts

Acceptance

Estimate

~150 LoC + tests. Independent of any unmerged work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions