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
2 changes: 1 addition & 1 deletion .github/nanoforge.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"commitFormat": "chore: release @nanoforge-dev/loader@{version}"
}
],
"docs": { "category": "cli" }
"docs": { "category": "loader" }
}
2 changes: 0 additions & 2 deletions docs/docs/loader/2-client.mdx → docs/docs/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Client
description: Bun HTTP server that serves the browser-side of a NanoForge project
---

import { Tooltip } from "mintlify/components";

## Overview

`loader-client` is a Bun HTTP server that bridges the browser and the compiled game client. It serves the `loader-website` frontend, exposes the game file manifest, delivers the compiled game assets, and forwards environment variables to the browser. It is the single entry point for everything the player's browser contacts.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/navigation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["overview", "client", "website", "server"]
8 changes: 3 additions & 5 deletions docs/docs/loader/1-overview.mdx → docs/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Loader
description: Overview of the @nanoforge-dev/loader packages
---

import { Card, CardGroup } from "mintlify/components";

## What is the Loader?

The NanoForge Loader is the runtime layer that starts a NanoForge project. It is invoked by the [NanoForge CLI](https://github.com/NanoForge-dev/CLI) when you run `nf start`, and handles both sides of a game simultaneously: the **client side** delivered to the browser and the **server side** running in Bun.
Expand Down Expand Up @@ -40,15 +38,15 @@ npx loader-server --dir .nanoforge/server
## Packages

<CardGroup cols={2}>
<Card title="loader-client" href="./2-client">
<Card title="loader-client" href="./client">
Bun HTTP server that serves the loader website and the compiled client game files. Exposes the
manifest, environment variables, and game assets. Supports HTTPS and hot-reload.
</Card>
<Card title="loader-website" href="./3-website">
<Card title="loader-website" href="./website">
Browser application bundled as static assets. Displays the loading screen, downloads and caches
game files via the browser Origin Private File System, then bootstraps the game.
</Card>
<Card title="loader-server" href="./4-server">
<Card title="loader-server" href="./server">
Bun process that runs the server-side game code in an isolated worker process. Supports
live-reload by restarting the worker on file changes.
</Card>
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/loader/4-server.mdx → docs/docs/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Server
description: Bun process that runs the server-side game code of a NanoForge project
---

import { Tooltip } from "mintlify/components";

## Overview

`loader-server` is a Bun process that runs the compiled server-side game code. It scans a built game directory, locates `/main.js`, then forks an isolated child process — the worker — that loads the game and calls its exported `main()` function. The parent process manages the worker lifecycle and restarts it when files change in watch mode.
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/loader/3-website.mdx → docs/docs/website.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Website
description: Browser application that loads and bootstraps a NanoForge game
---

import { Tooltip } from "mintlify/components";

## Overview

`loader-website` is a browser application (HTML + TypeScript) bundled as static assets and served by `loader-client`. It is the loading screen the player sees before the game starts. It fetches the game's file list from the server, downloads and caches each file locally in the browser, then dynamically imports the game entry point and starts it.
Expand Down
Loading