Development

This page is for working on tosijs itself. To use it, start at Start Here.

You'll need bun (the version in .bun-version), then bun install.

bun start                  # dev server with hot reload (https://localhost:8018)
bun test                   # run the unit tests
bun run test:browser       # run the real-browser tests (Chromium and Firefox)
bun run build              # production build (runs tests, then bundles + docs)
bun run format             # lint and format (ESLint + Prettier)
bun pack                   # create a local package tarball

The dev server uses HTTPS and needs local certificates: run bun run tls once.

Two switches for the dev server:

The documentation you are reading is built from this repository: the markdown files at the top level and in src/docs/, and the /*# … */ comment blocks in the source files. Code fences tagged js, html, css or test in those are live examples and run in the page.