feat: standalone WASM build and demo - #43
Closed
sathishkottravel wants to merge 2 commits into
Closed
sathishkottravel wants to merge 2 commits into
sathishkottravel wants to merge 2 commits into
Conversation
Split the Rust code into a shared core and a platform adapter (msfs or standalone, selected with a Cargo feature). The standalone build runs outside the sim and serves mock navigation data embedded in the module. On the TS side, the interface now talks to the module through a transport: CommBusTransport in the sim, or StandaloneTransport which loads and drives the standalone module in browsers and Bun/Node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add example/standalone-demo, which runs the standalone WASM module outside the sim through the JS interface: - A script printing some mock navigation data (bun run demo:standalone) - A NestJS HTTP API serving the mock data, with Swagger UI generated from the controllers (bun run demo:standalone:serve) The business logic lives in a framework-free service, and the controllers only map routes to it. Tests cover the service and the HTTP layer against an in-memory fake, and the real module when it is built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Opened here by mistake, closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a standalone build of the WASM module that runs outside the simulator and serves mock navigation data, plus a demo that uses it.
Standalone build
msfsorstandalone), selected with a Cargo feature.bun run build:wasm:standalonebuilds the module in Docker (no MSFS SDK needed). It generates mock navigation data from the example database and embeds it. Output:dist/standalone/msfs_navigation_data_interface.wasm.CommBusTransportin the sim, orStandaloneTransport, which runs the standalone module in browsers and Bun/Node.example/standalone-demobun run demo:standalone)./docs(bun run demo:standalone:serve). It has endpoints for the database, airports (plus runways, procedures, gates and frequencies) and enroute lookups.Testing
bun run build:wasm:standalonebun run demo:standalonebun run demo:standalone:serve, then open http://localhost:3000/docscd example/standalone-demo && bun test: 28 tests. The integration tests run against the real module once it's built.🤖 Generated with Claude Code