node package manager
Loosely couple your services. Use Orgs to version and reuse your code. Create a free org »


Project Scaffolding


Before you proceed, make sure you have Python 2.7.4, Ruby 1.9.3, Compass, Node.js and Git. For Compass, make sure you have ruby in your path.

The next step would be to run the following commands:

npm install -g grunt-cli
npm install -g yo

This will install the recommended tools globally. For scaffolding, CAG Single Page Application generator is published in the npm registry. To install the cag spa generator, you need to issue the command:

npm install -g generator-cagspa

Creating a Project

Creating a project is as simple as invoking yo cagspa under the directory where you want to create you project. This yeoman generator allows developers to create single page application projects as well as OSN gadget projects.

$ yo cagspa
   _____          _____
  / ____|   /\   / ____|
 | |       /  \ | |  __
 | |      / /\ \| | |_ |     Welcome to the Single Page Application generator.
 | |____ / ____ | |__| |
  \_____/_/    \_\_____|
What's your project name? (Myproject) MySample
Is it an OSN Gadget? (Y/n)

The generator will scaffold out the standard project structure, a basic grunt configuration and testacular setup.

Updating Yeoman Generator

npm unpublish generator-cagspa@0.0.0
npm publish generator-cagspa

You might need to add sudo if running on an Unix based OS.

After that, don't forget to reinstall the generator using npm install generator-cagspa -g.

Package Management

There are bower.json files under the root folder and 'src/test'. The latter is automatically invoked during the project generation. The former has to be invoked manually and only contains Jasmine related libs.