.PHONY: up down install

## Start Storybook on http://localhost:6006 (runs install tasks first) and open the browser
up:
	docker compose up --build -d storybook
	@echo "Waiting for Storybook to be ready..."
	@until curl -sf -o /dev/null http://localhost:6006; do sleep 1; done
	@open http://localhost:6006 2>/dev/null || xdg-open http://localhost:6006

## Stop the stack
down:
	docker compose down

## Run install tasks only (composer, npm root, pnpm .storybook)
install:
	docker compose run --rm composer-install
	docker compose run --rm npm-install
	docker compose run --rm pnpm-install
