2016-05-24 15:07:31 +03:00
|
|
|
/* global module, require, process */
|
|
|
|
/* jscs:disable */
|
|
|
|
var path = require('path'),
|
|
|
|
|
|
|
|
escapeChar = process.platform.match(/^win/) ? '^' : '\\',
|
|
|
|
cwd = process.cwd().replace(/( |\(|\))/g, escapeChar + '$1');
|
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all
|
|
|
|
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks);
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
jshintrc: true,
|
|
|
|
ignores: [
|
|
|
|
'node_modules/**',
|
|
|
|
'bower_components/**',
|
|
|
|
'tmp/**',
|
|
|
|
'dist/**',
|
|
|
|
'vendor/**'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
all: ['**/*.js']
|
|
|
|
},
|
|
|
|
|
|
|
|
jscs: {
|
|
|
|
app: {
|
|
|
|
options: {
|
|
|
|
config: '.jscsrc',
|
|
|
|
excludeFiles: [
|
|
|
|
'node_modules/**',
|
|
|
|
'bower_components/**',
|
|
|
|
'tests/**',
|
|
|
|
'tmp/**',
|
|
|
|
'dist/**',
|
|
|
|
'vendor/**'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
files: {
|
|
|
|
src: ['**/*.js']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
tests: {
|
|
|
|
options: {
|
|
|
|
config: 'tests/.jscsrc'
|
|
|
|
},
|
|
|
|
|
|
|
|
files: {
|
|
|
|
src: [
|
|
|
|
'tests/**/*.js'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
shell: {
|
2016-06-18 20:30:35 +03:00
|
|
|
'npm-install': {
|
|
|
|
command: 'npm install'
|
|
|
|
},
|
|
|
|
|
|
|
|
'bower-install': {
|
2016-06-26 17:00:51 +03:00
|
|
|
command: path.resolve(cwd + '/node_modules/.bin/bower install')
|
2016-06-18 20:30:35 +03:00
|
|
|
},
|
|
|
|
|
2016-05-24 15:07:31 +03:00
|
|
|
csscombfix: {
|
|
|
|
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -v app/styles')
|
|
|
|
},
|
|
|
|
|
|
|
|
csscomblint: {
|
|
|
|
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -lv app/styles')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-06-18 20:30:35 +03:00
|
|
|
grunt.registerTask('init', 'Install the client dependencies',
|
|
|
|
['shell:npm-install', 'shell:bower-install']
|
|
|
|
);
|
|
|
|
|
2016-05-24 15:07:31 +03:00
|
|
|
grunt.registerTask('lint', 'Run the code style checks and linter',
|
|
|
|
['jshint', 'jscs', 'shell:csscomblint']
|
|
|
|
);
|
|
|
|
};
|