diff --git a/.github/ISSUE_TEMPLATE/01-command_bug_report.yml b/.github/ISSUE_TEMPLATE/01-command_bug_report.yml index dbd86aa..f00298d 100644 --- a/.github/ISSUE_TEMPLATE/01-command_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01-command_bug_report.yml @@ -50,7 +50,7 @@ body: description: List necessary versions here. This includes your package version, runtime version, operating system etc. placeholder: | - @nanoforge-dev/loader-client 1.0.0 (`npm ls @nanoforge-dev/loader-client`) - - Node.js 25.x.x (`node --version`) + - Node.js 26.x.x (`node --version`) - TypeScript 5.9.3 (`npm ls typescript` if you use it) - macOS Ventura 13.3.1 validations: diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 61fe548..5263756 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -17,7 +17,7 @@ runs: name: Install Node.js uses: actions/setup-node@v6 with: - node-version: 25 + node-version-file: .nvmrc package-manager-cache: false registry-url: https://registry.npmjs.org diff --git a/.nvmrc b/.nvmrc index a682cfb..4aa0e0a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v25 +v26 diff --git a/README.md b/README.md index f4e8206..f338360 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository contains the Loader of NanoForge. Check [releases][github-releases] to see versions of the Loader. NanoForge is a powerful game engine for web browsers. -The Loader is the runtime layer invoked by the [NanoForge CLI][cli-source] when you run `nf start`. It handles both sides of a NanoForge project simultaneously: the **client side** served to the browser and the **server side** running in Node.js. +The Loader is the runtime layer invoked by the [NanoForge CLI][cli-source] when you run `nf start`. It handles both sides of a NanoForge project simultaneously: the **client side** served to the browser and the **server side** running in Bun. ## Usage @@ -47,7 +47,7 @@ nf start This monorepo provides three packages, each fulfilling a distinct role at runtime. - `loader-client` : Bun HTTP server that serves the browser loader UI and the compiled client game files. The entry point for everything the browser sees. -- `loader-server` : Node.js process that runs the compiled server game files in an isolated worker. The entry point for the server-side game logic. +- `loader-server` : Bun process that runs the compiled server game files in an isolated worker. The entry point for the server-side game logic. - `loader-website` : Browser application bundled as a static asset. Displays the loading screen, caches game files in the browser and bootstraps the game. ### `@nanoforge-dev/loader-client` @@ -73,7 +73,7 @@ The client loader is a Bun HTTP server that bridges the browser and the compiled ### `@nanoforge-dev/loader-server` -The server loader is a Node.js process that runs the server-side game code. It: +The server loader is a Bun process that runs the server-side game code. It: - Scans the game server directory for compiled files - Forks an isolated worker that requires `/main.js` and calls its exported `main()` function diff --git a/apps/client/package.json b/apps/client/package.json index fb2db9b..e0a975d 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -68,7 +68,7 @@ }, "packageManager": "pnpm@11.5.1", "engines": { - "node": "25" + "node": "26" }, "publishConfig": { "access": "public" diff --git a/apps/server/README.md b/apps/server/README.md index 8d572fb..57debb3 100644 --- a/apps/server/README.md +++ b/apps/server/README.md @@ -18,7 +18,7 @@ This package contains the Server Loader of NanoForge. It is part of the [NanoForge Loader][loader-source] monorepo. Check [releases][github-releases] to see versions. NanoForge is a powerful game engine for web browsers. -The server loader is a Node.js process that runs the server-side game code of a NanoForge project. It scans a compiled game directory, then forks an isolated worker process that loads `main.js` and calls its exported `main()` function. +The server loader is a Bun process that runs the server-side game code of a NanoForge project. It scans a compiled game directory, then forks an isolated worker process that loads `main.js` and calls its exported `main()` function. ## Usage diff --git a/apps/server/package.json b/apps/server/package.json index bd74cfb..7237852 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -44,9 +44,9 @@ "funding": "https://github.com/NanoForge-dev/Loader?sponsor", "scripts": { "build": "pnpm run build:server && pnpm run build:worker", - "build:server": "bun build src/server.ts --outdir dist --target node", - "build:worker": "bun build src/worker.ts --outdir dist --target node", - "start": "node dist/server.js", + "build:server": "bun build src/server.ts --outdir dist --target bun", + "build:worker": "bun build src/worker.ts --outdir dist --target bun", + "start": "bun run dist/server.js", "lint": "prettier --check . && eslint --format=pretty src", "format": "prettier --write . && eslint --fix --format=pretty src", "prepack": "pnpm run build && pnpm run lint", @@ -54,6 +54,7 @@ "release": "cliff-jumper" }, "dependencies": { + "bun": "catalog:core", "commander": "catalog:core" }, "devDependencies": { @@ -61,18 +62,23 @@ "@nanoforge-dev/utils-eslint-config": "catalog:lint", "@nanoforge-dev/utils-prettier-config": "catalog:lint", "@trivago/prettier-plugin-sort-imports": "catalog:lint", - "bun": "catalog:core", + "@types/bun": "catalog:core", "eslint": "catalog:lint", "prettier": "catalog:lint", "typescript": "catalog:build" }, "packageManager": "pnpm@11.5.1", "engines": { - "node": "25" + "node": "26" }, "publishConfig": { "access": "public" }, + "pnpm": { + "allowBuilds": { + "bun": true + } + }, "lint-staged": { "**": [ "prettier --ignore-unknown --write" diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json index 9e6d724..33abe00 100644 --- a/apps/server/tsconfig.json +++ b/apps/server/tsconfig.json @@ -1,6 +1,9 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["bun"] + }, "include": ["src/**/*.ts"], "exclude": ["node_modules", "dist"] } diff --git a/apps/website/package.json b/apps/website/package.json index e7313f0..a8ae585 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -53,7 +53,7 @@ }, "packageManager": "pnpm@11.5.1", "engines": { - "node": "25" + "node": "26" }, "publishConfig": { "access": "public" diff --git a/docs/docs/loader/1-overview.mdx b/docs/docs/loader/1-overview.mdx index ca34b33..0c03bab 100644 --- a/docs/docs/loader/1-overview.mdx +++ b/docs/docs/loader/1-overview.mdx @@ -7,12 +7,12 @@ 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 Node.js. +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. The Loader is a monorepo of three packages, each with a distinct responsibility at runtime: - **`loader-client`** — the Bun HTTP server that serves the browser with the loader UI and the compiled game files. -- **`loader-server`** — the Node.js process that runs the compiled server game code in an isolated worker. +- **`loader-server`** — the Bun process that runs the compiled server game code in an isolated worker. - **`loader-website`** — the browser application that displays the loading screen, caches game files locally, and bootstraps the game. The NanoForge CLI orchestrates all three; as a game developer you never interact with these packages directly. @@ -49,7 +49,7 @@ npx loader-server --dir .nanoforge/server game files via the browser Origin Private File System, then bootstraps the game. - Node.js process that runs the server-side game code in an isolated worker process. Supports + Bun process that runs the server-side game code in an isolated worker process. Supports live-reload by restarting the worker on file changes. diff --git a/docs/docs/loader/4-server.mdx b/docs/docs/loader/4-server.mdx index 5387d07..a9af398 100644 --- a/docs/docs/loader/4-server.mdx +++ b/docs/docs/loader/4-server.mdx @@ -1,13 +1,13 @@ --- title: Server -description: Node.js process that runs the server-side game code of a NanoForge project +description: Bun process that runs the server-side game code of a NanoForge project --- import { Tooltip } from "mintlify/components"; ## Overview -`loader-server` is a Node.js 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. +`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. ## Usage diff --git a/package.json b/package.json index 2b8f073..7ef5920 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ }, "packageManager": "pnpm@11.5.1", "engines": { - "node": "25" + "node": "26" }, "private": true, "lint-staged": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32c7dfa..7e3dda8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ catalogs: specifier: ^1.3.14 version: 1.3.14 '@types/node': - specifier: ^25.9.2 - version: 25.9.2 + specifier: ^26.6.2 + version: 26.6.2 bun: specifier: ^1.3.14 version: 1.3.14 @@ -67,7 +67,7 @@ importers: devDependencies: '@commitlint/cli': specifier: catalog:ci - version: 21.0.2(@types/node@25.9.2)(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.4.0)(typescript@6.0.3) + version: 21.0.2(@types/node@26.6.2)(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.4.0)(typescript@6.0.3) '@commitlint/config-conventional': specifier: catalog:ci version: 21.0.2 @@ -88,7 +88,7 @@ importers: version: 1.3.14 '@types/node': specifier: catalog:core - version: 25.9.2 + version: 26.6.2 eslint: specifier: catalog:lint version: 10.4.1(jiti@2.6.1) @@ -147,6 +147,9 @@ importers: apps/server: dependencies: + bun: + specifier: catalog:core + version: 1.3.14 commander: specifier: catalog:core version: 15.0.0 @@ -163,7 +166,7 @@ importers: '@trivago/prettier-plugin-sort-imports': specifier: catalog:lint version: 6.0.2(prettier@3.8.3) - bun: + '@types/bun': specifier: catalog:core version: 1.3.14 eslint: @@ -785,6 +788,9 @@ packages: '@types/node@25.9.2': resolution: {integrity: sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==} + '@types/node@26.6.2': + resolution: {integrity: sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==} + '@typescript-eslint/eslint-plugin@8.60.1': resolution: {integrity: sha512-JQ4S5GB0tfjO8BuJ4fcX+HodkzJjYBV+7OJ+wLygaX7OGQ7FudyHL4NSCA6ob+w3Yn+5MkKIozOwQhXeM7opVg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1215,6 +1221,7 @@ packages: git-raw-commits@5.0.1: resolution: {integrity: sha512-Y+csSm2GD/PCSh6Isd/WiMjNAydu0VBiG9J7EdQsNA5P9uXvLayqjmTsNlK5Gs9IhblFZqOU0yid5Il5JPoLiQ==} engines: {node: '>=18'} + deprecated: Deprecated and no longer maintained. Use @conventional-changelog/git-client instead. hasBin: true glob-parent@6.0.2: @@ -1608,6 +1615,9 @@ packages: undici-types@7.24.6: resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + undici-types@8.9.0: + resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==} + undici@6.26.0: resolution: {integrity: sha512-4yqz8a3n5HmGTlsbADNtr/dJlhkh/55Rq798G6ibiULcXbDtaLpTl1pvdqcbFfeoj3iSi52lePFM7h9H21cw/A==} engines: {node: '>=18.17'} @@ -1744,11 +1754,11 @@ snapshots: '@babel/helper-string-parser': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@commitlint/cli@21.0.2(@types/node@25.9.2)(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.4.0)(typescript@6.0.3)': + '@commitlint/cli@21.0.2(@types/node@26.6.2)(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.4.0)(typescript@6.0.3)': dependencies: '@commitlint/format': 21.0.1 '@commitlint/lint': 21.0.2 - '@commitlint/load': 21.0.2(@types/node@25.9.2)(typescript@6.0.3) + '@commitlint/load': 21.0.2(@types/node@26.6.2)(typescript@6.0.3) '@commitlint/read': 21.0.2(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.4.0) '@commitlint/types': 21.0.1 tinyexec: 1.2.4 @@ -1793,14 +1803,14 @@ snapshots: '@commitlint/rules': 21.0.2 '@commitlint/types': 21.0.1 - '@commitlint/load@21.0.2(@types/node@25.9.2)(typescript@6.0.3)': + '@commitlint/load@21.0.2(@types/node@26.6.2)(typescript@6.0.3)': dependencies: '@commitlint/config-validator': 21.0.1 '@commitlint/execute-rule': 21.0.1 '@commitlint/resolve-extends': 21.0.1 '@commitlint/types': 21.0.1 cosmiconfig: 9.0.1(typescript@6.0.3) - cosmiconfig-typescript-loader: 6.3.0(@types/node@25.9.2)(cosmiconfig@9.0.1(typescript@6.0.3))(typescript@6.0.3) + cosmiconfig-typescript-loader: 6.3.0(@types/node@26.6.2)(cosmiconfig@9.0.1(typescript@6.0.3))(typescript@6.0.3) es-toolkit: 1.47.0 is-plain-obj: 4.1.0 picocolors: 1.1.1 @@ -2207,6 +2217,10 @@ snapshots: dependencies: undici-types: 7.24.6 + '@types/node@26.6.2': + dependencies: + undici-types: 8.9.0 + '@typescript-eslint/eslint-plugin@8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.6.1))(typescript@6.0.3))(eslint@10.4.1(jiti@2.6.1))(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -2426,9 +2440,9 @@ snapshots: conventional-commits-parser: 6.4.0 meow: 13.2.0 - cosmiconfig-typescript-loader@6.3.0(@types/node@25.9.2)(cosmiconfig@9.0.1(typescript@6.0.3))(typescript@6.0.3): + cosmiconfig-typescript-loader@6.3.0(@types/node@26.6.2)(cosmiconfig@9.0.1(typescript@6.0.3))(typescript@6.0.3): dependencies: - '@types/node': 25.9.2 + '@types/node': 26.6.2 cosmiconfig: 9.0.1(typescript@6.0.3) jiti: 2.6.1 typescript: 6.0.3 @@ -3031,6 +3045,8 @@ snapshots: undici-types@7.24.6: {} + undici-types@8.9.0: {} + undici@6.26.0: {} unicorn-magic@0.3.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8ecbdcc..1a7af62 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,7 +17,7 @@ catalogs: lint-staged: ^17.0.7 core: '@types/bun': ^1.3.14 - '@types/node': ^25.9.2 + '@types/node': ^26.6.2 bun: ^1.3.14 commander: ^15.0.0 lint: