-
Notifications
You must be signed in to change notification settings - Fork 15
/
Gruntfile.coffee
69 lines (53 loc) · 1.76 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
currentVersion = 'v1.1.0'
module.exports = (grunt) ->
grunt.config.init
'mocha-chai-sinon':
spec:
src: [
'spec/lib/*.coffee'
]
options:
ui: 'bdd'
reporter: 'spec'
require: 'coffee-script/register'
single:
src: [
grunt.option('file') ? 'spec/lib/interval-tree.coffee'
]
options:
ui: 'bdd'
reporter: 'spec'
require: 'coffee-script/register'
yuidoc:
options:
paths: ['src']
syntaxtype: 'coffee'
extension: '.coffee'
master:
options:
outdir: 'doc'
coffee:
dist:
expand: true
cwd: 'src/lib'
src: ['**/*.coffee']
dest: 'dist/lib/'
ext: '.js'
extDot: 'first'
options:
bare: true
grunt.registerTask 'web', ->
done = @async()
browserify = require('browserify')
b = browserify './src/web-entry.coffee',
extensions: '.coffee'
b.transform('coffeeify')
b.bundle (err, buf) ->
require('fs').writeFileSync 'dist/interval-tree.js', buf.toString()
done()
grunt.loadNpmTasks 'grunt-mocha-chai-sinon'
grunt.loadNpmTasks 'grunt-contrib-yuidoc'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.registerTask 'default', 'mocha-chai-sinon:spec'
grunt.registerTask 'single', 'mocha-chai-sinon:single'
grunt.registerTask 'build', ['coffee:dist']