Seed bundled demos under top-level demos/ instead of code/

Move canonical sample scripts to a sibling folder of code/ and lib/ so
user projects stay separate from shipped examples. Backend seeding,
writable paths, and docs follow the new layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-14 22:34:12 +12:00
parent d355174f5a
commit e3400120d3
9 changed files with 63 additions and 53 deletions

View File

@@ -29,9 +29,10 @@ load_env_file(PROJECT_ROOT / ".env")
_default_workspace = PROJECT_ROOT / "workspace"
WORKSPACE_ROOT = Path(os.environ.get("WORKSPACE_ROOT", str(_default_workspace))).resolve()
# Canonical demo source. Files here are the single source of truth for the
# editor's "Reset demos" button and per-user account seeding. They ship with
# the static bundle (`/static/bundled-demos/...`) so a static-only host
# also exposes them. `workspace/` is intentionally NOT used for canonical
# data — it is treated as runtime/user state and is gitignored.
# Canonical demo bundle root (`manifest.json` lives here). Sample `.py`
# sources live under `demo/` (same idea as `bundled-lib/` for shared modules).
# They ship with the static bundle (`/static/bundled-demos/...`) so a
# static-only host also exposes them. `workspace/` is intentionally NOT used
# for canonical data — it is treated as runtime/user state and is gitignored.
BUNDLED_DEMOS_DIR = STATIC_DIR / "bundled-demos"
BUNDLED_DEMOS_CODE_DIR = BUNDLED_DEMOS_DIR / "demo"