- A Highly Configurable Environment
- Support for any
grunt
-enabled preprocessor - Lightning Fast Unit Testing Support with
karma
Now with BrowserStack Support. - Beautiful Functional Testing Support (check it out)
Documentation with Docular:
- To build the documentation run
$ grunt docular
. - To open the documentation you can use
$ grunt docular-server
Task Automation with Grunt:
- To start a local server do:
$ grunt server
- To make a local build do:
$ grunt build
NOTE: this build will automatically be available at localhost:9009 if you are also running $ grunt server
Unit Test Running with Karma:
- To run the Unit tests server do:
$ karma start
- Do
$ karma run
for blazing fast test running - To run the Unit tests just once do:
$ karma start --single-run
.
Functional Test Running with FuncUnit:
- Run
npm start
orgrunt server
. - The tests will run automatically as
localhost:9090
gets opened. - Refresh the page to rerun all the tests or click on
rerun
to rerun a specific one.
Test Running on BrowserStack:
- Put
BrowserStackTunnel.jar
inside thescripts
folder - Configure
scripts/bs-tunnel.sh
and.browserstack.json
with your BrowserStack credentials - Change the default browser inside
karma.conf.js
to one that uses BrowserStack - Open a new terminal an run
$ karma start
- Create the tunnel by running
$ npm run-script bs-tunnel
- Run
$ karma run
every time you need to run your tests
Client-side Package Management (using Bower):
- Search a package doing:
$ bower search key words
- Install a package doing:
$ bower install packageName[@version]
- Remove a package doing:
$ bower uninstall packageName
Run $ npm run-script setup
grunt-cli
,karma
.- Optionally are
bower
andphantomjs
.
- Sometimes the components folder doesn't get populated after setup raising weird errors in the browser. Calling
$ bower i
solves this issue. - EPEERINVALID after
npm i
ornpm run-script setup
. A recent update in Karma brought dependency management problems. We recommend to wipekarma
out completely (and all globally installed plugins) and re install by runningnpm run-script setup
. Read more here npm run-script setup
gives EACCESS error. Try running it withsudo
.
A shortcut npm start
is provided to start:
- a development server on
localhost:9000
- a functional testing server on
localhost:9090/test/e2e/runner.html
- a production server on
localhost:9009
What a normal start looks like:
$ grunt server
Running "clean:server" (clean) task
Running "livereload-start" task
... Starting Livereload server on 35729 ...
Running "connect:livereload" (connect) task
Started connect web server on localhost:9000.
Running "connect:test" (connect) task
Started connect web server on localhost:9090.
Running "connect:dist" (connect) task
Started connect web server on localhost:9009.
Running "watch" task
Watching app/{,*/}*.html,{.tmp,app}/styles/{,*/}*.css,{.tmp,app}/views/{,*/}*.html,{.tmp,app}/scripts/{,*/}*.js,app/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}
Take the dist
folder generated after $ grunt build
and put it wherever you want:
- Serve it off
nginx
,express
. - Thou we use and recommend
S3
andCloudFront
.
We welcome all help, but please follow this guidelines (Work In Progress):
We follow these Git Commit Message Conventions. Thou it's not entirely mandatory, we generate Changelogs with this so please keep in mind.
- semi-colons.
- Curly braces for single line if blocks. Same for loops and other places.
- Spacing. Indentation = 4 spaces.
- Spacing in functions.
function( like, this ) {}
- Variable declarations. If multiple variables are defined, use a leading comma for separation.
- Camelcased variable names. No underscores.
- Make sure that key is in objects when iterating over it. See below.
Use spaces when defining functions.
function( arg1, arg2, arg3 ) {
return 1;
}
Use spaces for if statements.
if ( condition ) {
// do something
} else {
// something else
}
var num = 1
, user = new User()
, date = new Date();
for ( var key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
console.log( obj[ key ] );
}
}
fill me in