feat: migrate to per-domain generated/ codegen layout (#96) #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-96-generated-folders"
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?
Summary
hero_servicetemplate to the new per-domaingenerated/codegen layout from hero_rpc#96 (merged as hero_rpc#101).cargo build --workspaceleavesgit statusempty.What changed
*_generated.rsfiles incrates/hero_service/src/catalog/andcrates/hero_service_server/src/catalog/; codegen now writes to<domain>/generated/instead.crates/hero_service_sdk/src/catalog.rs; the hero_rpc2 trait file is now atcrates/hero_service_sdk/src/generated/catalog.rs..gitignoregets the codegen entries:docs/openrpc.json,docs/*/openrpc.json,crates/hero_service_sdk/src/generated/,sdk/js/src/,sdk/js/types_generated.js,sdk/python/*/(with the usual!pyproject.tomlexception).crates/hero_service_sdk/Cargo.tomldeclaresbuild = "build.rs"plus a[build-dependencies] hero_service = { path = "../hero_service" }. The shimbuild.rsis a no-op; the dep edge forces cargo to runhero_service'sbuild.rs(which writeshero_service_sdk/src/generated/viaclient_crate_dir) before compiling here.crates/hero_service_server/src/catalog/rpc.rsimports updated:use super::*;(instead of the now-removedsuper::rpc_generated::*;/super::osis_server_generated::OsisCatalog;). The parentmod.rs'spub use generated::*;re-export surfaces the trait + handler types.docs/openrpc.json,docs/catalog/openrpc.json,sdk/js/src/*,sdk/js/types_generated.js).Acceptance check
No
*_generated.rsfilenames remain in the workspace; everything codegen-emitted lives under agenerated/subfolder that's gitignored next to a contributor-authored sibling.Test plan
cargo build --workspacesucceedsgit statusafter build is empty*_generated.rsfilenames remain anywhere outsidetarget/lab infocheckpasses (manifest still parseable from the lib.rs stubs)lab service hero_service --startworks (server still finds the embeddeddocs/openrpc.json)🤖 Generated with Claude Code
Following hero_rpc#96 — codegen output now lives in `generated/` subfolders that are gitignored everywhere they appear. Changes: - Delete stale `*_generated.rs` files in catalog/ and the SDK (now under generated/) - Repo-root `.gitignore` picks up `docs/openrpc.json`, `docs/*/openrpc.json`, `sdk/js/src/`, `sdk/python/*/`, and `crates/hero_service_sdk/src/generated/` - `crates/hero_service_sdk` gets a `build.rs` shim plus a `[build-dependencies] hero_service = { path = "../hero_service" }` so cargo runs the core crate's `build.rs` (which writes this crate's `src/generated/`) before compiling here - Update `crates/hero_service_server/src/catalog/rpc.rs` imports to go through the new parent-module `pub use generated::*;` re-export instead of the now-removed `rpc_generated`/`osis_server_generated` module paths After this change: - `cargo build --workspace` leaves `git status` empty - No `*_generated.rs` filenames remain in the workspace - Codegen output regenerates cleanly from a fresh clone Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>generated/subfolders + gitignore #96