Skip to content

Latest commit

 

History

History
86 lines (53 loc) · 1.92 KB

build-from-source.md

File metadata and controls

86 lines (53 loc) · 1.92 KB

Building from Source

The brs-engine project follows pretty standard node development patterns, with the caveat that it uses yarn for dependency management.

Prerequisites

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

Setup

  1. Clone this repo:

    $ git clone https://github.com/lvcabral/brs-engine.git
  2. Install dependencies:

    $ yarn install     # or just `yarn`

The build-test-clean dance

Build

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)

Release

To release a smaller version of the libraries Webpack can create a minified version by running yarn release.

Running the Example Web Application

To build and start the web application on your default browser just execute yarn start.

Testing

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

Cleaning

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