The brs-engine project follows pretty standard node
development patterns, with the caveat that it uses yarn
for dependency management.
As it builds (and runs the CLI) in node
, so you'll need to install that first.
Once that's ready, install yarn. Installing it with npm
is probably the simplest:
$ npm install -g yarn
-
Clone this repo:
$ git clone https://github.com/lvcabral/brs-engine.git
-
Install dependencies:
$ yarn install # or just `yarn`
This project is written in TypeScript, so it needs to be compiled before it can be executed. yarn build
compiles files in src/
into JavaScript and TypeScript declarations, and puts them in lib/
, bin/
and types/
.
$ yarn build
$ ls app/lib/
brs.api.js
brs.worker.js
$ ls bin/
brs.cli.js
$ ls types/
index.d.ts (and friends)
To release a smaller version of the libraries Webpack can create a minified version by running yarn release
.
To build and start the web application on your default browser just execute yarn start
.
Tests are written in plain-old JavaScript with Facebook's Jest, and can be run with the test
target:
$ yarn test
# tests start running
Note that only test files ending in .test.js
will be executed by yarn test
.
If you need to update the snapshots use the command: npx jest --updateSnapshot
Compiled output in lib/
, bin/
and types/
can be removed with the clean
target:
$ yarn clean
$ ls lib/
ls: cannot access 'lib': No such file or directory
$ ls bin/
ls: cannot access 'bin': No such file or directory
$ ls types/
ls: cannot access 'types': No such file or directory