feat(mapdb): integrate proto-generated Zod schemas for map content#7963
Merged
feat(mapdb): integrate proto-generated Zod schemas for map content#7963
Conversation
Single source of truth for world geography across all games. Covers zones with biomes and terrain generation, tile-based dungeons with room types and hazards, world objects (trees, rocks, flowers, ores), points of interest, spawn points with conditional rules, and region grouping. Auto-generated 517-line mapdb-schema.ts via gen-all.mjs pipeline.
… schemas Migrate astro-kbve mapdb content collection to use WorldObjectDefSchema from the proto-to-Zod codegen pipeline as the single source of truth. - Extend mapdb.proto with resource, structure, spawn, and visual fields - Regenerate mapdb-schema.ts with new field refinements - Rewrite IMapSchema.ts to merge WorldObjectDefSchema + Astro rendering fields - Migrate all 15 MDX content files to proto field names (snake_case) - Replace discriminated resource/structure union with field-presence checks - Update ServiceMapDB, MapDBPanel, ReactMapDBPanel for unified WorldObjectDef - Update API routes (mapdb, resources, structures) for new schema shape
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- Fix relative import from IMapSchema.ts to generated mapdb-schema.ts (was 4 levels up, needs 6 to reach repo root) - Add title field to all 15 MDX files (required by Starlight docsLoader)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
IMapSchema.tswith proto-generatedWorldObjectDefSchemaas the single source of truth for mapdb content validationmapdb.protowith 14 new fields (resource stats, structure stats, spawn hints, visual/metadata) and regenerate all Zod schemasServiceMapDB,MapDBPanel.astro, andReactMapDBPanel.tsxto use unifiedWorldObjectDefinstead ofIResource/IStructurediscriminated unionmapdb.json,resources.json,structures.json) to filter by field presence instead of type discriminationTest plan
npx astro buildsucceeds with updated content collection schema/mapdb/<slug>//api/mapdb.json,/api/resources.json,/api/structures.jsonreturn valid JSON with correct index keysnpx tsx packages/data/codegen/gen-all.mjsproduces same output