diff --git a/README.md b/README.md index f338360..866c963 100644 --- a/README.md +++ b/README.md @@ -61,15 +61,15 @@ The client loader is a Bun HTTP server that bridges the browser and the compiled - Supports HTTPS/TLS via `--cert` and `--key` - Supports hot-reload via WebSocket watch mode (`--watch`) -| Option | Default | Description | -| -------------------------- | ------------------- | ---------------------------------------------- | -| `-p, --port ` | `3000` | Port the HTTP server listens on | -| `-d, --dir ` | `.nanoforge/client` | Directory of compiled client game files | -| `--watch` | `false` | Enable file watcher and browser hot-reload | -| `--watch-port ` | auto | Port for the WebSocket watch server | -| `--watch-server-dir ` | — | Also watch a server game directory for changes | -| `--cert ` | — | TLS certificate file (enables HTTPS) | -| `--key ` | — | TLS private key file (enables HTTPS) | +| Option | Default | Description | +| -------------------------- | -------- | ---------------------------------------------- | +| `-p, --port ` | `3000` | Port the HTTP server listens on | +| `-d, --dir ` | required | Directory of compiled client game files | +| `--watch` | `false` | Enable file watcher and browser hot-reload | +| `--watch-port ` | auto | Port for the WebSocket watch server | +| `--watch-server-dir ` | — | Also watch a server game directory for changes | +| `--cert ` | — | TLS certificate file (enables HTTPS) | +| `--key ` | — | TLS private key file (enables HTTPS) | ### `@nanoforge-dev/loader-server` @@ -80,10 +80,10 @@ The server loader is a Bun process that runs the server-side game code. It: - Passes all game files and `NANOFORGE_*` environment variables to the game - Restarts the worker on file changes when `--watch` is enabled -| Option | Default | Description | -| ----------------- | ------------------- | ------------------------------------------------ | -| `-d, --dir ` | `.nanoforge/server` | Directory of compiled server game files | -| `--watch` | `false` | Enable file watcher and worker restart on change | +| Option | Default | Description | +| ----------------- | -------- | ------------------------------------------------ | +| `-d, --dir ` | required | Directory of compiled server game files | +| `--watch` | `false` | Enable file watcher and worker restart on change | ### `@nanoforge-dev/loader-website` diff --git a/apps/client/README.md b/apps/client/README.md index 7bd901f..ee5871f 100644 --- a/apps/client/README.md +++ b/apps/client/README.md @@ -58,15 +58,15 @@ The client loader exposes the following HTTP routes: ## Options -| Option | Default | Description | -| -------------------------- | ------------------- | ---------------------------------------------- | -| `-p, --port ` | `3000` | Port the HTTP server listens on | -| `-d, --dir ` | `.nanoforge/client` | Directory of compiled client game files | -| `--watch` | `false` | Enable file watcher and browser hot-reload | -| `--watch-port ` | auto | Port for the WebSocket watch server | -| `--watch-server-dir ` | — | Also watch a server game directory for changes | -| `--cert ` | — | TLS certificate file (enables HTTPS) | -| `--key ` | — | TLS private key file (enables HTTPS) | +| Option | Default | Description | +| -------------------------- | -------- | ---------------------------------------------- | +| `-p, --port ` | `3000` | Port the HTTP server listens on | +| `-d, --dir ` | required | Directory of compiled client game files | +| `--watch` | `false` | Enable file watcher and browser hot-reload | +| `--watch-port ` | auto | Port for the WebSocket watch server | +| `--watch-server-dir ` | — | Also watch a server game directory for changes | +| `--cert ` | — | TLS certificate file (enables HTTPS) | +| `--key ` | — | TLS private key file (enables HTTPS) | ## Watch Mode diff --git a/apps/server/README.md b/apps/server/README.md index 57debb3..d29d9bc 100644 --- a/apps/server/README.md +++ b/apps/server/README.md @@ -53,14 +53,14 @@ The server loader runs in two processes: ## Options -| Option | Default | Description | -| ----------------- | ------------------- | ------------------------------------------------ | -| `-d, --dir ` | `.nanoforge/server` | Directory of compiled server game files | -| `--watch` | `false` | Enable file watcher and worker restart on change | +| Option | Default | Description | +| ----------------- | -------- | ------------------------------------------------ | +| `-d, --dir ` | required | Directory of compiled server game files | +| `--watch` | `false` | Enable file watcher and worker restart on change | ## Watch Mode -When `--watch` is enabled, the loader watches the game directory recursively. On any file change, the running worker is killed and a new worker is immediately forked with a fresh state. Changes are debounced to 100 ms to avoid redundant restarts during bulk builds. +When `--watch` is enabled, the loader watches the game directory recursively. On any file change, the running worker is killed and a new worker is immediately forked with a fresh state. The first change restarts the worker, and further changes in the next 100 ms are ignored, so a burst of changes within that window causes one restart. ## Environment Variables