# Tool versions managed by mise (https://github.com/jdx/mise)
#
# SOURCE OF TRUTH for Node.js, Ruby, Java, and Yarn versions.
# After editing this file, run: yarn versions:sync
# This will detect differences and let you sync to .xxx-version files
#
# Adjust here when upgrading core build/runtime dependencies.

[tools]
node = "22.22.0"
ruby = "3.2.9"
java = "corretto-17.0.17.10.1"   # JDK vendor/version (17.0.17-amzn)
yarn = "1.22.22"

[env]
_.path = ["./bin"]

# ── Install ───────────────────────────────────────────────────────────────────

[tasks.install]
description = "Install all dependencies (gems and pods handled via yarn pre/postinstall hooks)"
run = "yarn install"

[tasks."install:gems"]
description = "Run the full preinstall script (installs gems and generates binstubs)"
run = "./scripts/preinstall.sh"

[tasks."install:pods"]
description = "Re-run CocoaPods installation (e.g. after Podfile changes)"
run = "cd ios && bundle exec pod repo update && RCT_NEW_ARCH_ENABLED=0 bundle exec pod install"

# ── Dev ───────────────────────────────────────────────────────────────────────

[tasks.dev]
description = "Start the app — usage: mise run dev [ios|android] [orchard|awal|sme] [prod|qa]"
run = """
platform=${1:-ios}
brand=${2:-orchard}
env=${3:-prod}
yarn start --platform $platform --brand $brand --env $env
"""

[tasks."dev:ios"]
description = "Start iOS (orchard, prod)"
run = "yarn start:ios"

[tasks."dev:android"]
description = "Start Android (orchard, prod)"
run = "yarn start:android"

# ── Quality ───────────────────────────────────────────────────────────────────

[tasks.test]
description = "Run unit tests"
run = "yarn test:unit"

[tasks.lint]
description = "Run TypeScript and ESLint checks"
run = "yarn lint"

# ── Pods (standalone) ─────────────────────────────────────────────────────────

[tasks."pods:update"]
description = "Update CocoaPods spec repo"
run = "cd ios && bundle exec pod repo update"
