-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
41 lines (30 loc) · 938 Bytes
/
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
.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'))
LIB = $(SRC:src/%=lib/%)
MOCHA_OPTS = -R dot --require babel-core/register
build::
@$(MAKE) -j 8 $(LIB)
lint::
@$(BIN)/eslint src
check::
@$(BIN)/flow --show-all-errors src
test::
@$(BIN)/mocha $(MOCHA_OPTS) $(TESTS)
ci::
@$(BIN)/mocha $(MOCHA_OPTS) --watch --watch-extensions json,md $(TESTS)
doctoc:
@$(BIN)/doctoc --title '**Table of Contents**' ./README.md
version-major version-minor version-patch:: lint check 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 $@ $<