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-sinkAfter installing/preparing the source SDK, normal development starts the managed session; it does not compile a native runtime. A matching registered Runner is required. If needed, build from the checked-in app:
cd examples/kitchen-sink
bun run rebuild:macos
bun run macos
# On Windows:
# bun run rebuild:windows
# bun run windowsKitchen Sink demonstrates windows/geometry, menus/shortcuts, files/dialogs, streaming/Trash, settings, clipboard, notifications/system APIs, audio, and native controls. Progress, results, and errors appear inline with detailed logs. Disposable filesystem demos create/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@latest MyNotes -- --example notes-lite
npm create @legendapp/spark@latest MyMusic -- --example music-lite
npm create @legendapp/spark@latest MyDiff -- --example diff-lite
npm create @legendapp/spark@latest 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 validate contract behavior, export policy, lifecycle transitions, and tooling; template checks create real consumers. Packed consumer checks separately validate the archive's dependency graph and declarations.
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.