-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
87 lines (70 loc) · 2.68 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.PHONY: test benchmarks
.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 ':#'
benchmarks : ## Run benchmarks
NODE_ENV=production node -r esm benchmarks/index.js || exit $? ; \
build : ## Build distribution files
rm -rf dist || exit $? ; \
npx microbundle --output dist || exit $? ; \
example : ## Execute macro
npx --node-arg '-r esm' babel -d macro/output macro/example.js || exit $? ;\
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: test-macro test-runtime ## Execute all the tests
test-runtime : ## Execute run-time tests
node -r esm index.test || exit $? ;\
test-macro : example ## Execute test macro
node -r esm macro/index.test || exit $? ;\
test-watch : test ## Execute tests on watch mode
npx chokidar-cli "**/*.js" -c "make test" || exit $? ;\
watch : ## Execute dist and watch
npx microbundle --output dist --watch ; \
# catch anything and do nothing
%:
@: