Entry points
Import only from these. Anything not listed is the library's own and may change.
| Import from | For | Most used | Reference |
|---|---|---|---|
@v12-engine/engine | Your rules: world, units, orders, hooks, sessions, maps, saves | createGame, Rules, World, createMap, parseMap, defineIds, connect | engine |
@v12-engine/engine/ai | Computer players: the kit and the brains | defineBrain, meleeBrain | engine-ai |
@v12-engine/engine/server | A server in Node | startServer, GameServer, GameRooms | engine-server |
@v12-engine/engine/testing | Tests, and many games in worker threads | testWorld, fixtureGame, order, run, simulate | engine-testing |
@v12-engine/engine/debug | Debug commands, the inspector, self-checks | debugCommands, defineDebugCommand, setDebugChecks | engine-debug |
@v12-engine/client | A game on a page, and what a view is written with | launch, loadGame, GameView, createLobby | client |
@v12-engine/client/app | An app of scenes: menus, campaigns, replays, servers | startApp, defineCampaign, onlineScene | client-app |
@v12-engine/editor | The map editor | openEditor, EditorClient | editor |
@v12-engine/client/testing | Tests of cinematics, hooks and HUD parts with no page | stepCinematic, testStage, testClient, scriptedSession, fake | client-testing |
@v12-engine/client/kit | Interface components, and what floats over the game | useOverlays, createOverlays, Button | client-kit |
@v12-engine/client/hud | The HUD's parts, to put together your own way | client-hud | |
@v12-engine/client/debug | The debug panel, console and stats | DebugPanel, LogConsole, PerfList | client-debug |
@v12-engine/client/lite-views | Drawing a world your own way: the views, camera, picking, the kit | createLiteWorldView, RtsCamera, createDrawKit | client-lite-views |
@v12-engine/client/ground | Ground textures in a worker (serveGroundTextures) | client-ground | |
@v12-engine/client/campaign-worker | A campaign's missions in a worker (serveCampaign) | client-campaign-worker | |
@v12-engine/client/looks-file | Unit looks kept as a file the editor writes | client-looks-file | |
@v12-engine/client/vite | Vite plugin that serves the shared art and copies what a build uses | assetsPackage | client-vite |
@v12-engine/editor/vite | Vite plugin that keeps maps and assets in the project | editorFiles | editor-vite |
Stylesheets: @v12-engine/client/styles.css (the interface), @v12-engine/client/tailwind.css (the same, for a project with its own Tailwind), @v12-engine/editor/styles.css (the editor), @v12-engine/client/fonts.css (the theme's typefaces, as files).
What is stable
Each entry point's API is kept in a report (packages/*/api/*.api.md), checked on every change. Every name is tagged:
| Tag | Promise |
|---|---|
public | Stable. Breaking it is a major version. |
beta | May change in a minor version. Every name is beta today. |
internal | No promise. Left out of the published types and the reference. |
@v12-engine/client/internal is what the editor takes from the client; it promises nothing and isn't in the reference.
The reference
The API reference is generated from doc comments: npm run docs:api makes it, npm run docs:dev or docs:build shows it.