-
Notifications
You must be signed in to change notification settings - Fork 76
/
Makefile
70 lines (56 loc) · 1.23 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
59
60
61
62
63
64
65
66
67
68
69
70
MAKEFLAGS += --warn-undefined-variables
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := all
.DELETE_ON_ERROR:
.SUFFIXES:
TEST ?= node
version ?= patch
node_modules: package.json
@npm prune
@npm install
@touch node_modules
.PHONY: clean
clean:
@$(RM) -fr node_modules
@$(RM) -fr npm-debug.log
@$(RM) -fr coverage
.PHONY: fmt
fmt: node_modules
@standard --fix
.PHONY: lint
lint: node_modules
@standard
.PHONY: test
test: lint
@if [ "$(TEST)" = "browser" ]; \
then make test-browser; \
else make test-node; \
fi
.PHONY: test-node
test-node: node_modules
tape test/index.js
.PHONY: test-browser
test-browser: node_modules
ifeq ($(TRAVIS_PULL_REQUEST),true)
zuul -- test/index.js
endif
.PHONY: zuul
zuul: node_modules
zuul --local 8080 --ui tape -- test/index.js
.PHONY: release
release: test
npm version $(version)
git push && git push --tags
npm publish
.PHONY: coverage
coverage: node_modules index.js test/index.js node_modules
@istanbul cover --report html --print detail ./test/index.js
@touch coverage
.PHONY: coveralls
coveralls: node_modules coverage
@istanbul report lcov
(cat coverage/lcov.info | coveralls) || exit 0
.PHONY: travis
travis: test coveralls