-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.03 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
# Globals
NBIN := node_modules/.bin
SRC := $(shell find src -type f -name "*.js")
TESTS := $(shell find test -type f -name "*.test.js")
EX := $(shell find examples -type f -name "*.js")
ALL := $(SRC) $(TESTS) $(EX)
# Executables
BABEL := $(NBIN)/babel
STANDARD := $(NBIN)/standard
DEPCHECK := $(NBIN)/npm-check
NYC := $(NBIN)/nyc
AVA := $(NBIN)/ava -v
COVERALLS := $(NBIN)/coveralls
# Get dependencies.
install:
@npm install
# Build w/ babel.
build: install
@$(BABEL) src -d lib
# Run unit tests.
test-unit:
@$(AVA)
# Check coverage.
coverage: install
@$(NYC) $(AVA)
# Review code.
lint: install
@$(STANDARD) $(ALL)
# Fix as many linter errors as possible.
fmt: install
@$(STANDARD) --fix $(ALL)
# Test code.
test: lint test-unit
# Test -> coverage -> check.
test-ci: test coverage
@$(NYC) report -r=text-lcov | $(COVERALLS)
# Push.
ship: build
# update "version" in package.json
# git release (tag, push)
npm publish
# Bye, temp files.
clean:
@rm -rf coverage .nyc_output node_modules
# Don't get confused.
.PHONY: test coverage lint