Skip to content

Commit 8d9ce00

Browse files
committed
Add Makefile
1 parent d69b1d9 commit 8d9ce00

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/.tools
12
/node_modules

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
TOOLS := ${CURDIR}/.tools
2+
TARGETS := $$(find . \( -name '*.ts' -or -name '*.md' \) -not -path './.node/*' -not -path './node_modules/*')
3+
4+
.DEFAULT_GOAL := help
5+
6+
help:
7+
@cat $(MAKEFILE_LIST) | \
8+
perl -ne 'print if /^\w+.*##/;' | \
9+
perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'
10+
11+
tools: FORCE ## Install development tools
12+
@mkdir -p ${TOOLS}
13+
@deno install -A -f -n udd --root ${TOOLS} https://deno.land/x/[email protected]/main.ts
14+
15+
fmt: FORCE ## Format code
16+
@deno fmt ${TARGETS}
17+
18+
fmt-check: FORCE ## Format check
19+
@deno fmt --check ${TARGETS}
20+
21+
lint: FORCE ## Lint code
22+
@deno lint ${TARGETS}
23+
24+
type-check: FORCE ## Type check
25+
@deno test --unstable --no-run ${TARGETS}
26+
27+
test: FORCE ## Test
28+
@deno test --unstable -A ${TARGETS}
29+
30+
update: FORCE ## Update dependencies
31+
@${TOOLS}/bin/udd ${TARGETS}
32+
@make fmt
33+
34+
FORCE:

0 commit comments

Comments
 (0)