All checks were successful
check / check (push) Successful in 26s
Add a new well at the bottom of the settings view that displays: - License (GPL-3.0) - Author (sneak) - Version (from package.json) - Build date (injected at build time) - Git commit short hash (linked to Gitea commit URL) Build-time injection: build.js now reads the git commit hash and version from package.json, injecting them via esbuild define constants. The Dockerfile and Makefile pass commit hashes as build args so the info is available even when .git is excluded from the Docker context. Easter egg: clicking the version number 10 times reveals a hidden debug well below the About well, containing a toggle for debug mode. The debug mode flag is persisted in state and enables verbose console logging via the runtime debug flag in the logger. closes #144
49 lines
1022 B
Makefile
49 lines
1022 B
Makefile
.PHONY: install test lint fmt fmt-check check docker hooks build clean dev
|
|
|
|
install:
|
|
@yarn install
|
|
|
|
test:
|
|
@echo "Running tests..."
|
|
@timeout 30 yarn run test 2>&1
|
|
|
|
lint:
|
|
@echo "Linting..."
|
|
@yarn run lint 2>&1
|
|
|
|
fmt:
|
|
@echo "Formatting..."
|
|
@yarn run fmt 2>&1
|
|
|
|
fmt-check:
|
|
@echo "Checking formatting..."
|
|
@yarn run fmt-check 2>&1
|
|
|
|
check: test lint fmt-check
|
|
|
|
build:
|
|
@echo "Building extension..."
|
|
@yarn run build 2>&1
|
|
|
|
clean:
|
|
@rm -rf dist/
|
|
|
|
dev:
|
|
@echo "Building in watch mode..."
|
|
@yarn run build --watch 2>&1
|
|
|
|
docker:
|
|
@docker build \
|
|
--build-arg GIT_COMMIT_SHORT=$$(git rev-parse --short HEAD 2>/dev/null || echo unknown) \
|
|
--build-arg GIT_COMMIT_FULL=$$(git rev-parse HEAD 2>/dev/null || echo unknown) \
|
|
-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."
|