Prototype commit
Some checks are pending
check / frontend (push) Waiting to run
check / server (push) Waiting to run

This commit is contained in:
Pen Anderson 2026-05-05 09:29:40 -05:00
commit 9884ccd9ed
29 changed files with 3438 additions and 0 deletions

45
Makefile Normal file
View file

@ -0,0 +1,45 @@
SHELL := /usr/bin/env bash
.PHONY: help
help:
@echo "make build — build server + frontend locally (sanity check)"
@echo "make check — type-check + go vet"
@echo "make tag V=patch|minor|major — bump version tag and push"
@echo "make prefetch — print sha256 + npmDepsHash + vendorHash for the homelab module"
.PHONY: build
build:
cd web && npm install && npm run build
cd server && go build -o docent ./...
.PHONY: check
check:
cd web && npm run check
cd server && go vet ./...
.PHONY: tag
tag:
@if [ -z "$(V)" ]; then echo "usage: make tag V=patch|minor|major" >&2; exit 1; fi
@latest=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0"); \
IFS=. read -r maj min pat <<< "$$latest"; \
case "$(V)" in \
major) maj=$$((maj+1)); min=0; pat=0 ;; \
minor) min=$$((min+1)); pat=0 ;; \
patch) pat=$$((pat+1)) ;; \
*) echo "V must be patch|minor|major" >&2; exit 1 ;; \
esac; \
new="v$${maj}.$${min}.$${pat}"; \
echo "tagging $$new"; \
git tag -a "$$new" -m "$$new"; \
git push --tags
.PHONY: prefetch
prefetch:
@latest=$$(git describe --tags --abbrev=0); \
url=$$(git remote get-url origin); \
echo "rev = $$latest"; \
echo "src hash:"; \
nix-prefetch-git "$$url" --rev "$$latest" --quiet | sed -n 's/.*"sha256": "\(.*\)".*/ \1/p'; \
echo ""; \
echo "Run \`nix build .#docent-frontend\` and \`nix build .#docent-server\` once to populate"; \
echo "npmDepsHash and vendorHash respectively (will fail on mismatch and print correct hash)."