Skip to content

[DX] Ship a one-command starter and compile/run every canonical example #142

Description

@proggeramlug

Parent: #126
Related: #48, #74

Problem

The README requires users to understand Perry, Rust, native libraries, and wasm-pack, but does not provide one canonical create/build/run path. Several examples have drifted manifests or native-library permissions, native examples use blocking loops that do not translate to web, and compilation is not enforced as a matrix. A simple engine that cannot run its first example simply is not simple.

Outcome

A one-command starter and a compile/run-tested example matrix for native and web, with one lifecycle model and no undocumented manifest edits.

Starter experience

Provide a supported flow equivalent to:

bloom new my-game
cd my-game
bloom run
bloom run --web
bloom build --release --target <target>

The exact CLI/package-runner names may differ, but a new user should not need the engine repository, manual Rust commands, or knowledge of native-library allowlists for the hello-scene path.

The template must include:

  • pinned compatible Bloom/Perry versions;
  • correct native-library permissions/configuration;
  • one source entry with init/update/draw/cleanup lifecycle;
  • asset folder and import example;
  • hot-reload/dev instructions where supported;
  • clear native/web target errors with missing-tool remediation.

Lifecycle

Define one public game loop abstraction used by canonical examples:

  • native may drive it from the platform loop;
  • web schedules via browser animation frames and never blocks;
  • pause/focus/resize/device-loss semantics are documented;
  • fixed vs variable update behavior is explicit;
  • immediate-mode raylib-style code remains concise.

Do not maintain separate game logic for native and web just to enter the loop.

Example policy

Classify examples:

  • canonical: small, documented, compiled on every PR, runtime-smoked where possible;
  • feature/stress: compiled in full lane, run in scheduled/hardware lane as appropriate;
  • historical/experimental: explicitly labeled and excluded with a reason.

Fix manifests/imports/stale APIs in canonical examples. Ensure pong uses edge-triggered pause semantics and does not demonstrate an accidental toggle-every-frame bug.

Acceptance criteria

  • A clean machine following documented prerequisites can create and render the starter natively with one command after dependency install.
  • The same starter renders in a browser with one command and no source changes.
  • Every canonical example compiles in CI against the repository packages and correct Perry version.
  • Native and web runtime smoke capture a known frame/pixel and fail on startup trap; Web: Bloom WASM functions trap with 'unreachable' after FFI bridge fix (#73) #74's class cannot pass compilation-only checks.
  • Example manifests contain required permissions/config, with schema/validation preventing drift.
  • README's first-run path is self-contained and tested as code/commands in CI.
  • Error messages distinguish missing compiler/toolchain, package mismatch, asset error, unsupported adapter, and runtime engine failure.

Likely files

  • README and target docs
  • examples/*/package.json, canonical example sources
  • src/core/ game-loop surface and platform adapters
  • native/web/build.sh/web glue as applicable
  • new CLI/template package or scripts
  • CI example/browser jobs

Non-goals

  • A full graphical editor.
  • Hiding all platform SDK installation requirements.
  • Keeping broken examples in the canonical matrix.

Dependencies

Activity

  1. proggeramlug commented on Jul 28, 2026

    @proggeramlug
    ContributorAuthor

    Partial foundation landed through #140 / draft PR #147:

    • tools/ci/examples.json is a sorted, completeness-checked inventory of all 20 canonical package/main examples.
    • Ten examples with stale manifests now declare the native libraries they actually import.
    • All 20 examples pass Perry code generation locally and produce individual machine-readable reports/logs.
    • The web lane now boots Bloom in a real browser, submits a known WebGPU frame, and verifies the captured compositor result instead of treating a WASM build as runtime proof.

    This does not close #142. The one-command starter/template, automatic Perry provisioning on every relevant PR runner, lifecycle coverage, and clean-machine linked native starter run still need implementation.

  2. proggeramlug commented on Jul 28, 2026

    @proggeramlug
    ContributorAuthor

    Hosted follow-up: Tests run 30344662755 now proves the browser half of this issue against the exact package built on Ubuntu. build-web uploaded native/web/pkg; dependent browser-smoke downloaded that artifact and passed the real Chrome WebGPU known-frame assertion. This is runtime evidence, not a build-only proxy.

    The remaining #142 scope is unchanged: starter/template creation, clean-machine native starter execution, lifecycle coverage, and making the full Perry example compile path routinely available in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions