-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCakefile
More file actions
77 lines (63 loc) · 2.07 KB
/
Cakefile
File metadata and controls
77 lines (63 loc) · 2.07 KB
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
flour = require 'flour'
cp = require 'child_process'
fs = require 'fs'
browserify = require 'browserify'
task 'build:main', ->
fs.writeFileSync 'lib/indexedup.js', browserify('src/indexedup.js').bundle()
task 'build:dist', ->
minify 'lib/indexedup.js', 'dist/indexedup.min.js'
task 'build:tests', ->
invoke 'lint'
flour.minifiers.js = null
compile 'test/spec.coffee' , 'test/browser/spec.js'
compile 'node_modules/chai/chai.js' , 'test/browser/chai.js'
compile 'node_modules/mocha/mocha.css', 'test/browser/mocha.css'
compile 'node_modules/mocha/mocha.js' , 'test/browser/mocha.js'
compile 'node_modules/buster/resources/buster-test.js' , 'test/levelup/buster-test.js'
compile 'node_modules/buster/resources/buster-test.css', 'test/levelup/buster-test.css'
fs.writeFileSync 'test/levelup/build.js', browserify('test/levelup/simple-test.js').bundle()
task 'build', ->
invoke 'lint'
invoke 'build:main'
invoke 'build:dist'
task 'watch', ->
watch 'src/*.js', -> invoke 'build:main'
task 'watch:tests', ->
invoke 'watch'
do (build = -> invoke 'build:tests')
watch [
'src/indexedup.js'
'test/spec.coffee'
'test/levelup/simple-test.js'
'test/levelup/common.js'
], build
task 'lint', ->
flour.linters.js.options =
forin : true
immed : true
latedef : true
newcap : true
nonew : true
undef : true
unused : true
asi : true
boss : true
eqnull : true
laxbreak : true
laxcomma : true
shadow : true
sub : true
strict : false
unused : false
browser : true
node : true
lint 'src/indexedup.js', (passed) ->
if not passed
process.exit()
throw 'Stop!'
task 'clean', ->
cp.exec 'rm -rf test/testdb*'
task 'test:browser', ->
invoke 'build:tests'
cp.exec 'open test/browser/index.html'
cp.exec 'open test/browser/levelup/index.html'