-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webpack): Add support for webpack
Also changed code style to use npm standard package to lint js - this is non-configurable and does not allow semicolons.
- Loading branch information
Showing
13 changed files
with
840 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,80 @@ | ||
/*globals require, __dirname */ | ||
/* globals require, __dirname */ | ||
/* jshint node:true */ | ||
'use strict'; | ||
'use strict' | ||
|
||
var gulp = require('gulp'); | ||
var jscs = require('gulp-jscs'); | ||
var jshint = require('gulp-jshint'); | ||
var karmaConfig = __dirname + '/karma.conf.js'; | ||
var lodash = require('lodash'); | ||
var paths = require('./paths'); | ||
var plato = require('plato'); | ||
var Server = require('karma').Server; | ||
var gulp = require('gulp') | ||
var lodash = require('lodash') | ||
var path = require('path') | ||
var paths = require('./paths') | ||
var plato = require('plato') | ||
var Server = require('karma').Server | ||
var standard = require('gulp-standard') | ||
|
||
gulp.task('clean', function () { | ||
|
||
var del = require('del'); | ||
return del([ | ||
'build' | ||
]); | ||
}); | ||
var karmaConfig = path.join(__dirname, 'karma.conf.js') | ||
|
||
gulp.task('default', ['clean:mobile']); | ||
gulp.task('clean', function () { | ||
var del = require('del') | ||
return del([ | ||
'build' | ||
]) | ||
}) | ||
|
||
gulp.task('complexity', function (done) { | ||
var callback = function () { | ||
done() | ||
} | ||
|
||
var callback = function () { | ||
done(); | ||
}; | ||
|
||
plato.inspect(paths.lint, 'build/complexity', {title: 'prerender', recurse: true}, callback); | ||
}); | ||
|
||
gulp.task('jscs', function () { | ||
return gulp | ||
.src(paths.lint) | ||
.pipe(jscs('.jscsrc')); | ||
}); | ||
plato.inspect(paths.lint, 'build/complexity', {title: 'prerender', recurse: true}, callback) | ||
}) | ||
|
||
gulp.task('lint', function () { | ||
return gulp | ||
.src(paths.lint) | ||
.pipe(jshint('.jshintrc')) | ||
.pipe(jshint.reporter('default', {verbose: true})) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
.pipe(jshint.reporter('fail')); | ||
}); | ||
|
||
var testConfig = function (options) { | ||
var travisOptions = process.env.TRAVIS && | ||
{ | ||
browsers: ['Firefox'], | ||
reporters: ['dots', 'coverage', 'threshold'] | ||
}; | ||
|
||
return lodash.assign(options, travisOptions); | ||
}; | ||
return gulp | ||
.src(paths.lint) | ||
.pipe(standard()) | ||
.pipe(standard.reporter('default', { | ||
breakOnError: true, | ||
quiet: true | ||
})) | ||
}) | ||
|
||
gulp.task('tdd', function (done) { | ||
gulp.watch(paths.all, ['jscs', 'lint']); | ||
|
||
var config = testConfig( | ||
{ | ||
autoWatch: true, | ||
browsers: ['PhantomJS'], | ||
configFile: karmaConfig, | ||
singleRun: false | ||
} | ||
); | ||
gulp.watch(paths.all, ['jscs', 'lint']) | ||
|
||
var config = testConfig( | ||
{ | ||
autoWatch: true, | ||
browsers: ['PhantomJS'], | ||
configFile: karmaConfig, | ||
singleRun: false | ||
} | ||
) | ||
|
||
var server = new Server(config, done) | ||
server.start() | ||
}) | ||
|
||
gulp.task('test', ['lint'], function (done) { | ||
var config = testConfig( | ||
{ | ||
configFile: karmaConfig, | ||
singleRun: true, | ||
reporters: ['progress', 'coverage', 'threshold'] | ||
} | ||
) | ||
|
||
var server = new Server(config, done) | ||
server.start() | ||
}) | ||
|
||
gulp.task('default', ['complexity', 'test']) | ||
|
||
var server = new Server(config, done); | ||
server.start(); | ||
}); | ||
|
||
gulp.task('test', ['jscs', 'lint'], function (done) { | ||
|
||
var config = testConfig( | ||
{ | ||
configFile: karmaConfig, | ||
singleRun: true, | ||
reporters: ['progress', 'coverage', 'threshold'] | ||
} | ||
); | ||
var testConfig = function (options) { | ||
var travisDefaultOptions = { | ||
browsers: ['Firefox'], | ||
reporters: ['dots', 'coverage', 'threshold'] | ||
} | ||
|
||
var server = new Server(config, done); | ||
server.start(); | ||
}); | ||
var travisOptions = process.env.TRAVIS && travisDefaultOptions | ||
|
||
gulp.task('default', ['complexity', 'test']); | ||
return lodash.assign(options, travisOptions) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
/* jshint node:true */ | ||
|
||
var bower = [ | ||
var nodeModules = [ | ||
'node_modules/jquery/dist/jquery.js', | ||
'node_modules/moment/moment.js', | ||
'node_modules/angular/angular.js', | ||
'node_modules/angular-mocks/angular-mocks.js' | ||
]; | ||
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js']; | ||
var miscFiles = ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js']; | ||
var demoFiles = []; | ||
var sourceFiles = ['src/**/*.js']; | ||
var testFiles = ['test/**/*.spec.js']; | ||
] | ||
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js'] | ||
var miscFiles = ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js'] | ||
var demoFiles = [] | ||
var sourceFiles = ['src/**/*.js'] | ||
var testFiles = ['test/**/*.spec.js'] | ||
|
||
module.exports = { | ||
all: bower.concat(sourceFiles).concat(testFiles).concat(demoFiles), | ||
all: nodeModules.concat(sourceFiles).concat(testFiles).concat(demoFiles), | ||
app: sourceFiles, | ||
bump: bumpFiles, | ||
lint: miscFiles.concat(sourceFiles).concat(testFiles).concat(miscFiles), | ||
src: sourceFiles, | ||
test: testFiles | ||
}; | ||
} |
Oops, something went wrong.