Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims
This commit is contained in:
36
Makefile
36
Makefile
@@ -1,27 +1,27 @@
|
||||
.PHONY: test lint fmt fmt-check check build build-bin install dev clean docker hooks
|
||||
|
||||
# Use `timeout` (GNU coreutils) when available so `make test` is hard-capped.
|
||||
# On macOS without coreutils this is empty and the cap is skipped.
|
||||
TIMEOUT := $(shell command -v timeout 2>/dev/null || command -v gtimeout 2>/dev/null)
|
||||
.PHONY: bootstrap setup test lint fmt fmt-check check build build-bin install dev clean docker hooks
|
||||
|
||||
YARN := yarn run
|
||||
|
||||
bootstrap:
|
||||
@script/bootstrap
|
||||
|
||||
setup:
|
||||
@script/setup
|
||||
|
||||
test:
|
||||
@$(TIMEOUT) $(if $(TIMEOUT),30s,) $(YARN) vitest run --reporter=dot || \
|
||||
{ echo "--- Rerunning with verbose for details ---"; \
|
||||
$(YARN) vitest run --reporter=verbose; exit 1; }
|
||||
@script/test
|
||||
|
||||
lint:
|
||||
@$(YARN) eslint .
|
||||
@$(YARN) prettier --check .
|
||||
@script/lint
|
||||
|
||||
fmt:
|
||||
@$(YARN) prettier --write .
|
||||
@script/fmt
|
||||
|
||||
fmt-check:
|
||||
@$(YARN) prettier --check .
|
||||
@script/fmt-check
|
||||
|
||||
check: test lint fmt-check
|
||||
check:
|
||||
@script/check
|
||||
|
||||
build:
|
||||
@$(YARN) tsc
|
||||
@@ -41,13 +41,7 @@ clean:
|
||||
@rm -rf dist coverage .vitest-cache *.tsbuildinfo
|
||||
|
||||
docker:
|
||||
docker build -t quak .
|
||||
@script/docker
|
||||
|
||||
hooks:
|
||||
@printf '#!/bin/sh\nset -e\nmake lint\nmake fmt-check\n' > .git/hooks/pre-commit
|
||||
@chmod +x .git/hooks/pre-commit
|
||||
@echo "Installed pre-commit hook (runs make lint && make fmt-check)."
|
||||
@echo "Note: tests are deliberately not in the pre-commit hook so the"
|
||||
@echo "TDD red-phase commit (failing tests, no implementation yet)"
|
||||
@echo "can land. CI runs make check via docker build, which catches"
|
||||
@echo "any branch that ships red."
|
||||
@script/install-precommit
|
||||
|
||||
Reference in New Issue
Block a user