Skip to main content

Overview

The project schematic generates a complete client or server project under directory (e.g. apps/client) inside a workspace: its own package.json, nanoforge.config.ts, tsconfig.json, example ECS component and system, src/main.ts entry point, and optionally a Dockerfile and lifecycle init functions. directory is the full destination path — it isn’t appended with part automatically, so generating a client and a server side by side means passing e.g. --directory=apps/client and --directory=apps/server in two separate invocations. For a standalone project (workspace: false), engine dependency versions are pinned to the newest release published at least 48h ago, mirroring pnpm’s own minimumReleaseAge supply-chain protection. @nanoforge-dev/ecs and @nanoforge-dev/network are resolved directly under those same names — no aliasing to a different registry package. A standalone project also generates its own allowBuilds config (pnpm-workspace.yaml’s allowBuilds map, package.json’s allowScripts or trustedDependencies, depending on packageManager) since it has no parent workspace root to provide one — see allowBuilds below. Engine packages are declared as devDependencies, except @nanoforge-dev/network on a server project, which is declared in dependencies because the server needs it at runtime. Every project gets @nanoforge-dev/cli, @nanoforge-dev/core, @nanoforge-dev/common, @nanoforge-dev/config, @nanoforge-dev/asset and @nanoforge-dev/ecs; a client project additionally gets @nanoforge-dev/env, @nanoforge-dev/graphics-2d, @nanoforge-dev/input and @nanoforge-dev/network. The engine packages (core, common, config, asset, env) share a single version, resolved from @nanoforge-dev/core.

Usage

Options

Generated structure

Examples

Generate a client project:
Generate a server project with Docker, syncing position with the client:
Generate a client that syncs its position from that server:
Generate a JavaScript client depending on a shared lib: