Skip to content

Commit b9233e6

Browse files
committed
Merge branch 'feature-bootstrap-optional'
2 parents b3908f0 + 731444c commit b9233e6

File tree

7 files changed

+37
-17
lines changed

7 files changed

+37
-17
lines changed

Diff for: app/index.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
2222
this.scriptAppName = this.appname + genUtils.appName(this);
2323
this.appPath = this.env.options.appPath;
2424
this.pkg = require('../package.json');
25+
2526
this.filters = {};
2627
},
2728

@@ -87,12 +88,25 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
8788
message: "What Angular router would you like to use?",
8889
choices: [ "ngRoute", "uiRouter"],
8990
filter: function( val ) { return val.toLowerCase(); }
91+
}, {
92+
type: "confirm",
93+
name: "bootstrap",
94+
message: "Would you like to include Bootstrap?"
95+
}, {
96+
type: "confirm",
97+
name: "uibootstrap",
98+
message: "Would you like to include UI Bootstrap?",
99+
when: function (answers) {
100+
return answers.bootstrap;
101+
}
90102
}], function (answers) {
91103
this.filters[answers.script] = true;
92104
this.filters[answers.markup] = true;
93105
this.filters[answers.stylesheet] = true;
94106
this.filters[answers.router] = true;
95-
cb();
107+
this.filters['bootstrap'] = answers.bootstrap;
108+
this.filters['uibootstrap'] = answers.uibootstrap;
109+
cb();
96110
}.bind(this));
97111
},
98112

@@ -205,16 +219,20 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
205219
},
206220

207221
ngModules: function() {
208-
this.filters = this.config.get('filters');
222+
this.filters = this._.defaults(this.config.get('filters'), {
223+
bootstrap: true,
224+
uibootstrap: true
225+
});
226+
209227
var angModules = [
210228
"'ngCookies'",
211229
"'ngResource'",
212-
"'ngSanitize'",
213-
"'ui.bootstrap'"
230+
"'ngSanitize'"
214231
];
215232
if(this.filters['ngroute']) angModules.push("'ngRoute'");
216233
if(this.filters['socketio']) angModules.push("'btford.socket-io'");
217234
if(this.filters['uirouter']) angModules.push("'ui.router'");
235+
if(this.filters['uibootstrap']) angModules.push("'ui.bootstrap'");
218236

219237
this.angularModules = "\n " + angModules.join(",\n ") +"\n";
220238
},

Diff for: app/templates/_bower.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"angular": ">=1.2.*",
66
"json3": "~3.3.1",
77
"es5-shim": "~3.0.1",
8-
"jquery": "~1.11.0",
8+
"jquery": "~1.11.0",<% if(filters.bootstrap) { %>
99
"bootstrap-sass-official": "~3.1.1",
10-
"bootstrap": "~3.1.1",
10+
"bootstrap": "~3.1.1",<% } %>
1111
"angular-resource": ">=1.2.*",
1212
"angular-cookies": ">=1.2.*",
1313
"angular-sanitize": ">=1.2.*",<% if(filters.ngroute) { %>
14-
"angular-route": ">=1.2.*",<% } %>
15-
"angular-bootstrap": "~0.11.0",
14+
"angular-route": ">=1.2.*",<% } %><% if(filters.uibootstrap) { %>
15+
"angular-bootstrap": "~0.11.0",<% } %>
1616
"font-awesome": ">=4.1.0",
1717
"lodash": "~2.4.1"<% if(filters.socketio) { %>,
1818
"angular-socket-io": "~0.6.0"<% } %><% if(filters.uirouter) { %>,

Diff for: app/templates/client/app/account(auth)/login/login(less).less

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<% if(filters.bootstrap) { %>
12
// Colors
23
// --------------------------------------------------
34

@@ -34,4 +35,4 @@
3435

3536
.btn-google-plus {
3637
.button-variant(@btnText; @btnGooglePlusBackground; @btnGooglePlusBackgroundHighlight);
37-
}
38+
}<% } %>

Diff for: app/templates/client/app/account(auth)/login/login(sass).scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<% if(filters.bootstrap) { %>
12
// Colors
23
// --------------------------------------------------
34

@@ -34,4 +35,4 @@ $btnGooglePlusBackgroundHighlight: #c53727;
3435

3536
.btn-google-plus {
3637
@include button-variant($btnText, $btnGooglePlusBackground, $btnGooglePlusBackgroundHighlight);
37-
}
38+
}<% } %>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@import 'bootstrap/less/bootstrap.less';
1+
<% if(filters.bootstrap) { %>@import 'bootstrap/less/bootstrap.less';<% } %>
22
@import 'font-awesome/less/font-awesome.less';
33

4-
@icon-font-path: '/bower_components/bootstrap/fonts/';
4+
<% if(filters.bootstrap) { %>@icon-font-path: '/bower_components/bootstrap/fonts/';<% } %>
55
@fa-font-path: '/bower_components/font-awesome/fonts';
66

77
/**

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
$icon-font-path: "/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";
1+
<% if(filters.bootstrap) { %>$icon-font-path: "/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/";<% } %>
22
$fa-font-path: "/bower_components/font-awesome/fonts";
3-
4-
@import 'bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';
3+
<% if(filters.bootstrap) { %>
4+
@import 'bootstrap-sass-official/vendor/assets/stylesheets/bootstrap';<% } %>
55
@import 'font-awesome/scss/font-awesome';
66

77
/**

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ module.exports = function(config) {
1717
'client/bower_components/angular-resource/angular-resource.js',
1818
'client/bower_components/angular-cookies/angular-cookies.js',
1919
'client/bower_components/angular-sanitize/angular-sanitize.js',
20-
'client/bower_components/angular-route/angular-route.js',
21-
'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
20+
'client/bower_components/angular-route/angular-route.js',<% if(filters.uibootstrap) { %>
21+
'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',<% } %>
2222
'client/bower_components/lodash/dist/lodash.compat.js',<% if(filters.socketio) { %>
2323
'client/bower_components/angular-socket-io/socket.js',<% } %><% if(filters.uirouter) { %>
2424
'client/bower_components/angular-ui-router/release/angular-ui-router.js',<% } %>

0 commit comments

Comments
 (0)