How to develop apps for Firefox OS

Yeoman is a tool that creates app scaffolds. It comes with a few templates (aka generators), but we can add our own —such as this one. When we run Yeoman, we will be asked several questions to customise the scaffolding, such as the app name, or whether we want to use an MVC framework or not.

Besides the directory structure, we get something more valuable: a Gruntfile. Grunt is used to automate tasks (think of it as Node's Rake or Fabric). The Gruntfile that you'll get with the Firefox OS generator has some useful tasks already configured:

Install the app into an actual Firefox OS device (without having to download Gaia).

Run tests.

Launch a local server (so you can try the app in a browser).

Compile Sass stylesheets.

Build a zip file to upload to the Marketplace.

Run a JavaScript linter to analyse your code.

Etc.

To use this, you just need to install Grunt, Yeoman and the generator: