-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (43 loc) · 939 Bytes
/
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
SHELL := /bin/bash
NODE_MODULES := node_modules
OUT := dist
.PHONY: setup
setup: install
@$(NODE_MODULES)/.bin/husky
# ---
.PHONY: install
install:
@make $(NODE_MODULES)
.PHONY: build
build:
@make $(OUT)
$(NODE_MODULES): package.json pnpm-lock.yaml
@pnpm install
$(OUT): src/** tsconfig.json package.json
@$(NODE_MODULES)/.bin/tsc --outDir $(OUT)
@touch $(OUT)
# ---
.PHONY: check
check: lint type test
.PHONY: lint
lint:
@$(NODE_MODULES)/.bin/biome check .
.PHONY: fix
fix:
@$(NODE_MODULES)/.bin/biome check . --apply
.PHONY: type
type:
@$(NODE_MODULES)/.bin/tsc --noEmit
.PHONY: test
test: ./src/option.doctest.ts
@$(NODE_MODULES)/.bin/vitest
.PHONY: coverage
coverage:
@$(NODE_MODULES)/.bin/vitest run --coverage --coverage.reporter html
@open coverage/index.html
.PHONY: clean
clean:
@rm -rf $(OUT)
# ---
./src/option.doctest.ts: ./src/option.ts
@$(NODE_MODULES)/.bin/tsdoc-testify --filepath $<