Jetpack Manager for Node.js
Replacing the previous python tool for developing Firefox Add-ons, cfx, jpm is a utility for developing, testing, and packaging add-ons.
Currently only works with Firefox 38+. Check out the --binary flag for ensuring that you're using the correct release of Firefox with jpm.
Installing from npm:
npm install jpm -g
Installing from GitHub to get latest features or working on jpm itself, use npm link to add the jpm global to your path:
git clone https://github.com/mozilla-jetpack/jpm.git
cd jpm
npm install
npm link
jpm has several commands: init, run, test, xpi, with details below. Some options are:
-b, --binary <path>Use the specified Firefox binary to run the add-on. Used inrunandtest.-v, --verbosePrints additional debugging information.--binary-args <CMDARGS>Passes other arguments into Firefox. Enclose multiple arguments in quotes.--debugEnable the add-on debugger when running the add-on.-p, --profile <PROFILE>Uses the profile name or path when running Firefox. Paths must start with either "./" or "/", or be considered a profile name.--prefs [path]Uses a JSON file or common js file which exports a JSON object. The keys of this object will be the pref names, the values will be the pref values.-o, --overload [path]Uses either the specified[path]or the path set in the environment variablesJETPACK_ROOTas the root for addon-sdk modules instead of the ones built into Firefox.--post-url <URL>experimental Used to post a xpi to a URL.
jpm initProvides a series of prompts to create apackage.jsonfor an add-on.jpm runRuns the current add-on.jpm testTests the current add-on.jpm xpiZips up the current add-on into a.xpifile.jpm postexperimental Zips up the current add-on into a.xpifile and post that to the--post-url.jpm watchpostexperimental Zips up the current add-on into a.xpifile and post that to the--post-url, every time a file in the current working directory changes.jpm signRetrieve a Mozilla-signed.xpifile for your current add-on.
Run current add-on with Firefox Nightly on OSX:
jpm run -b nightly
Turn current add-on into a .xpi file for deployment and installation
jpm xpi
Use local checkout of SDK modules for working on the SDK itself.
jpm run -o /path/to/addon-sdk
To run the jpm test suite
npm test
To run just a specific type of test (functional, unit), run the associated script:
npm run unit
Note: this is experimental
You must have the Extension Auto-Installer installed on Firefox.
Once this has completed, setup a watchpost:
jpm watchpost --post-url http://localhost:8888/
This will watch for changes to the current working directory and post a new xpi to your installed
Extension Auto-Installer which will then install the new xpi. To end the process, use the hokey, CTRL + C.
For a simple xpi and post, use:
jpm post --post-url http://localhost:8888/
For releasing a new version, ensure you have release-it via npm, which creates an incremental version commit, pushes to GH, and npm, and adds a tag. If you want to do a minor or major release as opposed to the default patch release, check out release-it's documentation on how to do it (it's easy).
$ cd PATH_TO_JPM_REPO
$ release-it
This will push to GitHub as well -- which should be your fork. To also push the tags upstream, where upstream is most likely mozilla-jetpack/jpm:
$ git push upstream TAG_NAME



