Refactor crate::generate::Generator per-target emission into modules #59
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_rpc#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up from #56. The agent who modularized
build/build.rsflagged (comment 33741) that per-target code emission (rust_types,rust_rpc,openrpc,js,rhai) does not live inbuild.rs— it lives incrate::generate::Generator. #56 was scoped "no behaviour change," so the per-target split couldn't be done there.This issue tracks splitting
Generatoritself.Goal
Extract per-target emission from the monolithic
crate::generate::Generatorinto focused modules, one per output target:generate/rust_types.rs— Rust struct/enum emission from OSchema typesgenerate/rust_server.rs— OSIS server handler emissiongenerate/rust_rpc.rs— RPC trait + handler emission (will need updating again once hero_rpc2 macro path lands in #55)generate/openrpc.rs— OpenRPC 1.3.2 spec emissiongenerate/js.rs— JS/TS SDK class emissiongenerate/rhai.rs— Rhai binding emissiongenerate/python.rs— Python SDK emission (new target per #55; empty stub for now if hero_rpc2 work hasn't added the Python codegen yet)Keep
Generatoritself as a thin orchestrator that loads schemas, picks targets per the build config, and dispatches to the per-target modules.Constraints
recipe_serverandpetstore_servermust build unchanged.Generatorstays stable.Out of scope
python.rsplaceholder.build/build.rsfurther (handled in #56).Acceptance
crates/generator/src/generate/exceeds ~500 LOC.cargo build,cargo test,cargo clippyall green.example/recipe_serverandexample/petstore_*build unchanged.Generator::from_dir,Generator::generate, etc.) unchanged.Related
build.rssplit.