Skip to content

Commit 4cf6ebe

Browse files
committed
Conflicts: .travis.yml app/index.js app/templates/Gruntfile.js app/templates/_bower.json app/templates/_package.json app/templates/client/app/app(js).js app/templates/server/api/thing/thing.controller.js app/templates/server/api/user(auth)/user.controller.js app/templates/server/app.js app/templates/server/auth(auth)/auth.service.js app/templates/server/auth(auth)/facebook(facebookAuth)/passport.js app/templates/server/auth(auth)/google(googleAuth)/passport.js app/templates/server/auth(auth)/local/index.js app/templates/server/auth(auth)/twitter(twitterAuth)/passport.js endpoint/templates/name.controller.js test/fixtures/bower.json test/fixtures/package.json test/test-file-creation.js
2 parents dff3c12 + e7087e6 commit 4cf6ebe

27 files changed

+341
-77
lines changed

Diff for: .travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: node_js
22
node_js:
33
- '0.10'
4+
- '0.11'
5+
- '0.12'
46
env:
57
global:
68
- SAUCE_USERNAME=fullstack_ci
@@ -10,4 +12,4 @@ before_install:
1012
- gem update --system
1113
- gem install sass --version "=3.3.7"
1214
- npm install -g bower grunt-cli
13-
services: mongodb
15+
services: mongodb

Diff for: app/index.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,18 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
9595

9696
return filterMap[val];
9797
}
98+
}, {
99+
type: 'confirm',
100+
name: 'babel',
101+
message: 'Would you like to use Javascript ES6 in your client by preprocessing it with Babel?',
102+
when: function (answers) {
103+
return answers.script === 'js';
104+
}
98105
}, {
99106
type: 'list',
100107
name: 'markup',
101108
message: 'What would you like to write markup with?',
102-
choices: [ 'HTML', 'Jade'],
109+
choices: ['HTML', 'Jade'],
103110
filter: function( val ) { return val.toLowerCase(); }
104111
}, {
105112
type: 'list',
@@ -127,6 +134,9 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
127134
return answers.bootstrap;
128135
}
129136
}], function (answers) {
137+
138+
this.filters.babel = !!answers.babel;
139+
if(this.filters.babel){ this.filters.js = true; }
130140
this.filters[answers.script] = true;
131141
this.filters[answers.markup] = true;
132142
this.filters[answers.stylesheet] = true;
@@ -323,6 +333,9 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
323333
'should'
324334
].filter(function(v) {return this.filters[v];}, this);
325335

336+
if(this.filters.ngroute) filters.push('ngroute');
337+
if(this.filters.uirouter) filters.push('uirouter');
338+
if(this.filters.babel) extensions.push('babel');
326339
if(this.filters.coffee) extensions.push('coffee');
327340
if(this.filters.js) extensions.push('js');
328341
if(this.filters.html) extensions.push('html');

Diff for: app/templates/Gruntfile.js

+58-20
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ module.exports = function (grunt) {
128128
'<%%= yeoman.client %>/{app,components}/**/*.spec.{coffee,litcoffee,coffee.md}'
129129
],
130130
tasks: ['karma']
131+
},<% } %><% if(filters.babel) { %>
132+
babel: {
133+
files: [
134+
'<%%= yeoman.client %>/{app,components}/**/*.js',
135+
'!<%%= yeoman.client %>/{app,components}/**/*.spec.js'
136+
],
137+
tasks: ['babel']
131138
},<% } %>
132139
gruntfile: {
133140
files: ['Gruntfile.js']
@@ -136,7 +143,11 @@ module.exports = function (grunt) {
136143
files: [
137144
'{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.css',
138145
'{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.html',
146+
<% if(filters.babel) { %>
147+
'.tmp/{app,components}/**/*.js',
148+
<% } else { %>
139149
'{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js',
150+
<% } %>
140151
'!{.tmp,<%%= yeoman.client %>}{app,components}/**/*.spec.js',
141152
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js',
142153
'<%%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
@@ -457,18 +468,20 @@ module.exports = function (grunt) {
457468

458469
// Run some tasks in parallel to speed up the build process
459470
concurrent: {
460-
server: [<% if (filters.coffee) { %>
461-
'coffee',<% } %><% if (filters.jade) { %>
462-
'jade',<% } %><% if (filters.stylus) { %>
463-
'stylus',<% } %><% if (filters.sass) { %>
464-
'sass',<% } %><% if (filters.less) { %>
471+
server: [<% if(filters.coffee) { %>
472+
'coffee',<% } %><% if(filters.babel) { %>
473+
'babel',<% } %><% if(filters.jade) { %>
474+
'jade',<% } %><% if(filters.stylus) { %>
475+
'stylus',<% } %><% if(filters.sass) { %>
476+
'sass',<% } %><% if(filters.less) { %>
465477
'less',<% } %>
466478
],
467-
test: [<% if (filters.coffee) { %>
468-
'coffee',<% } %><% if (filters.jade) { %>
469-
'jade',<% } %><% if (filters.stylus) { %>
470-
'stylus',<% } %><% if (filters.sass) { %>
471-
'sass',<% } %><% if (filters.less) { %>
479+
test: [<% if(filters.coffee) { %>
480+
'coffee',<% } %><% if(filters.babel) { %>
481+
'babel',<% } %><% if(filters.jade) { %>
482+
'jade',<% } %><% if(filters.stylus) { %>
483+
'stylus',<% } %><% if(filters.sass) { %>
484+
'sass',<% } %><% if(filters.less) { %>
472485
'less',<% } %>
473486
],
474487
debug: {
@@ -480,11 +493,12 @@ module.exports = function (grunt) {
480493
logConcurrentOutput: true
481494
}
482495
},
483-
dist: [<% if (filters.coffee) { %>
484-
'coffee',<% } %><% if (filters.jade) { %>
485-
'jade',<% } %><% if (filters.stylus) { %>
486-
'stylus',<% } %><% if (filters.sass) { %>
487-
'sass',<% } %><% if (filters.less) { %>
496+
dist: [<% if(filters.coffee) { %>
497+
'coffee',<% } %><% if(filters.babel) { %>
498+
'babel',<% } %><% if(filters.jade) { %>
499+
'jade',<% } %><% if(filters.stylus) { %>
500+
'stylus',<% } %><% if(filters.sass) { %>
501+
'sass',<% } %><% if(filters.less) { %>
488502
'less',<% } %>
489503
'imagemin',
490504
'svgmin'
@@ -618,7 +632,25 @@ module.exports = function (grunt) {
618632
ext: '.js'
619633
}]
620634
}
621-
},<% } %><% if (filters.stylus) { %>
635+
},<% } %><% if(filters.babel) { %>
636+
637+
// Compiles ES6 to JavaScript using Babel
638+
babel: {
639+
options: {
640+
sourceMap: true
641+
},
642+
server: {
643+
files: [{
644+
expand: true,
645+
cwd: 'client',
646+
src: [
647+
'{app,components}/**/*.js',
648+
'!{app,components}/**/*.spec.js'
649+
],
650+
dest: '.tmp'
651+
}]
652+
}
653+
},<% } %><% if(filters.stylus) { %>
622654

623655
// Compiles Stylus to CSS
624656
stylus: {
@@ -687,10 +719,16 @@ module.exports = function (grunt) {
687719
},
688720
files: {
689721
'<%%= yeoman.client %>/index.html': [
690-
['{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js',
691-
'!{.tmp,<%%= yeoman.client %>}/app/app.js',
692-
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.spec.js',
693-
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js']
722+
[
723+
<% if(filters.babel) { %>
724+
'.tmp/{app,components}/**/*.js',
725+
<% } else { %>
726+
'{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.js',
727+
<% } %>
728+
'!{.tmp,<%%= yeoman.client %>}/app/app.js',
729+
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.spec.js',
730+
'!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js'
731+
]
694732
]
695733
}
696734
},<% if (filters.stylus) { %>

Diff for: app/templates/_.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ public
55
.idea
66
client/bower_components
77
dist
8-
/server/config/local.env.js
8+
/server/config/local.env.js
9+
npm-debug.log

Diff for: app/templates/_bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"angular-route": "~1.2",<% } %><% if (filters.uibootstrap) { %>
1414
"angular-bootstrap": "~0.11.0",<% } %>
1515
"font-awesome": ">=4.1.0",
16-
"lodash": "~2.4.1"<% if (filters.socketio) { %>,
17-
"angular-socket-io": "~0.6.0"<% } %><% if (filters.uirouter) { %>,
18-
"angular-ui-router": "~0.2.10"<% } %>
16+
"lodash": "~2.4.1"<% if(filters.socketio) { %>,
17+
"angular-socket-io": "~0.6.0"<% } %><% if(filters.uirouter) { %>,
18+
"angular-ui-router": "~0.2.15"<% } %>
1919
},
2020
"devDependencies": {
2121
"angular-mocks": "~1.2",

Diff for: app/templates/_package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"mongoose-bird": "~0.0.1",<% } %><% if (filters.sequelize) { %>
2020
"sequelize": "^2.0.0-rc2",
2121
"sqlite3": "~3.0.2",<% } %><% if (filters.auth) { %>
22-
"jsonwebtoken": "^0.3.0",
23-
"express-jwt": "^0.1.3",
22+
"jsonwebtoken": "^5.0.0",
23+
"express-jwt": "^3.0.0",
2424
"passport": "~0.2.0",
2525
"passport-local": "~0.1.6",<% } %><% if (filters.facebookAuth) { %>
2626
"passport-facebook": "latest",<% } %><% if (filters.twitterAuth) { %>
@@ -30,7 +30,7 @@
3030
"connect-mongo": "^0.4.1"<% } %><% if (filters.socketio) { %>,
3131
"socket.io": "^1.0.6",
3232
"socket.io-client": "^1.0.6",
33-
"socketio-jwt": "^2.0.2"<% } %>
33+
"socketio-jwt": "^3.0.0"<% } %>
3434
},
3535
"devDependencies": {
3636
"grunt": "~0.4.4",
@@ -45,10 +45,13 @@
4545
"grunt-contrib-imagemin": "~0.7.1",
4646
"grunt-contrib-jshint": "~0.10.0",
4747
"grunt-contrib-uglify": "~0.4.0",
48+
<<<<<<< HEAD
4849
"grunt-contrib-watch": "~0.6.1",<% if (filters.coffee) { %>
4950
"grunt-contrib-coffee": "^0.10.1",<% } %><% if (filters.jade) { %>
5051
"grunt-contrib-jade": "^0.11.0",<% } %><% if (filters.less) { %>
51-
"grunt-contrib-less": "^0.11.4",<% } %>
52+
"grunt-contrib-less": "^0.11.4",<% } %><% if(filters.babel) { %>
53+
"karma-babel-preprocessor": "^5.2.1",
54+
"grunt-babel": "~5.0.0",<% } %>
5255
"grunt-google-cdn": "~0.4.0",
5356
"grunt-jscs": "~0.7.1",
5457
"grunt-newer": "~0.7.0",
@@ -64,8 +67,9 @@
6467
"grunt-protractor-runner": "^1.1.0",
6568
"grunt-injector": "~0.5.4",
6669
"grunt-karma": "~0.8.2",
67-
"grunt-build-control": "~0.4.0",<% if (filters.sass) { %>
68-
"grunt-contrib-sass": "^0.7.3",<% } %><% if (filters.stylus) { %>
70+
"grunt-build-control": "~0.4.0",
71+
"grunt-mocha-test": "~0.10.2",<% if(filters.sass) { %>
72+
"grunt-contrib-sass": "^0.7.3",<% } %><% if(filters.stylus) { %>
6973
"grunt-contrib-stylus": "latest",<% } %>
7074
"jit-grunt": "^0.5.0",
7175
"time-grunt": "~0.3.1",

Diff for: app/templates/client/.jshintrc

-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
"curly": true,
88
"eqeqeq": true,
99
"immed": true,
10-
"indent": 2,
1110
"latedef": true,
1211
"newcap": true,
1312
"noarg": true,
1413
"quotmark": "single",
15-
"regexp": true,
1614
"undef": true,
1715
"unused": true,
1816
"strict": true,

Diff for: app/templates/client/app/app(js).js

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ angular.module('<%= scriptAppName %>', [<%= angularModules %>])
4949
$rootScope.$on(<% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, function(event, next) {
5050
Auth.isLoggedIn(function(loggedIn) {
5151
if (next.authenticate && !loggedIn) {
52+
event.preventDefault();
5253
<% if (filters.ngroute) { %>$location.path('/login');<% } if (filters.uirouter) { %>$state.go('login');<% } %>
5354
}
5455
});

Diff for: app/templates/client/app/main/main(css).css

+4
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
padding: 30px 0;
2828
margin-top: 70px;
2929
border-top: 1px solid #E5E5E5;
30+
}
31+
32+
.navbar-text {
33+
margin-left: 15px;
3034
}

Diff for: app/templates/client/app/main/main(less).less

+4
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
padding: 30px 0;
2828
margin-top: 70px;
2929
border-top: 1px solid #E5E5E5;
30+
}
31+
32+
.navbar-text {
33+
margin-left: 15px;
3034
}

Diff for: app/templates/client/app/main/main(sass).scss

+4
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
padding: 30px 0;
2828
margin-top: 70px;
2929
border-top: 1px solid #E5E5E5;
30+
}
31+
32+
.navbar-text {
33+
margin-left: 15px;
3034
}

Diff for: app/templates/client/app/main/main(stylus).styl

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222
border-top 1px solid #E5E5E5
2323
margin-top 70px
2424
padding 30px 0
25-
text-align center
25+
text-align center
26+
27+
.navbar-text
28+
margin-left 15px

Diff for: app/templates/client/components/modal(uibootstrap)/modal.service(js).js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ angular.module('<%= scriptAppName %>')
3939
/**
4040
* Open a delete confirmation modal
4141
* @param {String} name - name or info to show on modal
42-
* @param {All} - any additional args are passed staight to del callback
42+
* @param {All} - any additional args are passed straight to del callback
4343
*/
4444
return function() {
4545
var args = Array.prototype.slice.call(arguments),

Diff for: app/templates/client/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@
5050
<script src="socket.io-client/socket.io.js"></script><% } %>
5151
<!-- endbuild -->
5252

53+
<% if(filters.babel) { %>
54+
<!-- build:js(.tmp) app/app.js -->
55+
<% } else { %>
5356
<!-- build:js({.tmp,client}) app/app.js -->
57+
<% } %>
5458
<script src="app/app.js"></script>
5559
<!-- injector:js -->
5660
<!-- endinjector -->

Diff for: app/templates/karma.conf.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ module.exports = function(config) {
3737

3838
preprocessors: {
3939
'**/*.jade': 'ng-jade2js',
40-
'**/*.html': 'html2js',
40+
'**/*.html': 'html2js',<% if(filters.babel) { %>
41+
'client/app/**/*.js': 'babel',<% } %>
4142
'**/*.coffee': 'coffee',
4243
},
4344

@@ -49,6 +50,20 @@ module.exports = function(config) {
4950
stripPrefix: 'client/'
5051
},
5152

53+
<% if(filters.babel) { %>
54+
babelPreprocessor: {
55+
options: {
56+
sourceMap: 'inline'
57+
},
58+
filename: function (file) {
59+
return file.originalPath.replace(/\.js$/, '.es5.js');
60+
},
61+
sourceFileName: function (file) {
62+
return file.originalPath;
63+
}
64+
},
65+
<% } %>
66+
5267
// list of files / patterns to exclude
5368
exclude: [],
5469

Diff for: app/templates/server/.jshintrc

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"latedef": "nofunc",
99
"newcap": true,
1010
"noarg": true,
11-
"regexp": true,
1211
"undef": true,
1312
"smarttabs": true,
1413
"asi": true,

0 commit comments

Comments
 (0)