# platform-contracts — package Makefile (CONVENTIONS.md §11 delegation contract).
# Dual-language leaf package: @demystify/platform-contracts (TS) + demystify-platform-contracts (Py).
# Targets: setup lint test build integration (+ pack, sync-vendored helpers).

SHELL := /bin/bash
UV := uv
PNPM := pnpm

.PHONY: setup lint test build integration pack sync-vendored

setup:
	$(PNPM) install --frozen-lockfile || $(PNPM) install
	$(UV) sync --extra dev

lint:
	$(PNPM) run lint
	$(UV) run ruff check .
	$(UV) run ruff format --check .
	$(UV) run mypy src

test:
	$(PNPM) run test
	$(UV) run pytest -q

build:
	$(PNPM) run build
	$(UV) build

# Publishable-artifact dry runs (both registries).
pack: build
	npm pack --dry-run
	$(UV) build

# No infra/docker for a leaf contracts package; nothing to do.
integration:
	@echo "platform-contracts: no tier-3 integration (leaf package, no infra)"

# Regenerate every module's vendored docs/contracts/* markdown from this source.
# Run by MODULE agents during adoption — NOT part of setup/test/build.
sync-vendored:
	node scripts/sync-vendored.mjs $(ARGS)
