Examples and validation
Explore Kitchen Sink, generate focused apps, and run source and platform checks.
Kitchen Sink
From the current source checkout:
bun run kitchen-sinkPrepare the source SDK and register a matching Runner first. To build a custom runtime for Kitchen Sink:
cd examples/kitchen-sink
bun run rebuild:macos
bun run macos
# On Windows:
# bun run rebuild:windows
# bun run windowsKitchen Sink demonstrates desktop APIs, camera, rich text, and native controls. Results and errors appear inline. Filesystem demos create and recycle test data.
bun run kitchen-sink:prepare /absolute/path/to/KitchenSinkCheck packs the SDK and creates a separate copied consumer for integration testing. It preserves that consumer's generated identity/configuration rather than changing the checked-in app.
Smaller applications
Create a focused app with npm:
npm create @legendapp/spark MyNotes -- --example notes-lite
npm create @legendapp/spark MyMusic -- --example music-lite
npm create @legendapp/spark MyDiff -- --example diff-lite
npm create @legendapp/spark MyEditor -- --example document-editorThen run the generated app, for example:
cd MyNotes
npm run macosFor local SDK development, prepare the source SDK and run bun run spark create /absolute/path/to/MyNotes --example notes-lite from its checkout.
Notes Lite covers local notes, search, import/export, recovery, and session restoration. Music Lite covers playback/queue ownership. Diff Lite covers text comparison. Document Editor covers file operations, menus, document requests, and desktop lifecycle. These examples are distinct from the full Legend Apps products.
The helper example demonstrates an app-supplied executable without a Node runtime in Hermes. The universal Settings starter uses native controls plus platform adapters.
Source checks
From the SDK checkout:
bun run typecheck
bun run test
bun run test:templatesbun run test uses Vitest, not Bun's test runner. Source checks cover APIs, lifetimes, and tooling. Template checks create real apps; packed consumer checks verify distributed dependencies and types.
Native and platform checks
Native suites need their toolchains and disposable consumer projects. Read prerequisites before running them. Relevant commands include:
| Command | Purpose |
|---|---|
bun run test:native | Native API probes |
bun run test:ui | Packed native UI consumer |
bun run test:platform --platform <target> | Shared contract catalog on a target |
bun run test:windows | Windows Runner → Fast Refresh → added module → custom build |
bun run test:windows:prepare | Generation/bundles without Windows native execution |
bun run test:runtimes:all | Runner/dev/release background runtimes and pruning |
bun run test:universal / bun run test:universal:dev | Universal generation/bundles and shared sessions |
bun run test:add-desktop | Existing Expo app preservation/composition |
Run your app on each target OS and architecture to check native behavior as well as generation and bundling.
See the platform testing guide, manual testing checklist, and platform limits.