nf build --watch runs overlapping rebuilds and ignores new files

Aperta
#279 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
build-system, cli

Direzione di ricerca

Start with src/action/actions/build.action.ts, especially the watcher setup and executeBuild(true) calls linked in the issue; trace how resetOut interacts with builds for one target. Check the watcher paths for source and assets, then review or add coverage for overlapping saves, added files, deleted files, and asset changes. Done means rebuilds are serialized with at most one debounced pending run and all listed changes trigger one.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug command:build
Which package is this bug report for?

@nanoforge-dev/cli

Which command is this bug report for?

build

Issue description

nf build --watch (and so nf dev) can run several rebuilds of the same target at once, and it ignores new and deleted files (read from the code, not run).

chokidar's change events call executeBuild(true) directly, with no debounce and no queue (src/action/actions/build.action.ts#L158, src/action/actions/build.action.ts#L165-L167). A save that touches several files, or a format-on-save, starts overlapping builds. Each of them deletes the output folder (resetOut) while another one writes to it. Only change is watched, so adding (add) or deleting (unlink) a file doesn't trigger a rebuild, and neither does a change in the assets folder.

Expected: one rebuild at a time per target (at most one pending, debounced), triggered by add/unlink and by assets changes too.

Found during a read-only audit of main at e95b881 (2026-11-11).

Code sample
watch(watchPath).on("change", onChange);
Versions
  • @nanoforge-dev/cli 3.0.1 (main, e95b881)
  • Node.js 26.7.0
  • Bun 1.3.14 (bundled)
  • Linux
Issue priority

Low (slightly annoying)

I have tested this issue on a development release

No response

Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
2g 18h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NanoForge-dev/CLI

Tutte le issue di NanoForge-dev/CLI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.