feat: add QuestCore game editor scaffold with codegen and parser#8
Merged
feat: add QuestCore game editor scaffold with codegen and parser#8
Conversation
Add the editor design doc and initial SvelteKit project scaffold with: - TypeScript export model (Room, Entity, Rule, Condition, Effect types) - Editor model layer (EditorItem<T> wrapper with metadata) - Factory functions for creating new content items - Known verb list with aliases - Tailwind 4, Vitest, adapter-static (SPA), luaparse configured - Directory structure for codegen, parser, validator, store, components Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement the Phase 1 contract: parse .lua files into TypeScript model
and re-export them as clean Lua. Verified with full round-trip of the
Lost Crown game (8 rooms, 10 entities, 30+ rules, 5 event handlers).
Codegen: model → .lua for all content types (game, rooms, items, NPCs,
enemies, rules, events) with condition/effect serialization.
Parser: .lua → luaparse AST → walker → table evaluator → typed model.
Handles both curried syntax (Room "id" {}) and call syntax (Rule(...)).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Adds the QuestCore game editor as a SvelteKit web app in
tools/editor/. This PR covers the design doc and Phase 1 implementation: the TypeScript data model, Lua code generation, and Lua import parser — the full round-trip contract between.luafiles and the editor's typed model.Purpose
The editor will let game authors visually create QuestCore games without knowing Lua. This PR proves the foundational contract: we can parse existing
.luagame files into a TypeScript model and re-export them as clean Lua. All subsequent UI work (Phases 2-5) builds on this.What's included:
docs/design/editor-design.md— Full technical design document.luafor all content types (game, rooms, items, NPCs, enemies, rules, events).lua→ luaparse AST → walker → table evaluator → typed model.luafiles, re-exports them, and verifies correctnessTests Performed
npm test— 63 unit tests covering:npm run check— zero TypeScript/Svelte errorsnpm run build— production build succeedsTests Not Performed
make ci— Go CI pipeline doesn't cover thetools/editor/directory (separate Node.js project)CI Checks
make cipasses locallyAI Assisted
🤖 Generated with Claude Code