Skip to content

Commit dcc8561

Browse files
committed
Merge pull request #1190 from DaftMonk/gulp
add experimental Gulp support
2 parents dfd9a13 + c70fd47 commit dcc8561

File tree

6 files changed

+570
-27
lines changed

6 files changed

+570
-27
lines changed

Diff for: app/generator.js

+23-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export default class Generator extends Base {
1919
defaults: false
2020
});
2121

22+
this.option('gulp', {
23+
desc: 'Use experimental Gulp configuration',
24+
type: Boolean,
25+
defaults: false
26+
});
27+
2228
this.option('app-suffix', {
2329
desc: 'Allow a custom suffix to be added to the module name',
2430
type: String,
@@ -129,6 +135,11 @@ export default class Generator extends Base {
129135
this.filters[answers.router] = true;
130136
this.filters.bootstrap = !!answers.bootstrap;
131137
this.filters.uibootstrap = !!answers.uibootstrap;
138+
139+
this.scriptExt = answers.script === 'coffee' ? 'coffee' : 'js';
140+
this.templateExt = answers.markup;
141+
this.styleExt = answers.stylesheet;
142+
132143
cb();
133144
}.bind(this));
134145
},
@@ -243,7 +254,14 @@ export default class Generator extends Base {
243254

244255
this.log('\n# Project\n');
245256

246-
this.prompt([{
257+
this.prompt([/*{
258+
type: 'list',
259+
name: 'buildtool',
260+
message: 'Would you like to use Gulp (experimental) instead of Grunt?',
261+
choices: ['Grunt', 'Gulp'],
262+
default: 0,
263+
filter: val => val.toLowerCase()
264+
}, */{
247265
type: 'list',
248266
name: 'testing',
249267
message: 'What would you like to write tests with?',
@@ -268,10 +286,10 @@ export default class Generator extends Base {
268286
return answers.testing === 'mocha';
269287
}
270288
}], function (answers) {
271-
/**
272-
* Default to grunt until gulp support is implemented
273-
*/
274-
this.filters.grunt = true;
289+
this.filters.grunt = !this.options['gulp'];
290+
this.filters.gulp = !!this.options['gulp'];
291+
// this.filters.grunt = answers.buildtool === 'grunt';
292+
// this.filters.gulp = answers.buildtool === 'gulp';
275293

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

Diff for: app/templates/_package.json

+66-21
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,52 @@
3737
},
3838
"devDependencies": {
3939
"autoprefixer": "^6.0.0",
40-
"babel-core": "^5.6.4",
40+
"babel-core": "^5.6.4",<% if(filters.gulp) { %>
41+
"del": "^2.0.2",
42+
"gulp": "^3.9.0",
43+
"gulp-add-src": "^0.2.0",
44+
"gulp-angular-templatecache": "^1.7.0",
45+
"gulp-autoprefixer": "2.3.1",<% if(filters.babel) { %>
46+
"gulp-babel": "^5.1.0",<% } %>
47+
"gulp-cache": "^0.2.10",
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",<% if(filters.less) { %>
53+
"gulp-less": "3.0.3",<% } %>
54+
"gulp-livereload": "^3.8.0",
55+
"gulp-load-plugins": "^1.0.0-rc.1",
56+
"gulp-minify-css": "^1.1.6",
57+
"gulp-mocha": "^2.1.3",
58+
"gulp-ng-annotate": "^1.1.0",
59+
"gulp-ng-constant": "^1.1.0",
60+
"gulp-plumber": "^1.0.1",
61+
"gulp-rename": "^1.2.2",
62+
"gulp-rev": "^5.0.0",
63+
"gulp-rev-replace": "^0.4.2",
64+
"gulp-sort": "^1.1.1",
65+
"gulp-sourcemaps": "^1.5.2",
66+
"gulp-svgmin": "^1.1.2",
67+
"gulp-uglify": "^1.2.0",
68+
"gulp-useref": "^1.2.0",
69+
"gulp-util": "^3.0.5",
70+
"gulp-watch": "^4.3.5",<% 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",<% } %>
81+
"utile": "~0.3.0",
82+
"nodemon": "^1.3.7",
83+
"run-sequence": "^1.1.0",
84+
"lazypipe": "^0.2.4",
85+
"wiredep": "^2.2.2",<% } /*end gulp*/ if(filters.grunt) { %>
4186
"grunt": "~0.4.5",
4287
"grunt-wiredep": "^2.0.0",
4388
"grunt-concurrent": "^2.0.1",
@@ -49,11 +94,9 @@
4994
"grunt-contrib-jshint": "~0.11.2",
5095
"grunt-contrib-uglify": "~0.11.0",
5196
"grunt-contrib-watch": "~0.6.1",<% if (filters.jade) { %>
52-
"grunt-contrib-jade": "^0.15.0",
53-
"karma-ng-jade2js-preprocessor": "^0.2.0",<% } %><% if (filters.less) { %>
97+
"grunt-contrib-jade": "^0.15.0",<% } %><% if (filters.less) { %>
5498
"grunt-contrib-less": "^1.0.0",<% } %><% if(filters.babel) { %>
55-
"karma-babel-preprocessor": "^5.2.1",<% } %>
56-
"grunt-babel": "~5.0.0",
99+
"grunt-babel": "~5.0.0",<% } %>
57100
"grunt-google-cdn": "~0.4.0",
58101
"grunt-jscs": "^2.1.0",
59102
"grunt-newer": "^1.1.1",
@@ -73,39 +116,41 @@
73116
"grunt-contrib-sass": "^0.9.0",<% } %><% if(filters.stylus) { %>
74117
"grunt-contrib-stylus": "~0.22.0",<% } %>
75118
"jit-grunt": "^0.9.1",
76-
"time-grunt": "^1.2.1",
77119
"grunt-express-server": "^0.5.1",
78120
"grunt-postcss": "~0.7.1",
79121
"grunt-open": "~0.2.3",
122+
"time-grunt": "^1.2.1",
123+
"grunt-mocha-test": "~0.12.7",
124+
"grunt-mocha-istanbul": "^3.0.1",<% } /*end grunt*/ %>
80125
"open": "~0.0.4",
81126
"jshint-stylish": "~2.1.0",
82127
"connect-livereload": "^0.5.3",
83-
"mocha": "^2.2.5",
84-
"grunt-mocha-test": "~0.12.7",
85-
"grunt-mocha-istanbul": "^3.0.1",
86128
"istanbul": "~0.4.1",
87129
"chai": "^3.2.0",
88130
"sinon": "^1.16.1",
89131
"chai-as-promised": "^5.1.0",
90132
"chai-things": "^0.2.0",
91-
"sinon-chai": "^2.8.0",<% if (filters.mocha) { %>
92-
"karma-mocha": "^0.2.0",
93-
"karma-chai-plugins": "^0.6.0",<% } if (filters.jasmine) { %>
94-
"jasmine-core": "^2.3.4",
95-
"karma-jasmine": "~0.3.0",
96-
"jasmine-spec-reporter": "^2.4.0",<% } %>
133+
"karma": "~0.13.3",
97134
"karma-ng-scenario": "~0.1.0",
98135
"karma-firefox-launcher": "~0.1.6",
99136
"karma-script-launcher": "~0.1.0",
100137
"karma-chrome-launcher": "~0.2.0",
101-
"requirejs": "~2.1.11",
102138
"karma-requirejs": "~0.2.2",
103139
"karma-jade-preprocessor": "0.0.11",
104-
"phantomjs": "^1.9.18",
105-
"karma-phantomjs-launcher": "~0.2.0",
106-
"karma": "~0.13.3",
107-
"karma-ng-html2js-preprocessor": "~0.2.0",
140+
"karma-phantomjs-launcher": "~0.2.0",<% if (filters.jade) { %>
141+
"karma-ng-jade2js-preprocessor": "^0.2.0",<% } else { %>
142+
"karma-ng-html2js-preprocessor": "~0.2.0",<% } %>
108143
"karma-spec-reporter": "~0.0.20",
144+
"sinon-chai": "^2.8.0",<% if (filters.mocha) { %>
145+
"mocha": "^2.2.5",
146+
"karma-mocha": "^0.2.0",
147+
"karma-chai-plugins": "^0.6.0",<% } if (filters.jasmine) { %>
148+
"jasmine-core": "^2.3.4",
149+
"karma-jasmine": "~0.3.0",
150+
"jasmine-spec-reporter": "^2.4.0",<% } if(filters.babel) { %>
151+
"karma-babel-preprocessor": "^5.2.1",<% } %>
152+
"requirejs": "~2.1.11",
153+
"phantomjs": "^1.9.18",
109154
"proxyquire": "^1.0.1",
110155
"supertest": "^1.1.0"
111156
},
@@ -115,7 +160,7 @@
115160
},
116161
"scripts": {
117162
"start": "node server",
118-
"test": "grunt test",
163+
"test": "<%= filters.grunt ? 'grunt' : 'gulp' %> test",
119164
"update-webdriver": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
120165
},
121166
"private": true

0 commit comments

Comments
 (0)