This demo recreates the justbash.dev terminal experience with MoonBash running in the browser.
- a full-screen terminal-style landing page
- MoonBash running entirely in-memory in the browser
- preloaded repository docs like
README.md,ARCHITECTURE.md,API.md,ROADMAP.md, andAGENTS.md - custom commands:
about,install,github - command history and tab completion in the browser UI
- automatic real verification on load: command-by-command registry checks plus smoke tests
The demo is split into three pieces:
src/website/*.mbt- MoonBit-led website runtime:config.mbtparses injected config and builds verification plansdom_helpers.mbtcreates and updates DOM withtiye/dom-ffiapp.mbtowns shell state, history, tab completion, autoplay verification, and async flowwebsite.mbtis the mount entry point
src/website/bridge.mbt- thin host bridge forBashruntime creation and the few browser APIs not yet wrapped ergonomicallysrc/wrapper/browser.ts- browser-facing wrapper exports used by the demo bundleexamples/website/main.js- thin bootstrap that injects config, docs, files, and wrapper exports intoglobalThis
Build output lands in examples/website/dist/.
vp run build:websiteThis runs:
moon build --target js --releasevp build -c vite.website.config.tsto bundle the website with Vite+ / Rolldown- Vite rewrites
index.html, bundlesmain.js, and emits the final static site toexamples/website/dist/
vp run serve:websiteThis uses vp preview -c vite.website.config.ts --port 4173 --strictPort.
Then open http://localhost:4173.
This repository can be deployed to Vercel as a static site.
Included config:
vercel.jsonsets the build command and output directoryscripts/vercel-build.shinstalls MoonBit in the build environment if needed, then runsvp run build:website
Expected Vercel behavior:
- dependencies are installed from the repo lockfile
- MoonBit is installed during the build step if it is not already available
- the static output is published from
examples/website/dist
If you import the repository into Vercel, keep the project root at the repository root.
This demo is meant to prove usability, not just compilation:
- MoonBash can be embedded as a real browser terminal
- the browser runtime can explore a preloaded virtual filesystem interactively
- MoonBit can own part of the frontend integration layer, not only the shell core
- the website can autoplay a real verification pass and surface concrete pass/fail results in the UI
- the async execution path can be driven from MoonBit via
moonbitlang/async/js_async, instead of staying in ad-hoc JS promise chains