BTC Skeletons

Angular

Chaplin

Cordova

Ember

Table of Contents

  1. About
    1. Core
    2. Testing
    3. Cordova
    4. Serverpack
    5. Frameworks
  2. Getting Started
  3. Tasks
    1. Packages
    2. Extras
    3. Generators
    4. Assembling
    5. Testing

About

These are set of starter projects to build rich client-side experiences using Node.js. These skeletons are aimed at leveraging packages to develop and build, while providing a set of unified tasks and definitions to focus less on configuration and setup.

Core

The following tools are leveraged to provide a unified workflow:

Testing

Additional packages can be introduced to cover testing of your JavaScript applications:

Cordova

Skeleton variants are available to package your web applications to run with access to native components using Apache Cordova. Visit this page for more information about extras that are provided for Cordova.

Serverpack

Skeleton variants are available that provide additional packages to build a full stack application, inspired by MEAN:

Frameworks

The following starter projects are available to download, including Cordova and Serverpack variants. The JavaScript frameworks available include:

Getting Started

  1. Download and install the following if you have not already:
  2. Download one of the starter projects from GitHub.
  3. Navigate to the project directory and run the command npm install.

Tasks

You are free to work with the individual packages that these skeletons use. (ex: Brunch, Scaffolt, etc.) However, tasks are provided to simplify your workflow with consistency. These tasks are executed using Jake. ex: jake [task]

Packages

These tasks are to handle things that are package-related, such as Bower and NPM.

bower:clean

Remove downloaded Bower components. This is useful if you want to reinstall dependencies, such as updates or packages have been corrupted.

bower:install

Download Bower components.

npm:clean

Remove downloaded NPM modules. This is useful if you want to reinstall dependencies, such as updates or packages have been corrupted. Remember that after running this task npm install needs to be executed to install dependencies.

Extras

These commands add additional features/items to the project that are not included by default.

add:jquery
rem:jquery

Add/remove the ubiquitous library jQuery to/from the project.

add:normalize
rem:normalize

Add/remove normalize.css to/from the project to ensure a consistent starting point in styling between different browsers.

Generators

Generator commands are available to generate and tear down files from templates given a type and name, eliminating the writing of boilerplate code.

generate / destroy

Generate or tear down templates. ex: jake generate codetest=user

generate codetest=[name]
destroy codetest=[name]

Generate/destroy a test file with the given test name for testing client-side code with Karma.

generate sitetest=[name]
destroy sitetest=[name]

Generate/destroy a test file with the given test name for testing the site with WebDriverJS.

generate servermodel=[name]
destroy servermodel=[name]

(Serverpack only) Generate/destroy a Mongoose model.

Assembling

The following tasks are for assembling the application, generating JS/CSS and copy assets. The following modes are provided:

If any Bower dependencies have not been downloaded yet, Bower will first download them.

build:[mode]

Assemble code and assets once.

watch:[mode]

Assemble the code and assets, plus watch for changes. Rebuild every time a change is detected.

server:[mode] browsersync=false

Assemble the code and assets, plus watch for changes. Rebuild every time a change is detected. Also, the server is booted up.

Testing

To begin running tests make sure that the task test:install is run first to install required packages.

test:install

Install packages required to run code and site testing. You should only need to run this once, unless the task npm:clean has been invoked, or testing packages have been updated.

test:all codereporter=[codereporter] sitereporter=[sitereporter]

Run all tests listed below once. For more information on reporters see below.

test:code reporter=[reporter] watch=false browsersync=false

Run code-based tests (ex: unit tests) using Karma. Karma is preconfigured to run with all available browsers on the system. (PhantomJS is included) Karma reporter can be specified with the reporter option. By default Karma runs once. If you run this task with watch=true Karma will watch for changes and auto-run on changes. You can also run the server while watching files with watch=server, plus use BrowserSync with browsersync=true.

test:site reporter=[reporter] watch=false

Run site-based tests (ex: system tests) using PhantomJS and WebDriverJS. A server is started up temporarily to interact with the site. A mocha reporter can be specified with the reporter option. By default Karma runs once. If you run this task with watch=true Mocha will auto-run on changes with Nodemon. The global method getDriver is provided to setup a driver, while the global property baseUrl returns the root url. (ex: http://localhost:3333) Mocha as Promised is also included to take advantage of WebDriverJS' use of promises.