Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims

This commit is contained in:
2026-07-07 00:21:15 +02:00
parent 3ffc0bec80
commit d1c3123b2b
17 changed files with 345 additions and 27 deletions

View File

@@ -1,25 +1,38 @@
.PHONY: install test lint fmt fmt-check check docker hooks build clean dev
.PHONY: bootstrap setup install test lint fmt fmt-check check docker hooks build clean dev
# Standard targets are thin shims; the implementations live in script/
# per the scripts-to-rule-them-all pattern (see the Entrypoints section
# of README.md).
bootstrap:
@script/bootstrap
setup:
@script/setup
install:
@yarn install
test:
@echo "Running tests..."
@timeout 30 yarn run test 2>&1
@script/test
lint:
@echo "Linting..."
@yarn run lint 2>&1
@script/lint
fmt:
@echo "Formatting..."
@yarn run fmt 2>&1
@script/fmt
fmt-check:
@echo "Checking formatting..."
@yarn run fmt-check 2>&1
@script/fmt-check
check: test lint fmt-check
check:
@script/check
docker:
@script/docker
hooks:
@script/install-precommit
build:
@echo "Building extension..."
@@ -31,15 +44,3 @@ clean:
dev:
@echo "Building in watch mode..."
@yarn run build --watch 2>&1
docker:
@docker build -t autistmask .
hooks:
@echo "Installing pre-commit hook..."
@mkdir -p .git/hooks
@echo '#!/usr/bin/env bash' > .git/hooks/pre-commit
@echo 'set -euo pipefail' >> .git/hooks/pre-commit
@echo 'make check' >> .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed."