Installs Storybook 10.4 in apps/app/ as a component-development and autodoc tool. Configures viteFinal with all seven SPA aliases so stories resolve imports identically to the dev/build pipeline. preview.ts reuses @/plugins/primevue's installPrimeVue() so Storybook stays in lock-step with main.ts whenever the PrimeVue config changes. Only the addons we need are wired: addon-docs (autodocs) and addon-a11y (axe-core checks). addon-interactions is intentionally omitted — interaction testing stays in Playwright CT per the testing architecture. Seed stories: PrimeVue Button (Primary/Secondary/Danger), Tailwind utility box, and FormField (Default/WithError/Disabled) wrapped in @primevue/forms Form + Zod resolver. Adds make storybook target alongside make app / make docs.
110 lines
4.7 KiB
Makefile
110 lines
4.7 KiB
Makefile
.PHONY: help services services-stop services-glitchtip-status api app docs migrate fresh db-shell test test-db-create schema-dump storybook
|
|
|
|
# Colors
|
|
GREEN := \033[0;32m
|
|
YELLOW := \033[0;33m
|
|
CYAN := \033[0;36m
|
|
NC := \033[0m
|
|
|
|
# Compose files merged for local dev. Both files share one project so
|
|
# Mailpit (bm_mailpit) is reachable from the GlitchTip containers.
|
|
COMPOSE_FILES := -f docker-compose.yml -f docker-compose.glitchtip.yml
|
|
|
|
help:
|
|
@echo ""
|
|
@echo "$(GREEN)╔══════════════════════════════════════════════════════════════╗$(NC)"
|
|
@echo "$(GREEN)║ CREWLI - Development Commands ║$(NC)"
|
|
@echo "$(GREEN)╚══════════════════════════════════════════════════════════════╝$(NC)"
|
|
@echo ""
|
|
@echo " $(YELLOW)Services (Docker):$(NC)"
|
|
@echo " make services Start MySQL, Redis, Mailpit, GlitchTip"
|
|
@echo " make services-stop Stop all Docker services"
|
|
@echo " make services-glitchtip-status Tail GlitchTip web container logs"
|
|
@echo ""
|
|
@echo " $(YELLOW)Development Servers:$(NC)"
|
|
@echo " make api Laravel API → http://localhost:8000"
|
|
@echo " make app Organizer SPA → http://localhost:5174"
|
|
@echo " make docs VitePress docs → http://localhost:5176"
|
|
@echo " make storybook Storybook (apps/app) → http://localhost:6006"
|
|
@echo ""
|
|
@echo " $(YELLOW)Database:$(NC)"
|
|
@echo " make migrate Run migrations"
|
|
@echo " make fresh Fresh migrate + seed"
|
|
@echo " make db-shell Open MySQL shell"
|
|
@echo " make test-db-create Create crewli_test database (one-time)"
|
|
@echo " make schema-dump Regenerate MySQL schema dump (run after new migrations)"
|
|
@echo ""
|
|
@echo " $(YELLOW)Testing:$(NC)"
|
|
@echo " make test Run PHPUnit suite (creates crewli_test if needed)"
|
|
@echo ""
|
|
|
|
services:
|
|
@echo "$(GREEN)Starting Docker services...$(NC)"
|
|
@docker compose $(COMPOSE_FILES) up -d
|
|
@echo ""
|
|
@echo "$(GREEN)Services:$(NC)"
|
|
@echo " $(CYAN)MySQL:$(NC) localhost:3306 (crewli / secret)"
|
|
@echo " $(CYAN)Redis:$(NC) localhost:6379"
|
|
@echo " $(CYAN)Mailpit:$(NC) http://localhost:8025"
|
|
@echo " $(CYAN)GlitchTip:$(NC) http://localhost:8200"
|
|
@echo ""
|
|
@echo "$(YELLOW)Waiting for MySQL...$(NC)"
|
|
@until docker exec bm_mysql mysqladmin ping -h localhost -u root -proot --silent 2>/dev/null; do sleep 1; done
|
|
@echo "$(GREEN)✓ Ready!$(NC)"
|
|
@echo "$(YELLOW)Note:$(NC) GlitchTip web takes ~60s on first boot (migrations)."
|
|
@echo " Tail logs with: $(CYAN)make services-glitchtip-status$(NC)"
|
|
|
|
services-stop:
|
|
@docker compose $(COMPOSE_FILES) down
|
|
@echo "$(GREEN)✓ Services stopped$(NC)"
|
|
|
|
services-glitchtip-status:
|
|
@docker compose $(COMPOSE_FILES) logs -f glitchtip-web
|
|
|
|
api:
|
|
@echo "$(GREEN)Starting Laravel API → http://localhost:8000$(NC)"
|
|
@cd api && php artisan serve
|
|
|
|
app:
|
|
@echo "$(GREEN)Starting Organizer SPA → http://localhost:5174$(NC)"
|
|
@cd apps/app && pnpm dev
|
|
|
|
docs:
|
|
@echo "$(GREEN)Starting VitePress docs → http://localhost:5176$(NC)"
|
|
@cd docs && npm run docs:dev
|
|
|
|
migrate:
|
|
@cd api && php artisan migrate
|
|
|
|
fresh:
|
|
@cd api && php artisan migrate:fresh --seed
|
|
|
|
db-shell:
|
|
@docker exec -it bm_mysql mysql -u crewli -psecret crewli
|
|
|
|
test-db-create:
|
|
@echo "$(GREEN)Creating crewli_test database...$(NC)"
|
|
@docker exec bm_mysql mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS crewli_test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON crewli_test.* TO 'crewli'@'%'; FLUSH PRIVILEGES;"
|
|
@echo "$(GREEN)✓ crewli_test ready$(NC)"
|
|
|
|
test: test-db-create
|
|
@cd api && php artisan test
|
|
|
|
# Regenerate api/database/schema/mysql-schema.sql via Laravel's native
|
|
# `schema:dump` command. Brings crewli_test to head first so the dump
|
|
# always reflects the latest migration set. Requires mysql-client on
|
|
# host PATH (see CLAUDE.md "Schema dumps (CI fast path)").
|
|
#
|
|
# After adding a new migration: run `make schema-dump` and commit the
|
|
# regenerated dump alongside the migration.
|
|
schema-dump: test-db-create
|
|
@echo "$(GREEN)Migrating crewli_test to head...$(NC)"
|
|
@cd api && DB_DATABASE=crewli_test php artisan migrate --force --quiet
|
|
@echo "$(GREEN)Regenerating api/database/schema/mysql-schema.sql...$(NC)"
|
|
@cd api && DB_DATABASE=crewli_test php artisan schema:dump --database=mysql
|
|
@echo "$(YELLOW)Note: Commit the updated schema dump alongside any new migrations.$(NC)"
|
|
|
|
storybook:
|
|
@echo "$(GREEN)Starting Storybook → http://localhost:6006$(NC)"
|
|
@cd apps/app && pnpm storybook
|