This document describes the process for setting up and running this package on your local computer.
This package is for Node.js.
You can install Node.js here, or if you are using Chocolatey run choco install nodejs
.
It runs on MacOS, Windows, and Linux environments.
It runs on many versions of Node.js, tested back to version 12.x.
ESLint is used for Typescript linting. To lint the Typescript code, run npm run lint
. To only lint for errors (excluding warnings), run npm run lint-errors-only
.
To build all of the Typescript code, run npm run build-ts
.
To build the Typescript code that is published to npm, run npm run build-ts-dist
.
Jest is used for unit testing. To build and run the unit tests, run npm run unit-tests
.
The unit tests can be debugged with Visual Studio Code by running the Run Unit Tests debug task.
An example app that fully demonstrates the usage of Verba is at ./examples/app.
To run the example:
- Clone repository:
git clone https://github.com/samhuk/verba.git && cd verba
- Install NPM dependencies:
npm i
- Run:
npm run example
- Alternatively, run the example app that errors to demonstrate error emission and handling:
npm run error-example
npm run check
- Useful to run before committing to check the full validity of a change. This runs linting, Typescript build, and unit tests.
Pull requests automatically run a CI pipeline that checks various criteria:
- Linting
- Typescript build
- Unit tests
These must pass for a pull request to be approved and merged.
Run npm run check
to check local validity of code.
Run npm run build-ts-dist
to build the Typescript code to produce the Javascript code that is published to npm.
Run npm publish
to publish to npm.