walkthrough: write output to a stable on-disk path + gitignore it #110

Merged
timur merged 1 commit from walkthrough-persistent into development 2026-05-21 11:40:53 +00:00
Owner

Drops the TempDir + auto-cleanup. The walkthrough now writes its full scaffolded workspace into <repo>/examples/walkthrough_demo/ so you can cd in and browse the generated files after the example exits.

The path is gitignored (new /examples/walkthrough_demo/ entry in .gitignore) and wiped + recreated on every run — output always reflects current scaffolder + codegen behaviour and never accidentally gets committed.

Also: codegen anchor fix

OschemaBuilder resolves every path relative to its manifest_dir (mirroring how build.rs runs from a specific crate's root). The previous draft anchored at the workspace root, which leaked spurious src/ and target/ dirs into the top-level demo tree. Anchor at crates/hero_demo/ instead — same shape as examples/recipe_server/crates/hero_recipes/build.rs — so codegen lands in the right siblings.

Closing message

Now prints the demo dir path and a small index of paths to peek at:

✓ Walkthrough complete.

  Browse the generated tree: /…/examples/walkthrough_demo
  Interesting paths:
    • sdk/rust/src/generated/greetings.rs       — typed SDK trait
    • crates/hero_demo_server/src/greetings/generated/server.rs
                                                — CRUD dispatcher
    • crates/hero_demo_admin/templates/         — Askama admin UI
    • crates/hero_demo_admin/src/routes/        — typed-SDK route handlers
    • crates/hero_demo_web/                     — public read-only sibling
    • docs/openrpc.json                         — full OpenRPC spec

Drops the tempfile dependency.

Test plan

  • cargo run --manifest-path examples/recipe_server/Cargo.toml --example 01_walkthrough produces a clean tree at examples/walkthrough_demo/.
  • All advertised paths exist on disk after the run.
  • git check-ignore confirms the directory is excluded.
  • Second run successfully wipes + regenerates the tree.
Drops the TempDir + auto-cleanup. The walkthrough now writes its full scaffolded workspace into `<repo>/examples/walkthrough_demo/` so you can `cd` in and browse the generated files after the example exits. The path is **gitignored** (new `/examples/walkthrough_demo/` entry in `.gitignore`) and wiped + recreated on every run — output always reflects current scaffolder + codegen behaviour and never accidentally gets committed. ## Also: codegen anchor fix `OschemaBuilder` resolves every path relative to its `manifest_dir` (mirroring how `build.rs` runs from a specific crate's root). The previous draft anchored at the workspace root, which leaked spurious `src/` and `target/` dirs into the top-level demo tree. Anchor at `crates/hero_demo/` instead — same shape as `examples/recipe_server/crates/hero_recipes/build.rs` — so codegen lands in the right siblings. ## Closing message Now prints the demo dir path and a small index of paths to peek at: ``` ✓ Walkthrough complete. Browse the generated tree: /…/examples/walkthrough_demo Interesting paths: • sdk/rust/src/generated/greetings.rs — typed SDK trait • crates/hero_demo_server/src/greetings/generated/server.rs — CRUD dispatcher • crates/hero_demo_admin/templates/ — Askama admin UI • crates/hero_demo_admin/src/routes/ — typed-SDK route handlers • crates/hero_demo_web/ — public read-only sibling • docs/openrpc.json — full OpenRPC spec ``` Drops the `tempfile` dependency. ## Test plan - [x] `cargo run --manifest-path examples/recipe_server/Cargo.toml --example 01_walkthrough` produces a clean tree at `examples/walkthrough_demo/`. - [x] All advertised paths exist on disk after the run. - [x] `git check-ignore` confirms the directory is excluded. - [x] Second run successfully wipes + regenerates the tree.
walkthrough: write scaffold + codegen output to a stable on-disk path
Some checks failed
Test / test (pull_request) Failing after 1m31s
Test / test (push) Failing after 1m56s
c6413b02fb
Drop the TempDir + auto-cleanup. The walkthrough now writes its full
scaffolded workspace into `<repo>/examples/walkthrough_demo/` so you
can `cd` in and browse the generated files after the example exits.

The path is gitignored (new `/examples/walkthrough_demo/` entry in
.gitignore) and wiped + recreated on every run, so the output always
reflects current scaffolder + codegen behaviour and never accidentally
gets committed.

Also fixes the codegen anchor: `OschemaBuilder` resolves every path
relative to its `manifest_dir` (mirroring how `build.rs` runs from a
specific crate's root). The previous draft anchored at the workspace
root, which leaked spurious `src/` and `target/` dirs into the
top-level demo tree. Anchor at `crates/hero_demo/` instead — same
shape as `examples/recipe_server/crates/hero_recipes/build.rs` — so
codegen lands in the right siblings.

Closing message now prints the demo dir path and a list of interesting
files to peek at (typed SDK trait, dispatcher, Askama templates, admin
routes, web crate, full OpenRPC spec).

Drops the `tempfile` dependency.
timur merged commit e45072d4fa into development 2026-05-21 11:40:53 +00:00
timur deleted branch walkthrough-persistent 2026-05-21 11:40:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_rpc!110
No description provided.