Skip to content

Commit 693a660

Browse files
committed
Clean up Makefile
1 parent 2b753c1 commit 693a660

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
.PHONY: lint dev build test watch-test pre-commit-check install-pre-commit
1+
.PHONY: build dev lint test watch-test pre-commit-check install-pre-commit
22

3-
build: dep-npm dep-node-modules
3+
build: node_modules
44
npx vite build
55

6-
dev: dep-npm dep-node-modules install-pre-commit
6+
dev: node_modules install-pre-commit
77
npx vite --host 0
88

9-
lint: dep-npm dep-node-modules
9+
lint: node_modules
1010
npx prettier --write .
1111

12-
test: dep-npm dep-node-modules
12+
test: node_modules
1313
npx vitest run --coverage
1414

15-
watch-test: dep-npm dep-node-modules
15+
watch-test: node_modules
1616
npx vitest --coverage
1717

1818
pre-commit-check: pre-commit-lint test
1919

20-
pre-commit-lint: dep-npm dep-node-modules
20+
pre-commit-lint: node_modules
2121
@npx prettier --check $$( \
2222
git diff --name-only --cached \
2323
) || ( \
@@ -36,16 +36,16 @@ install-pre-commit: .git/hooks/pre-commit
3636
chmod +x '$@'
3737

3838

39-
.PHONY: dep-npm dep-node-modules
39+
.PHONY: dep-npm
40+
deps: dep-npm node_modules
4041

4142
dep-npm:
42-
@npm -h 2>&1 | grep 'npm@' > /dev/null 2>&1 || ( \
43+
@npm --version >/dev/null 2>&1 || ( \
4344
printf '%s\n' \
4445
'NPM required!' \
4546
'https://nodejs.org/en/download/package-manager' ; \
4647
exit 1 ; \
4748
)
4849

49-
dep-node-modules: package.json package-lock.json dep-npm
50-
@test -d node_modules > /dev/null 2>&1 \
51-
|| npm install
50+
node_modules: package.json package-lock.json | dep-npm
51+
npm ci

0 commit comments

Comments
 (0)