Skip to main content

Overview

The part-base schematic generates the foundational folder structure for a NanoForge client or server part. It creates example components and systems, the .nanoforge save file used to track ECS state, and optionally lifecycle init functions.

Usage

Options

Generated structure

Save file

The .nanoforge/{part}.save.json file is the source of truth for ECS state. It lists the libraries, components, systems, and entities registered for this part. The part-main schematic reads this file to generate the main.ts entry point.

Init functions

When initFunctions is true, the following lifecycle hooks are scaffolded:

Examples

Generate a TypeScript client part:
Generate a server part with init hooks:
Generate a JavaScript client in a specific directory: