Package Exports
- roku-deploy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (roku-deploy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
roku-deploy
Publish Roku projects to a Roku device by using Node.js.
Installation
npm install roku-deployRequirements
Your project must be structured the way that Roku expects. The source files can be in a subdirectory (using the
rootDirconfig option), but whever your roku files exist, they must align with the following folder structure:components/
images/
source/
manifestYou should create a rokudeploy.json file at the root of your project that contains all of the overrides to the default options. roku-deploy will auto-detect this file and use it when possible.
sample rokudeploy.json
{
"host": "192.168.1.101",
"password": "securePassword"
}Usage
From a node script
var rokuDeploy = require('roku-deploy');
//deploy a .zip package of your project to a roku device
rokuDeploy.deploy({
host: 'ip-of-roku',
password: 'password for roku dev admin portal'
//other options if necessary
}).then(function(){
//it worked
}, function(error) {
//it failed
console.error(error);
});Or
//create a signed package of your project
rokuDeploy.deployAndSignPackage({
host: 'ip-of-roku',
password: 'password for roku dev admin portal',
signingPassword: 'signing password'
//other options if necessary
}).then(function(pathToSignedPackage){
console.log('Signed package created at ', pathToSignedPackage);
}, function(error) {
//it failed
console.error(error);
});From an npm script in package.json. (Requires rokudeploy.json to exist at the root level where this is being run)
{
"scripts": {
"deploy": "roku-deploy"
}
}You can provide a callback in any of the higher level methods, which allows you to modify the copied contents before the package is zipped. An info object is passed in with the following attributes
manifestData: [key: string]: string Contains all the parsed values from the manifest file
stagingFolderPath: string Path to staging folder to make it so you only need to know the relative path to what you're trying to modify
let options = { host: 'ip-of-roku', password: 'password for roku dev admin portal' //other options if necessary }; rokuDeploy.deploy(options, (info) => { //modify staging dir before it's zipped }).then(function(){ //it worked }, function(){ //it failed });
Options
Here are the available options. The defaults are shown to the right of the option name, but all can be overridden:
host: string (required)
The IP address or hostname of the target Roku device. Example:"192.168.1.21"password: string (required)
The password for logging in to the developer portal on the target Roku devicesigningPassword: string (required for signing)
The password used for creating signed packagesrekeySignedPackage: string (required for rekeying)
Path to a copy of the signed package you want to use for rekeyingdevId: string
Dev ID we are expecting the device to have. If supplied we check that the dev ID returned after keying matches what we expectedoutDir?: string =
"./out"
A full path to the folder where the zip/pkg package should be placedoutFile?: string =
"roku-deploy"
The base filename the zip/pkg file should be given (excluding the extension)rootDir?: string =
'./'
The root path to the folder holding your project. The manifest file should be directly underneath this folder. Use this option when your roku project is in a subdirectory of where roku-deploy is installed.files?: ( string | { src: string; dest: string; } ) [] =
[ "source/**/*.*", "components/**/*.*", "images/**/*.*", "manifest" ]An array of file paths, globs, or {src:string;dest:string} objects that will be copied into the deployment package.
Using the {src;dest} objects will allow you to move files into different destination paths in the deployment package. This would be useful for copying environment-specific configs into a common config location (i.e. copy from
"ProjectRoot\configs\dev.config.json"to"roku-deploy.zip\config.json"). Here's a sample://deploy configs/dev.config.json as config.json { "src": "configs/dev.config.json", "dest": "config.json" }
//you can omit the filename in dest if you want the file to keep its name. Just end dest with a trailing slash. { "src": "languages/english/language.xml", "dest": "languages/" }
This will result in the
[sourceFolder]/configs/dev.config.jsonfile being copied to the zip file and named"config.json".You can also provide negated globs (thanks to glob-all). So something like this would include all component files EXCEPT for specs.
files: [ 'components/**/*.*', '!components/**/*.spec.*' ]NOTE: If you override this "files" property, you need to provide all config values, as your array will completely overwrite the default.
retainStagingFolder?: boolean =
false
Set this to true to prevent the staging folder from being deleted after creating the package. This is helpful for troubleshooting why your package isn't being created the way you expected.stagingFolderPath?: string =
`${options.outDir}/.roku-deploy-staging`
The path to the staging folder (where roku-deploy places all of the files right before zipping them up).convertToSquashfs?: boolean =
false
If true we convert to squashfs before creating the pkg fileincrementBuildNumber?: boolean =
false
If true we increment the build number to be a timestamp in the format yymmddHHMMusername?: string =
"rokudev"
The username for the roku box. This will always be 'rokudev', but allow to be passed in just in case roku adds support for custom usernames in the futurepackagePort?: string = 80 The port used for package-related requests. This is mainly used for things like emulators, or when your roku is behind a firewall with a port-forward.
remotePort?: string = 8060 The port used for sending remote control commands (like home press or back press). This is mainly used for things like emulators, or when your roku is behind a firewall with a port-forward.
remoteDebug?: boolean = false When publishing a side loaded channel this flag can be used to enable the socket based BrightScript debug protocol. More information on the BrightScript debug protocol can be found here: https://developer.roku.com/en-ca/docs/developer-program/debugging/socket-based-debugger.md
Click here to see the typescript interface for these options
Changelog
Click here to view the changelog