Skip to main content

TypeScript Development

The TypeScript implementation lives in typescript/. It uses pnpm as the package manager and Vite (library mode) for building.

Setup

cd typescript
pnpm install

Testing

pnpm test

Build

pnpm build

This produces dual ESM and CJS outputs in dist/, along with rolled-up TypeScript declaration files. Two entry points are emitted:

  • covertable — the core make / makeAsync API.
  • covertable/pict — the PictModel class and weightsByValue helper, in a separate chunk so consumers who do not need PICT support do not pay for it.

Publish

# pnpm login
pnpm build
pnpm version patch
pnpm publish