addons-linter/Gruntfile.js

67 строки
1.4 KiB
JavaScript
Исходник Обычный вид История

var fs = require('fs');
var md = require('markdown-it')();
var emoji = require('markdown-it-emoji');
module.exports = function(grunt) {
// load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns
require('load-grunt-tasks')(grunt);
var configs = require('load-grunt-configs')(grunt, {
config: {
src: 'tasks/*.js',
},
});
grunt.initConfig(configs);
grunt.registerTask('buildrules', 'Build the rules', function() {
md.use(emoji);
var markdown = md.render(fs.readFileSync('docs/rules.md',
{ encoding: 'utf8' }));
var template = fs.readFileSync('docs/rules.tmpl',
{ encoding: 'utf8' });
var html = template.replace('{{MARKDOWN}}', markdown);
fs.writeFileSync('docs/html/index.html', html);
});
2015-10-23 21:27:59 +03:00
grunt.registerTask('start', [
'webpack:eslintwatch',
'webpack:buildwatch',
]);
grunt.registerTask('build', [
'webpack:eslint',
'webpack:build',
]);
grunt.registerTask('publish-rules', [
'copy',
'buildrules',
'gh-pages',
]);
2015-10-08 17:54:41 +03:00
grunt.registerTask('test', [
'clean',
'instrument',
2015-10-23 21:27:59 +03:00
'webpack:eslint',
2015-10-23 18:59:39 +03:00
'webpack:coverage',
2015-10-08 17:54:41 +03:00
'mochaTest',
'storeCoverage',
'makeReport',
'eslint',
'jscs',
]);
2015-10-23 18:59:39 +03:00
grunt.registerTask('test-no-coverage', [
'clean',
2015-10-23 21:27:59 +03:00
'webpack:eslint',
2015-10-23 18:59:39 +03:00
'webpack:test',
'mochaTest',
'eslint',
'jscs',
]);
};