#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
export PATH="/Applications/Tiled.app/Contents/MacOS:${PATH}"
cd "$ROOT"
node scripts/generate-maps.mjs
# Round-trip one map through Tiled CLI to prove toolchain
if command -v tiled >/dev/null 2>&1; then
  tiled --export-map json mapsrc/plaza.tmx public/assets/maps/plaza_tiled_export.json || true
fi
echo "Maps done."
