feat: compose executable frontend runtime
This commit is contained in:
@@ -4,14 +4,23 @@ import { createApplication } from "../application/create-application.js";
|
||||
* This is the only module allowed to join concrete adapters to application
|
||||
* ports. Boot phases are explicit so failures can stop before product mount.
|
||||
*
|
||||
* @template Config
|
||||
* @template Release
|
||||
* @template {Parameters<typeof createApplication>[0]} Ports
|
||||
* @param {{
|
||||
* loadConfig(): Promise<Record<string, unknown>>,
|
||||
* loadRelease(config: Record<string, unknown>): Promise<Record<string, unknown>>,
|
||||
* loadConfig(): Promise<Config>,
|
||||
* loadRelease(config: Config): Promise<Release>,
|
||||
* createAdapters(context: {
|
||||
* config: Record<string, unknown>,
|
||||
* release: Record<string, unknown>
|
||||
* }): Promise<Parameters<typeof createApplication>[0]>
|
||||
* config: Config,
|
||||
* release: Release
|
||||
* }): Promise<Ports>
|
||||
* }} factories
|
||||
* @returns {Promise<Readonly<{
|
||||
* config: Config,
|
||||
* release: Release,
|
||||
* ports: Ports,
|
||||
* application: ReturnType<typeof createApplication>
|
||||
* }>>}
|
||||
*/
|
||||
export async function createCompositionRoot(factories) {
|
||||
const config = await factories.loadConfig();
|
||||
|
||||
Reference in New Issue
Block a user