Don't generate empty src/services/ placeholder (subsumes #68) #75
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_blueprint#75
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?
Problem
Every scaffolded service has an empty
crates/<name>/src/services/mod.rsplaceholder. Contributor sees a folder with one emptymod.rsand has to guess what it's for.The placeholder also causes the #68 collision: if your domain is named
services, the generator and the placeholder both try to ownsrc/services/.What to do
Pick one:
servicesmodule for anything, just don't emit it. Cleanest fix. Also closes #68 as a side effect.My lean: remove it. The preserved trait impl already lives in
crates/<name>_server/src/<domain>/rpc.rs; there's no need for a separateservicesnamespace in the core lib.What to do
services/mod.rsemission in the scaffolder.Acceptance
src/services/directory.servicesas the domain name works without manual fix-up.hero_service,recipe_serverrebuild cleanly post-fix.Fix landed on branch
issue-75-remove-services-placeholder-v2(1c2993df4b).Changes
crates/generator/src/build/scaffold.rs— dropsrc/services/mod.rsemission, droppub mod services;from thesrc/lib.rsstub, updatetest_scaffold_core_and_sdk_crates_have_lib_rsto assert the placeholder is absent.crates/generator/src/build/builder.rs— dropgenerate_services_placeholdercall + thepub mod services;push ingenerate_lib_rs.crates/generator/src/build/emit/services.rs— deleted; removed fromemit/mod.rs.example/recipe_server/crates/hero_recipes+crates/server/examples/recipe_server— removed committed placeholder dirs and correspondingpub mod services;.Acceptance verification
cargo run -p hero_rpc_generator -- --name hero_smoke75 --schemas-dir schemas) — nosrc/services/directory, nopub mod services;line in any emitted file.services(hero_svctestworkspace) builds clean. The onlypub mod services;in lib.rs is the feature-gated one for the domain itself;src/services/is populated entirely by codegen (mod.rs,openrpc.json,types.rs,types_generated.rs,types_wasm_generated.rs).example/recipe_serverfull workspace rebuilds clean.cargo test -p hero_rpc_generator build::scaffold— 18 passed.This subsumes #68 — the placeholder is the only thing that collided with a
servicesdomain name, and removing it eliminates the collision at the source.Ready for review.
servicesdomain) #68