A package manager for the Roku platform.
- Install Node.JS from here
- install the
ropm
node modulenpm i ropm -g
As you probably already know, the Roku project structure is fairly strict. There are a few hard rules:
- All files found in
pkg:/source/
are compiled into a single scope, and all functions are global to that scope. - Components must be stored underneath
pkg:/components/
.
This makes a simple package manager slightly more difficult, because file paths alone are not enough to prevent name collisions.
ropm solves the naming collision problem by rewriting the names of all functions and components in an ropm module.
The roku_modules
folder should not be commited to your project repository.
Assume you want to use a ropm module called PrettyList
. PrettyList
includes a global function called
- on install,
ropm
copies all of the files from the package intoroku_modules/<package_name>
. - Then
ropm
rewrites function and component names to have a prefix. (this prevents naming collisions) - When you're ready to bundle your project, you can do one of the following:
a. runropm packge
to generate a full package of your project
b. runropm copy <target_folder>
to apply theropm
file copy logic overtop of your project folder, at any point duing your custom build process.
The ropm