- Issues
- #179
celld dev: watcher doesn't ignore .wrangler/, and there's no way to add ignores
gsiener opened ·
## Summary
`celld dev`'s file watcher ignores `.celld`, `.git`, `node_modules`, and `target` (per the docs), but not `.wrangler/`. Since `celld dev` consumes `wrangler.jsonc` as its project config, a `.wrangler/` state directory is present in most projects celld runs — and any write into it triggers a full rebuild + restart. There is no `--no-watch` flag or ignore-list option in 0.4.0 to opt out.
This makes "run the same acceptance suite against `wrangler dev` and `celld dev`" — the natural way to check for divergence between the two runtimes — unreliable, because the wrangler half of the suite writes into `.wrangler/state` and can restart celld mid-run.
## Reproduction
celld 0.4.0, macOS (aarch64-apple-darwin). In a project whose `wrangler.jsonc` declares a Durable Object and an R2 bucket:
``` $ celld dev . --port 9933 # wait for ready $ grep -c "change detected" celld.log 0
# create many Durable Objects via real ingest traffic (165 spans -> many DO instances) $ grep -c "change detected" celld.log 0 # .celld correctly ignored
$ mkdir -p .wrangler/state/probe && date > .wrangler/state/probe/t.txt $ grep -c "change detected" celld.log 1 # rebuild + restart ```
So the ignore list works as documented for `.celld` — DO creation writes plenty of state there and correctly triggers nothing. The gap is specifically that `.wrangler/` is treated as source.
## Why this bites in practice
A Worker project being tested on both runtimes typically runs `wrangler dev --persist-to .wrangler/state` and `celld dev` in the same working tree. Two ways that breaks:
1. Running the two phases in sequence — the wrangler phase's writes land in `.wrangler/state`, and if celld is still up (or comes up while anything is still flushing), it restarts. 2. `workerd` child processes that outlive the wrangler phase keep writing to `.wrangler/state` afterwards. In our case this restarted celld 2–3 times per run, which silently corrupted a test asserting real DO `alarm()` timing — the assertion was being evaluated across isolate teardowns.
We worked around it by relocating `--persist-to` and our logs outside the project tree, and by adding an assertion that fails any run whose celld log contains `change detected`. Both are fine as workarounds, but they only exist because the watch scope can't be narrowed.
To be clear about attribution: the *trigger* in our case was our own leaked `workerd` processes, which is our bug and we fixed it. The reportable part is that a project can't tell celld to stop watching a directory that isn't source.
## Suggested fix, in rough order of preference
1. **Add `.wrangler` to the default ignore list.** It's the state directory of the tool whose config format celld reads, so it's very likely to be present and is never source. 2. **Support an ignore list** — a `--watch-ignore` flag, a `.celldignore` file, or honoring `.gitignore`. This generalizes past `.wrangler` (build output dirs, coverage, editor scratch). 3. **Add `--no-watch`** so a CI/acceptance run can opt out of rebuild-on-change entirely. For a non-interactive test run, watching has no upside and only adds a failure mode.
(1) alone would resolve the concrete case; (2) or (3) would make it robust for projects with other non-source directories.
## Environment
- celld 0.4.0, `aarch64-apple-darwin` - Project config: `wrangler.jsonc` with a SQLite-backed Durable Object, an R2 bucket binding, and static assets - `celld dev --help` in 0.4.0 lists only `--host`, `--port`, `--logs` — no watch-related options
bartlomiejuassigned bartlomieju2 months ago on GitHub
- BA
Thanks, this will be released in the next release this week.
bartlomiejureferenced fd7b96b993f52 months ago on GitHub
bartlomiejureferenced b61356b29deb2 months ago on GitHub
bartlomiejureferenced 7ac68e0bd2a72 months ago on GitHub
bartlomiejureferenced 10cb1303dac72 months ago on GitHub