All files / blong-suite browser.ts

100% Statements 48/48
100% Branches 4/4
100% Functions 2/2
100% Lines 48/48

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 491x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * browser.ts — blong-suite browser entry point.
 *
 * Each realm listed in `children` is self-contained — it brings its own
 * infrastructure (blong-browser, blong-server, etc.). The runtime
 * deduplicates shared infrastructure by URL.
 *
 * To add another realm:
 *   1. Add its package to dependencies in package.json.
 *   2. Append `async function <name>() { return import('<pkg>/browser.ts'); }`
 *      to the children array.
 *   3. Add a config key for the realm if needed.
 */
import {browser} from '@feasibleone/blong';
import pkg from './package.json' with {type: 'json'};
 
export default browser(blong => ({
    url: import.meta.url,
    pkg: {
        name: pkg.name,
        version: pkg.version,
    },
    validation: blong.type.Object({
        marine: blong.type.Object({}),
    }),
    children: [
        /** Built-in blong-browser realm: RPC, auth, portal, auth orchestrators */
        async function ui() {
            return import('@feasibleone/blong-browser/browser.ts');
        },
        /** Marine biology realm (brings blong-browser infrastructure with it) */
        async function marine() {
            return import('@feasibleone/blong-marine/browser.ts');
        },
    ],
    config: {
        default: {
            ui: {
                portal: {
                    portal: {
                        title: 'Blong Suite',
                    },
                },
            },
            marine: {},
        },
    },
}));