# mise-en-place (mise) configuration
# Tool version management and project setup
# Install mise: https://mise.jdx.dev/getting-started.html
[tools]
# Java 21 - Required for the project
java = "21.0.0"
# Gradle - Build tool
gradle = "8.5"
# Node.js - Required for frontend development
node = "20.11.0"
# Docker - For containerized services
# Note: Docker version managed by system, not mise
# Ollama - LLM runtime
# Note: Ollama installed separately, not via mise
[env]
# Project-specific environment variables
# These are loaded when entering the project directory
# Database Configuration
DB_USERNAME = "postgres"
DB_PASSWORD = "postgres"
# Redis Configuration
REDIS_HOST = "localhost"
REDIS_PORT = "6379"
# Ollama Configuration
OLLAMA_BASE_URL = "http://localhost:11434"
OLLAMA_MODEL = "deepseek-coder:6.7b"
# Repository Clone Path
REPO_CLONE_PATH = "./repos"
# Essential development workflow tasks
# For complete command reference, see COMMANDS.md
[tasks.setup]
description = "Full project setup - installs mise, tools, and starts services"
# Note: This task is typically run via the setup scripts which handle mise installation
# The scripts then call mise tasks for the actual setup work
run = "echo 'Please run: ./scripts/setup.ps1 (Windows) or ./scripts/setup.sh (Linux/Mac)'"
[tasks.start-services]
description = "Start Docker services (PostgreSQL and Redis)"
run_windows = "powershell -File scripts/start-services.ps1"
run = "bash scripts/start-services.sh"
[tasks.stop-services]
description = "Stop Docker services"
run_windows = "powershell -File scripts/stop-services.ps1"
run = "bash scripts/stop-services.sh"
[tasks.build]
description = "Build the project (without tests)"
run_windows = "powershell -File scripts/gradle-build.ps1"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew build -x test; else gradle build -x test; fi'"
[tasks.build-all]
description = "Build the project with tests"
run_windows = "powershell -File scripts/gradle-build.ps1 -WithTests"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew build; else gradle build; fi'"
[tasks.test]
description = "Run all tests (automatically generates code coverage report)"
run_windows = "powershell -File scripts/gradle-test.ps1"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew test; else gradle test; fi'"
[tasks.test-unit]
description = "Run only unit tests"
run_windows = "powershell -File scripts/gradle-test.ps1 -UnitOnly"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew test --tests \"*Test\" --exclude-tests \"*ComponentTest\"; else gradle test --tests \"*Test\" --exclude-tests \"*ComponentTest\"; fi'"
[tasks.test-component]
description = "Run only component tests (requires Docker)"
run_windows = "powershell -File scripts/gradle-test.ps1 -ComponentOnly"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew test --tests \"adrianmikula.jakartamigration.component.*\"; else gradle test --tests \"adrianmikula.jakartamigration.component.*\"; fi'"
[tasks.test-e2e]
description = "Run only end-to-end tests (requires Docker and database)"
run_windows = "powershell -File scripts/gradle-test.ps1 -E2EOnly"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew test --tests \"adrianmikula.jakartamigration.e2e.*\"; else gradle test --tests \"adrianmikula.jakartamigration.e2e.*\"; fi'"
[tasks.coverage]
description = "Generate code coverage report and open in browser (or print summary)"
run_windows = "powershell -File scripts/gradle-coverage.ps1"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew jacocoTestReport jacocoCoverageSummary; else gradle jacocoTestReport jacocoCoverageSummary; fi; report_path=\"build/reports/jacoco/test/html/index.html\"; xml_path=\"build/reports/jacoco/test/jacocoTestReport.xml\"; if [ -f \"$report_path\" ]; then echo \"\"; echo \"=== Code Coverage Report ===\"; echo \"HTML Report: $(pwd)/$report_path\"; echo \"XML Report: $(pwd)/$xml_path\"; if [ -f \"$xml_path\" ] && command -v grep > /dev/null 2>&1 && command -v awk > /dev/null 2>&1; then echo \"\"; echo \"Coverage Summary:\"; instruction_line=$(grep \"type=\\\"INSTRUCTION\\\"\" \"$xml_path\" | head -1); if [ -n \"$instruction_line\" ]; then missed=$(echo \"$instruction_line\" | grep -oE \"missed=\\\"[0-9]+\\\"\" | grep -oE \"[0-9]+\"); covered=$(echo \"$instruction_line\" | grep -oE \"covered=\\\"[0-9]+\\\"\" | grep -oE \"[0-9]+\"); if [ -n \"$missed\" ] && [ -n \"$covered\" ] && [ \"$missed\" -ge 0 ] && [ \"$covered\" -ge 0 ]; then total=$((missed + covered)); if [ $total -gt 0 ]; then percentage=$(awk \"BEGIN {printf \\\"%.2f\\\", ($covered / $total) * 100}\"); echo \" Instructions: $covered/$total ($percentage%)\"; echo \" Covered: $covered\"; echo \" Missed: $missed\"; fi; fi; fi; fi; echo \"\"; if command -v xdg-open > /dev/null 2>&1; then echo \"Opening in browser...\"; xdg-open \"$report_path\" 2>/dev/null; elif command -v open > /dev/null 2>&1; then echo \"Opening in browser...\"; open \"$report_path\" 2>/dev/null; else echo \"To view the report, open: $report_path\"; fi; else echo \"Coverage report not found. Run tests first.\"; fi'"
[tasks.coverage-open]
description = "Open code coverage HTML report in browser"
run_windows = "powershell -c 'if (Test-Path \"build\\reports\\jacoco\\test\\html\\index.html\") { Start-Process \"build\\reports\\jacoco\\test\\html\\index.html\" } else { Write-Host \"Coverage report not found. Run 'mise run coverage' first.\" }'"
run = "bash -c 'if [ -f build/reports/jacoco/test/html/index.html ]; then if command -v xdg-open > /dev/null; then xdg-open build/reports/jacoco/test/html/index.html; elif command -v open > /dev/null; then open build/reports/jacoco/test/html/index.html; else echo \"Coverage report: build/reports/jacoco/test/html/index.html\"; fi; else echo \"Coverage report not found. Run 'mise run coverage' first.\"; fi'"
[tasks.coverage-clean]
description = "Clean coverage reports and execution data"
run_windows = "powershell -c 'if (Test-Path \"build\\reports\\jacoco\") { Remove-Item -Recurse -Force \"build\\reports\\jacoco\" }; if (Test-Path \"build\\jacoco\") { Remove-Item -Recurse -Force \"build\\jacoco\" }; Write-Host \"Coverage reports cleaned\"'"
run = "bash -c 'rm -rf build/reports/jacoco build/jacoco && echo \"Coverage reports cleaned\"'"
[tasks.run]
description = "Run the application"
run_windows = "powershell -File scripts/gradle-run.ps1"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew bootRun; else gradle bootRun; fi'"
[tasks.clean]
description = "Clean build artifacts"
run_windows = "powershell -File scripts/gradle-clean.ps1"
run = "bash -c 'if [ -f gradlew ]; then ./gradlew clean; else gradle clean; fi'"
[tasks.docker-logs]
description = "View Docker service logs (follow mode)"
run = "docker compose logs -f"
[tasks.docker-ps]
description = "Check Docker services status"
run = "docker compose ps"
[tasks.db-connect]
description = "Connect to PostgreSQL database"
run = "docker exec -it jakarta-migration-postgres psql -U postgres -d jakarta_migration"
[tasks.redis-connect]
description = "Connect to Redis CLI"
run = "docker exec -it jakarta-migration-redis redis-cli"
[tasks.health]
description = "Check application health (requires app to be running)"
run = "curl http://localhost:8080/actuator/health"
# Frontend Development Tasks
[tasks.frontend-install]
description = "Install frontend dependencies"
run = "cd frontend && npm install"
[tasks.frontend-dev]
description = "Start frontend development server (Vite)"
run = "cd frontend && npm run dev"
[tasks.frontend-build]
description = "Build frontend for production"
run = "cd frontend && npm run build"
[tasks.frontend-preview]
description = "Preview production build locally"
run = "cd frontend && npm run preview"
[tasks.frontend-clean]
description = "Clean frontend build artifacts and node_modules"
run_windows = "powershell -c 'if (Test-Path \"frontend\\node_modules\") { Remove-Item -Recurse -Force \"frontend\\node_modules\" }; if (Test-Path \"frontend\\dist\") { Remove-Item -Recurse -Force \"frontend\\dist\" }; Write-Host \"Frontend cleaned\"'"
run = "bash -c 'rm -rf frontend/node_modules frontend/dist && echo \"Frontend cleaned\"'"
# Storybook Tasks
[tasks.storybook]
description = "Start Storybook development server (http://localhost:6006)"
run = "cd frontend && npm run storybook"
[tasks.storybook-build]
description = "Build Storybook for static hosting"
run = "cd frontend && npm run build-storybook"