Skip to content

refactor(examples): group multifile scripted_demo into a folder - #71

Merged
chaliy merged 1 commit into
mainfrom
claude/multifile-examples-folder-fp7i1k
Jun 28, 2026
Merged

chaliy merged 1 commit into
mainfrom
claude/multifile-examples-folder-fp7i1k

Conversation

@chaliy

@chaliy chaliy commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What

Reorganize examples/ so that multifile examples each live in their own folder.

  • Move the four scripted_demo files into examples/scripted_demo/:
    • scripted_demo.rs → main.rs (so Cargo still auto-discovers it as the scripted_demo example)
    • scripted_demo.py, scripted_demo.json, scripted_demo.toml (names kept)
  • Remove the orphan top-level examples/package.json and examples/package-lock.json — leftovers from when the TypeScript example lived at the top level. The real TS example already lives in examples/node/ with its own pinned lockfile.
  • Update every path reference: the example sources (comments, Script::from_file, the TOML script_path), .github/workflows/ci.yml, examples/README.md (including pointing the TypeScript section at examples/node/), and docs/api.md.

Why

The scripted_demo example is made of four files that belonged together but sat flat in examples/, mixed in with the single-file examples. Grouping them into a folder (matching the existing examples/node/ TS example) makes the layout consistent and self-documenting, and clears out unused package files.

How

git mv the files into the new folder, rename the Rust entrypoint to main.rs to preserve Cargo example auto-discovery, then update all path references across sources, CI, README, and docs.

Risk

  • Low
  • Path-only reorganization, no library/server logic changed. The risk surface is stale path references; all known references were updated and exercised.

Checklist

  • Tests added or updated — no new code paths (pure file move + path updates); full suite still green (cargo test: 44 passed), clippy/fmt clean, ./tests/smoke_test.sh passed, and the scripted server was booted from the new config path. cargo run --example scripted_demo builds and loads the script from the new location.
  • Backward compatibility considered — cargo run --example scripted_demo unchanged; only on-disk file locations moved.

Generated by Claude Code

Move the four scripted_demo files (Rust example, Python client, script
JSON, and server TOML) into examples/scripted_demo/. The Rust file becomes
main.rs so Cargo still auto-discovers it as the "scripted_demo" example.

Update all path references in the example sources, CI workflow, README, and
docs/api.md. Remove the orphan top-level examples/package.json and
package-lock.json left over from when the TypeScript example lived at the
top level; the real TS example now lives in examples/node/ with its own
pinned lockfile, and point the README TypeScript section there.
@chaliy
chaliy merged commit ad854ba into main Jun 28, 2026
11 checks passed
@chaliy
chaliy deleted the claude/multifile-examples-folder-fp7i1k branch June 28, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant