--- /dev/null
+module.exports = function() {
+
+ var config = {
+ javaScriptFiles: [
+ './src/**/*.js',
+ './*.js'
+ ],
+ jshintConfigurationFile: '.jshintrc',
+ jscsConfigurationFile: '.jscsrc'
+ };
+
+ config.getWiredepDefaultOptions = function() {
+ var options = {
+ bowerJson: config.bower.json,
+ directory: config.bower.directory,
+ ignorePath: config.bower.ignorePath
+ };
+ return options;
+ };
+
+
+ return config;
+};
--- /dev/null
+var args = require('yargs').argv;
+var config = require('./gulp.config')();
+var gulp = require('gulp');
+var plugins = require('gulp-load-plugins')({
+ pattern: ['gulp-*', 'gulp.*'], // the glob(s) to search for
+ scope: ['dependencies', 'devDependencies', 'peerDependencies'], // which keys in the config to look within
+ replaceString: /^gulp(-|\.)/, // what to remove from the name of the module when adding it to the context
+ camelize: true, // if true, transforms hyphenated plugins names to camel case
+ lazy: true, // whether the plugins should be lazy loaded on demand
+ rename: {} // a mapping of plugins to rename
+});
+
+/**
+ * Arguments:
+ *
+ * --verbose : Various tasks will produce more output to the console.
+ */
+
+gulp.task('help', plugins.taskListing);
+
+/**
+ * @description
+ * vet (evaluate) the code and create coverage report
+ *
+ * @return {Stream}
+ */
+gulp.task('vet', function() {
+
+ plugins.util.log(plugins.util.colors.blue('Checking source with JSHint and JSCS'));
+
+ return gulp.src(config.javaScriptFiles)
+ .pipe(plugins.if(args.verbose, plugins.print()))
+ .pipe(plugins.jshint(config.jshintConfigurationFile))
+ .pipe(plugins.jshint.reporter('jshint-stylish', {verbose: true}))
+ .pipe(plugins.jshint.reporter('fail'))
+ .pipe(plugins.jscs({
+ configPath: config.jscsConfigurationFile,
+ fix: false
+ }));
+});
+
+gulp.task('wiredep', function() {
+
+ plugins.util.log('Wiring the bower dependencies into the html');
+
+ var wiredep = require('wiredep').stream;
+ var options = config.getWiredepDefaultOptions();
+
+ // Only include stubs if flag is enabled
+ var js = args.stubs ? [].concat(config.js, config.stubsjs) : config.js;
+
+ return gulp
+ .src(config.index)
+ .pipe(wiredep(options))
+ .pipe(inject(js, '', config.jsOrder))
+ .pipe(gulp.dest(config.client));
+});
"express": "~4.13.3",
"express-http-proxy": "~0.6.0",
"gulp": "~3.9.0",
+ "gulp-if": "~1.2.5",
+ "gulp-jscs": "~2.0.0",
+ "gulp-jshint": "~1.11.2",
+ "gulp-load-plugins": "~1.0.0-rc.1",
+ "gulp-print": "~1.1.0",
+ "gulp-task-listing": "~1.0.1",
"gulp-useref": "~1.3.0",
"gulp-util": "~3.0.6",
+ "jshint-stylish": "~2.0.1",
"karma-coverage": "~0.5.0",
"karma-jasmine": "~0.3.6",
"karma-junit-reporter": "~0.3.3",
"karma-phantomjs-launcher": "~0.2.1",
- "wiredep": "~3.0.0-beta"
+ "wiredep": "~3.0.0-beta",
+ "yargs": "~3.19.0"
},
"config": {
"backend-port": "8080",