Skip to content

feat(cli): add cms-lab watch for the local dev loop (#27)#145

Merged
i-afaqrashid merged 1 commit into
mainfrom
feat/watch-mode
May 29, 2026
Merged

feat(cli): add cms-lab watch for the local dev loop (#27)#145
i-afaqrashid merged 1 commit into
mainfrom
feat/watch-mode

Conversation

@i-afaqrashid
Copy link
Copy Markdown
Owner

What

Adds cms-lab watch: re-runs the scan when cms-lab.config.ts changes and, with --interval <duration>, on a fixed timer. Prints a short timestamped summary per run ([HH:MM:SS] N errors, ...). Reuses the --only/--skip/--type filters from scan, reloads config each run so edits take effect without restarting, and detects the Next project once.

Design

The watcher and stop signal are injectable (dependencies.watch, dependencies.watchSignal), so the loop is tested deterministically without real fs events or timers. The default watcher is a debounced fs.watch wrapper; the real CLI runs until Ctrl-C. Overlapping runs are coalesced (a change during a run queues exactly one rerun). A scan failure prints and keeps watching rather than exiting.

Interactive extras from the design doc (raw-stdin re-run key, warm-adapter TTL) are intentionally left out of this first version to keep it robust and well-tested.

How verified

  • New CLI tests: a config-change triggers a rerun and abort exits cleanly (exit 0); an invalid --interval exits 2.
  • pnpm verify green (223 tests). Documented under /docs/scan.

Refs improvements/27.

cms-lab watch re-runs the scan when cms-lab.config.ts changes and, with
--interval, on a fixed timer, printing a short timestamped summary per
run. It reloads config each run (edits take effect without restarting)
and reuses the scan filters (--only/--skip/--type).

The watcher and stop signal are injectable dependencies, so the loop is
tested deterministically without real fs events or timers. The default
watcher is a debounced fs.watch wrapper. Interactive extras (raw-stdin
re-run key, warm-adapter TTL) are intentionally out of this first version.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cms-lab-site Ready Ready Preview, Comment May 29, 2026 9:44am

@i-afaqrashid i-afaqrashid merged commit 583aee6 into main May 29, 2026
12 checks passed
@i-afaqrashid i-afaqrashid deleted the feat/watch-mode branch May 29, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant