forked from fczbkk/css-selector-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
95 lines (81 loc) · 2.27 KB
/
Gruntfile.coffee
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
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
banner:
"""
/*
<%= pkg.title %>, v<%= pkg.version %>
by <%= pkg.author %>
<%= pkg.homepage %>
*/
"""
coffeelint:
app: [
'src/css-selector-generator.coffee'
'test/src/css-selector-generator.spec.coffee'
]
jasmine:
default:
src: ['build/css-selector-generator.js']
options:
keepRunner: true
outfile: 'test/_SpecRunner.html'
specs: 'test/spec/css-selector-generator.spec.js'
coffee:
default:
options:
join: true
files:
'build/css-selector-generator.js' : [
'src/css-selector-generator.coffee'
]
'test/spec/css-selector-generator.spec.js' : [
'test/src/complex-example.coffee'
'test/src/css-selector-generator.spec.coffee'
]
uglify:
default:
options:
banner: "<%= banner %>"
files:
'build/css-selector-generator.min.js' : [
'build/css-selector-generator.js'
]
watch:
default:
options:
atBegin: true
files: [
'src/css-selector-generator.coffee'
'test/src/css-selector-generator.spec.coffee'
]
tasks: ['dev']
bump:
options:
files: [
'package.json'
# 'bower.json'
]
updateConfigs: ['pkg']
commitFiles: ['-a']
pushTo: 'origin'
conventionalChangelog:
options:
changelogOpts:
preset: 'angular'
release:
src: 'CHANGELOG.md'
# Constructs the code, runs tests and if everything is OK, creates a minified
# version ready for production. This task is intended to be run manually.
grunt.registerTask 'build', 'Bumps version and builds JS.', (version_type) ->
version_type = 'patch' unless version_type in ['patch', 'minor', 'major']
grunt.task.run [
"bump-only:#{version_type}"
'dev'
'uglify'
'conventionalChangelog'
'bump-commit'
]
grunt.registerTask 'dev', ['coffeelint', 'coffee', 'jasmine']
grunt.registerTask 'default', ['watch']