-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 1.36 KB
/
Makefile
File metadata and controls
68 lines (54 loc) · 1.36 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
67
68
# Include env file
ifneq (,$(wildcard ./.env))
include .env
export
endif
.DEFAULT_GOAL := all
.PHONY: bootstrap ## setup dev environment
bootstrap: install
npx husky install
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"'
.PHONY: test ## run tests
test:
npx vitest -c vitest.config.ts
.PHONY: testcov ## run test coverage
testcov:
npx vitest run --coverage
.PHONY: build ## compile typescript to /build
build:
npx tsc -p tsconfig.json
npx tsc-alias -p tsconfig.json
.PHONY: clean ## clean installation and dist files
clean:
rm -rf coverage
rm -rf dist
rm -rf node_modules
rm -rf package-lock.json
.PHONY: install ## install dependencies
install:
npm cache clean -f
npm install -g husky
npm install
.PHONY: dev ## run script
dev:
npx vite-node -c vitest.config.ts src/index.ts
.PHONY: format ## auto-format js source files
format:
npx ts-standard --fix
.PHONY: lint ## lint standard js
lint:
npx ts-standard
.PHONE: release ## generate a new release version
release:
npx standard-version
.PHONE: publish
publish: release ## publish a version
git push --follow-tags origin main && npm publish
rebuild: clean deps
all: test lint
.PHONY: help ## display this message
help:
@grep -E \
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-19s\033[0m %s\n", $$2, $$3}'