-
-
Notifications
You must be signed in to change notification settings - Fork 217
/
Makefile
59 lines (43 loc) · 1.69 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
ESLINT = node_modules/.bin/eslint --report-unused-disable-directives
ISTANBUL = node_modules/.bin/istanbul
UGLIFYJS = node_modules/.bin/uglifyjs
XYZ = node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z --repo [email protected]:davidchambers/Base64.js.git --script scripts/prepublish
SRC = base64.js
MIN = $(patsubst %.js,%.min.js,$(SRC))
.PHONY: all
all: $(MIN)
%.min.js: %.js
$(UGLIFYJS) $< --compress --mangle > $@
.PHONY: bytes
bytes: base64.min.js
gzip --best --stdout $< | wc -c | tr -d ' '
.PHONY: clean
clean:
rm -f -- $(MIN)
.PHONY: lint
lint:
$(ESLINT) \
--config node_modules/sanctuary-style/eslint-es3.json \
--global $$ \
--global define \
--global exports \
--global module \
--global self \
--rule 'max-len: [off]' \
--rule 'no-plusplus: [off]' \
-- base64.js
$(ESLINT) \
--config node_modules/sanctuary-style/eslint-es3.json \
--env node \
--global describe \
--global it \
-- test/*.js
.PHONY: release-major release-minor release-patch
release-major release-minor release-patch:
@$(XYZ) --increment $(@:release-%=%)
.PHONY: setup
setup:
npm install
.PHONY: test
test:
$(ISTANBUL) cover node_modules/.bin/_mocha -- --reporter spec