Skip to content

Installation

idadwind edited this page Sep 22, 2026 · 2 revisions

Installation and development

Use Node.js 22 or newer for development. Browser rendering requires Canvas; 3D views require WebGL2.

From the repository root:

npm install
npm run build

Install the built library into another application:

npm install /absolute/path/to/your-checkout

For a portable archive, run npm pack in the engine repository, then install the resulting archive in the consuming app:

npm install /absolute/path/to/webnim-math-engine-0.1.0.tgz

These instructions use a local checkout or archive; they do not assume the package has been published to a registry. Rebuild the library after changing its source.

Repository commands

Command, from the repository root Purpose
npm run build Compile TypeScript and copy stylesheet, font and schema assets
npm test Build and run the engine's automated tests
npm run test:package Verify a packed installation, TypeScript consumer and browser bundle
npm run demo Build the engine, install demo dependencies, build the site and start its server
npm pack Build and create an installable package archive

The demo is a separate private app in demo/. It imports public package entry points and is excluded from the published engine package. Open http://localhost:1431 after npm run demo. Stop with Ctrl+C; rerun to rebuild changes. This command does not provide live reload.

Public entry points

Import Use
webnim/document Scene types, compiler, evaluator, schema and capability lists
webnim/browser Browser player and player types
webnim/browser/style.css Math label styles and packaged font references
webnim/scene-v1.schema.json Structural JSON schema
webnim Older Engine, SceneBuilder, factories and helpers
webnim/react Optional Stage adapter for the older scene/frame API
webnim/react/style.css Styles for that React adapter

React is an optional peer dependency. KaTeX, Three.js, AJV and polygon-clipping are package dependencies. A React application can also mount the document player directly in a DOM container.


Wiki home · Quick start

Clone this wiki locally