forked from andreypopp/react-derivable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.18 KB
/
Makefile
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
.DELETE_ON_ERROR:
BIN = ./node_modules/.bin
TESTS = $(shell find src -path '*/__tests__/*-test.js')
FIXTURES = $(shell find src -path '*/__tests__/*-fixture/*.js')
SRC = $(filter-out $(TESTS) $(FIXTURES), \
$(shell find src -name '*.js' -or -name '*.js.flow'))
LIB = $(SRC:src/%=lib/%)
MOCHA_OPTS = -R dot --require ./src/__tests__/setup.js
build::
@$(MAKE) -j 8 $(LIB)
benchmark: build
@node ./benchmark/index.js
lint::
@$(BIN)/eslint src
check::
@$(BIN)/flow --show-all-errors src
test::
@$(BIN)/babel-node $(BIN)/_mocha $(MOCHA_OPTS) $(TESTS)
test-flow::
@(cd test_flow/ && npm install && $(BIN)/flow check-contents < ./index.js)
ci::
@$(BIN)/babel-node $(BIN)/_mocha --watch $(MOCHA_OPTS) $(TESTS)
doctoc:
@$(BIN)/doctoc --title '**Table of Contents**' ./README.md
version-major version-minor version-patch:: lint test build
@npm version $(@:version-%=%)
publish::
@npm publish
@git push --tags origin HEAD:master
clean::
@rm -rf lib
lib/%.js: src/%.js
@echo "Building $<"
@mkdir -p $(@D)
@$(BIN)/babel $(BABEL_OPTIONS) -o $@ $<
lib/%.js.flow: src/%.js.flow
@echo "Building $<"
@mkdir -p $(@D)
@cp $< $@