0.45.0 • Published 3 years ago

brs v0.45.0

Weekly downloads
6,409
License
MIT
Repository
github
Last release
3 years ago

BRS: Off-Roku BrightScript

An interpreter for the BrightScript language that runs on non-Roku platforms.

CircleCI NPM Version

Installation

The BRS project is published as a node package, so use npm:

$ npm install -g brs

or yarn if that's your preference:

$ yarn global add brs

Usage

This repo provides the brs executable, which operates in two ways.

REPL

An interactive BrightScript REPL (Read-Execute-Print Loop) is available by running brs with no arguments, e.g.:

$ brs
brs> ?"Dennis Ritchie said ""Hello, World!"""
Dennis Ritchie said "Hello, World!"

Quit by entering ^D (Control-D).

Executing a file

BRS can execute an arbitrary BrightScript file as well! Simply pass the file to the brs executable, e.g.:

$ cat hello-world.brs
?"Dennis Ritchie said ""Hello, World!"""

$ brs hello-world.brs
Dennis Ritchie said "Hello, World!"

Sure, but why?

The Roku series of media streaming devices are wildly popular amongst consumers, and several very popular streaming services offer Channels for the Roku platform. Unfortunately, Roku chanels must be written in a language called BrightScript, which is only executable directly on a Roku device. BRS hopes to change that by allowing Roku developers to test their code on their own machines, thus improving the quality of their channels and the end-user's experience as a whole.

So can I use this to watch TV without a Roku?

Nope! The BRS project currently has no intention of emulating the Roku user interface, integrating with the Roku store, or emulating content playback. In addition to likely getting this project in legal trouble, that sort of emulation is a ton of work. BRS isn't mature enough to be able to sustain that yet.

Building from source

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

Prerequisites

BRS builds (and runs) 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/sjbarag/brs.git
  2. Install dependencies:

    $ yarn install     # or just `yarn`
  3. Get brs onto your PATH:

    $ yarn link

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/ and types/ respectively.

$ yarn build

$ ls lib/
index.js (and friends)

$ ls types/
index.d.ts (and friends)

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.

Cleaning

Compiled output in lib/ and types/ can be removed with the clean target:

$ yarn clean

$ ls lib/
ls: cannot access 'lib': No such file or directory

$ ls types/
ls: cannot access 'types': No such file or directory

All Together

Thanks to the npm-run-all package, it's trivially easy to combine these into a sequence of tasks without relying on shell semantics:

$ yarn run-s clean build test
0.45.0

3 years ago

0.44.1

3 years ago

0.44.0

3 years ago

0.43.0

4 years ago

0.42.0

4 years ago

0.41.0

4 years ago

0.40.0

4 years ago

0.40.1

4 years ago

0.39.0

4 years ago

0.38.0

4 years ago

0.37.0

4 years ago

0.36.0

4 years ago

0.35.0

4 years ago

0.34.0

4 years ago

0.33.1

4 years ago

0.33.0

4 years ago

0.32.0

4 years ago

0.31.0

4 years ago

0.30.0

4 years ago

0.29.0

4 years ago

0.28.0

4 years ago

0.27.0

4 years ago

0.26.1

4 years ago

0.26.0

4 years ago

0.25.1

4 years ago

0.25.0

4 years ago

0.24.1

4 years ago

0.24.0

4 years ago

0.23.0

4 years ago

0.22.0

4 years ago

0.21.0

5 years ago

0.20.0

5 years ago

0.19.0

5 years ago

0.18.4

5 years ago

0.18.3

5 years ago

0.18.2

5 years ago

0.18.1

5 years ago

0.18.0

5 years ago

0.17.6

5 years ago

0.17.5

5 years ago

0.17.4

5 years ago

0.17.3

5 years ago

0.17.2

5 years ago

0.17.1

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

6 years ago

0.13.0-rc.3

6 years ago

0.13.0-rc.2

6 years ago

0.13.0-rc

6 years ago

0.13.0-beta.2

6 years ago

0.13.0-beta.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.1

7 years ago

0.6.1-alpha

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago