Style guide

Set up environment

# Clone OS.js
$ git clone
$ cd OS.js

# Install all dependencies and extra testing suite
$ npm install
$ sudo npm install -g grunt-cli mocha

# Build everything
$ node osjs build

# Optionally run watch to automatically rebuild client files upon changes.
$ grunt watch

# Optionally install the node supervisor to automaticall restart server upon changes.
$ npm install -g supervisor

# Start server
$ ./bin/

Tips and Tricks

Automatically build changes

Simply run grunt watch

Reload application in client



You can test everything (html and css syntax, javascript linting and unit tests) by simply running grunt test.


Everything is done with Git and Github. All changes should be submitted via a custom branch.

# Create a new branch
# You can name the branch `issue-XXX` if you have an open issue for your planned changes.
# Or if not, something like `translate-LANG`, `feature-X` or `bugfix-Y`
$ git checkout -b issue-XXX

# Make modifications
$ edit src/client/javascript/init.js

# Rebuild everything
$ node osjs build

# Run tests
$ grunt test

# Commit and push changes
$ git add src/client/javascript/init.js
$ git commit -m "API: Fix exception on init when connection is lost"
$ git push origin issue-XXX

Now go to the OS.js repository pull request page. Find your branch and press "Create pull request". Fill in the details and submit. It will be looked at ASAP.