A simple starter project for Roku, with:
- Useful VSCode defaults
- roku-deploy for packaging/deploying
- brighterscript-formatter for formatting
- brighterscript and @rokucommunity/bslint for code validation
Using Node 12+
npm install
This will set a few useful files:
.env
: to edit to configure your Roku device and password.vscode/*
: launch script, settings
bsconfig.json
: choose which files go into your Roku packagebsfmt.json
: formatter options- linting options
Format your .brs
code
npm run format # dry run
npm run format:write
Run on device
npm run dev
(or just Run > Start debugging in VSCode)
npm run lint
Change bslint
default rules in bslint.json
.
Still, sometimes you need to ignore false positives, or exclude 3rd party code from linting:
- diagnosticFilters in
bsconfig.json
to filter errors (after they are collected), - ignores in
bslint.json
to skip files from advanced linting
You can also add inline comments ' bs:disable-...
to ignore errors and warnings on a per-line basis.
Prepare package:
npm run build
npm run build:prod
Install/sign on device:
npm run deploy "out/Roku-Starter-roku-production-0.0.123.zip"
npm run sign "out/Roku-Starter-roku-production-0.0.123.zip"
TODO: add option to rekey the device before signing
Maybe you want to go to the next step and embrace a richer language?
Check https://github.com/rokucommunity/brighterscript#overview
TODO: instructions to upgrade