generator-nodecli
Version:
A Yeoman generator for nodejs modules
62 lines (58 loc) • 1.61 kB
JavaScript
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
complexity: {
generic: {
src: ['app/**/*.js'],
options: {
errorsOnly: false,
cyclometric: 6, // default is 3
halstead: 16, // default is 8
maintainability: 100 // default is 100
}
}
},
bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: false,
prereleaseName: false,
regExp: false
}
},
mochacli: {
all: ['test/**/*.js'],
options: {
reporter: 'spec',
ui: 'tdd'
}
},
watch: {
js: {
files: ['**/*.js', '!node_modules/**/*.js'],
tasks: ['default'],
options: {
nospawn: true
}
}
}
})
grunt.loadNpmTasks('grunt-complexity')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-bump')
grunt.loadNpmTasks('grunt-mocha-cli')
grunt.registerTask('test', ['complexity', 'mochacli', 'watch'])
grunt.registerTask('ci', ['complexity', 'mochacli'])
grunt.registerTask('default', ['test'])
}