Development

Development

This guide covers the development patterns and workflow, or how to build and test the engine.

Contents

Workflow

Building

Code is written in Typescript, built with make, and runs in Node 12+.

Run make build to compile into out/.

Testing

Tests are written using Mocha, with Chai assertions and Sinon mocks/stubs/spies.

Run make test to run tests (Mocha by itself). Run make cover to run tests under nyc, and collect coverage reports into out/coverage/lcov-report/index.html.

Running

The engine can be run from make or docker with the demo data.

Run make run to run the game normally. Run make run-image to run the latest docker image (may pull the image).

Debugging

The engine has a few builtin debug commands, which can be run from within the game:

Run graph out/debug-graph in the game, then make graph normally to render the world tree.

Run make debug to run the engine and wait for a Chrome inspector to be attached.

Patterns