Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
balthazar committed Mar 5, 2015
2 parents 000e692 + 6d021fb commit 61136de
Show file tree
Hide file tree
Showing 61 changed files with 558 additions and 178 deletions.
61 changes: 61 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowOperatorBeforeLineBreak": ["+", "."],
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"requireBlocksOnNewline": 1,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": true,
"requireDotNotation": true,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": true,
"requireSpaceAfterLineComment": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeKeywords": [
"else",
"while",
"catch"
],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInsideObjectBrackets": "all",
"validateIndentation": 2,
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}
26 changes: 13 additions & 13 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"forin": true,
"freeze": true,
"globalstrict": true,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"laxbreak": true,
"maxdepth": 3,
"nonbsp": true,
"nonew": false,
"strict": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true
"globals": {
"describe": true,
"before": true,
"it": true
}
}
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* **NO** support for outdated browsers — *Working for IE users? Too bad.*
* **NO** pre-install for Google Analytics — *Wanna track people? Do it yourself.*
* **Livereload** on changes in client / server — *You don't have time to waste.*
* **JSHint** integration — *Write clean code, for purpose.*
* **JSHint** & **JSCS** integration — *Write clean code, for purpose.*
* **Sass** support — *Because CSS is a mess.*
* **Fast build***You do faster? Let's see that.*

Expand All @@ -26,12 +26,15 @@ Optional:

npm install -g generator-bangular
yo bangular

### Table of contents

- [Manage project](https://github.com/42Zavattas/generator-bangular#manage-project)
- [Generators](https://github.com/42Zavattas/generator-bangular#generators)
- [Features](https://github.com/42Zavattas/generator-bangular#features)
- [HOWTOs](https://github.com/42Zavattas/generator-bangular#howtos)
- [Protractor](https://github.com/42Zavattas/generator-bangular#protractor)
- [Sockets](https://github.com/42Zavattas/generator-bangular#sockets)
- [Passport](https://github.com/42Zavattas/generator-bangular#passport)
- [Architecture](https://github.com/42Zavattas/generator-bangular#architecutre)

# Manage project
Expand All @@ -54,12 +57,16 @@ Launch client and server tests, using Karma and Mocha, both by default.

gulp control

Validate the app through JSHint.
Validate the app through [JSHint](http://jshint.com/) and [JSCS](http://jscs.info/).

gulp bump [--major || --minor || --patch]

Bump versions of `package.json` and `bower.json` files using *Semantic Versioning* and commit them. Default to **patch**.

gulp e2e

Launch your server and then run protractor tests. See [protractor howtos](https://github.com/42Zavattas/generator-bangular#protractor).

# Generators

- Global
Expand Down Expand Up @@ -139,11 +146,19 @@ The **name** parameter is required. This will create a new `.scss` file in he `c
yo bangular:api <name>

**Url**: Route that will be exposed on your server to access this ressource.<br>
**Socket**: If you want to emit socket event on model changes.
**Socket**: If you want to emit socket event on model changes (only with mongo & sockets).<br>
**Resource**: If you want to scaffold a basic `$resource` for this route (only with ngResource).

The **name** parameter is required. A **name** folder will be created at `server/api/`.

# Features
# HOWTOs

### Protractor

First, you will have to run the `gulp e2e:update` command to update the chromedriver and the selenium jar.
Since the path to the jar is hardcoded in the `protractor.conf.js` file and the version is susceptible to change, you will potentially have to update the version number.
For people which have multiple Chrome installed, you can specify the path to the binary in the configuration.
You can now run `gulp e2e`, remember to stop your server since it will automatically create a new one.

### Sockets

Expand All @@ -158,8 +173,8 @@ The sockets can be quickly usable in your controllers, [here is an example](http

### Passport

On project generation, you can integrate passport authentification in your app. It will create default views for the signup and login. You can easily protect your routes for a connected user by adding the `isAuthenticated` middleware on it.

On project generation, you can integrate passport authentification in your app.
It will create default views for the signup and login. You can easily protect your routes for a connected user by adding the `isAuthenticated` middleware on it.

# Architecture

Expand Down
2 changes: 1 addition & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var BangularGenerator = yeoman.generators.NamedBase.extend({
type: 'confirm',
name: 'sockets',
message: 'Do you want to generate sockets integration for this model?',
default: true
default: false
});
}

Expand Down
2 changes: 1 addition & 1 deletion api/templates/json/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var fs = require('fs');

function handleError(res, err) {
function handleError (res, err) {
return res.status(500).send(err);
}

Expand Down
2 changes: 1 addition & 1 deletion api/templates/mongo/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ exports.register = function (socket) {
socket.emit('<%= objectName %>:remove', doc);
});

}
};
2 changes: 1 addition & 1 deletion api/templates/restock/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var request = require('request');

function handleError(res, err) {
function handleError (res, err) {
return res.status(500).send(err);
}

Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var BangularGenerator = yeoman.generators.Base.extend({
self.filters.sockets = props.sockets;
self.filters.auth = props.auth;
if (props.auth) {
self.filters['ngCookies'] = true;
self.filters.ngCookies = true;
}
done();
});
Expand Down
61 changes: 61 additions & 0 deletions app/templates/#.jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowOperatorBeforeLineBreak": ["+", "."],
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
"disallowYodaConditions": true,
"requireBlocksOnNewline": 1,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": true,
"requireDotNotation": true,
"requireLineBreakAfterVariableAssignment": true,
"requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": true,
"requireSpaceAfterLineComment": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeKeywords": [
"else",
"while",
"catch"
],
"requireSpaceBeforeObjectValues": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInsideObjectBrackets": "all",
"validateIndentation": 2,
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}
15 changes: 15 additions & 0 deletions app/templates/#.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bitwise": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"globalstrict": true,
"latedef": true,
"laxbreak": true,
"maxdepth": 3,
"nonbsp": true,
"nonew": false,
"strict": true,
"undef": true,
"unused": true
}
23 changes: 23 additions & 0 deletions app/templates/#protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
exports.config = { // jshint ignore:line

// The version is susceptible to change
seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar',
// chromeDriver: './node_modules/gulp-protractor/node_modules/protractor/selenium/chromedriver',

baseUrl: 'http://localhost:9000',

capabilities: {
browserName: 'chrome'
// chromeOptions: {
// binary: '/usr/bin/google-chrome-stable'
// }
},

framework: 'jasmine',

jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}

};
42 changes: 0 additions & 42 deletions app/templates/.jshintrc

This file was deleted.

9 changes: 9 additions & 0 deletions app/templates/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- '0.10'
- '0.11'
- '0.12'
before_script:
- npm install -g bower gulp
- bower install<% if (filters.backend === 'mongo') { %>
services: mongodb<% } %>
19 changes: 19 additions & 0 deletions app/templates/client/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"browser": true,
"globals": {
"angular": true,
"browser": true,
"element": true,
"by": true,
"module": true,
"console": true,
"it": true,
"describe": true,
"inject": true,
"expect": true,
"alert": true,
"afterEach": true,
"beforeEach": true<% if (filters.sockets) { %>,
"io" : true<% } %>
}
}
Loading

0 comments on commit 61136de

Please sign in to comment.