Skip to content

chore: move the example games to the examples repository and add pnpm examples - #516

Merged
Exeloo merged 5 commits into
mainfrom
feat/examples-games
Nov 13, 2026
Merged

Exeloo merged 5 commits into
mainfrom
feat/examples-games

Conversation

@Exeloo

@Exeloo Exeloo commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Closes #513

The example games move to the examples repository (NanoForge-dev/examples feat/centralize-games): example/cube-3d → basics/graphics-3d, example/pong-3d → demos/pong-3d, example/pong-network → demos/pong-network, all on CLI ^3.0.1. Only the end-to-end test games stay here.

  • example/ is removed; the docs pages (graphics-3d, network) link to the examples repository.
  • The e2e games (e2e/game, e2e/game-2d, e2e/game-3d) follow the editor's format: one component or system per file, TSDoc tags (@component/@system, @side), literal name, app.use(new EditorLibrary()); engine packages workspace:*, CLI and config ^3.0.1.
  • pnpm examples (scripts/examples.ts, devDependency @inquirer/prompts for the multiple-choice select) copies chosen games from a local examples checkout (--from, NANOFORGE_EXAMPLES, ../examples, or asked for) into the gitignored .examples/, links their @nanoforge-dev/* dependencies to this engine's packages, and installs each copy. The real games are never modified (copies, symlinks followed).

How do you test this PR?

pnpm examples --from ../examples --games input-keyboard,pong-network
cd .examples/basics/input-keyboard && pnpm build && pnpm start

Run on HEAD: pnpm build 13/13, pnpm lint 17/17, pnpm test:unit 13/13, pnpm test:e2e (6 passed, includes e2e/examples.test.ts), CI=1 pnpm test:e2e:graphics 8 passed with unchanged snapshots. pnpm examples on input-keyboard, pong-network, graphics-3d and basics/network, then pnpm build in each copy: "Build succeeded!"; engine and examples git status unchanged. Run from e2e/ with a relative --from and --games " input-keyboard, ": resolved from the caller's folder.

Merge danger

Two-way door: no published package or API changes; nothing deploys on merge. Merge after NanoForge-dev/examples feat/centralize-games (the docs links point at its new folders; the docs pages sync at the next release). The editor reads <engine>/e2e/game after NanoForge-dev/Editor feat/examples-games; the editor's main still reads example/pong-network from a local engine, so merge both together (its CI uses a pinned engine and is not affected).

Follow-up issues

Quality gate

Check Result Notes
Docs Updated README, AGENTS.md, docs/docs graphics-3d and network pages
Correctness Pass fix 9d25b0f (relative paths from the caller's folder, trimmed game names); merge order noted above
Performance N/A (tooling, tests and docs only)
Accessibility Pass Minor only (terminal prompt wording, link text)
Security Pass Minor only (symlinks followed out of the checkout; pnpm install runs the copy's scripts, as in the checkout)
Style Pass Minor only (node: prefixes, a type-only import cycle in e2e games); lint: pass

cube-3d, pong-3d and pong-network now live in NanoForge-dev/examples
(basics/graphics-3d, demos/pong-3d, demos/pong-network); the docs link there.
One component or system per file with the editor's TSDoc tags, EditorLibrary registered last,
editor-lib from the workspace, and @nanoforge-dev/cli and config 3.0.1.
Copies chosen games of a local examples checkout into the gitignored .examples/, links their
engine dependencies to this repository's packages and installs them as their own pnpm workspace,
so the engine's lockfile never changes.
A copied link would point back into the examples checkout and let the copy edit the real game.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move example/pong-network to the v3 cli

1 participant