Skip to content

Commit f50d094

Browse files
committed
feat(gen): make bootstrap and bootstrap ui optional
1 parent 1703916 commit f50d094

File tree

7 files changed

+31
-16
lines changed

7 files changed

+31
-16
lines changed

Diff for: app/index.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,25 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
8787
message: "What Angular router would you like to use?",
8888
choices: [ "ngRoute", "uiRouter"],
8989
filter: function( val ) { return val.toLowerCase(); }
90+
}, {
91+
type: "confirm",
92+
name: "bootstrap",
93+
message: "Would you like to include Bootstrap?"
94+
}, {
95+
type: "confirm",
96+
name: "uibootstrap",
97+
message: "Would you like to include UI Bootstrap?",
98+
when: function (answers) {
99+
return answers.bootstrap;
100+
}
90101
}], function (answers) {
91102
this.filters[answers.script] = true;
92103
this.filters[answers.markup] = true;
93104
this.filters[answers.stylesheet] = true;
94105
this.filters[answers.router] = true;
95-
cb();
106+
if(answers.bootstrap) this.filters[answers.bootstrap] = true;
107+
if(answers.uibootstrap) this.filters[answers.uibootstrap] = true;
108+
cb();
96109
}.bind(this));
97110
},
98111

@@ -209,12 +222,12 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
209222
var angModules = [
210223
"'ngCookies'",
211224
"'ngResource'",
212-
"'ngSanitize'",
213-
"'ui.bootstrap'"
225+
"'ngSanitize'"
214226
];
215227
if(this.filters['ngroute']) angModules.push("'ngRoute'");
216228
if(this.filters['socketio']) angModules.push("'btford.socket-io'");
217229
if(this.filters['uirouter']) angModules.push("'ui.router'");
230+
if(this.filters['uibootstrap']) angModules.push("'ui.bootstrap'");
218231

219232
this.angularModules = "\n " + angModules.join(",\n ") +"\n";
220233
},

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)