This project uses Node.js to run, so make sure you have a version compatible with the one listed in .node-version.
Yarn is used to manage dependencies and run scripts. After cloning the repository you can use this command to install dependencies:
yarn- Run
yarn run asbuildto compile the WASM & generate typings for it - Run
yarn run buildto compile and bundle the regular source code into thedist/folder - Run
yarn run typesto generate the raw type declarations for the regular source code - Run
yarn run validate-api:localto generate the API report & bundled type declaration to thedist/folder
All files are formatted using Prettier.
You can check code style with this command:
yarn run styleYou can format files with this command:
yarn run style --writeXO (a wrapper around ESLint) is used to lint the source.
You can run the this command to lint the source:
yarn run lintYou can fix linting errors with this command:
yarn run lint --fixJest is used for unit testing.
Unit tests are stored in the test/ directory mirroring the structure of the source files (ex. src/config.ts would have test/config.test.ts).
You can run the tests with the test script:
yarn testYou can run tests in watch mode with this command:
yarn test --watchYou can collect test coverage by running this command:
yarn run test:coverageThis will generate a coverage folder which has a breakdown of coverage of the project.
The CI will upload the coverage information to CodeCov which can be viewed here.
Benchmarks are stored in the benchmark/ directory.
You can compile them by running this command:
yarn run build:benchmarksAnd can run them with
yarn run benchmarksor
node benchmark/dist/index.js