Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <port>` | `3000` | Port the HTTP server listens on |
| `-d, --dir <dir>` | `.nanoforge/client` | Directory of compiled client game files |
| `--watch` | `false` | Enable file watcher and browser hot-reload |
| `--watch-port <port>` | auto | Port for the WebSocket watch server |
| `--watch-server-dir <dir>` | — | Also watch a server game directory for changes |
| `--cert <file>` | — | TLS certificate file (enables HTTPS) |
| `--key <file>` | — | TLS private key file (enables HTTPS) |
| Option | Default | Description |
| -------------------------- | -------- | ---------------------------------------------- |
| `-p, --port <port>` | `3000` | Port the HTTP server listens on |
| `-d, --dir <dir>` | required | Directory of compiled client game files |
| `--watch` | `false` | Enable file watcher and browser hot-reload |
| `--watch-port <port>` | auto | Port for the WebSocket watch server |
| `--watch-server-dir <dir>` | — | Also watch a server game directory for changes |
| `--cert <file>` | — | TLS certificate file (enables HTTPS) |
| `--key <file>` | — | TLS private key file (enables HTTPS) |

### `@nanoforge-dev/loader-server`

Expand All @@ -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 <dir>` | `.nanoforge/server` | Directory of compiled server game files |
| `--watch` | `false` | Enable file watcher and worker restart on change |
| Option | Default | Description |
| ----------------- | -------- | ------------------------------------------------ |
| `-d, --dir <dir>` | required | Directory of compiled server game files |
| `--watch` | `false` | Enable file watcher and worker restart on change |

### `@nanoforge-dev/loader-website`

Expand Down
18 changes: 9 additions & 9 deletions apps/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ The client loader exposes the following HTTP routes:

## Options

| Option | Default | Description |
| -------------------------- | ------------------- | ---------------------------------------------- |
| `-p, --port <port>` | `3000` | Port the HTTP server listens on |
| `-d, --dir <dir>` | `.nanoforge/client` | Directory of compiled client game files |
| `--watch` | `false` | Enable file watcher and browser hot-reload |
| `--watch-port <port>` | auto | Port for the WebSocket watch server |
| `--watch-server-dir <dir>` | — | Also watch a server game directory for changes |
| `--cert <file>` | — | TLS certificate file (enables HTTPS) |
| `--key <file>` | — | TLS private key file (enables HTTPS) |
| Option | Default | Description |
| -------------------------- | -------- | ---------------------------------------------- |
| `-p, --port <port>` | `3000` | Port the HTTP server listens on |
| `-d, --dir <dir>` | required | Directory of compiled client game files |
| `--watch` | `false` | Enable file watcher and browser hot-reload |
| `--watch-port <port>` | auto | Port for the WebSocket watch server |
| `--watch-server-dir <dir>` | — | Also watch a server game directory for changes |
| `--cert <file>` | — | TLS certificate file (enables HTTPS) |
| `--key <file>` | — | TLS private key file (enables HTTPS) |

## Watch Mode

Expand Down
10 changes: 5 additions & 5 deletions apps/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ The server loader runs in two processes:

## Options

| Option | Default | Description |
| ----------------- | ------------------- | ------------------------------------------------ |
| `-d, --dir <dir>` | `.nanoforge/server` | Directory of compiled server game files |
| `--watch` | `false` | Enable file watcher and worker restart on change |
| Option | Default | Description |
| ----------------- | -------- | ------------------------------------------------ |
| `-d, --dir <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

Expand Down
Loading