hub-sveltekit-minimal
The minimal SvelteKit host for @devframes/hub: one initHub() call behind a single catch-all endpoint, the UI supplied by @devframes/hub-ui.
Package: hub-sveltekit-minimal · framework: SvelteKit
What it shows
initHub({ base, devframes, ui: createUi() })insrc/hub.ts, memoized onglobalThis. The RPC socket runs on a side-car port (ws: { sidecar: true }) advertised via__connection.json— SvelteKit's+server.tshandlers hand overRequests and never see WebSocket upgrades, so the hub takes a socket of its own.src/routes/__devframes/[...path]/+server.tsmounts the whole namespace:fallbackanswers every method withhub.handler(event.request), and the[...path]rest param matches the namespace root as well as everything beneath it.- The endpoint exports
trailingSlash = 'ignore'so SvelteKit serves the hub's trailing-slash URLs (the standalone viewer and each frame SPA) verbatim instead of 308-redirecting them, andsrc/app.htmlinjects${hub.base}embedded.jsto mount the floating dock.
Run it
sh
pnpm install
pnpm --filter hub-sveltekit-minimal dev