Create a new toy
Quick scaffold
Use the scaffold script for the standard module layout:
bash
bun run scripts/scaffold-toy.ts --slug <slug> --title "<Title>" --type module --with-test
Register the toy
Add the toy metadata entry in assets/data/toys.json and point module to the new TypeScript file.
Verify
bash
bun run check:toys
Manual creation (when scaffolding is not enough)
- •Create
assets/js/toys/<slug>.tsand exportstart({ container }). - •Add cleanup logic (remove canvas, cancel animation frame).
- •Register audio handlers with
registerToyGlobals. - •Add the toy entry in
assets/data/toys.json.
Local validation
bash
bun run dev
Open http://localhost:5173/toy.html?toy=<slug> and confirm the toy loads.