-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
99 lines (77 loc) · 1.75 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* jshint esversion: 6 */
const semver = require("semver");
module.exports = function(grunt)
{
var pkg = grunt.file.readJSON('package.json');
var nextVer = semver.inc(pkg.version, 'patch');
grunt.initConfig(
{
// Package
pkg: pkg,
// JSHint
jshint:
{
all: ['Gruntfile.js', 'lib/**/*.js', 'index.js', 'tst/**/*.js', '!**.arch*/**'],
options:
{
node: true,
esversion: 6,
strict: false,
expr: true, // allow tenery operator w/out assignment
laxbreak: true,
"-W138": true, // Allow: Regular parameters should not come after default parameters
}
},
// Tests
mochaTest:
{
test:
{
options:
{
reporter: 'spec',
bail: true
},
src: ['tst/_index.js']
}
},
// Git
gitadd:
{
deploy:
{
options:
{
all: true
}
}
},
gitpush:
{
deploy:
{
options:
{
branch: 'master',
}
}
},
exec:
{
// Update
update: 'npm update',
// Patch
patch: 'npm version patch',
// Publish
publish: 'npm publish --access public',
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-git');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('develop', 'develop', ['jshint', 'mochaTest']);
grunt.registerTask('update', 'update dependencies', ['exec:update', 'mochaTest']);
grunt.registerTask('deploy', 'deploy', ['exec:update', 'develop', 'gitadd:deploy', 'exec:patch']);
grunt.registerTask('publish', 'publish', ['deploy', 'gitpush:deploy', 'exec:publish']);
};