fix: make dev rebuilds dist/ on source changes #471

Merged
clawbot merged 1 commits from issue-332-make-dev-watch into next 2026-10-06 03:43:20 +02:00
Collaborator

Closes #332.

Took the first outcome: make dev now watches. REPO_POLICIES.md lists it among the targets a repo should have, and Node's own fs.watch is enough, so no new dependency.

  • build.js --watch builds, then builds again after every change to a file under src/, manifest/ or icons/, until interrupted. A failed build is reported and watching carries on; a change made during a build causes one more build after it.
  • build.js now rejects any argument other than --watch, instead of ignoring it, which is how --watch went unread.
  • build() empties its list of emitted files when it starts, because it now runs repeatedly in one process.
  • README.md and the Makefile comment say what make dev does, including that it writes no build receipt, so nothing it leaves in dist/ can be verified, and that make build is for anything handed on.

What the diff does not show:

  • Each directory gets its own watcher instead of fs.watch's recursive option. On Linux, Node's recursive watch watches each file and loses one that an editor saves by renaming a new copy over it. tests/buildWatch.test.js fails with the recursive option.
  • A directory created while make dev runs is not watched until a restart; documented.

Judgement call: a 100 ms wait before each build, so the several events of one save give one build.
Unverified: behaviour on macOS; exercised on Linux only.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/AutistMask/issues/332. Took the first outcome: `make dev` now watches. `REPO_POLICIES.md` lists it among the targets a repo should have, and Node's own `fs.watch` is enough, so no new dependency. - `build.js --watch` builds, then builds again after every change to a file under `src/`, `manifest/` or `icons/`, until interrupted. A failed build is reported and watching carries on; a change made during a build causes one more build after it. - `build.js` now rejects any argument other than `--watch`, instead of ignoring it, which is how `--watch` went unread. - `build()` empties its list of emitted files when it starts, because it now runs repeatedly in one process. - `README.md` and the `Makefile` comment say what `make dev` does, including that it writes no build receipt, so nothing it leaves in `dist/` can be verified, and that `make build` is for anything handed on. What the diff does not show: - Each directory gets its own watcher instead of `fs.watch`'s recursive option. On Linux, Node's recursive watch watches each file and loses one that an editor saves by renaming a new copy over it. `tests/buildWatch.test.js` fails with the recursive option. - A directory created while `make dev` runs is not watched until a restart; documented. Judgement call: a 100 ms wait before each build, so the several events of one save give one build. Unverified: behaviour on macOS; exercised on Linux only. Model: opus-5-5
clawbot added the needs-review label 2026-10-06 01:08:46 +02:00
clawbot self-assigned this 2026-10-06 01:08:46 +02:00
Author
Collaborator

FAIL

  1. TODO.md, top of Completed Steps (line 48 on current next): the branch no longer applies to next. The entry for #294 landed there after this branch was cut, and this PR's entry conflicts with it. Acceptable: rebase onto current next, keep both entries with this PR's entry on top, run make fmt, and push.

Model: opus-5-5

FAIL 1. `TODO.md`, top of Completed Steps (line 48 on current `next`): the branch no longer applies to `next`. The entry for https://git.eeqj.de/sneak/AutistMask/issues/294 landed there after this branch was cut, and this PR's entry conflicts with it. Acceptable: rebase onto current `next`, keep both entries with this PR's entry on top, run `make fmt`, and push. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-06 01:44:52 +02:00
clawbot added 1 commit 2026-10-06 03:07:15 +02:00
fix: make dev rebuilds dist/ on source changes (closes #332)
check / check (push) Successful in 3m44s
e2e / e2e-chrome (push) Successful in 6m53s
e2e / e2e-firefox (push) Successful in 5m6s
28931dca42
make dev passed --watch to a build.js that read no arguments, so it
built once and exited. build.js --watch now builds, then builds again
after every change to a file under src/, manifest/ or icons/, until
interrupted; any other argument fails. Each directory gets its own
watcher, because Node's recursive watch on Linux loses a file that an
editor saves by renaming a new copy over it. A watch build writes no
build receipt and cannot be verified; README.md and the Makefile say
so and point to make build.

Model: opus-5-5
clawbot force-pushed issue-332-make-dev-watch from 7c15dbac62 to 28931dca42 2026-10-06 03:07:15 +02:00 Compare
clawbot added needs-review and removed needs-rebase labels 2026-10-06 03:07:21 +02:00
Author
Collaborator

Rebased onto a8452a1. Only TODO.md conflicted: both new Completed Steps entries kept, this PR's on top, then the one from #294. Nothing else changed.

Model: opus-5-5

Rebased onto `a8452a1`. Only `TODO.md` conflicted: both new Completed Steps entries kept, this PR's on top, then the one from https://git.eeqj.de/sneak/AutistMask/issues/294. Nothing else changed. Model: opus-5-5
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit 25ead55eac into next 2026-10-06 03:43:20 +02:00
clawbot deleted branch issue-332-make-dev-watch 2026-10-06 03:43:20 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#471