-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.coffee
101 lines (92 loc) · 3.19 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
96
97
98
99
100
module.exports = (grunt)->
grunt.initConfig
jade:
examples:
options:
pretty: true
files: [
cwd: 'examples/'
src: ['*.jade', '!template.jade']
dest: 'demo/'
ext: '.html'
expand: true
flatten: true
]
copy:
demo:
cwd: 'dist/'
src: '*'
dest: 'demo/'
expand: true
flatten: true
stylus:
light:
files:
'dist/forest-d3.css': ['style/*.styl']
options:
compress: false
import: ['variables/light']
dark:
files:
'dist/forest-d3-dark.css': ['style/*.styl']
options:
compress: false
import: ['variables/dark']
coffeelint:
client:
files:
src: ['src/*.coffee']
options:
configFile: 'coffeelint.json'
coffee:
options:
bare: false
client:
files:
'dist/forest-d3.js': [
'src/main.coffee'
'src/base.coffee'
'src/visualizations/*.coffee'
'src/utils.coffee'
'src/data.coffee'
'src/plugins/*.coffee'
'src/features/*.coffee'
'src/chart.coffee'
'src/bar-chart.coffee'
'src/stacked-chart.coffee'
'src/pie-chart.coffee'
]
examples:
expand: true
flatten: true
src: 'examples/src/*.coffee'
dest: 'demo/'
ext: '.js'
karma:
client:
options:
browsers: ['Firefox']
frameworks: ['mocha', 'sinon-chai']
reporters: ['spec', 'coverage']
junitReporter:
outputFile: 'karma.xml'
singleRun: true
preprocessors:
'dist/*.js': ['coverage']
'test/*.coffee': 'coffee'
files: [
'node_modules/d3/d3.js'
'node_modules/jquery/dist/jquery.js'
'dist/*.js'
'dist/*.css'
'test/*.coffee'
]
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-jade'
grunt.loadNpmTasks 'grunt-contrib-stylus'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-karma'
grunt.registerTask 'examples', ['coffee', 'stylus', 'jade', 'copy']
grunt.registerTask 'test', ['coffee', 'karma']
grunt.registerTask 'default', ['coffeelint','examples', 'karma']