-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 928 Bytes
/
Makefile
File metadata and controls
51 lines (38 loc) · 928 Bytes
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
.PHONY: build dev lint test watch-test pre-commit-check install-pre-commit
build: node_modules
npx vite build
dev: node_modules install-pre-commit
npx vite --host 0
lint: node_modules
npx prettier --write .
test: node_modules
npx vitest run --coverage
watch-test: node_modules
npx vitest --coverage
pre-commit-check: pre-commit-lint test
pre-commit-lint: node_modules
@npx prettier --check $$( \
git diff --name-only --cached \
) || ( \
npx prettier --write . ; \
exit 1 ; \
)
install-pre-commit: .git/hooks/pre-commit
.git/hooks/pre-commit:
printf '%s\n' \
'#!/bin/bash' \
'' \
'make pre-commit-check' \
> '$@'
chmod +x '$@'
.PHONY: dep-npm
deps: dep-npm node_modules
dep-npm:
@npm --version >/dev/null 2>&1 || ( \
printf '%s\n' \
'NPM required!' \
'https://nodejs.org/en/download/package-manager' ; \
exit 1 ; \
)
node_modules: package.json package-lock.json | dep-npm
npm ci