Define ZoneSpec, CultureProfile, and NpcBlueprint structs with serde/RON deserialization. Ship example RON files as schema contract for the copy team (#609, #610). Add validate-ron CLI for copy team to lint their files without compiling the server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
848 B
Bash
Executable File
29 lines
848 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# RON content validator — wrapper for the Rust validate_ron binary (#611).
|
|
#
|
|
# Usage:
|
|
# tooling/validate-ron <file.ron> <zone|culture>
|
|
#
|
|
# Examples:
|
|
# tooling/validate-ron content/global/zone-identity-spec.example.ron zone
|
|
# tooling/validate-ron content/global/culture-krenn.example.ron culture
|
|
|
|
set -euo pipefail
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: tooling/validate-ron <file.ron> <zone|culture>"
|
|
echo ""
|
|
echo "Validates a RON file against the Rust struct schema."
|
|
echo "Schema types:"
|
|
echo " zone — ZoneSpec (zone identity spec)"
|
|
echo " culture — CultureProfile (culture profile)"
|
|
exit 1
|
|
fi
|
|
|
|
# Resolve file to absolute path before changing directory
|
|
FILE="$(realpath "$1")"
|
|
SCHEMA="$2"
|
|
|
|
cd "$(dirname "$0")/../server"
|
|
exec cargo run --quiet --bin validate_ron -- "$FILE" "$SCHEMA"
|