Skip to content

Commit 28a18d7

Browse files
committed
feat(gulp): add Gulp support
1 parent 5e9b350 commit 28a18d7

File tree

5 files changed

+441
-9
lines changed

5 files changed

+441
-9
lines changed

Diff for: app/index.js

+22-6
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
8282
this.log('# Client\n');
8383

8484
this.prompt([{
85-
type: 'list',
85+
type: "list",
8686
name: 'script',
8787
message: 'What would you like to write scripts with?',
8888
choices: [ 'JavaScript', 'JavaScript + Babel', 'CoffeeScript'],
@@ -125,7 +125,6 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
125125
return answers.bootstrap;
126126
}
127127
}], function (answers) {
128-
129128
// also set 'js' to true if using babel
130129
if(answers.script === 'babel') { this.filters.js = true; }
131130
this.filters[answers.script] = true;
@@ -249,6 +248,18 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
249248
this.log('\n# Project\n');
250249

251250
this.prompt([{
251+
type: 'list',
252+
name: 'buildtool',
253+
message: 'Would you like to use Gulp (experimental) instead of Grunt?',
254+
choices: [ 'Grunt', 'Gulp', 'Both'],
255+
filter: function(val) {
256+
return {
257+
'Grunt': 'grunt',
258+
'Gulp': 'gulp',
259+
'Both': 'grunt_and_gulp'
260+
}[val];
261+
}
262+
}, {
252263
type: 'list',
253264
name: 'testing',
254265
message: 'What would you like to write tests with?',
@@ -273,10 +284,8 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
273284
return answers.testing === 'mocha';
274285
}
275286
}], function (answers) {
276-
/**
277-
* Default to grunt until gulp support is implemented
278-
*/
279-
this.filters.grunt = true;
287+
this.filters.grunt = answers.buildtool === 'grunt' || answers.buildtool === 'grunt_and_gulp';
288+
this.filters.gulp = answers.buildtool === 'gulp' || answers.buildtool === 'grunt_and_gulp';
280289

281290
this.filters[answers.testing] = true;
282291
if (answers.testing === 'mocha') {
@@ -360,6 +369,13 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
360369
},
361370

362371
ngModules: function() {
372+
this.scriptExt = this.filters.coffee ? 'coffee' : 'js';
373+
this.styleExt = this.filters.less ? 'less' :
374+
this.filters.sass ? 'scss' :
375+
this.filters.stylus ? 'styl' :
376+
'css';
377+
this.templateExt = this.filters.jade ? 'jade' : 'html';
378+
363379
var angModules = [
364380
"'ngCookies'",
365381
"'ngResource'",
File renamed without changes.

Diff for: app/templates/_package.json

+45-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"errorhandler": "~1.0.0",
1313
"compression": "~1.0.1",
1414
"composable-middleware": "^0.3.0",
15-
"lodash": "~2.4.1",
15+
"lodash": "~3.9.3",
1616
"babel-core": "^5.6.4",<% if (filters.jade) { %>
1717
"jade": "~1.2.0",<% } %><% if (filters.html) { %>
1818
"ejs": "~0.8.4",<% } %><% if (filters.mongoose) { %>
@@ -35,7 +35,49 @@
3535
"serve-favicon": "~2.0.1"
3636
},
3737
"devDependencies": {
38-
"autoprefixer-core": "^5.2.1",
38+
"autoprefixer-core": "^5.2.1",<% if(filters.gulp) { %>
39+
"gulp": "^3.9.0",
40+
"gulp-add-src": "^0.2.0",
41+
"gulp-angular-templatecache": "^1.7.0",
42+
"gulp-autoprefixer": "2.3.1",<% if(filters.babel) { %>
43+
"gulp-babel": "^5.1.0",<% } %>
44+
"gulp-cache": "^0.2.10",
45+
"gulp-clean": "^0.3.1",
46+
"gulp-concat": "^2.6.0",
47+
"gulp-filter": "^2.0.2",
48+
"gulp-imagemin": "^2.2.1",
49+
"gulp-inject": "^1.3.1",
50+
"gulp-jshint": "^1.11.0",
51+
"gulp-karma": "0.0.4",<% if(filters.less) { %>
52+
"gulp-less": "3.0.3",<% } %>
53+
"gulp-livereload": "^3.8.0",
54+
"gulp-load-plugins": "^1.0.0-rc.1",
55+
"gulp-minify-css": "^1.1.6",
56+
"gulp-ngmin": "^0.3.0",
57+
"gulp-plumber": "^1.0.1",
58+
"gulp-rev": "^5.0.0",
59+
"gulp-rev-replace": "^0.4.2",
60+
"gulp-sourcemaps": "^1.5.2",
61+
"gulp-svgmin": "^1.1.2",
62+
"gulp-uglify": "^1.2.0",
63+
"gulp-useref": "^1.2.0",
64+
"gulp-util": "^3.0.5",
65+
"gulp-watch": "^4.2.4",
66+
"utile": "~0.3.0",
67+
"nodemon": "^1.3.7",
68+
"run-sequence": "^1.1.0",
69+
"lazypipe": "^0.2.4",
70+
"wiredep": "^2.2.2",<% if(filters.jade) { %>
71+
"gulp-jade": "^1.0.1",<% } if(filters.stylus) { %>
72+
"gulp-stylus": "^2.0.4",
73+
"gulp-stylint": "^1.1.3",
74+
"nib": "^1.1.0",<% } if(filters.sass) { %>
75+
"gulp-sass": "^2.0.1",
76+
"gulp-scss-lint": "^0.2.1",<% } if(filters.less) { %>
77+
"gulp-less": "^3.0.3",
78+
"gulp-recess": "^1.1.2",<% } if(filters.coffee) { %>
79+
"gulp-coffeelint": "^0.5.0",
80+
"gulp-coffee": "^2.3.1",<% }} if(filters.grunt) { %>
3981
"grunt": "~0.4.5",
4082
"grunt-wiredep": "^2.0.0",
4183
"grunt-concurrent": "^2.0.1",
@@ -73,7 +115,7 @@
73115
"time-grunt": "^1.2.1",
74116
"grunt-express-server": "^0.5.1",
75117
"grunt-postcss": "^0.5.5",
76-
"grunt-open": "~0.2.3",
118+
"grunt-open": "~0.2.3",<% } %>
77119
"open": "~0.0.4",
78120
"jshint-stylish": "~2.0.1",
79121
"connect-livereload": "^0.5.3",

0 commit comments

Comments
 (0)