MCP Apps Kit - v0.5.0
    Preparing search index...

    Function buildAndTransform

    • Convenience function to build and transform React UIs in one step.

      This combines buildReactUIs and transformToCoreDefs for simpler usage.

      Parameters

      • defs: Record<string, ReactUIDef | UIDef>

        Record of UI keys to ReactUIDef or UIDef

      • Optionaloptions: BuildOptions

        Build options (passed to buildReactUIs)

      Returns Promise<Record<string, UIDef>>

      Promise resolving to standard UIDefs

      import { buildAndTransform, defineReactUI } from "@mcp-apps-kit/ui-react-builder";
      import { defineUI, createApp } from "@mcp-apps-kit/core";

      const uis = await buildAndTransform({
      "react-widget": defineReactUI({ component: MyWidget }),
      "html-widget": defineUI({ html: "./widget.html" }),
      });

      // All are now standard UIDefs
      console.log(uis["react-widget"].html.startsWith("<!DOCTYPE html>")); // true
      console.log(uis["html-widget"].html); // "./widget.html"