Files
qavion-time-tracker-assessment/.mise.toml
T
2026-05-20 17:47:44 +02:00

59 lines
1.6 KiB
TOML

[tools]
java = "temurin-21"
maven = "3.9.9"
node = "22"
lefthook = "1.11.12"
gitleaks = "8.26.0"
[tasks.setup]
description = "Install deps, git hooks, env file, and validate local toolchain"
run = """
#!/bin/bash
set -euo pipefail
if ! command -v java >/dev/null 2>&1; then
echo "ERROR: Java 21 JDK not found. Run 'mise install' first, or install OpenJDK 21 and set JAVA_HOME." >&2
exit 1
fi
java_major="$(java -XshowSettings:properties -version 2>&1 | awk -F= '/java.specification.version/ { gsub(/[[:space:]]/, "", $2); print $2; exit }')"
if [ "${java_major}" != "21" ]; then
echo "ERROR: Java 21 is required, but found Java ${java_major}. Run 'mise install' or set JAVA_HOME to a Java 21 JDK." >&2
exit 1
fi
# Prime and validate the Maven wrapper cache so backend startup does not fail later.
backend/mvnw -f backend/pom.xml -v >/dev/null
npm --prefix frontend install
lefthook install
cp -n .env.example .env 2>/dev/null || true
"""
[tasks.backend]
description = "Run the Spring Boot backend"
run = "backend/mvnw -f backend/pom.xml spring-boot:run"
[tasks.frontend]
description = "Run the Vite frontend"
run = "npm --prefix frontend run dev"
[tasks.test-backend]
description = "Run backend tests"
run = "backend/mvnw -f backend/pom.xml test -q"
[tasks.test-frontend]
description = "Run frontend tests"
run = "cd frontend && npx vitest run"
[tasks.check]
description = "Format-check, lint, and test"
run = """
#!/bin/bash
set -e
mvn -f backend/pom.xml spotless:check -q
(cd frontend && npx biome check src)
mvn -f backend/pom.xml test -q
(cd frontend && npx vitest run)
"""