-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (49 loc) · 1.51 KB
/
Makefile
File metadata and controls
66 lines (49 loc) · 1.51 KB
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
#
# Makefile
# edgardleal, 2020-03-12 09:50
#
DONE = echo ✓ $@ done
SOURCES = $(shell find src/ -type f -name '*.ts')
JSON_GET_VALUE = grep $1 | head -n 1 | sed 's/[," ]//g' | cut -d : -f 2
APP_NAME = $(shell cat package.json 2>/dev/null | $(call JSON_GET_VALUE,name))
modules = $(wildcard node_modules/*/*.js)
.PHONY: all clean help run build install lint
all: run
node_modules/.last_lint: $(SOURCES)
yarn lint
@touch $@
lint: ## lint: run eslint
lint: node_modules/.last_lint
@$(DONE)
node_modules/.bin/tsc: package.json
yarn || npm i
@touch $@
run: ## run: build and run this project
run: dist/index.js
DEBUG=project* node dist/index.js
index.ts: $(SOURCES)
dist/index.js: index.ts node_modules/.last_lint node_modules/.bin/tsc coverage/index.html
./node_modules/.bin/tsc -p tsconfig.json
build: ## build: transpile typescript to javascript
build: dist/index.js
@$(DONE)
node_modules/.bin/jest: package.json
yarn || npm i
@touch $@
install: ## install: install project dependencies
install: node_modules/.bin/jest
@$(DONE)
coverage/index.html: $(SOURCES) node_modules/.bin/jest
DEBUG=project* yarn test --coverage --coverageReporters html
test: ## test: run unit tests
test: coverage/index.html
@$(DONE)
clean: ## clean: Remove ./node_modules and call clean in all children projects
git clean -fdX
@$(DONE)
hel%: ## help: Show this help message.
@echo "usage: make [target] ..."
@echo ""
@echo "targets:"
@grep -Eh '^.+:\ ##\ .+' ${MAKEFILE_LIST} | cut -d ' ' -f '3-' | column -t -s ':'
# vim:ft=make