-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (58 loc) · 2.12 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
.PHONY: test
.DEFAULT_GOAL := help
ARG=$(filter-out $@,$(MAKECMDGOALS))
VERSION=$(shell node -p -e 'require("./package.json").version')
help: ## Show this help message
@echo 'usage: make [target] <type> <name>'
@echo
@echo 'Targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
format : ## Enforces a consistent style by parsing your code and re-printing it
npx prettier --write "*.js" ;\
release :
git add -A || exit $? ;\
git commit -m 'release: $(VERSION)' || exit $? ;\
git push origin master || exit $? ;\
git tag $(VERSION) || exit $? ;\
git push --tags || exit $? ;\
npm publish || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released $(VERSION)" || exit 1) ;\
release-beta :
git add -A || exit $? ;\
git commit -m 'release: $(VERSION)' || exit $? ;\
git push origin master || exit $? ;\
git tag $(VERSION) || exit $? ;\
git push --tags || exit $? ;\
npm publish --tag beta || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released $(VERSION)" || exit 1) ;\
release-minor : ## Release a new minor version
make test || exit $? ;\
make dist || exit $? ;\
npm version minor || exit $? ;\
make release || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released new minor $(VERSION)" || exit 1) ;\
release-minor-beta : ## Release a new minor beta version
make test || exit $? ;\
make dist || exit $? ;\
npm version minor || exit $? ;\
make release-beta || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released new minor $(VERSION)" || exit 1) ;\
release-major : ## Release a new major version
make test || exit $? ;\
make dist || exit $? ;\
npm version major || exit $? ;\
make release || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released new major $(VERSION)" || exit 1) ;\
release-major-beta : ## Release a new major beta version
make test || exit $? ;\
make dist || exit $? ;\
npm version major || exit $? ;\
make release-beta || exit $? ;\
([ $$? -eq 0 ] && echo "✓ Released new major $(VERSION)" || exit 1) ;\
test : ## Execute tests
node index.test || exit $? ;\
test-watch : test ## Execute tests on watch mode
npx chokidar-cli "**/*.js" -c "make test" || exit $? ;\
# catch anything and do nothing
%:
@: