.PHONY: install dev build preview typecheck test sync release release-verify clean feat-roadmap

install:
	npm install

dev:
	npm run dev

build:
	npm run build

preview:
	npm run preview

typecheck:
	npm run typecheck

test:
	npm run test:e2e

sync:
	npm run sync:bimr

# Public npm registry hosting @bimr/web. Written into the release .npmrc so a
# fresh clone resolves it. Override if the registry moves.
PUBLIC_NPM_REGISTRY ?= https://fordj.org/api/packages/rvba/npm/

# Publish a no-history snapshot to gitaec.org/rvba/bimr-studio.git (matching
# the BIMR release flow). Requires a clean tree; confirm the push when asked.
# Optional message: make release MSG="release: studio 0.1.0"
release:
	PUBLIC_NPM_REGISTRY=$(PUBLIC_NPM_REGISTRY) scripts/release.sh bimr-studio "$(MSG)"

# Verify a published snapshot: fresh clone from gitaec → install → build.
release-verify:
	rm -rf /tmp/bimr-studio-release
	git clone https://gitaec.org/rvba/bimr-studio.git /tmp/bimr-studio-release
	cd /tmp/bimr-studio-release && npm install && npm run build

clean:
	rm -rf dist node_modules test-results playwright-report

# Work on the roadmap feature branch: switch to it, fast-forward, run dev.
feat-roadmap:
	git checkout feat/roadmap
	git pull --ff-only
	npm run dev
