- Narrow the worktree-id/T3-path check to docs/superpowers/specs and docs/superpowers/plans. Scanning the whole repo flagged any legitimate reference to .t3/worktrees or t3code-<hex> (fixtures, example configs) and would block unrelated commits. - Switch the pre-commit hook shebang to bash and call the check via an absolute path derived from git rev-parse so the hook works regardless of the cwd git happens to invoke it from. - install-hooks now warns when it overwrites an existing core.hooksPath rather than silently clobbering a custom setup. - Add make verify-local-paths to the AGENTS.md pre-MR checklist so contributors run it explicitly even when --no-verify is used. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
78 lines
2.6 KiB
Makefile
78 lines
2.6 KiB
Makefile
.PHONY: frontend build dev-frontend dev-backend dev-proxy dev-transcode lint clean jellyfin-web-bundle migrate-continuum-check verify-local-paths install-hooks
|
|
|
|
GIT_COMMON_DIR := $(strip $(shell git rev-parse --git-common-dir 2>/dev/null))
|
|
MAIN_CHECKOUT_ROOT := $(if $(GIT_COMMON_DIR),$(abspath $(GIT_COMMON_DIR)/..))
|
|
SHARED_MAKEFILE_LOCAL := $(if $(GIT_COMMON_DIR),$(abspath $(GIT_COMMON_DIR)/../Makefile.local))
|
|
DEFAULT_PLUGIN_SDK_DIR := $(abspath ../silo-plugin-sdk)
|
|
SHARED_PLUGIN_SDK_DIR := $(if $(MAIN_CHECKOUT_ROOT),$(abspath $(MAIN_CHECKOUT_ROOT)/../silo-plugin-sdk))
|
|
|
|
ifneq ($(wildcard $(DEFAULT_PLUGIN_SDK_DIR)),)
|
|
DEV_PLUGIN_SDK_DIR ?= $(DEFAULT_PLUGIN_SDK_DIR)
|
|
else ifneq ($(wildcard $(SHARED_PLUGIN_SDK_DIR)),)
|
|
DEV_PLUGIN_SDK_DIR ?= $(SHARED_PLUGIN_SDK_DIR)
|
|
endif
|
|
|
|
JELLYFIN_WEB_OUTPUT_DIR ?= third_party/jellyfin-web
|
|
|
|
# Build the frontend (requires pnpm)
|
|
frontend:
|
|
cd web && pnpm install --frozen-lockfile && pnpm run build
|
|
|
|
# Build the Go binary (depends on frontend)
|
|
build: frontend
|
|
go build -o silo ./cmd/silo/
|
|
|
|
# Run frontend dev server (proxies API to localhost:8080)
|
|
dev-frontend:
|
|
cd web && pnpm run dev
|
|
|
|
# Run the Go backend (integrated mode)
|
|
dev-backend:
|
|
go run ./cmd/silo/
|
|
|
|
# Run a proxy node (stateless stream proxy, no DB required)
|
|
dev-proxy:
|
|
go run ./cmd/silo/ --mode=proxy
|
|
|
|
# Run a transcode node (HLS transcode worker, no DB required)
|
|
dev-transcode:
|
|
go run ./cmd/silo/ --mode=transcode
|
|
|
|
# Lint Go and frontend code
|
|
lint:
|
|
golangci-lint run
|
|
cd web && pnpm run lint
|
|
|
|
# Check committed content for local machine path leaks.
|
|
verify-local-paths:
|
|
scripts/check-local-path-leaks.sh
|
|
|
|
# Install repo-local git hooks for this checkout/worktree.
|
|
install-hooks:
|
|
@existing="$$(git config --local core.hooksPath 2>/dev/null || true)"; \
|
|
if [ -n "$$existing" ] && [ "$$existing" != ".githooks" ]; then \
|
|
echo "warning: overwriting existing local core.hooksPath ($$existing) with .githooks"; \
|
|
fi
|
|
git config core.hooksPath .githooks
|
|
|
|
# Fetch and build the pinned Jellyfin Web bundle
|
|
jellyfin-web-bundle:
|
|
JELLYFIN_WEB_OUTPUT_DIR=$(JELLYFIN_WEB_OUTPUT_DIR) scripts/fetch-jellyfin-web.sh
|
|
|
|
# Read-only preflight for Continuum Docker installs moving to Silo.
|
|
migrate-continuum-check:
|
|
scripts/migrate-continuum-docker.sh check
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -rf web/dist web/node_modules silo
|
|
|
|
# Include developer-specific targets (gitignored, optional).
|
|
# In Git worktrees, fall back to the main checkout's Makefile.local so custom
|
|
# targets like dev-deploy work without per-worktree symlinks or copies.
|
|
ifneq ($(wildcard Makefile.local),)
|
|
include Makefile.local
|
|
else ifneq ($(wildcard $(SHARED_MAKEFILE_LOCAL)),)
|
|
include $(SHARED_MAKEFILE_LOCAL)
|
|
endif
|