Skip to content

Commit 2b12087

Browse files
committed
feat(gulp): add Gulp support
1 parent 3e901b0 commit 2b12087

File tree

5 files changed

+504
-10
lines changed

5 files changed

+504
-10
lines changed

Diff for: app/generator.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export default class Generator extends Base {
136136
this.filters[answers.router] = true;
137137
this.filters.bootstrap = !!answers.bootstrap;
138138
this.filters.uibootstrap = !!answers.uibootstrap;
139+
140+
this.scriptExt = answers.script === 'coffee' ? 'coffee' : 'js';
141+
this.templateExt = answers.markup;
142+
this.styleExt = answers.stylesheet;
143+
139144
cb();
140145
}.bind(this));
141146
},
@@ -251,6 +256,19 @@ export default class Generator extends Base {
251256
this.log('\n# Project\n');
252257

253258
this.prompt([{
259+
type: 'list',
260+
name: 'buildtool',
261+
message: 'Would you like to use Gulp (experimental) instead of Grunt?',
262+
choices: ['Grunt', 'Gulp', 'Both'],
263+
default: 0,
264+
filter: function(val) {
265+
return {
266+
'Grunt': 'grunt',
267+
'Gulp': 'gulp',
268+
'Both': 'grunt_and_gulp'
269+
}[val];
270+
}
271+
}, {
254272
type: 'list',
255273
name: 'testing',
256274
message: 'What would you like to write tests with?',
@@ -275,10 +293,8 @@ export default class Generator extends Base {
275293
return answers.testing === 'mocha';
276294
}
277295
}], function (answers) {
278-
/**
279-
* Default to grunt until gulp support is implemented
280-
*/
281-
this.filters.grunt = true;
296+
this.filters.grunt = answers.buildtool === 'grunt' || answers.buildtool === 'grunt_and_gulp';
297+
this.filters.gulp = answers.buildtool === 'gulp' || answers.buildtool === 'grunt_and_gulp';
282298

283299
this.filters[answers.testing] = true;
284300
if (answers.testing === 'mocha') {
File renamed without changes.

Diff for: app/templates/_package.json

+50-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,50 @@
3737
},
3838
"devDependencies": {
3939
"autoprefixer": "^6.0.0",
40-
"babel-core": "^5.6.4",
40+
"babel-core": "^5.6.4",<% if(filters.gulp) { %>
41+
"gulp": "^3.9.0",
42+
"gulp-add-src": "^0.2.0",
43+
"gulp-angular-templatecache": "^1.7.0",
44+
"gulp-autoprefixer": "2.3.1",<% if(filters.babel) { %>
45+
"gulp-babel": "^5.1.0",<% } %>
46+
"gulp-cache": "^0.2.10",
47+
"gulp-clean": "^0.3.1",
48+
"gulp-concat": "^2.6.0",
49+
"gulp-filter": "^2.0.2",
50+
"gulp-imagemin": "^2.2.1",
51+
"gulp-inject": "^1.3.1",
52+
"gulp-jshint": "^1.11.0",
53+
"gulp-karma": "0.0.4",<% if(filters.less) { %>
54+
"gulp-less": "3.0.3",<% } %>
55+
"gulp-livereload": "^3.8.0",
56+
"gulp-load-plugins": "^1.0.0-rc.1",
57+
"gulp-minify-css": "^1.1.6",
58+
"gulp-mocha": "^2.1.3",
59+
"gulp-ngmin": "^0.3.0",
60+
"gulp-plumber": "^1.0.1",
61+
"gulp-rev": "^5.0.0",
62+
"gulp-rev-replace": "^0.4.2",
63+
"gulp-sourcemaps": "^1.5.2",
64+
"gulp-svgmin": "^1.1.2",
65+
"gulp-uglify": "^1.2.0",
66+
"gulp-useref": "^1.2.0",
67+
"gulp-util": "^3.0.5",
68+
"gulp-watch": "^4.3.5",<% if(filters.jade) { %>
69+
"gulp-jade": "^1.0.1",<% } if(filters.stylus) { %>
70+
"gulp-stylus": "^2.0.4",
71+
"gulp-stylint": "^1.1.3",
72+
"nib": "^1.1.0",<% } if(filters.sass) { %>
73+
"gulp-sass": "^2.0.1",
74+
"gulp-scss-lint": "^0.2.1",<% } if(filters.less) { %>
75+
"gulp-less": "^3.0.3",
76+
"gulp-recess": "^1.1.2",<% } if(filters.coffee) { %>
77+
"gulp-coffeelint": "^0.5.0",
78+
"gulp-coffee": "^2.3.1",<% } %>
79+
"utile": "~0.3.0",
80+
"nodemon": "^1.3.7",
81+
"run-sequence": "^1.1.0",
82+
"lazypipe": "^0.2.4",
83+
"wiredep": "^2.2.2",<% } if(filters.grunt) { %>
4184
"grunt": "~0.4.5",
4285
"grunt-wiredep": "^2.0.0",
4386
"grunt-concurrent": "^2.0.1",
@@ -71,17 +114,17 @@
71114
"grunt-build-control": "^0.6.0",<% if(filters.sass) { %>
72115
"grunt-contrib-sass": "^0.9.0",<% } %><% if(filters.stylus) { %>
73116
"grunt-contrib-stylus": "latest",<% } %>
74-
"jit-grunt": "^0.9.1",
75-
"time-grunt": "^1.2.1",
76117
"grunt-express-server": "^0.5.1",
77118
"grunt-postcss": "^0.6.0",
119+
"grunt-mocha-test": "~0.12.7",
120+
"grunt-mocha-istanbul": "^3.0.1",
78121
"grunt-open": "~0.2.3",
122+
"jit-grunt": "^0.9.1",
123+
"time-grunt": "^1.2.1",<% } %>
79124
"open": "~0.0.4",
80125
"jshint-stylish": "~2.0.1",
81126
"connect-livereload": "^0.5.3",
82127
"mocha": "^2.2.5",
83-
"grunt-mocha-test": "~0.12.7",
84-
"grunt-mocha-istanbul": "^3.0.1",
85128
"istanbul": "^0.3.17",
86129
"chai-as-promised": "^5.1.0",
87130
"chai-things": "^0.2.0",
@@ -90,7 +133,8 @@
90133
"karma-chai-plugins": "^0.6.0",<% } if (filters.jasmine) { %>
91134
"jasmine-core": "^2.3.4",
92135
"karma-jasmine": "~0.3.0",
93-
"jasmine-spec-reporter": "^2.4.0",<% } %>
136+
"jasmine-spec-reporter": "^2.4.0",<% } if(filters.babel) { %>
137+
"karma-babel-preprocessor": "^5.2.1",<% } %>
94138
"karma-ng-scenario": "~0.1.0",
95139
"karma-firefox-launcher": "~0.1.6",
96140
"karma-script-launcher": "~0.1.0",

0 commit comments

Comments
 (0)