nf build --watch wipes the browser server build on each client rebuild in p2p mode

Aperta
#278 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
bun, node.js, typescript
Ambito
build-system

Direzione di ricerca

Read src/action/actions/build.action.ts, especially the p2p browser server output configuration at lines 74–82 and the watch rebuild flow around resetOut at line 139. Trace how client and server targets are scheduled on rebuild, then check whether a client rebuild preserves or rebuilds the browser server output. Done means the server app remains available after client changes in watch mode.

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

In a peer-to-peer workspace (network: "p2p"), nf build --watch deletes the browser build of the server app every time the client rebuilds (read from the code, not run).

The browser server target writes into <client out>/server (src/action/actions/build.action.ts#L74-L82). In watch mode each target rebuilds on its own, and each rebuild first runs resetOut(target.output) (src/action/actions/build.action.ts#L139). A change under the client's entry folder therefore deletes <client out>/server. It only comes back when a file in the server's entry folder changes, so until then the host's browser loads the game without its server app.

#244 ordered the server build after the client build "since that one resets the output". That works for a one-off build, but not for watch rebuilds.

Expected: in p2p mode, a client rebuild is followed by a rebuild of the browser server targets (or a client rebuild leaves the server/ subfolder alone).

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

Code sample
output: relative(server.directory, join(client.directory, client.output, "server")),
// ...
const executeBuild = (rebuild = false) =>
  runSafe(() => { this.resetOut(target.output, target.directory); /* ... */ });
Versions
  • @nanoforge-dev/cli 3.0.1 (main, e95b881)
  • Node.js 26.7.0
  • Bun 1.3.14 (bundled)
  • Linux
Issue priority

Medium (should be fixed soon)

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.