-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
58 lines (43 loc) · 1.25 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
54
55
56
57
58
.DELETE_ON_ERROR:
BIN = ./node_modules/.bin
TESTS = $(shell find src -path '*/__tests__/*-test.js')
SRC = $(filter-out $(TESTS), $(shell find src -name '*.js')) $(wildcard src/*.js.flow)
LIB = $(SRC:src/%.js=lib/%.js) $(SRC:src/%.js=lib/%.js.flow)
NODE = $(BIN)/babel-node $(BABEL_OPTIONS)
MOCHA_OPTIONS = --require ./src/__tests__/setup.js
MOCHA = $(BIN)/_mocha $(MOCHA_OPTIONS)
NYC_OPTIONS = --all --require babel-core/register
NYC = $(BIN)/nyc $(NYC_OPTIONS)
build:
@$(MAKE) -j 8 $(LIB)
lint:
@$(BIN)/eslint src
check:
@$(BIN)/flow
test::
@NODE_ENV=test $(BIN)/jest
ci:
@NODE_ENV=test $(BIN)/jest --watch
storybook:
@$(BIN)/start-storybook -p 6006
storybook-build:
@$(BIN)/build-storybook
doctoc:
@$(BIN)/doctoc --title '**Table of Contents**' ./README.md
test-cov::
@NODE_ENV=test $(BIN)/jest --coverage
version-major version-minor version-patch: lint test
@npm version $(@:version-%=%)
publish: build check test lint
@npm publish
@git push --tags origin HEAD:master
clean:
@rm -rf lib/
lib/%.js: src/%.js
@echo "Building $@"
@mkdir -p $(@D)
@NODE_ENV="production" $(BIN)/babel $(BABEL_OPTIONS) -o $@ $<
lib/%.js.flow: src/%.js
@echo "Building $@"
@mkdir -p $(@D)
@cp $< $@