@designos/compiler-core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 relacloud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ for (const file of output.files) {
|
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
`componentIRToMitosis` is exported for integrations that need the intermediate representation. The adapter maps imports, prop defaults/types, state initializers/types, expressions, events, spreads, slots, conditionals, loops, fragments, and nested components into Mitosis-shaped data. For `targetOptions.typescript: true`, generated prop signatures are verified for Preact, Qwik, React, React Native, RSC, Solid, and Taro; state annotations are verified for Angular, Preact, React, React Native, RSC, and Taro. Other targets/options receive `MITOSIS_PROP_TYPE_NOT_PRESERVED` and/or `MITOSIS_STATE_TYPE_NOT_PRESERVED` where applicable. These are narrow emission checks, not proof that every target preserves other modeled behavior. See the [
|
|
26
|
+
`componentIRToMitosis` is exported for integrations that need the intermediate representation. The adapter maps imports, prop defaults/types, state initializers/types, expressions, events, spreads, slots, conditionals, loops, fragments, and nested components into Mitosis-shaped data. For `targetOptions.typescript: true`, generated prop signatures are verified for Preact, Qwik, React, React Native, RSC, Solid, and Taro; state annotations are verified for Angular, Preact, React, React Native, RSC, and Taro. Other targets/options receive `MITOSIS_PROP_TYPE_NOT_PRESERVED` and/or `MITOSIS_STATE_TYPE_NOT_PRESERVED` where applicable. These are narrow emission checks, not proof that every target preserves other modeled behavior. See the [rendering documentation](../../docs/concepts/rendering.md) for target-specific output boundaries; the framework-neutral DesignOS model remains canonical.
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
## Source-authored components
|
|
@@ -45,7 +45,7 @@ const output = generateMitosisSourceComponent(mitosisComponent, "react", {
|
|
|
45
45
|
|
|
46
46
|
The source project's manifest remains the editor/catalog definition (stable page `type`, display name, fields, slots and capabilities). Mitosis source and its hooks, state, events, context, refs, styles and imports are build-time component implementation, not page data. A `PageDocument` remains framework-neutral JSON and is supplied to a framework renderer alongside a separately generated component registry.
|
|
47
47
|
|
|
48
|
-
The CLI accepts two project formats. Version `1` is the existing `CompilerProject` with `implementation.kind: "ir"`. Version `2` is file-based TSX: each component entry points to a `.lite.tsx` source and a JSON manifest, and can declare style and asset files. The CLI parses version-2 sources before compiling; it retains the version-1 API unchanged. Declared `styles` are copied and imported by the generated component entry module, while `assets` are copied without being bundled. See [the CLI guide](../compiler-cli/README.md) and the [
|
|
48
|
+
The CLI accepts two project formats. Version `1` is the existing `CompilerProject` with `implementation.kind: "ir"`. Version `2` is file-based TSX: each component entry points to a `.lite.tsx` source and a JSON manifest, and can declare style and asset files. The CLI parses version-2 sources before compiling; it retains the version-1 API unchanged. Declared `styles` are copied and imported by the generated component entry module, while `assets` are copied without being bundled. See [the CLI guide](../compiler-cli/README.md) and the [component-kit specification](../../docs/specifications/component-kits.md).
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
import type { CompilerProject } from "@designos/compiler-core";
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ interface ParseMitosisSourceOptions {
|
|
|
36
36
|
*/
|
|
37
37
|
declare function parseMitosisSource(source: string, options?: ParseMitosisSourceOptions): MitosisComponent;
|
|
38
38
|
|
|
39
|
-
type CompilerTarget = "react" | "vue" | "angular" | "html" | "svelte" | "solid" | "alpine" | "builder" | "customElement" | "liquid" | "lit" | "marko" | "mitosis" | "preact" | "qwik" | "reactNative" | "rsc" | "stencil" | "swift" | "taro" | "template" | "webcomponent";
|
|
39
|
+
type CompilerTarget = "react" | "vue" | "blade" | "angular" | "html" | "svelte" | "solid" | "alpine" | "builder" | "customElement" | "liquid" | "lit" | "marko" | "mitosis" | "preact" | "qwik" | "reactNative" | "rsc" | "stencil" | "swift" | "taro" | "template" | "webcomponent";
|
|
40
40
|
interface IRImport {
|
|
41
41
|
source: string;
|
|
42
42
|
names: string[];
|
|
@@ -159,6 +159,8 @@ type CompilerProjectComponent = Omit<ComponentSource, "implementation"> & {
|
|
|
159
159
|
interface CompilerProject {
|
|
160
160
|
schemaVersion: "1";
|
|
161
161
|
components: CompilerProjectComponent[];
|
|
162
|
+
/** Global CSS/resources copied into every target artifact directory. */
|
|
163
|
+
styles?: ComponentAssetReference[];
|
|
162
164
|
}
|
|
163
165
|
/** File-based DesignOS source project consumed by the CLI. */
|
|
164
166
|
interface CompilerSourceProjectComponent {
|
|
@@ -172,6 +174,8 @@ interface CompilerSourceProjectComponent {
|
|
|
172
174
|
interface CompilerSourceProject {
|
|
173
175
|
schemaVersion: "2";
|
|
174
176
|
components: CompilerSourceProjectComponent[];
|
|
177
|
+
/** Global CSS/resources copied into every target artifact directory. */
|
|
178
|
+
styles?: ComponentAssetReference[];
|
|
175
179
|
}
|
|
176
180
|
interface Diagnostic {
|
|
177
181
|
severity: "error" | "warning" | "info";
|
package/dist/index.js
CHANGED
|
@@ -1069,6 +1069,28 @@ function validateCompilerProject(project) {
|
|
|
1069
1069
|
const componentTypes = /* @__PURE__ */ new Set();
|
|
1070
1070
|
const componentNames = /* @__PURE__ */ new Set();
|
|
1071
1071
|
const assetOutputs = /* @__PURE__ */ new Map();
|
|
1072
|
+
if (project.styles !== void 0 && !Array.isArray(project.styles)) {
|
|
1073
|
+
diagnostics.push({ severity: "error", code: "COMPILER_PROJECT_STYLES_INVALID", message: "styles must be an array", path: "styles" });
|
|
1074
|
+
}
|
|
1075
|
+
for (const [styleIndex, style] of (Array.isArray(project.styles) ? project.styles : []).entries()) {
|
|
1076
|
+
const stylePath = `styles[${styleIndex}]`;
|
|
1077
|
+
if (!isSafeRelativePath(style.source)) {
|
|
1078
|
+
diagnostics.push({ severity: "error", code: "COMPILER_PROJECT_STYLE_SOURCE_PATH_INVALID", message: "Style source must be a safe path relative to the project root", path: `${stylePath}.source` });
|
|
1079
|
+
continue;
|
|
1080
|
+
}
|
|
1081
|
+
const outputPath = style.outputPath ?? style.source;
|
|
1082
|
+
if (!isSafeRelativePath(outputPath)) {
|
|
1083
|
+
diagnostics.push({ severity: "error", code: "COMPILER_PROJECT_STYLE_OUTPUT_PATH_INVALID", message: "Style outputPath must be a safe path relative to the generated output directory", path: `${stylePath}.outputPath` });
|
|
1084
|
+
continue;
|
|
1085
|
+
}
|
|
1086
|
+
const normalizedOutputPath = outputPath.toLowerCase();
|
|
1087
|
+
const existingSource = assetOutputs.get(normalizedOutputPath);
|
|
1088
|
+
if (existingSource && existingSource !== style.source) {
|
|
1089
|
+
diagnostics.push({ severity: "error", code: "COMPILER_PROJECT_STYLE_OUTPUT_COLLISION", message: `Different styles target the same output path: ${outputPath}`, path: `${stylePath}.outputPath` });
|
|
1090
|
+
} else {
|
|
1091
|
+
assetOutputs.set(normalizedOutputPath, style.source);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1072
1094
|
project.components.forEach((definition, index) => {
|
|
1073
1095
|
const prefix = `components[${index}]`;
|
|
1074
1096
|
const manifest = definition?.manifest;
|
|
@@ -1187,6 +1209,9 @@ async function compileProject(project, registry, options) {
|
|
|
1187
1209
|
const generatedPaths = /* @__PURE__ */ new Set();
|
|
1188
1210
|
const registryEntries = [];
|
|
1189
1211
|
const targetDefinition = registry.get(options.target);
|
|
1212
|
+
for (const style of project.styles ?? []) {
|
|
1213
|
+
assets.set(style.outputPath ?? style.source, style.source);
|
|
1214
|
+
}
|
|
1190
1215
|
for (const [index, definition] of project.components.entries()) {
|
|
1191
1216
|
let result;
|
|
1192
1217
|
if (definition.implementation.kind === "ir") {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mitosis.ts","../src/source.ts","../src/index.ts"],"sourcesContent":["import {\n componentToAlpine,\n componentToBuilder,\n componentToAngular,\n componentToCustomElement,\n componentToHtml,\n componentToLiquid,\n componentToLit,\n componentToMarko,\n componentToMitosis,\n componentToPreact,\n componentToQwik,\n componentToReact,\n componentToReactNative,\n componentToRsc,\n componentToSolid,\n componentToStencil,\n componentToSvelte,\n componentToSwift,\n componentToTaro,\n componentToTemplate,\n componentToVue,\n} from \"@builder.io/mitosis\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\nimport { TargetRegistry } from \"./index\";\nimport type { ComponentIR, CompilerProjectRegistryEntry, Diagnostic, GeneratedFile, GenerationContext, GenerationResult, IRAttribute, IRNode } from \"./index\";\n\nexport const mitosisTargets = [\n \"alpine\", \"angular\", \"builder\", \"customElement\", \"html\", \"liquid\", \"lit\", \"marko\", \"mitosis\",\n \"preact\", \"qwik\", \"react\", \"reactNative\", \"rsc\", \"solid\", \"stencil\", \"svelte\",\n \"swift\", \"taro\", \"template\", \"vue\", \"webcomponent\",\n] as const;\nexport type MitosisTarget = (typeof mitosisTargets)[number];\nexport interface MitosisTargetCapability {\n generation: \"smoke-tested\";\n semanticParity: \"unverified\";\n sourceMaps: \"unverified\";\n diagnostics: \"partial\";\n}\nexport const mitosisTargetCapabilities: Readonly<Record<MitosisTarget, MitosisTargetCapability>> = Object.freeze(\n Object.fromEntries(mitosisTargets.map((target) => [target, Object.freeze({\n generation: \"smoke-tested\" as const,\n semanticParity: \"unverified\" as const,\n sourceMaps: \"unverified\" as const,\n diagnostics: \"partial\" as const,\n })])) as Record<MitosisTarget, MitosisTargetCapability>,\n);\ntype MNode = Record<string, any>;\ntype MComponent = Record<string, any>;\n\nconst propTypeTargets = new Set<MitosisTarget>([\"preact\", \"qwik\", \"react\", \"reactNative\", \"rsc\", \"solid\", \"taro\"]);\nconst stateTypeTargets = new Set<MitosisTarget>([\"angular\", \"preact\", \"react\", \"reactNative\", \"rsc\", \"taro\"]);\n\nfunction createComponentPropType(component: ComponentIR): { name: string; declaration: string } | undefined {\n if (!component.props.some((prop) => typeof prop.type === \"string\" && prop.type.trim())) return undefined;\n\n const importedNames = new Set(component.imports.flatMap((item) => item.names));\n const componentName = component.name.replace(/[^A-Za-z0-9_$]/g, \"_\");\n let name = `__DesignOS_${componentName}_Props`;\n while (importedNames.has(name)) name = `_${name}`;\n\n const properties = component.props.map((prop) => {\n const propertyName = /^[$A-Z_a-z][$\\w]*$/.test(prop.name) ? prop.name : JSON.stringify(prop.name);\n const optional = prop.optional || prop.defaultValue !== undefined ? \"?\" : \"\";\n const type = typeof prop.type === \"string\" && prop.type.trim() ? prop.type.trim() : \"any\";\n return ` ${propertyName}${optional}: ${type};`;\n });\n\n return { name, declaration: `type ${name} = {\\n${properties.join(\"\\n\")}\\n};` };\n}\n\nfunction toMitosisNode(node: IRNode): MNode {\n const base: MNode = { \"@type\": \"@builder.io/mitosis/node\", name: \"div\", meta: {}, scope: {}, properties: {}, bindings: {}, children: [] };\n if (node.kind === \"text\") {\n base.properties._text = node.value;\n } else if (node.kind === \"expression\") {\n base.bindings._text = { code: node.binding.code, type: \"single\", bindingType: \"expression\" };\n } else if (node.kind === \"slot\") {\n base.name = \"Slot\";\n if (node.name) base.properties.name = node.name;\n if (node.fallback) base.children = node.fallback.map((child) => toMitosisNode(child));\n } else if (node.kind === \"fragment\") {\n base.name = \"Fragment\";\n base.children = node.children.map((child) => toMitosisNode(child));\n } else if (node.kind === \"conditional\") {\n base.name = \"Show\";\n base.bindings.when = { code: node.condition.code, type: \"single\", bindingType: \"expression\" };\n base.children = node.then.map((child) => toMitosisNode(child));\n if (node.otherwise?.length) {\n base.meta.else = toMitosisNode({ kind: \"fragment\", children: node.otherwise });\n }\n } else if (node.kind === \"loop\") {\n base.name = \"For\";\n base.scope = { forName: node.itemName, indexName: node.indexName, collectionName: undefined };\n base.bindings.each = { code: node.collection.code, type: \"single\", bindingType: \"expression\" };\n base.children = node.children.map((child) => toMitosisNode(child));\n } else {\n base.name = node.kind === \"element\" ? node.tag : node.name;\n base.children = (node.children ?? []).map((child) => toMitosisNode(child));\n for (const attribute of node.attributes ?? []) applyAttribute(base, attribute);\n if (node.kind === \"component\" && node.slots) {\n const { default: defaultSlot, ...namedSlots } = node.slots;\n if (defaultSlot) base.children.push(...defaultSlot.map((child) => toMitosisNode(child)));\n if (Object.keys(namedSlots).length) {\n base.slots = Object.fromEntries(Object.entries(namedSlots).map(([name, children]) => [name, toMitosisSlotChildren(children)]));\n }\n }\n }\n return base;\n}\n\nfunction toMitosisSlotChildren(children: IRNode[]): MNode[] {\n const nodes = children.length === 1 && children[0].kind === \"fragment\" ? children[0].children : children;\n if (nodes.length === 1 && nodes[0].kind === \"text\") {\n const child = nodes[0];\n const node = toMitosisNode(child);\n node.properties._text = JSON.stringify(child.value);\n return [node];\n }\n return nodes.map((child) => toMitosisNode(child));\n}\n\nfunction applyAttribute(node: MNode, attribute: IRAttribute): void {\n if (!attribute.binding) {\n if (attribute.value !== undefined) node.properties[attribute.name] = attribute.value;\n return;\n }\n const binding = attribute.binding;\n const eventName = binding.eventName ?? attribute.name;\n const key = binding.kind === \"event\" && !eventName.startsWith(\"on\")\n ? `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`\n : attribute.name;\n node.bindings[key] = {\n code: binding.code,\n type: binding.kind === \"spread\" ? \"spread\" : \"single\",\n ...(binding.kind === \"spread\" ? { spreadType: \"normal\" } : { bindingType: binding.kind === \"event\" ? \"function\" : \"expression\" }),\n ...(binding.parameters ? { arguments: binding.parameters } : {}),\n };\n}\nexport function componentIRToMitosis(component: ComponentIR): MComponent {\n const imports = component.imports.map((item) => ({\n path: item.source,\n imports: Object.fromEntries(item.names.map((name) => [name, name])),\n ...(item.typeOnly ? { importKind: \"type\" } : {}),\n }));\n const propType = createComponentPropType(component);\n return {\n \"@type\": \"@builder.io/mitosis/component\",\n name: component.name,\n imports,\n exports: {},\n inputs: component.props.map((prop) => ({ name: prop.name, defaultValue: prop.defaultValue })),\n props: Object.fromEntries(component.props.map((prop) => [prop.name, { propertyType: \"normal\", optional: !!prop.optional || prop.defaultValue !== undefined }])),\n defaultProps: Object.fromEntries(component.props.filter((prop) => prop.defaultValue !== undefined).map((prop) => [prop.name, { type: \"property\", code: JSON.stringify(prop.defaultValue) }])),\n state: Object.fromEntries(component.state.map((item) => [item.name, {\n type: \"property\",\n code: item.initialValue,\n ...(typeof item.type === \"string\" && item.type.trim() ? { typeParameter: item.type.trim() } : {}),\n }])),\n meta: { ...(component.metadata ?? {}) },\n refs: {},\n context: { get: {}, set: {} },\n hooks: { onMount: [], onEvent: [] },\n children: component.root.kind === \"fragment\" ? component.root.children.map((node) => toMitosisNode(node)) : [toMitosisNode(component.root)],\n subComponents: [],\n ...(component.styles ? { style: component.styles } : {}),\n ...(propType ? { types: [propType.declaration], propsTypeRef: propType.name } : {}),\n };\n}\n\nfunction normalizeReactNativeFragmentLinks(component: MComponent): void {\n const visit = (node: MNode): void => {\n const href = node.properties?.href;\n if (typeof href === \"string\" && href.startsWith(\"#\")) {\n delete node.properties.href;\n node.bindings ??= {};\n node.bindings.href = {\n code: JSON.stringify(href),\n type: \"single\",\n bindingType: \"expression\",\n };\n }\n\n if (Array.isArray(node.children)) node.children.forEach(visit);\n if (node.slots && typeof node.slots === \"object\") {\n for (const children of Object.values(node.slots) as MNode[][]) children.forEach(visit);\n }\n };\n\n if (Array.isArray(component.children)) component.children.forEach(visit);\n}\n\nconst generators: Record<MitosisTarget, (component: MComponent, options: Record<string, unknown>) => unknown> = {\n alpine: (c, o) => componentToAlpine(o as any)({ component: c as any }),\n builder: (c, o) => componentToBuilder(o as any)({ component: c as any }),\n angular: (c, o) => componentToAngular(o as any)({ component: c as any }),\n customElement: (c, o) => componentToCustomElement(o as any)({ component: c as any }),\n html: (c, o) => componentToHtml(o as any)({ component: c as any }),\n liquid: (c, o) => componentToLiquid(o as any)({ component: c as any }),\n lit: (c, o) => componentToLit(o as any)({ component: c as any }),\n marko: (c, o) => componentToMarko(o as any)({ component: c as any }),\n mitosis: (c, o) => componentToMitosis(o as any)({ component: c as any }),\n preact: (c, o) => componentToPreact(o as any)({ component: c as any }),\n qwik: (c, o) => componentToQwik(o as any)({ component: c as any }),\n react: (c, o) => componentToReact(o as any)({ component: c as any }),\n reactNative: (c, o) => componentToReactNative(o as any)({ component: c as any }),\n rsc: (c, o) => componentToRsc(o as any)({ component: c as any }),\n solid: (c, o) => componentToSolid(o as any)({ component: c as any }),\n stencil: (c, o) => componentToStencil(o as any)({ component: c as any }),\n svelte: (c, o) => componentToSvelte(o as any)({ component: c as any }),\n swift: (c, o) => componentToSwift(o as any)({ component: c as any }),\n taro: (c, o) => componentToTaro(o as any)({ component: c as any }),\n template: (c, o) => componentToTemplate(o as any)({ component: c as any }),\n vue: (c, o) => componentToVue(o as any)({ component: c as any }),\n webcomponent: (c, o) => componentToCustomElement(o as any)({ component: c as any }),\n};\n\nconst siblingElseTargets = new Set<MitosisTarget>([\"alpine\", \"customElement\", \"html\", \"swift\", \"template\", \"webcomponent\"]);\nconst nativeSlotProjectionTargets = new Set<MitosisTarget>([\n \"alpine\", \"angular\", \"customElement\", \"html\", \"liquid\", \"lit\", \"marko\", \"qwik\", \"stencil\", \"svelte\", \"template\", \"vue\", \"webcomponent\",\n]);\nconst nativeSlotOutletTargets = new Set<MitosisTarget>([\"alpine\", \"customElement\", \"html\", \"liquid\", \"lit\", \"stencil\", \"template\", \"webcomponent\"]);\nconst eventlessTargets = new Set<MitosisTarget>([\"liquid\", \"template\"]);\nconst nativePropDefaultTargets = new Set<MitosisTarget>([\"angular\", \"preact\", \"react\", \"reactNative\", \"rsc\", \"stencil\", \"svelte\", \"taro\", \"vue\"]);\nconst expressionPropDefaultTargets = new Set<MitosisTarget>([\"alpine\", \"builder\", \"customElement\", \"html\", \"lit\", \"marko\", \"mitosis\", \"solid\", \"template\", \"webcomponent\"]);\nconst swiftTextTags = new Set([\"span\", \"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]);\n\nfunction swiftPrimitiveType(type: unknown): \"string\" | \"number\" | \"boolean\" | undefined {\n if (typeof type !== \"string\") return undefined;\n switch (type.trim().toLowerCase()) {\n case \"string\": return \"string\";\n case \"number\": return \"number\";\n case \"boolean\":\n case \"bool\": return \"boolean\";\n default: return undefined;\n }\n}\n\nfunction swiftDefaultLiteral(type: unknown, value: unknown): string | undefined {\n const normalizedType = swiftPrimitiveType(type);\n if (normalizedType === \"string\" && typeof value === \"string\") {\n if (/[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f]/.test(value)) return undefined;\n const escaped = value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\");\n return `\"${escaped}\"`;\n }\n if (normalizedType === \"number\" && typeof value === \"number\" && Number.isFinite(value)) return String(value);\n if (normalizedType === \"boolean\" && typeof value === \"boolean\") return String(value);\n return undefined;\n}\n\nfunction applySwiftPropTypes(component: MComponent, props: ComponentIR[\"props\"]): void {\n for (const prop of props) {\n const type = swiftPrimitiveType(prop.type);\n if (type && component.props?.[prop.name]) component.props[prop.name].propertyType = type;\n }\n}\n\nfunction hasNamedComponentSlots(node: IRNode): boolean {\n if (node.kind === \"component\" && Object.keys(node.slots ?? {}).some((name) => name !== \"default\")) return true;\n if (node.kind === \"conditional\") return node.then.some(hasNamedComponentSlots) || (node.otherwise ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasNamedComponentSlots);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"element\") return (node.children ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"component\") return (node.children ?? []).some(hasNamedComponentSlots)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasNamedComponentSlots));\n return false;\n}\n\nfunction hasUnsupportedNamedComponentSlots(node: IRNode, target: MitosisTarget): boolean {\n if (target === \"swift\") return hasNamedComponentSlots(node);\n if (target === \"solid\" && node.kind === \"component\") {\n const hasUnsupportedSlot = Object.entries(node.slots ?? {}).some(([name, children]) => {\n if (name === \"default\") return false;\n return children.length !== 1 || (children[0]?.kind !== \"text\" && children[0]?.kind !== \"expression\");\n });\n if (hasUnsupportedSlot) return true;\n }\n if (node.kind === \"conditional\") return node.then.some((child) => hasUnsupportedNamedComponentSlots(child, target))\n || (node.otherwise ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"slot\") return (node.fallback ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"element\") return (node.children ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"component\") return (node.children ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target))\n || Object.values(node.slots ?? {}).some((children) => children.some((child) => hasUnsupportedNamedComponentSlots(child, target)));\n return false;\n}\n\nfunction hasUnsupportedNamedSlotOutlet(node: IRNode, target: MitosisTarget): boolean {\n if (target === \"swift\" && node.kind === \"slot\") return true;\n if (node.kind === \"conditional\") return node.then.some((child) => hasUnsupportedNamedSlotOutlet(child, target))\n || (node.otherwise ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"slot\") return (node.fallback ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"element\") return (node.children ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"component\") return (node.children ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target))\n || Object.values(node.slots ?? {}).some((children) => children.some((child) => hasUnsupportedNamedSlotOutlet(child, target)));\n return false;\n}\n\nfunction hasConditionalElse(node: IRNode): boolean {\n if (node.kind === \"conditional\") {\n return !!node.otherwise?.length || node.then.some(hasConditionalElse) || (node.otherwise ?? []).some(hasConditionalElse);\n }\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasConditionalElse);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasConditionalElse);\n if (node.kind === \"element\") return (node.children ?? []).some(hasConditionalElse);\n if (node.kind === \"component\") return (node.children ?? []).some(hasConditionalElse)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasConditionalElse));\n return false;\n}\n\nfunction hasEventHandlers(node: IRNode): boolean {\n if ((node.kind === \"element\" || node.kind === \"component\") && (node.attributes ?? []).some((attribute) => attribute.binding?.kind === \"event\")) return true;\n if (node.kind === \"conditional\") return node.then.some(hasEventHandlers) || (node.otherwise ?? []).some(hasEventHandlers);\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasEventHandlers);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasEventHandlers);\n if (node.kind === \"element\") return (node.children ?? []).some(hasEventHandlers);\n if (node.kind === \"component\") return (node.children ?? []).some(hasEventHandlers)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasEventHandlers));\n return false;\n}\n\nfunction preservesPropDefault(target: MitosisTarget, name: string, value: unknown, propType?: unknown): boolean {\n if (nativePropDefaultTargets.has(target)) return true;\n if (target === \"qwik\") return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) && serializeDefaultValue(value) !== undefined;\n if (target === \"swift\") return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) && swiftDefaultLiteral(propType, value) !== undefined;\n if (target === \"liquid\") {\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) return false;\n return typeof value === \"string\" || typeof value === \"boolean\" || (typeof value === \"number\" && Number.isFinite(value));\n }\n return expressionPropDefaultTargets.has(target)\n && /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name)\n && serializeDefaultValue(value) !== undefined;\n}\n\nfunction serializeDefaultValue(value: unknown): string | undefined {\n try {\n const serialized = JSON.stringify(value);\n return typeof serialized === \"string\" ? serialized : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction applyExpressionPropDefaults(nodes: MNode[], props: ComponentIR[\"props\"]): void {\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const serialized = serializeDefaultValue(prop.defaultValue);\n return serialized === undefined ? [] : [{ name: prop.name, serialized }];\n });\n if (defaults.length === 0) return;\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code !== \"string\") continue;\n let code = binding.code;\n for (const { name, serialized } of defaults) {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const access = `props.${name}`;\n const replacement = `(${access} === undefined ? ${serialized} : ${access})`;\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n code = code.replace(dotReference, replacement).replace(bracketReference, replacement);\n }\n binding.code = code;\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n nodes.forEach(visit);\n}\n\ninterface QwikPropDefaultAlias {\n name: string;\n alias: string;\n serialized: string;\n}\n\nfunction applyQwikPropDefaults(component: MComponent, props: ComponentIR[\"props\"]): QwikPropDefaultAlias[] {\n const usedNames = new Set<string>([\n ...props.map((prop) => prop.name),\n ...Object.keys(component.state ?? {}),\n ]);\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const serialized = serializeDefaultValue(prop.defaultValue);\n if (serialized === undefined) return [];\n let alias = `__designosDefault_${prop.name}`;\n let suffix = 1;\n while (usedNames.has(alias)) alias = `__designosDefault_${prop.name}_${suffix++}`;\n usedNames.add(alias);\n return [{ name: prop.name, alias, serialized }];\n });\n if (defaults.length === 0) return defaults;\n\n const rewrite = (source: string): string => defaults.reduce((code, { name, alias }) => {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n return code.replace(dotReference, alias).replace(bracketReference, alias);\n }, source);\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code === \"string\") binding.code = rewrite(binding.code);\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n (component.children as MNode[]).forEach(visit);\n for (const state of Object.values(component.state ?? {}) as Array<{ code?: unknown }>) {\n if (typeof state.code === \"string\") state.code = rewrite(state.code);\n }\n return defaults;\n}\n\nfunction addQwikPropDefaults(output: string, defaults: QwikPropDefaultAlias[]): string | undefined {\n if (defaults.length === 0) return output;\n const signature = /(component\\$\\(\\s*\\(\\s*props(?:\\s*:\\s*[^)]*)?\\)\\s*=>\\s*\\{)/;\n if (!signature.test(output)) return undefined;\n const declarations = defaults\n .map(({ name, alias, serialized }) => ` const ${alias} = props.${name} === undefined ? ${serialized} : props.${name};`)\n .join(\"\\n\");\n return output.replace(signature, (match) => `${match}\\n${declarations}`);\n}\n\nfunction applySwiftPropDefaults(nodes: MNode[], props: ComponentIR[\"props\"]): void {\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const literal = swiftDefaultLiteral(prop.type, prop.defaultValue);\n return literal === undefined ? [] : [{ name: prop.name, literal }];\n });\n if (defaults.length === 0) return;\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code !== \"string\") continue;\n let code = binding.code;\n for (const { name, literal } of defaults) {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const replacement = `(props.${name} ?? ${literal})`;\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n code = code.replace(dotReference, replacement).replace(bracketReference, replacement);\n }\n binding.code = code;\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n nodes.forEach(visit);\n}\n\nfunction addSwiftPropDefaults(output: string, props: ComponentIR[\"props\"]): string {\n for (const prop of props) {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) continue;\n const literal = swiftDefaultLiteral(prop.type, prop.defaultValue);\n if (literal === undefined) continue;\n const escapedName = prop.name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const declaration = new RegExp(`^([\\\\t ]*)let\\\\s+${escapedName}(\\\\s*:[^\\\\n]+)$`, \"m\");\n output = output.replace(declaration, (_match, indent: string, annotation: string) => `${indent}var ${prop.name}${annotation} = ${literal}`);\n }\n return output;\n}\n\nfunction addLiquidPropDefaults(output: string, component: ComponentIR): string {\n const assignments = component.props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !preservesPropDefault(\"liquid\", prop.name, prop.defaultValue, prop.type)) return [];\n const literal = JSON.stringify(prop.defaultValue);\n if (typeof literal !== \"string\") return [];\n const allowFalse = prop.defaultValue === false ? \", allow_false: true\" : \"\";\n return [`{% assign ${prop.name} = ${prop.name} | default: ${literal}${allowFalse} %}`];\n });\n return assignments.length ? `${assignments.join(\"\\n\")}\\n${output}` : output;\n}\n\nfunction toLiquidCondition(code: string): string | undefined {\n const condition = code.replace(/\\b(?:props|state)\\./g, \"\").trim();\n const identifier = \"[A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*\";\n const literal = `(?:${identifier}|\\\\d+(?:\\\\.\\\\d+)?|'[^'\\\\\\\\]*'|\\\"[^\\\"\\\\\\\\]*\\\")`;\n if (new RegExp(`^${identifier}$`).test(condition)) return condition;\n if (new RegExp(`^${literal}\\\\s*(?:==|!=|>=|<=|>|<)\\\\s*${literal}$`).test(condition)) return condition;\n return undefined;\n}\n\nfunction hasUnsupportedLiquidElse(node: IRNode): boolean {\n if (node.kind === \"conditional\") {\n if (node.otherwise?.length && !toLiquidCondition(node.condition.code)) return true;\n return node.then.some(hasUnsupportedLiquidElse) || (node.otherwise ?? []).some(hasUnsupportedLiquidElse);\n }\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasUnsupportedLiquidElse);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasUnsupportedLiquidElse);\n if (node.kind === \"element\") return (node.children ?? []).some(hasUnsupportedLiquidElse);\n if (node.kind === \"component\") return (node.children ?? []).some(hasUnsupportedLiquidElse)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasUnsupportedLiquidElse));\n return false;\n}\n\nfunction lowerElseBranches(nodes: MNode[]): MNode[] {\n const lowered: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerElseBranches(sourceNode.children) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerElseBranches(children as MNode[])])),\n } : {}),\n };\n const elseNode = node.name === \"Show\" ? node.meta.else as MNode | undefined : undefined;\n const condition = node.bindings?.when?.code;\n if (!elseNode || typeof condition !== \"string\" || !condition.trim()) {\n lowered.push(node);\n continue;\n }\n\n delete node.meta.else;\n const elseChildren = elseNode.name === \"Fragment\" && Array.isArray(elseNode.children)\n ? elseNode.children as MNode[]\n : [elseNode];\n const alternate: MNode = {\n ...node,\n bindings: {\n ...node.bindings,\n when: { ...node.bindings.when, code: `!(${condition})` },\n },\n children: lowerElseBranches(elseChildren),\n };\n lowered.push(node, alternate);\n }\n return lowered;\n}\n\nfunction lowerLiquidElseBranches(nodes: MNode[], baseComponent: MComponent, options: Record<string, unknown>): MNode[] {\n const lowered: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerLiquidElseBranches(sourceNode.children, baseComponent, options) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerLiquidElseBranches(children as MNode[], baseComponent, options)])),\n } : {}),\n };\n const elseNode = node.name === \"Show\" ? node.meta.else as MNode | undefined : undefined;\n const condition = node.bindings?.when?.code;\n const liquidCondition = typeof condition === \"string\" ? toLiquidCondition(condition) : undefined;\n if (!elseNode || !liquidCondition) {\n lowered.push(node);\n continue;\n }\n\n const elseChildren = elseNode.name === \"Fragment\" && Array.isArray(elseNode.children)\n ? lowerLiquidElseBranches(elseNode.children as MNode[], baseComponent, options)\n : lowerLiquidElseBranches([elseNode], baseComponent, options);\n const renderNodes = (children: MNode[]) => generators.liquid({ ...baseComponent, children, style: \"\" }, { ...options, prettier: false, reactive: false });\n lowered.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"div\",\n properties: { _text: `{% if ${liquidCondition} %}${renderNodes(node.children ?? [])}{% else %}${renderNodes(elseChildren)}{% endif %}` },\n bindings: {},\n meta: {},\n scope: {},\n children: [],\n });\n }\n return lowered;\n}\n\nfunction normalizeSwiftShowBranches(nodes: MNode[]): MNode[] {\n return nodes.map((sourceNode) => {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? normalizeSwiftShowBranches(sourceNode.children) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, normalizeSwiftShowBranches(children as MNode[])])),\n } : {}),\n };\n if (node.name === \"Show\" && node.bindings?.when) {\n node.name = \"Group\";\n node.bindings.if = node.bindings.when;\n delete node.bindings.when;\n }\n if (typeof node.bindings?._text?.code === \"string\") {\n node.name = \"Text\";\n node.bindings.innerHTML = node.bindings._text;\n delete node.bindings._text;\n }\n if (swiftTextTags.has(String(node.name).toLowerCase()) && node.children?.length) {\n if (node.children.length === 1) {\n const child = node.children[0] as MNode;\n const textBinding = child.bindings?.innerHTML ?? child.bindings?._text;\n if (typeof textBinding?.code === \"string\") {\n node.name = \"Text\";\n node.bindings = { ...(node.bindings ?? {}), innerHTML: textBinding };\n node.children = [];\n } else if (typeof child.properties?._text === \"string\") {\n node.name = \"Text\";\n node.properties = { ...(node.properties ?? {}), _text: child.properties._text };\n node.children = [];\n }\n }\n if (node.children?.length) node.name = \"div\";\n }\n return node;\n });\n}\n\nfunction decodeSlotText(node: MNode): MNode {\n const encoded = node.properties?._text;\n if (typeof encoded === \"string\") {\n try {\n const decoded = JSON.parse(encoded);\n if (typeof decoded === \"string\" && JSON.stringify(decoded) === encoded) node.properties._text = decoded;\n } catch {\n // Non-JSON text is a raw text node or an expression preserved elsewhere.\n }\n }\n return node;\n}\n\nfunction isMitosisTextNode(node: MNode): boolean {\n return Object.hasOwn(node.properties ?? {}, \"_text\") || Object.hasOwn(node.bindings ?? {}, \"_text\");\n}\n\nfunction lowerNamedComponentSlots(nodes: MNode[], target: MitosisTarget): MNode[] {\n const result: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n properties: { ...(sourceNode.properties ?? {}) },\n bindings: { ...(sourceNode.bindings ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerNamedComponentSlots(sourceNode.children, target) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerNamedComponentSlots(children as MNode[], target)])),\n } : {}),\n };\n\n if (target === \"builder\" && node.slots) {\n for (const slotChildren of Object.values(node.slots) as MNode[][]) slotChildren.forEach(decodeSlotText);\n } else if (target === \"solid\" && node.slots) {\n for (const [slotName, slotChildren] of Object.entries(node.slots) as [string, MNode[]][]) {\n if (slotChildren.length !== 1) continue;\n const slotChild = decodeSlotText(slotChildren[0]);\n if (Object.hasOwn(slotChild.bindings ?? {}, \"_text\")) node.bindings[slotName] = slotChild.bindings._text;\n else if (typeof slotChild.properties?._text === \"string\") node.properties[slotName] = slotChild.properties._text;\n }\n delete node.slots;\n } else if (target === \"reactNative\" && node.slots) {\n for (const slotChildren of Object.values(node.slots) as MNode[][]) {\n for (const child of slotChildren) {\n const decoded = decodeSlotText(child).properties?._text;\n if (typeof decoded === \"string\" && !Object.hasOwn(child.bindings ?? {}, \"_text\")) {\n child.bindings ??= {};\n child.bindings._text = { code: JSON.stringify(decoded), type: \"single\", bindingType: \"expression\" };\n delete child.properties._text;\n }\n }\n }\n } else if (nativeSlotProjectionTargets.has(target) && node.slots) {\n const projected: MNode[] = [];\n for (const [slotName, slotChildren] of Object.entries(node.slots) as [string, MNode[]][]) {\n const children = slotChildren.map(decodeSlotText);\n if (target === \"vue\" || target === \"svelte\") {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: target === \"vue\" ? \"template\" : \"svelte:fragment\",\n properties: target === \"vue\" ? { [`v-slot:${slotName}`]: \"\" } : { slot: slotName },\n bindings: {},\n meta: {},\n scope: {},\n children,\n });\n continue;\n }\n if (target === \"marko\") {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: `@${slotName}`,\n properties: {},\n bindings: {},\n meta: {},\n scope: {},\n children,\n });\n continue;\n }\n\n const slotAttribute = target === \"qwik\" ? \"q:slot\" : target === \"angular\" ? slotName : \"slot\";\n for (const child of children) {\n if (isMitosisTextNode(child)) {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"span\",\n properties: { [slotAttribute]: slotName },\n bindings: {},\n meta: {},\n scope: {},\n children: [child],\n });\n } else {\n child.properties ??= {};\n child.properties[slotAttribute] = slotAttribute === slotName ? \"\" : slotName;\n projected.push(child);\n }\n }\n }\n node.children = [...(node.children ?? []), ...projected];\n delete node.slots;\n }\n\n if (node.name === \"Slot\" && target === \"marko\") {\n node.name = node.properties.name ? `@${node.properties.name}` : \"@renderBody\";\n delete node.properties.name;\n } else if (node.name === \"Slot\" && target === \"solid\") {\n const slotName = node.properties.name;\n const code = typeof slotName === \"string\" && slotName !== \"default\" ? `props.${slotName}` : \"props.children\";\n const valueNode: MNode = {\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"div\",\n properties: {},\n bindings: { _text: { code, type: \"single\", bindingType: \"expression\" } },\n meta: {},\n scope: {},\n children: [],\n };\n if (node.children?.length) {\n node.name = \"Show\";\n node.properties = {};\n node.bindings = { when: { code, type: \"single\", bindingType: \"expression\" } };\n node.meta = { ...node.meta, else: { \"@type\": \"@builder.io/mitosis/node\", name: \"Fragment\", properties: {}, bindings: {}, meta: {}, scope: {}, children: node.children } };\n node.children = [valueNode];\n } else {\n node.name = valueNode.name;\n node.properties = valueNode.properties;\n node.bindings = valueNode.bindings;\n node.meta = valueNode.meta;\n node.children = [];\n }\n } else if (node.name === \"Slot\" && nativeSlotOutletTargets.has(target)) node.name = \"slot\";\n result.push(node);\n }\n return result;\n}\n\nfunction resultFiles(value: unknown, target: string, name: string): { path: string; contents: string; kind: \"component\" | \"style\" | \"metadata\" }[] {\n if (typeof value === \"string\") return [{ path: `${name}.${extensionFor(target)}`, contents: value, kind: \"component\" }];\n if (value && typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n if (typeof obj.code === \"string\") return [{ path: `${name}.${extensionFor(target)}`, contents: obj.code, kind: \"component\" }];\n if (Array.isArray(obj.files)) return obj.files.flatMap((f: any, i: number) => typeof f === \"string\" ? [{ path: `${name}${i ? `-${i}` : \"\"}.${extensionFor(target)}`, contents: f, kind: \"component\" as const }] : typeof f?.contents === \"string\" ? [{ path: f.path || `${name}${i ? `-${i}` : \"\"}.${extensionFor(target)}`, contents: f.contents, kind: f.kind === \"style\" ? \"style\" as const : \"component\" as const }] : []);\n }\n return [{ path: `${name}.${extensionFor(target)}`, contents: JSON.stringify(value, null, 2), kind: \"component\" }];\n}\nfunction extensionFor(target: string): string {\n const extensions: Record<string, string> = { builder: \"json\", webcomponent: \"js\", react: \"tsx\", preact: \"tsx\", reactNative: \"tsx\", solid: \"tsx\", angular: \"ts\", vue: \"vue\", svelte: \"svelte\", qwik: \"tsx\", stencil: \"tsx\", lit: \"ts\", html: \"html\", customElement: \"js\", liquid: \"liquid\", alpine: \"html\", marko: \"marko\", mitosis: \"lite.tsx\", swift: \"swift\", taro: \"tsx\", template: \"template\", rsc: \"tsx\" };\n return extensions[target] ?? \"txt\";\n}\nexport function generateWithMitosis(context: GenerationContext): GenerationResult {\n const target = context.target as MitosisTarget;\n if (!(target in generators)) throw new Error(`Unsupported Mitosis target: ${target}`);\n const component = componentIRToMitosis(context.component);\n component.children = lowerNamedComponentSlots(component.children, target);\n const qwikBaseline = target === \"qwik\" ? JSON.parse(JSON.stringify(component)) as MComponent : undefined;\n const qwikDefaults = target === \"qwik\" ? applyQwikPropDefaults(component, context.component.props) : [];\n if (target === \"swift\") {\n applySwiftPropTypes(component, context.component.props);\n applySwiftPropDefaults(component.children, context.component.props);\n }\n if (expressionPropDefaultTargets.has(target)) applyExpressionPropDefaults(component.children, context.component.props);\n if (target === \"liquid\") component.children = lowerLiquidElseBranches(component.children, component, context.options);\n if (target === \"reactNative\") normalizeReactNativeFragmentLinks(component);\n if (siblingElseTargets.has(target)) component.children = lowerElseBranches(component.children);\n if (target === \"swift\") component.children = normalizeSwiftShowBranches(component.children);\n let output = generators[target](component, context.options);\n let qwikDefaultsInjected = true;\n if (target === \"qwik\" && qwikDefaults.length > 0) {\n const outputWithDefaults = typeof output === \"string\" ? addQwikPropDefaults(output, qwikDefaults) : undefined;\n if (outputWithDefaults === undefined) {\n output = generators.qwik(qwikBaseline as MComponent, context.options);\n qwikDefaultsInjected = false;\n } else {\n output = outputWithDefaults;\n }\n }\n if (target === \"liquid\" && typeof output === \"string\") output = addLiquidPropDefaults(output, context.component);\n if (target === \"swift\" && typeof output === \"string\") output = addSwiftPropDefaults(output, context.component.props);\n const emitsPropTypes = context.options.typescript === true && propTypeTargets.has(target);\n const emitsStateTypes = context.options.typescript === true && stateTypeTargets.has(target);\n const diagnostics: Diagnostic[] = [\n {\n severity: \"warning\",\n code: \"MITOSIS_TARGET_SEMANTICS_UNVERIFIED\",\n message: `DesignOS has smoke-tested code generation for ${target}, but has not verified semantic parity for this target.`,\n path: `target.${target}`,\n },\n ...context.component.props\n .filter((prop) => prop.type !== undefined)\n .filter((prop) => target === \"swift\"\n ? !swiftPrimitiveType(prop.type)\n : !emitsPropTypes || typeof prop.type !== \"string\" || !prop.type.trim())\n .map((prop) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_PROP_TYPE_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the type annotation for prop \"${prop.name}\" with the current target options.`,\n path: `props.${prop.name}.type`,\n })),\n ...context.component.state\n .filter((state) => state.type !== undefined)\n .filter((state) => !emitsStateTypes || typeof state.type !== \"string\" || !state.type.trim())\n .map((state) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_STATE_TYPE_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the type annotation for state \"${state.name}\" with the current target options.`,\n path: `state.${state.name}.type`,\n })),\n ...context.component.props\n .filter((prop) => prop.defaultValue !== undefined)\n .filter((prop) => !preservesPropDefault(target, prop.name, prop.defaultValue, prop.type)\n || (target === \"qwik\" && !qwikDefaultsInjected))\n .map((prop) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_PROP_DEFAULT_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the default value for prop \"${prop.name}\".`,\n path: `props.${prop.name}.defaultValue`,\n })),\n ...(hasUnsupportedNamedComponentSlots(context.component.root, target) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_NAMED_COMPONENT_SLOT_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve named component slots for the current target.`,\n path: \"root.slots\",\n }] : []),\n ...(hasUnsupportedNamedSlotOutlet(context.component.root, target) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_SLOT_OUTLET_NOT_PRESERVED\",\n message: \"The SwiftUI output does not connect a slot outlet to caller-provided content; only fallback markup may render.\",\n path: \"root.slot\",\n }] : []),\n ...(target === \"liquid\" && hasUnsupportedLiquidElse(context.component.root) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_CONDITIONAL_ELSE_NOT_PRESERVED\",\n message: \"The Liquid target cannot safely lower this conditional else expression.\",\n path: \"root.otherwise\",\n }] : []),\n ...(eventlessTargets.has(target) && hasEventHandlers(context.component.root) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_EVENT_HANDLER_NOT_PRESERVED\",\n message: `The ${target} target has no interactive event runtime and cannot preserve event handler bindings.`,\n path: \"root.events\",\n }] : []),\n ];\n return { target: context.target, files: resultFiles(output, target, context.component.name), diagnostics };\n}\n\nfunction mitosisNodeHasEventBindings(node: MNode): boolean {\n if (Object.entries(node.bindings ?? {}).some(([name, binding]: [string, any]) =>\n /^on[A-Z]/.test(name) && binding?.bindingType === \"function\",\n )) return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasEventBindings(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasEventBindings(child)));\n}\n\nfunction mitosisNodeHasNamedSlots(node: MNode): boolean {\n if (Object.keys(node.slots ?? {}).some((name) => name !== \"default\")) return true;\n if (typeof node.properties?.slot === \"string\" && node.properties.slot !== \"\" && node.properties.slot !== \"default\") return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasNamedSlots(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasNamedSlots(child)));\n}\n\nfunction mitosisNodeHasSlotOutlet(node: MNode): boolean {\n if (node.name === \"Slot\") return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasSlotOutlet(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasSlotOutlet(child)));\n}\n\n/** Generate directly from Mitosis parser output so hooks, context, refs, subcomponents,\n * target blocks and other upstream semantics are not narrowed through ComponentIR. */\nexport function generateMitosisSourceComponent(\n authoredComponent: MitosisComponent,\n target: MitosisTarget,\n options: Record<string, unknown> = {},\n): GenerationResult {\n if (!(target in generators)) throw new Error(`Unsupported Mitosis target: ${target}`);\n const component = structuredClone(authoredComponent) as MComponent;\n component.children = lowerNamedComponentSlots(component.children ?? [], target);\n if (target === \"liquid\") component.children = lowerLiquidElseBranches(component.children, component, options);\n if (target === \"reactNative\") normalizeReactNativeFragmentLinks(component);\n if (siblingElseTargets.has(target)) component.children = lowerElseBranches(component.children);\n if (target === \"swift\") component.children = normalizeSwiftShowBranches(component.children);\n\n const output = generators[target](component, options);\n const diagnostics: Diagnostic[] = [{\n severity: \"warning\",\n code: \"MITOSIS_TARGET_SEMANTICS_UNVERIFIED\",\n message: `DesignOS has not verified semantic parity for all Mitosis source features on ${target}; output is generated by the upstream Mitosis target emitter.`,\n path: `target.${target}`,\n }];\n if (eventlessTargets.has(target) && (component.hooks?.onEvent?.length || component.children.some((node: MNode) => mitosisNodeHasEventBindings(node)))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_EVENT_HANDLER_NOT_PRESERVED\",\n message: `The ${target} target has no interactive event runtime and cannot preserve event handler bindings.`,\n path: \"source.events\",\n });\n }\n if (target === \"swift\" && component.children.some((node: MNode) => mitosisNodeHasNamedSlots(node))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_NAMED_COMPONENT_SLOT_NOT_PRESERVED\",\n message: \"The Swift target adapter does not preserve named component slot composition.\",\n path: \"source.children.slots\",\n });\n }\n if (target === \"swift\" && component.children.some((node: MNode) => mitosisNodeHasSlotOutlet(node))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_SLOT_OUTLET_NOT_PRESERVED\",\n message: \"The Swift target output does not connect a Mitosis Slot outlet to caller-provided content; only fallback markup may render.\",\n path: \"source.children.slot\",\n });\n }\n return { target, files: resultFiles(output, target, component.name), diagnostics };\n}\n\nfunction generateProjectRegistry(target: \"react\" | \"vue\", entries: CompilerProjectRegistryEntry[]): GeneratedFile {\n const imports = entries.map((entry, index) => {\n const modulePath = target === \"vue\" ? entry.modulePath : entry.modulePath.replace(/\\.(?:tsx?|jsx?)$/, \"\");\n return `import DesignOSComponent${index} from ${JSON.stringify(`./${modulePath}`)};`;\n });\n const registrations = entries.map((entry, index) => ` ${JSON.stringify(entry.type)}: DesignOSComponent${index},`);\n return {\n path: \"components.ts\",\n kind: \"metadata\",\n contents: [\n ...imports,\n \"\",\n \"export const components = {\",\n ...registrations,\n \"};\",\n \"\",\n \"export default components;\",\n \"\",\n ].join(\"\\n\"),\n };\n}\n\nexport function createMitosisTarget(target: MitosisTarget) {\n return {\n name: target,\n generate: (context: GenerationContext) => generateWithMitosis(context),\n generateMitosis: (component: MitosisComponent, options: Record<string, unknown>) => generateMitosisSourceComponent(component, target, options),\n ...((target === \"react\" || target === \"vue\")\n ? { generateProjectRegistry: (entries: CompilerProjectRegistryEntry[]) => generateProjectRegistry(target, entries) }\n : {}),\n };\n}\nexport function createMitosisCompiler(): TargetRegistry {\n const registry = new TargetRegistry();\n for (const target of mitosisTargets) registry.register(createMitosisTarget(target));\n return registry;\n}\n","import { parseJsx } from \"@builder.io/mitosis\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\n\nexport interface ParseMitosisSourceOptions {\n filePath?: string;\n /** Preserve JSX blocks nested in component props when the upstream parser supports them. */\n enableBlocksSlots?: boolean;\n}\n\ninterface DesignOSSourceProp {\n name: string;\n optional: boolean;\n defaultValue?: unknown;\n}\n\nfunction parseLiteral(value: string): unknown {\n try {\n return JSON.parse(value.trim().replace(/'/g, '\"'));\n } catch {\n return undefined;\n }\n}\n\nfunction findTypeDeclarationBody(source: string, propsTypeRef: string): string | undefined {\n const declaration = source.match(new RegExp(`(?:interface|type)\\\\s+${propsTypeRef}\\\\s*(?:=)?\\\\s*\\\\{`));\n if (!declaration || declaration.index === undefined) return undefined;\n const start = declaration.index + declaration[0].length - 1;\n let depth = 0;\n let quote: string | undefined;\n let escaped = false;\n for (let index = start; index < source.length; index += 1) {\n const character = source[index];\n if (quote) {\n if (escaped) escaped = false;\n else if (character === \"\\\\\") escaped = true;\n else if (character === quote) quote = undefined;\n continue;\n }\n if (character === \"'\" || character === '\"' || character === \"`\") {\n quote = character;\n continue;\n }\n if (character === \"{\") depth += 1;\n else if (character === \"}\" && --depth === 0) return source.slice(start + 1, index);\n }\n return undefined;\n}\n\nfunction splitTopLevelFields(body: string): string[] {\n const fields: string[] = [];\n let start = 0;\n let depth = 0;\n for (let index = 0; index < body.length; index += 1) {\n if (body[index] === \"{\" || body[index] === \"[\" || body[index] === \"<\") depth += 1;\n else if (body[index] === \"}\" || body[index] === \"]\" || body[index] === \">\") depth = Math.max(0, depth - 1);\n else if (body[index] === \";\" && depth === 0) {\n fields.push(body.slice(start, index));\n start = index + 1;\n }\n }\n fields.push(body.slice(start));\n return fields;\n}\n\nfunction extractDesignOSSourceProps(source: string, propsTypeRef: string | undefined): DesignOSSourceProp[] {\n if (!propsTypeRef) return [];\n const body = findTypeDeclarationBody(source, propsTypeRef);\n if (body === undefined) return [];\n const props = new Map<string, DesignOSSourceProp>();\n for (const field of splitTopLevelFields(body)) {\n const match = field.trim().match(/^([A-Za-z_$][\\w$]*)\\s*(\\?)?\\s*:\\s*([^\\n]+)$/);\n if (!match) continue;\n props.set(match[1], { name: match[1], optional: Boolean(match[2]) });\n }\n const destructured = source.match(/function\\s+\\w+\\s*\\(\\s*\\{([\\s\\S]*?)\\}\\s*(?::[^)]*)?\\)/);\n if (destructured) {\n for (const part of destructured[1].split(\",\")) {\n const match = part.trim().match(/^([A-Za-z_$][\\w$]*)\\s*=\\s*(.+)$/);\n if (!match || !props.has(match[1])) continue;\n const value = parseLiteral(match[2]);\n if (value !== undefined) props.get(match[1])!.defaultValue = value;\n }\n }\n return [...props.values()];\n}\n\n/**\n * Parse developer-authored TSX with the same Mitosis parser used by its compiler.\n * The returned Mitosis component is retained intact; it is not reverse-mapped\n * through DesignOS ComponentIR, which cannot represent every Mitosis feature.\n */\nexport function parseMitosisSource(source: string, options: ParseMitosisSourceOptions = {}): MitosisComponent {\n if (typeof source !== \"string\") throw new TypeError(\"Mitosis source must be a string\");\n\n try {\n const component = parseJsx(source, {\n typescript: true,\n enableBlocksSlots: options.enableBlocksSlots ?? true,\n ...(options.filePath ? { filePath: options.filePath } : {}),\n });\n const designosProps = extractDesignOSSourceProps(source, component.propsTypeRef);\n if (designosProps.length > 0) component.meta = { ...component.meta, designosProps: designosProps as any };\n return component;\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new Error(`Unable to parse DesignOS TSX${options.filePath ? ` at ${options.filePath}` : \"\"}: ${message}`, { cause });\n }\n}\n","import type { ComponentManifest, PageNode } from \"@designos/core\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\n\nexport type CompilerTarget = \"react\" | \"vue\" | \"angular\" | \"html\" | \"svelte\" | \"solid\" | \"alpine\" | \"builder\" | \"customElement\" | \"liquid\" | \"lit\" | \"marko\" | \"mitosis\" | \"preact\" | \"qwik\" | \"reactNative\" | \"rsc\" | \"stencil\" | \"swift\" | \"taro\" | \"template\" | \"webcomponent\";\n\nexport interface IRImport {\n source: string;\n names: string[];\n typeOnly?: boolean;\n}\n\nexport interface IRProp {\n name: string;\n type?: string;\n optional?: boolean;\n defaultValue?: unknown;\n}\n\nexport interface IRState {\n name: string;\n type?: string;\n initialValue: string;\n}\n\nexport interface IRBinding {\n code: string;\n kind: \"expression\" | \"event\" | \"spread\";\n eventName?: string;\n parameters?: string[];\n}\n\nexport interface IRAttribute {\n name: string;\n value?: string;\n binding?: IRBinding;\n}\n\nexport interface IRTextNode {\n kind: \"text\";\n value: string;\n}\n\nexport interface IRExpressionNode {\n kind: \"expression\";\n binding: IRBinding;\n}\n\nexport interface IRElementNode {\n kind: \"element\";\n tag: string;\n attributes?: IRAttribute[];\n children?: IRNode[];\n}\n\nexport interface IRComponentNode {\n kind: \"component\";\n name: string;\n attributes?: IRAttribute[];\n children?: IRNode[];\n slots?: Record<string, IRNode[]>;\n}\n\nexport interface IRFragmentNode {\n kind: \"fragment\";\n children: IRNode[];\n}\n\nexport interface IRConditionalNode {\n kind: \"conditional\";\n condition: IRBinding;\n then: IRNode[];\n otherwise?: IRNode[];\n}\n\nexport interface IRLoopNode {\n kind: \"loop\";\n collection: IRBinding;\n itemName: string;\n indexName?: string;\n children: IRNode[];\n}\n\nexport interface IRSlotNode {\n kind: \"slot\";\n name?: string;\n fallback?: IRNode[];\n}\n\nexport type IRNode = IRTextNode | IRExpressionNode | IRElementNode | IRComponentNode | IRFragmentNode | IRConditionalNode | IRLoopNode | IRSlotNode;\n\nexport interface ComponentIR {\n version: \"0.1\";\n name: string;\n imports: IRImport[];\n props: IRProp[];\n state: IRState[];\n root: IRNode;\n styles?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface ComponentSource {\n manifest: ComponentManifest;\n implementation: { kind: \"ir\"; component: ComponentIR }\n | { kind: \"mitosis\"; component: MitosisComponent }\n | { kind: \"runtime\"; module: string; exportName?: string };\n}\n\n/** A project-local file used by a component implementation. */\nexport interface ComponentAssetReference {\n /** Path relative to the DesignOS project root; absolute paths and traversal are not allowed. */\n source: string;\n /** Path relative to the generated target directory. Defaults to `source`. */\n outputPath?: string;\n}\n\n/** A component definition that can be compiled for a framework target. */\nexport type CompilerProjectComponent = Omit<ComponentSource, \"implementation\"> & {\n /** Project compilation accepts neutral DesignOS IR or a parsed Mitosis component. */\n implementation: { kind: \"ir\"; component: ComponentIR } | { kind: \"mitosis\"; component: MitosisComponent };\n /** Target-relative module directory; defaults to `components` and preserves relative import layout. */\n outputDirectory?: string;\n /** CSS/resources imported by the generated entry module; copied with the project assets. */\n styles?: ComponentAssetReference[];\n assets?: ComponentAssetReference[];\n};\n\n/** Framework-neutral component source catalog consumed by the future project compiler. */\nexport interface CompilerProject {\n schemaVersion: \"1\";\n components: CompilerProjectComponent[];\n}\n\n/** File-based DesignOS source project consumed by the CLI. */\nexport interface CompilerSourceProjectComponent {\n source: string;\n manifest: string;\n exportName?: string;\n outputDirectory?: string;\n styles?: ComponentAssetReference[];\n assets?: ComponentAssetReference[];\n}\n\nexport interface CompilerSourceProject {\n schemaVersion: \"2\";\n components: CompilerSourceProjectComponent[];\n}\n\nexport interface Diagnostic {\n severity: \"error\" | \"warning\" | \"info\";\n code: string;\n message: string;\n path?: string;\n}\n\nexport interface GeneratedFile {\n path: string;\n contents: string;\n kind: \"component\" | \"style\" | \"metadata\";\n}\n\nexport interface GenerationContext {\n target: CompilerTarget;\n component: ComponentIR;\n options: Record<string, unknown>;\n}\n\nexport interface GenerationResult {\n target: CompilerTarget;\n files: GeneratedFile[];\n diagnostics: Diagnostic[];\n}\n\nexport interface CompilerPlugin {\n name: string;\n order?: number;\n beforeNormalize?(component: ComponentIR): ComponentIR | void;\n afterNormalize?(component: ComponentIR): ComponentIR | void;\n beforeGenerate?(context: GenerationContext): void | Promise<void>;\n afterGenerate?(result: GenerationResult): GenerationResult | void | Promise<GenerationResult | void>;\n}\n\nexport interface CompilerProjectRegistryEntry {\n /** Framework-neutral serialized component type used by PageNode.type. */\n type: string;\n /** Generated module path relative to the target output directory. */\n modulePath: string;\n}\n\nexport interface CompilerTargetDefinition {\n name: CompilerTarget;\n generate(context: GenerationContext): GenerationResult;\n /** Optional lossless path for components parsed from the Mitosis TSX contract. */\n generateMitosis?(component: MitosisComponent, options: Record<string, unknown>): GenerationResult;\n /** Optional target-specific source file that maps PageNode types to generated framework modules. */\n generateProjectRegistry?(entries: CompilerProjectRegistryEntry[]): GeneratedFile;\n}\n\nexport class TargetRegistry {\n private readonly targets = new Map<CompilerTarget, CompilerTargetDefinition>();\n\n register(target: CompilerTargetDefinition): void {\n if (this.targets.has(target.name)) throw new Error(`Compiler target already registered: ${target.name}`);\n this.targets.set(target.name, target);\n }\n\n get(target: CompilerTarget): CompilerTargetDefinition {\n const definition = this.targets.get(target);\n if (!definition) throw new Error(`Compiler target not registered: ${target}`);\n return definition;\n }\n\n names(): CompilerTarget[] { return [...this.targets.keys()]; }\n}\n\nexport interface CompileOptions {\n target: CompilerTarget;\n targetOptions?: Record<string, unknown>;\n plugins?: CompilerPlugin[];\n}\n\nexport interface CompilerProjectAssetOutput {\n /** Source path relative to the project root. */\n source: string;\n /** Destination path relative to the compiler output directory. */\n outputPath: string;\n}\n\nexport interface CompileProjectResult {\n target: CompilerTarget;\n files: GeneratedFile[];\n assets: CompilerProjectAssetOutput[];\n diagnostics: Diagnostic[];\n}\n\nexport function normalizeComponent(component: ComponentIR): ComponentIR {\n return structuredClone(component);\n}\n\nexport function validateComponentIR(component: ComponentIR): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n if (!component || typeof component !== \"object\") {\n return [{ severity: \"error\", code: \"COMPONENT_IR_REQUIRED\", message: \"ComponentIR must be an object\", path: \"component\" }];\n }\n if (typeof component.name !== \"string\" || !component.name.trim()) diagnostics.push({ severity: \"error\", code: \"COMPONENT_NAME_REQUIRED\", message: \"ComponentIR.name is required\", path: \"name\" });\n if (!component.root || typeof component.root !== \"object\") diagnostics.push({ severity: \"error\", code: \"COMPONENT_ROOT_REQUIRED\", message: \"ComponentIR.root is required\", path: \"root\" });\n if (!Array.isArray(component.imports)) diagnostics.push({ severity: \"error\", code: \"COMPONENT_IMPORTS_INVALID\", message: \"ComponentIR.imports must be an array\", path: \"imports\" });\n if (!Array.isArray(component.state)) diagnostics.push({ severity: \"error\", code: \"COMPONENT_STATE_INVALID\", message: \"ComponentIR.state must be an array\", path: \"state\" });\n if (!Array.isArray(component.props)) {\n diagnostics.push({ severity: \"error\", code: \"COMPONENT_PROPS_INVALID\", message: \"ComponentIR.props must be an array\", path: \"props\" });\n return diagnostics;\n }\n const names = new Set<string>();\n for (const prop of component.props) {\n if (names.has(prop.name)) diagnostics.push({ severity: \"error\", code: \"DUPLICATE_PROP\", message: `Duplicate prop: ${prop.name}`, path: \"props\" });\n names.add(prop.name);\n }\n return diagnostics;\n}\n\nfunction serializedValue(value: unknown): string {\n if (value === undefined) return \"undefined\";\n return JSON.stringify(value, (_key, nested) => {\n if (!nested || typeof nested !== \"object\" || Array.isArray(nested)) return nested;\n return Object.fromEntries(Object.entries(nested).sort(([left], [right]) => left.localeCompare(right)));\n });\n}\n\n/**\n * Manifest defaults populate authored PageNodes; source defaults remain runtime\n * fallbacks. A mismatch is reported instead of silently rewriting either side.\n */\nexport function validateManifestImplementationContract(\n manifest: ComponentManifest,\n implementation: CompilerProjectComponent[\"implementation\"],\n path = \"component\",\n): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n const sourceProps = implementation.kind === \"ir\"\n ? new Map(implementation.component.props.map((prop) => [prop.name, prop]))\n : new Map(\n ((implementation.component.meta as { designosProps?: Array<{ name: string; optional: boolean; defaultValue?: unknown }> } | undefined)?.designosProps ?? [])\n .map((prop) => [prop.name, prop]),\n );\n const manifestFields = new Map(manifest.fields.map((field) => [field.name, field]));\n const supportsChildren = Boolean(\n manifest.capabilities?.canHaveChildren\n || manifest.slots?.some((slot) => slot.name === \"default\" || slot.name === \"children\"),\n );\n\n for (const prop of sourceProps.values()) {\n if (prop.name === \"children\" && supportsChildren) continue;\n if (!manifestFields.has(prop.name)) diagnostics.push({\n severity: \"warning\",\n code: \"COMPILER_PROJECT_SOURCE_PROP_NOT_IN_MANIFEST\",\n message: `Source prop \"${prop.name}\" is not editable through manifest \"${manifest.type}\".`,\n path: `${path}.implementation.component.props.${prop.name}`,\n });\n }\n\n for (const field of manifest.fields) {\n const prop = sourceProps.get(field.name);\n if (!prop) {\n if (field.required) diagnostics.push({\n severity: \"error\",\n code: \"COMPILER_PROJECT_REQUIRED_FIELD_NOT_IN_SOURCE\",\n message: `Required manifest field \"${field.name}\" is not declared by the source component.`,\n path: `${path}.manifest.fields.${field.name}`,\n });\n continue;\n }\n if (field.defaultValue !== undefined && prop.defaultValue !== undefined && serializedValue(field.defaultValue) !== serializedValue(prop.defaultValue)) diagnostics.push({\n severity: \"error\",\n code: \"COMPILER_PROJECT_DEFAULT_MISMATCH\",\n message: `Manifest default for \"${field.name}\" differs from the source runtime default; manifest defaults win for authored page data and source defaults remain runtime fallbacks.`,\n path: `${path}.manifest.fields.${field.name}.defaultValue`,\n });\n }\n\n return diagnostics;\n}\n\nfunction isSafeRelativePath(value: unknown): value is string {\n return typeof value === \"string\"\n && value.length > 0\n && !value.startsWith(\"/\")\n && !value.includes(\"\\\\\")\n && !/^[A-Za-z]:/.test(value)\n && value.split(\"/\").every((part) => part.length > 0 && part !== \".\" && part !== \"..\");\n}\n\nexport function validateCompilerProject(project: CompilerProject): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n if (!project || typeof project !== \"object\" || project.schemaVersion !== \"1\") {\n return [{ severity: \"error\", code: \"COMPILER_PROJECT_SCHEMA_VERSION_UNSUPPORTED\", message: \"CompilerProject.schemaVersion must be \\\"1\\\"\", path: \"schemaVersion\" }];\n }\n if (!Array.isArray(project.components)) {\n return [{ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENTS_REQUIRED\", message: \"CompilerProject.components must be an array\", path: \"components\" }];\n }\n\n const componentTypes = new Set<string>();\n const componentNames = new Set<string>();\n const assetOutputs = new Map<string, string>();\n\n project.components.forEach((definition, index) => {\n const prefix = `components[${index}]`;\n const manifest = definition?.manifest;\n const implementation = definition?.implementation;\n const type = manifest?.type;\n\n if (typeof type !== \"string\" || !type.trim()) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_TYPE_REQUIRED\", message: \"Component manifest type must be a non-empty string\", path: `${prefix}.manifest.type` });\n } else if (componentTypes.has(type)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_DUPLICATE_COMPONENT_TYPE\", message: `Duplicate component manifest type: ${type}`, path: `${prefix}.manifest.type` });\n } else {\n componentTypes.add(type);\n }\n\n if (!manifest || typeof manifest.displayName !== \"string\" || !manifest.displayName.trim() || !Array.isArray(manifest.fields)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_MANIFEST_INVALID\", message: \"Component manifest requires a displayName and fields array\", path: `${prefix}.manifest` });\n }\n\n if (!implementation || (implementation.kind !== \"ir\" && implementation.kind !== \"mitosis\") || !implementation.component) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_IMPLEMENTATION_INVALID\", message: \"Project compilation requires a DesignOS IR or parsed Mitosis component implementation\", path: `${prefix}.implementation` });\n } else {\n const name: unknown = implementation.component.name;\n if (typeof name !== \"string\" || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_NAME_INVALID\", message: `Component name must be a valid identifier for generated framework components: ${name}`, path: `${prefix}.implementation.component.name` });\n } else if (componentNames.has(name)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_DUPLICATE_COMPONENT_NAME\", message: `Duplicate component implementation name: ${name}`, path: `${prefix}.implementation.component.name` });\n } else {\n componentNames.add(name);\n }\n if (implementation.kind === \"ir\") {\n diagnostics.push(...validateComponentIR(implementation.component).map((diagnostic) => ({\n ...diagnostic,\n path: diagnostic.path ? `${prefix}.implementation.component.${diagnostic.path}` : `${prefix}.implementation.component`,\n })));\n } else if (implementation.component[\"@type\"] !== \"@builder.io/mitosis/component\") {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_MITOSIS_COMPONENT_INVALID\", message: \"Parsed Mitosis implementation has an invalid component discriminator\", path: `${prefix}.implementation.component.@type` });\n }\n if (manifest && Array.isArray(manifest.fields)) diagnostics.push(...validateManifestImplementationContract(manifest, implementation, prefix));\n }\n\n const outputDirectory = definition?.outputDirectory ?? \"components\";\n if (!isSafeRelativePath(outputDirectory)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_OUTPUT_DIRECTORY_INVALID\", message: \"outputDirectory must be a safe path relative to the target output directory\", path: `${prefix}.outputDirectory` });\n }\n\n for (const collection of [\"styles\", \"assets\"] as const) {\n const references = definition?.[collection];\n if (references !== undefined && !Array.isArray(references)) {\n diagnostics.push({ severity: \"error\", code: `COMPILER_PROJECT_${collection.toUpperCase()}_INVALID`, message: `${collection} must be an array`, path: `${prefix}.${collection}` });\n }\n for (const [assetIndex, asset] of (Array.isArray(references) ? references : []).entries()) {\n const assetPath = `${prefix}.${collection}[${assetIndex}]`;\n if (!isSafeRelativePath(asset.source)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_SOURCE_PATH_INVALID\", message: \"Asset source must be a safe path relative to the project root\", path: `${assetPath}.source` });\n continue;\n }\n const outputPath = asset.outputPath ?? asset.source;\n if (!isSafeRelativePath(outputPath)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_OUTPUT_PATH_INVALID\", message: \"Asset outputPath must be a safe path relative to the generated output directory\", path: `${assetPath}.outputPath` });\n continue;\n }\n const normalizedOutputPath = outputPath.toLowerCase();\n const existingSource = assetOutputs.get(normalizedOutputPath);\n if (existingSource && existingSource !== asset.source) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_OUTPUT_COLLISION\", message: `Different assets target the same output path: ${outputPath}`, path: `${assetPath}.outputPath` });\n } else {\n assetOutputs.set(normalizedOutputPath, asset.source);\n }\n }\n }\n });\n\n return diagnostics;\n}\n\nexport async function compileComponent(\n component: ComponentIR,\n registry: TargetRegistry,\n options: CompileOptions,\n): Promise<GenerationResult> {\n const plugins = [...(options.plugins ?? [])].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n let normalized = normalizeComponent(component);\n for (const plugin of plugins) normalized = plugin.beforeNormalize?.(normalized) ?? normalized;\n for (const plugin of plugins) normalized = plugin.afterNormalize?.(normalized) ?? normalized;\n const diagnostics = validateComponentIR(normalized);\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], diagnostics };\n }\n const context: GenerationContext = { target: options.target, component: normalized, options: options.targetOptions ?? {} };\n for (const plugin of plugins) await plugin.beforeGenerate?.(context);\n let result = registry.get(options.target).generate(context);\n result = { ...result, diagnostics: [...diagnostics, ...result.diagnostics] };\n for (const plugin of plugins) result = (await plugin.afterGenerate?.(result)) ?? result;\n return result;\n}\n\nfunction relativeModulePath(fromFile: string, toFile: string): string {\n const fromDirectory = fromFile.split(\"/\").slice(0, -1);\n const toParts = toFile.split(\"/\");\n let shared = 0;\n while (shared < fromDirectory.length && shared < toParts.length && fromDirectory[shared] === toParts[shared]) shared++;\n const path = [\n ...Array.from({ length: fromDirectory.length - shared }, () => \"..\"),\n ...toParts.slice(shared),\n ].join(\"/\");\n return path.startsWith(\".\") ? path : `./${path}`;\n}\n\nfunction addStyleImports(contents: string, moduleOutputPath: string, styles: ComponentAssetReference[]): string {\n const statements = [...new Set(styles.map((style) =>\n `import ${JSON.stringify(relativeModulePath(moduleOutputPath, style.outputPath ?? style.source))};`,\n ))].filter((statement) => !contents.includes(statement));\n if (statements.length === 0) return contents;\n const firstLineEnd = contents.indexOf(\"\\n\");\n if (contents.startsWith(\"// @ts-nocheck\") && firstLineEnd >= 0) {\n return `${contents.slice(0, firstLineEnd + 1)}${statements.join(\"\\n\")}\\n${contents.slice(firstLineEnd + 1)}`;\n }\n return `${statements.join(\"\\n\")}\\n${contents}`;\n}\n\nexport async function compileProject(\n project: CompilerProject,\n registry: TargetRegistry,\n options: CompileOptions,\n): Promise<CompileProjectResult> {\n const diagnostics = validateCompilerProject(project);\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], assets: [], diagnostics };\n }\n\n const files: GeneratedFile[] = [];\n const assets = new Map<string, string>();\n const generatedPaths = new Set<string>();\n const registryEntries: CompilerProjectRegistryEntry[] = [];\n const targetDefinition = registry.get(options.target);\n\n for (const [index, definition] of project.components.entries()) {\n let result: GenerationResult;\n if (definition.implementation.kind === \"ir\") {\n result = await compileComponent(definition.implementation.component, registry, options);\n } else if (targetDefinition.generateMitosis) {\n result = targetDefinition.generateMitosis(definition.implementation.component, options.targetOptions ?? {});\n } else {\n result = {\n target: options.target,\n files: [],\n diagnostics: [{\n severity: \"error\",\n code: \"COMPILER_TARGET_MITOSIS_SOURCE_UNSUPPORTED\",\n message: `Target ${options.target} does not provide a Mitosis source generator.`,\n path: `components[${index}].implementation`,\n }],\n };\n }\n diagnostics.push(...result.diagnostics.map((diagnostic) => ({\n ...diagnostic,\n path: diagnostic.path ? `components[${index}].${diagnostic.path}` : `components[${index}]`,\n })));\n\n const componentName = definition.implementation.component.name;\n for (const file of result.files) {\n if (!isSafeRelativePath(file.path)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_GENERATED_PATH_INVALID\", message: `Target generated an unsafe relative file path: ${file.path}`, path: `components[${index}].output` });\n continue;\n }\n const outputPath = `${definition.outputDirectory ?? \"components\"}/${file.path}`;\n const normalizedPath = outputPath.toLowerCase();\n if (generatedPaths.has(normalizedPath)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_GENERATED_PATH_COLLISION\", message: `Multiple components generated the same output path: ${outputPath}`, path: `components[${index}].output` });\n continue;\n }\n generatedPaths.add(normalizedPath);\n const isEntryModule = file.kind === \"component\" && file.path.split(\"/\").pop()?.startsWith(`${componentName}.`);\n files.push({\n ...file,\n path: outputPath,\n contents: isEntryModule && definition.styles?.length\n ? addStyleImports(file.contents, outputPath, definition.styles)\n : file.contents,\n });\n }\n\n if (targetDefinition.generateProjectRegistry) {\n const entryFiles = result.files.filter((file) => file.kind === \"component\" && file.path.split(\"/\").pop()?.startsWith(`${componentName}.`));\n if (entryFiles.length !== 1) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_ENTRY_AMBIGUOUS\", message: `Expected one generated entry module for ${componentName}; found ${entryFiles.length}`, path: `components[${index}].output` });\n } else {\n registryEntries.push({\n type: definition.manifest.type,\n modulePath: `${definition.outputDirectory ?? \"components\"}/${entryFiles[0].path}`,\n });\n }\n }\n\n for (const asset of [...(definition.styles ?? []), ...(definition.assets ?? [])]) {\n assets.set(asset.outputPath ?? asset.source, asset.source);\n }\n }\n\n if (targetDefinition.generateProjectRegistry) {\n const registryFile = targetDefinition.generateProjectRegistry(registryEntries);\n if (!isSafeRelativePath(registryFile.path)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_PATH_INVALID\", message: `Target generated an unsafe registry path: ${registryFile.path}`, path: \"target.registry\" });\n } else if (generatedPaths.has(registryFile.path.toLowerCase())) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_PATH_COLLISION\", message: `Registry output collides with a generated component file: ${registryFile.path}`, path: \"target.registry\" });\n } else {\n generatedPaths.add(registryFile.path.toLowerCase());\n files.push(registryFile);\n }\n } else {\n diagnostics.push({ severity: \"info\", code: \"COMPILER_PROJECT_REGISTRY_NOT_REGISTERED\", message: `Target ${options.target} has no verified project component registry emitter; generated files are emitted without components.ts.`, path: `target.${options.target}` });\n }\n\n for (const outputPath of assets.keys()) {\n if (generatedPaths.has(outputPath.toLowerCase())) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_GENERATED_PATH_COLLISION\", message: `Asset output collides with a generated file: ${outputPath}`, path: \"assets\" });\n }\n }\n\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], assets: [], diagnostics };\n }\n\n return {\n target: options.target,\n files,\n assets: [...assets.entries()].map(([outputPath, source]) => ({ source, outputPath })),\n diagnostics,\n };\n}\n\nexport function pageNodeToComponentIR(node: PageNode): ComponentIR {\n return {\n version: \"0.1\",\n name: node.type,\n imports: [],\n props: Object.keys(node.props).map((name) => ({ name, defaultValue: node.props[name] })),\n state: [],\n root: { kind: \"component\", name: node.type, attributes: Object.keys(node.props).map((name) => ({ name, binding: { kind: \"expression\", code: `props.${name}` } })) },\n metadata: { sourceNodeId: node.id },\n };\n}\n\nexport { componentIRToMitosis, createMitosisCompiler, createMitosisTarget, generateMitosisSourceComponent, generateWithMitosis, mitosisTargets, mitosisTargetCapabilities } from \"./mitosis\";\nexport type { MitosisTarget, MitosisTargetCapability } from \"./mitosis\";\nexport { parseMitosisSource } from \"./source\";\nexport type { ParseMitosisSourceOptions } from \"./source\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKA,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAA,EAAiB;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAO;AAAA,EAAS;AAAA,EACnF;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAe;AAAA,EAAO;AAAA,EAAS;AAAA,EAAW;AAAA,EACrE;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAY;AAAA,EAAO;AACtC;AAQO,IAAM,4BAAsF,OAAO;AAAA,EACxG,OAAO,YAAY,eAAe,IAAI,CAAC,WAAW,CAAC,QAAQ,OAAO,OAAO;AAAA,IACvE,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,aAAa;AAAA,EACf,CAAC,CAAC,CAAC,CAAC;AACN;AAIA,IAAM,kBAAkB,oBAAI,IAAmB,CAAC,UAAU,QAAQ,SAAS,eAAe,OAAO,SAAS,MAAM,CAAC;AACjH,IAAM,mBAAmB,oBAAI,IAAm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AQ,CAAC,GAAG,YAAY;AAAA,EACtE;AAEA,SAAO;AAAA,IACL,QAAQ,QAAQ;AAAA,IAChB;AAAA,IACA,QAAQ,CAAC,GAAG,OAAO,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC,YAAY,MAAM,OAAO,EAAE,QAAQ,WAAW,EAAE;AAAA,IACpF;AAAA,EACF;AACF;AAEO,SAAS,sBAAsB,MAA6B;AACjE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,KAAK;AAAA,IACX,SAAS,CAAC;AAAA,IACV,OAAO,OAAO,KAAK,KAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,cAAc,KAAK,MAAM,IAAI,EAAE,EAAE;AAAA,IACvF,OAAO,CAAC;AAAA,IACR,MAAM,EAAE,MAAM,aAAa,MAAM,KAAK,MAAM,YAAY,OAAO,KAAK,KAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,SAAS,EAAE,MAAM,cAAc,MAAM,SAAS,IAAI,GAAG,EAAE,EAAE,EAAE;AAAA,IAClK,UAAU,EAAE,cAAc,KAAK,GAAG;AAAA,EACpC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/mitosis.ts","../src/source.ts","../src/index.ts"],"sourcesContent":["import {\n componentToAlpine,\n componentToBuilder,\n componentToAngular,\n componentToCustomElement,\n componentToHtml,\n componentToLiquid,\n componentToLit,\n componentToMarko,\n componentToMitosis,\n componentToPreact,\n componentToQwik,\n componentToReact,\n componentToReactNative,\n componentToRsc,\n componentToSolid,\n componentToStencil,\n componentToSvelte,\n componentToSwift,\n componentToTaro,\n componentToTemplate,\n componentToVue,\n} from \"@builder.io/mitosis\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\nimport { TargetRegistry } from \"./index\";\nimport type { ComponentIR, CompilerProjectRegistryEntry, Diagnostic, GeneratedFile, GenerationContext, GenerationResult, IRAttribute, IRNode } from \"./index\";\n\nexport const mitosisTargets = [\n \"alpine\", \"angular\", \"builder\", \"customElement\", \"html\", \"liquid\", \"lit\", \"marko\", \"mitosis\",\n \"preact\", \"qwik\", \"react\", \"reactNative\", \"rsc\", \"solid\", \"stencil\", \"svelte\",\n \"swift\", \"taro\", \"template\", \"vue\", \"webcomponent\",\n] as const;\nexport type MitosisTarget = (typeof mitosisTargets)[number];\nexport interface MitosisTargetCapability {\n generation: \"smoke-tested\";\n semanticParity: \"unverified\";\n sourceMaps: \"unverified\";\n diagnostics: \"partial\";\n}\nexport const mitosisTargetCapabilities: Readonly<Record<MitosisTarget, MitosisTargetCapability>> = Object.freeze(\n Object.fromEntries(mitosisTargets.map((target) => [target, Object.freeze({\n generation: \"smoke-tested\" as const,\n semanticParity: \"unverified\" as const,\n sourceMaps: \"unverified\" as const,\n diagnostics: \"partial\" as const,\n })])) as Record<MitosisTarget, MitosisTargetCapability>,\n);\ntype MNode = Record<string, any>;\ntype MComponent = Record<string, any>;\n\nconst propTypeTargets = new Set<MitosisTarget>([\"preact\", \"qwik\", \"react\", \"reactNative\", \"rsc\", \"solid\", \"taro\"]);\nconst stateTypeTargets = new Set<MitosisTarget>([\"angular\", \"preact\", \"react\", \"reactNative\", \"rsc\", \"taro\"]);\n\nfunction createComponentPropType(component: ComponentIR): { name: string; declaration: string } | undefined {\n if (!component.props.some((prop) => typeof prop.type === \"string\" && prop.type.trim())) return undefined;\n\n const importedNames = new Set(component.imports.flatMap((item) => item.names));\n const componentName = component.name.replace(/[^A-Za-z0-9_$]/g, \"_\");\n let name = `__DesignOS_${componentName}_Props`;\n while (importedNames.has(name)) name = `_${name}`;\n\n const properties = component.props.map((prop) => {\n const propertyName = /^[$A-Z_a-z][$\\w]*$/.test(prop.name) ? prop.name : JSON.stringify(prop.name);\n const optional = prop.optional || prop.defaultValue !== undefined ? \"?\" : \"\";\n const type = typeof prop.type === \"string\" && prop.type.trim() ? prop.type.trim() : \"any\";\n return ` ${propertyName}${optional}: ${type};`;\n });\n\n return { name, declaration: `type ${name} = {\\n${properties.join(\"\\n\")}\\n};` };\n}\n\nfunction toMitosisNode(node: IRNode): MNode {\n const base: MNode = { \"@type\": \"@builder.io/mitosis/node\", name: \"div\", meta: {}, scope: {}, properties: {}, bindings: {}, children: [] };\n if (node.kind === \"text\") {\n base.properties._text = node.value;\n } else if (node.kind === \"expression\") {\n base.bindings._text = { code: node.binding.code, type: \"single\", bindingType: \"expression\" };\n } else if (node.kind === \"slot\") {\n base.name = \"Slot\";\n if (node.name) base.properties.name = node.name;\n if (node.fallback) base.children = node.fallback.map((child) => toMitosisNode(child));\n } else if (node.kind === \"fragment\") {\n base.name = \"Fragment\";\n base.children = node.children.map((child) => toMitosisNode(child));\n } else if (node.kind === \"conditional\") {\n base.name = \"Show\";\n base.bindings.when = { code: node.condition.code, type: \"single\", bindingType: \"expression\" };\n base.children = node.then.map((child) => toMitosisNode(child));\n if (node.otherwise?.length) {\n base.meta.else = toMitosisNode({ kind: \"fragment\", children: node.otherwise });\n }\n } else if (node.kind === \"loop\") {\n base.name = \"For\";\n base.scope = { forName: node.itemName, indexName: node.indexName, collectionName: undefined };\n base.bindings.each = { code: node.collection.code, type: \"single\", bindingType: \"expression\" };\n base.children = node.children.map((child) => toMitosisNode(child));\n } else {\n base.name = node.kind === \"element\" ? node.tag : node.name;\n base.children = (node.children ?? []).map((child) => toMitosisNode(child));\n for (const attribute of node.attributes ?? []) applyAttribute(base, attribute);\n if (node.kind === \"component\" && node.slots) {\n const { default: defaultSlot, ...namedSlots } = node.slots;\n if (defaultSlot) base.children.push(...defaultSlot.map((child) => toMitosisNode(child)));\n if (Object.keys(namedSlots).length) {\n base.slots = Object.fromEntries(Object.entries(namedSlots).map(([name, children]) => [name, toMitosisSlotChildren(children)]));\n }\n }\n }\n return base;\n}\n\nfunction toMitosisSlotChildren(children: IRNode[]): MNode[] {\n const nodes = children.length === 1 && children[0].kind === \"fragment\" ? children[0].children : children;\n if (nodes.length === 1 && nodes[0].kind === \"text\") {\n const child = nodes[0];\n const node = toMitosisNode(child);\n node.properties._text = JSON.stringify(child.value);\n return [node];\n }\n return nodes.map((child) => toMitosisNode(child));\n}\n\nfunction applyAttribute(node: MNode, attribute: IRAttribute): void {\n if (!attribute.binding) {\n if (attribute.value !== undefined) node.properties[attribute.name] = attribute.value;\n return;\n }\n const binding = attribute.binding;\n const eventName = binding.eventName ?? attribute.name;\n const key = binding.kind === \"event\" && !eventName.startsWith(\"on\")\n ? `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`\n : attribute.name;\n node.bindings[key] = {\n code: binding.code,\n type: binding.kind === \"spread\" ? \"spread\" : \"single\",\n ...(binding.kind === \"spread\" ? { spreadType: \"normal\" } : { bindingType: binding.kind === \"event\" ? \"function\" : \"expression\" }),\n ...(binding.parameters ? { arguments: binding.parameters } : {}),\n };\n}\nexport function componentIRToMitosis(component: ComponentIR): MComponent {\n const imports = component.imports.map((item) => ({\n path: item.source,\n imports: Object.fromEntries(item.names.map((name) => [name, name])),\n ...(item.typeOnly ? { importKind: \"type\" } : {}),\n }));\n const propType = createComponentPropType(component);\n return {\n \"@type\": \"@builder.io/mitosis/component\",\n name: component.name,\n imports,\n exports: {},\n inputs: component.props.map((prop) => ({ name: prop.name, defaultValue: prop.defaultValue })),\n props: Object.fromEntries(component.props.map((prop) => [prop.name, { propertyType: \"normal\", optional: !!prop.optional || prop.defaultValue !== undefined }])),\n defaultProps: Object.fromEntries(component.props.filter((prop) => prop.defaultValue !== undefined).map((prop) => [prop.name, { type: \"property\", code: JSON.stringify(prop.defaultValue) }])),\n state: Object.fromEntries(component.state.map((item) => [item.name, {\n type: \"property\",\n code: item.initialValue,\n ...(typeof item.type === \"string\" && item.type.trim() ? { typeParameter: item.type.trim() } : {}),\n }])),\n meta: { ...(component.metadata ?? {}) },\n refs: {},\n context: { get: {}, set: {} },\n hooks: { onMount: [], onEvent: [] },\n children: component.root.kind === \"fragment\" ? component.root.children.map((node) => toMitosisNode(node)) : [toMitosisNode(component.root)],\n subComponents: [],\n ...(component.styles ? { style: component.styles } : {}),\n ...(propType ? { types: [propType.declaration], propsTypeRef: propType.name } : {}),\n };\n}\n\nfunction normalizeReactNativeFragmentLinks(component: MComponent): void {\n const visit = (node: MNode): void => {\n const href = node.properties?.href;\n if (typeof href === \"string\" && href.startsWith(\"#\")) {\n delete node.properties.href;\n node.bindings ??= {};\n node.bindings.href = {\n code: JSON.stringify(href),\n type: \"single\",\n bindingType: \"expression\",\n };\n }\n\n if (Array.isArray(node.children)) node.children.forEach(visit);\n if (node.slots && typeof node.slots === \"object\") {\n for (const children of Object.values(node.slots) as MNode[][]) children.forEach(visit);\n }\n };\n\n if (Array.isArray(component.children)) component.children.forEach(visit);\n}\n\nconst generators: Record<MitosisTarget, (component: MComponent, options: Record<string, unknown>) => unknown> = {\n alpine: (c, o) => componentToAlpine(o as any)({ component: c as any }),\n builder: (c, o) => componentToBuilder(o as any)({ component: c as any }),\n angular: (c, o) => componentToAngular(o as any)({ component: c as any }),\n customElement: (c, o) => componentToCustomElement(o as any)({ component: c as any }),\n html: (c, o) => componentToHtml(o as any)({ component: c as any }),\n liquid: (c, o) => componentToLiquid(o as any)({ component: c as any }),\n lit: (c, o) => componentToLit(o as any)({ component: c as any }),\n marko: (c, o) => componentToMarko(o as any)({ component: c as any }),\n mitosis: (c, o) => componentToMitosis(o as any)({ component: c as any }),\n preact: (c, o) => componentToPreact(o as any)({ component: c as any }),\n qwik: (c, o) => componentToQwik(o as any)({ component: c as any }),\n react: (c, o) => componentToReact(o as any)({ component: c as any }),\n reactNative: (c, o) => componentToReactNative(o as any)({ component: c as any }),\n rsc: (c, o) => componentToRsc(o as any)({ component: c as any }),\n solid: (c, o) => componentToSolid(o as any)({ component: c as any }),\n stencil: (c, o) => componentToStencil(o as any)({ component: c as any }),\n svelte: (c, o) => componentToSvelte(o as any)({ component: c as any }),\n swift: (c, o) => componentToSwift(o as any)({ component: c as any }),\n taro: (c, o) => componentToTaro(o as any)({ component: c as any }),\n template: (c, o) => componentToTemplate(o as any)({ component: c as any }),\n vue: (c, o) => componentToVue(o as any)({ component: c as any }),\n webcomponent: (c, o) => componentToCustomElement(o as any)({ component: c as any }),\n};\n\nconst siblingElseTargets = new Set<MitosisTarget>([\"alpine\", \"customElement\", \"html\", \"swift\", \"template\", \"webcomponent\"]);\nconst nativeSlotProjectionTargets = new Set<MitosisTarget>([\n \"alpine\", \"angular\", \"customElement\", \"html\", \"liquid\", \"lit\", \"marko\", \"qwik\", \"stencil\", \"svelte\", \"template\", \"vue\", \"webcomponent\",\n]);\nconst nativeSlotOutletTargets = new Set<MitosisTarget>([\"alpine\", \"customElement\", \"html\", \"liquid\", \"lit\", \"stencil\", \"template\", \"webcomponent\"]);\nconst eventlessTargets = new Set<MitosisTarget>([\"liquid\", \"template\"]);\nconst nativePropDefaultTargets = new Set<MitosisTarget>([\"angular\", \"preact\", \"react\", \"reactNative\", \"rsc\", \"stencil\", \"svelte\", \"taro\", \"vue\"]);\nconst expressionPropDefaultTargets = new Set<MitosisTarget>([\"alpine\", \"builder\", \"customElement\", \"html\", \"lit\", \"marko\", \"mitosis\", \"solid\", \"template\", \"webcomponent\"]);\nconst swiftTextTags = new Set([\"span\", \"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]);\n\nfunction swiftPrimitiveType(type: unknown): \"string\" | \"number\" | \"boolean\" | undefined {\n if (typeof type !== \"string\") return undefined;\n switch (type.trim().toLowerCase()) {\n case \"string\": return \"string\";\n case \"number\": return \"number\";\n case \"boolean\":\n case \"bool\": return \"boolean\";\n default: return undefined;\n }\n}\n\nfunction swiftDefaultLiteral(type: unknown, value: unknown): string | undefined {\n const normalizedType = swiftPrimitiveType(type);\n if (normalizedType === \"string\" && typeof value === \"string\") {\n if (/[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f]/.test(value)) return undefined;\n const escaped = value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\");\n return `\"${escaped}\"`;\n }\n if (normalizedType === \"number\" && typeof value === \"number\" && Number.isFinite(value)) return String(value);\n if (normalizedType === \"boolean\" && typeof value === \"boolean\") return String(value);\n return undefined;\n}\n\nfunction applySwiftPropTypes(component: MComponent, props: ComponentIR[\"props\"]): void {\n for (const prop of props) {\n const type = swiftPrimitiveType(prop.type);\n if (type && component.props?.[prop.name]) component.props[prop.name].propertyType = type;\n }\n}\n\nfunction hasNamedComponentSlots(node: IRNode): boolean {\n if (node.kind === \"component\" && Object.keys(node.slots ?? {}).some((name) => name !== \"default\")) return true;\n if (node.kind === \"conditional\") return node.then.some(hasNamedComponentSlots) || (node.otherwise ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasNamedComponentSlots);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"element\") return (node.children ?? []).some(hasNamedComponentSlots);\n if (node.kind === \"component\") return (node.children ?? []).some(hasNamedComponentSlots)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasNamedComponentSlots));\n return false;\n}\n\nfunction hasUnsupportedNamedComponentSlots(node: IRNode, target: MitosisTarget): boolean {\n if (target === \"swift\") return hasNamedComponentSlots(node);\n if (target === \"solid\" && node.kind === \"component\") {\n const hasUnsupportedSlot = Object.entries(node.slots ?? {}).some(([name, children]) => {\n if (name === \"default\") return false;\n return children.length !== 1 || (children[0]?.kind !== \"text\" && children[0]?.kind !== \"expression\");\n });\n if (hasUnsupportedSlot) return true;\n }\n if (node.kind === \"conditional\") return node.then.some((child) => hasUnsupportedNamedComponentSlots(child, target))\n || (node.otherwise ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"slot\") return (node.fallback ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"element\") return (node.children ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target));\n if (node.kind === \"component\") return (node.children ?? []).some((child) => hasUnsupportedNamedComponentSlots(child, target))\n || Object.values(node.slots ?? {}).some((children) => children.some((child) => hasUnsupportedNamedComponentSlots(child, target)));\n return false;\n}\n\nfunction hasUnsupportedNamedSlotOutlet(node: IRNode, target: MitosisTarget): boolean {\n if (target === \"swift\" && node.kind === \"slot\") return true;\n if (node.kind === \"conditional\") return node.then.some((child) => hasUnsupportedNamedSlotOutlet(child, target))\n || (node.otherwise ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"slot\") return (node.fallback ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"element\") return (node.children ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target));\n if (node.kind === \"component\") return (node.children ?? []).some((child) => hasUnsupportedNamedSlotOutlet(child, target))\n || Object.values(node.slots ?? {}).some((children) => children.some((child) => hasUnsupportedNamedSlotOutlet(child, target)));\n return false;\n}\n\nfunction hasConditionalElse(node: IRNode): boolean {\n if (node.kind === \"conditional\") {\n return !!node.otherwise?.length || node.then.some(hasConditionalElse) || (node.otherwise ?? []).some(hasConditionalElse);\n }\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasConditionalElse);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasConditionalElse);\n if (node.kind === \"element\") return (node.children ?? []).some(hasConditionalElse);\n if (node.kind === \"component\") return (node.children ?? []).some(hasConditionalElse)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasConditionalElse));\n return false;\n}\n\nfunction hasEventHandlers(node: IRNode): boolean {\n if ((node.kind === \"element\" || node.kind === \"component\") && (node.attributes ?? []).some((attribute) => attribute.binding?.kind === \"event\")) return true;\n if (node.kind === \"conditional\") return node.then.some(hasEventHandlers) || (node.otherwise ?? []).some(hasEventHandlers);\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasEventHandlers);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasEventHandlers);\n if (node.kind === \"element\") return (node.children ?? []).some(hasEventHandlers);\n if (node.kind === \"component\") return (node.children ?? []).some(hasEventHandlers)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasEventHandlers));\n return false;\n}\n\nfunction preservesPropDefault(target: MitosisTarget, name: string, value: unknown, propType?: unknown): boolean {\n if (nativePropDefaultTargets.has(target)) return true;\n if (target === \"qwik\") return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) && serializeDefaultValue(value) !== undefined;\n if (target === \"swift\") return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) && swiftDefaultLiteral(propType, value) !== undefined;\n if (target === \"liquid\") {\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) return false;\n return typeof value === \"string\" || typeof value === \"boolean\" || (typeof value === \"number\" && Number.isFinite(value));\n }\n return expressionPropDefaultTargets.has(target)\n && /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name)\n && serializeDefaultValue(value) !== undefined;\n}\n\nfunction serializeDefaultValue(value: unknown): string | undefined {\n try {\n const serialized = JSON.stringify(value);\n return typeof serialized === \"string\" ? serialized : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction applyExpressionPropDefaults(nodes: MNode[], props: ComponentIR[\"props\"]): void {\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const serialized = serializeDefaultValue(prop.defaultValue);\n return serialized === undefined ? [] : [{ name: prop.name, serialized }];\n });\n if (defaults.length === 0) return;\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code !== \"string\") continue;\n let code = binding.code;\n for (const { name, serialized } of defaults) {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const access = `props.${name}`;\n const replacement = `(${access} === undefined ? ${serialized} : ${access})`;\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n code = code.replace(dotReference, replacement).replace(bracketReference, replacement);\n }\n binding.code = code;\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n nodes.forEach(visit);\n}\n\ninterface QwikPropDefaultAlias {\n name: string;\n alias: string;\n serialized: string;\n}\n\nfunction applyQwikPropDefaults(component: MComponent, props: ComponentIR[\"props\"]): QwikPropDefaultAlias[] {\n const usedNames = new Set<string>([\n ...props.map((prop) => prop.name),\n ...Object.keys(component.state ?? {}),\n ]);\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const serialized = serializeDefaultValue(prop.defaultValue);\n if (serialized === undefined) return [];\n let alias = `__designosDefault_${prop.name}`;\n let suffix = 1;\n while (usedNames.has(alias)) alias = `__designosDefault_${prop.name}_${suffix++}`;\n usedNames.add(alias);\n return [{ name: prop.name, alias, serialized }];\n });\n if (defaults.length === 0) return defaults;\n\n const rewrite = (source: string): string => defaults.reduce((code, { name, alias }) => {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n return code.replace(dotReference, alias).replace(bracketReference, alias);\n }, source);\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code === \"string\") binding.code = rewrite(binding.code);\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n (component.children as MNode[]).forEach(visit);\n for (const state of Object.values(component.state ?? {}) as Array<{ code?: unknown }>) {\n if (typeof state.code === \"string\") state.code = rewrite(state.code);\n }\n return defaults;\n}\n\nfunction addQwikPropDefaults(output: string, defaults: QwikPropDefaultAlias[]): string | undefined {\n if (defaults.length === 0) return output;\n const signature = /(component\\$\\(\\s*\\(\\s*props(?:\\s*:\\s*[^)]*)?\\)\\s*=>\\s*\\{)/;\n if (!signature.test(output)) return undefined;\n const declarations = defaults\n .map(({ name, alias, serialized }) => ` const ${alias} = props.${name} === undefined ? ${serialized} : props.${name};`)\n .join(\"\\n\");\n return output.replace(signature, (match) => `${match}\\n${declarations}`);\n}\n\nfunction applySwiftPropDefaults(nodes: MNode[], props: ComponentIR[\"props\"]): void {\n const defaults = props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) return [];\n const literal = swiftDefaultLiteral(prop.type, prop.defaultValue);\n return literal === undefined ? [] : [{ name: prop.name, literal }];\n });\n if (defaults.length === 0) return;\n\n const visit = (node: MNode): void => {\n for (const binding of Object.values(node.bindings ?? {}) as Array<{ code?: unknown }>) {\n if (typeof binding.code !== \"string\") continue;\n let code = binding.code;\n for (const { name, literal } of defaults) {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const replacement = `(props.${name} ?? ${literal})`;\n const dotReference = new RegExp(`\\\\bprops(?:\\\\?\\\\.|\\\\.)${escapedName}\\\\b`, \"g\");\n const bracketReference = new RegExp(`\\\\bprops\\\\s*\\\\[\\\\s*(['\\\"])${escapedName}\\\\1\\\\s*\\\\]`, \"g\");\n code = code.replace(dotReference, replacement).replace(bracketReference, replacement);\n }\n binding.code = code;\n }\n node.children?.forEach(visit);\n if (node.slots) Object.values(node.slots as Record<string, MNode[]>).forEach((children) => children.forEach(visit));\n const elseNode = node.meta?.else;\n if (elseNode && typeof elseNode === \"object\") visit(elseNode as MNode);\n };\n nodes.forEach(visit);\n}\n\nfunction addSwiftPropDefaults(output: string, props: ComponentIR[\"props\"]): string {\n for (const prop of props) {\n if (prop.defaultValue === undefined || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(prop.name)) continue;\n const literal = swiftDefaultLiteral(prop.type, prop.defaultValue);\n if (literal === undefined) continue;\n const escapedName = prop.name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const declaration = new RegExp(`^([\\\\t ]*)let\\\\s+${escapedName}(\\\\s*:[^\\\\n]+)$`, \"m\");\n output = output.replace(declaration, (_match, indent: string, annotation: string) => `${indent}var ${prop.name}${annotation} = ${literal}`);\n }\n return output;\n}\n\nfunction addLiquidPropDefaults(output: string, component: ComponentIR): string {\n const assignments = component.props.flatMap((prop) => {\n if (prop.defaultValue === undefined || !preservesPropDefault(\"liquid\", prop.name, prop.defaultValue, prop.type)) return [];\n const literal = JSON.stringify(prop.defaultValue);\n if (typeof literal !== \"string\") return [];\n const allowFalse = prop.defaultValue === false ? \", allow_false: true\" : \"\";\n return [`{% assign ${prop.name} = ${prop.name} | default: ${literal}${allowFalse} %}`];\n });\n return assignments.length ? `${assignments.join(\"\\n\")}\\n${output}` : output;\n}\n\nfunction toLiquidCondition(code: string): string | undefined {\n const condition = code.replace(/\\b(?:props|state)\\./g, \"\").trim();\n const identifier = \"[A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*\";\n const literal = `(?:${identifier}|\\\\d+(?:\\\\.\\\\d+)?|'[^'\\\\\\\\]*'|\\\"[^\\\"\\\\\\\\]*\\\")`;\n if (new RegExp(`^${identifier}$`).test(condition)) return condition;\n if (new RegExp(`^${literal}\\\\s*(?:==|!=|>=|<=|>|<)\\\\s*${literal}$`).test(condition)) return condition;\n return undefined;\n}\n\nfunction hasUnsupportedLiquidElse(node: IRNode): boolean {\n if (node.kind === \"conditional\") {\n if (node.otherwise?.length && !toLiquidCondition(node.condition.code)) return true;\n return node.then.some(hasUnsupportedLiquidElse) || (node.otherwise ?? []).some(hasUnsupportedLiquidElse);\n }\n if (node.kind === \"loop\" || node.kind === \"fragment\") return node.children.some(hasUnsupportedLiquidElse);\n if (node.kind === \"slot\") return (node.fallback ?? []).some(hasUnsupportedLiquidElse);\n if (node.kind === \"element\") return (node.children ?? []).some(hasUnsupportedLiquidElse);\n if (node.kind === \"component\") return (node.children ?? []).some(hasUnsupportedLiquidElse)\n || Object.values(node.slots ?? {}).some((children) => children.some(hasUnsupportedLiquidElse));\n return false;\n}\n\nfunction lowerElseBranches(nodes: MNode[]): MNode[] {\n const lowered: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerElseBranches(sourceNode.children) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerElseBranches(children as MNode[])])),\n } : {}),\n };\n const elseNode = node.name === \"Show\" ? node.meta.else as MNode | undefined : undefined;\n const condition = node.bindings?.when?.code;\n if (!elseNode || typeof condition !== \"string\" || !condition.trim()) {\n lowered.push(node);\n continue;\n }\n\n delete node.meta.else;\n const elseChildren = elseNode.name === \"Fragment\" && Array.isArray(elseNode.children)\n ? elseNode.children as MNode[]\n : [elseNode];\n const alternate: MNode = {\n ...node,\n bindings: {\n ...node.bindings,\n when: { ...node.bindings.when, code: `!(${condition})` },\n },\n children: lowerElseBranches(elseChildren),\n };\n lowered.push(node, alternate);\n }\n return lowered;\n}\n\nfunction lowerLiquidElseBranches(nodes: MNode[], baseComponent: MComponent, options: Record<string, unknown>): MNode[] {\n const lowered: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerLiquidElseBranches(sourceNode.children, baseComponent, options) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerLiquidElseBranches(children as MNode[], baseComponent, options)])),\n } : {}),\n };\n const elseNode = node.name === \"Show\" ? node.meta.else as MNode | undefined : undefined;\n const condition = node.bindings?.when?.code;\n const liquidCondition = typeof condition === \"string\" ? toLiquidCondition(condition) : undefined;\n if (!elseNode || !liquidCondition) {\n lowered.push(node);\n continue;\n }\n\n const elseChildren = elseNode.name === \"Fragment\" && Array.isArray(elseNode.children)\n ? lowerLiquidElseBranches(elseNode.children as MNode[], baseComponent, options)\n : lowerLiquidElseBranches([elseNode], baseComponent, options);\n const renderNodes = (children: MNode[]) => generators.liquid({ ...baseComponent, children, style: \"\" }, { ...options, prettier: false, reactive: false });\n lowered.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"div\",\n properties: { _text: `{% if ${liquidCondition} %}${renderNodes(node.children ?? [])}{% else %}${renderNodes(elseChildren)}{% endif %}` },\n bindings: {},\n meta: {},\n scope: {},\n children: [],\n });\n }\n return lowered;\n}\n\nfunction normalizeSwiftShowBranches(nodes: MNode[]): MNode[] {\n return nodes.map((sourceNode) => {\n const node: MNode = {\n ...sourceNode,\n meta: { ...(sourceNode.meta ?? {}) },\n children: Array.isArray(sourceNode.children) ? normalizeSwiftShowBranches(sourceNode.children) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, normalizeSwiftShowBranches(children as MNode[])])),\n } : {}),\n };\n if (node.name === \"Show\" && node.bindings?.when) {\n node.name = \"Group\";\n node.bindings.if = node.bindings.when;\n delete node.bindings.when;\n }\n if (typeof node.bindings?._text?.code === \"string\") {\n node.name = \"Text\";\n node.bindings.innerHTML = node.bindings._text;\n delete node.bindings._text;\n }\n if (swiftTextTags.has(String(node.name).toLowerCase()) && node.children?.length) {\n if (node.children.length === 1) {\n const child = node.children[0] as MNode;\n const textBinding = child.bindings?.innerHTML ?? child.bindings?._text;\n if (typeof textBinding?.code === \"string\") {\n node.name = \"Text\";\n node.bindings = { ...(node.bindings ?? {}), innerHTML: textBinding };\n node.children = [];\n } else if (typeof child.properties?._text === \"string\") {\n node.name = \"Text\";\n node.properties = { ...(node.properties ?? {}), _text: child.properties._text };\n node.children = [];\n }\n }\n if (node.children?.length) node.name = \"div\";\n }\n return node;\n });\n}\n\nfunction decodeSlotText(node: MNode): MNode {\n const encoded = node.properties?._text;\n if (typeof encoded === \"string\") {\n try {\n const decoded = JSON.parse(encoded);\n if (typeof decoded === \"string\" && JSON.stringify(decoded) === encoded) node.properties._text = decoded;\n } catch {\n // Non-JSON text is a raw text node or an expression preserved elsewhere.\n }\n }\n return node;\n}\n\nfunction isMitosisTextNode(node: MNode): boolean {\n return Object.hasOwn(node.properties ?? {}, \"_text\") || Object.hasOwn(node.bindings ?? {}, \"_text\");\n}\n\nfunction lowerNamedComponentSlots(nodes: MNode[], target: MitosisTarget): MNode[] {\n const result: MNode[] = [];\n for (const sourceNode of nodes) {\n const node: MNode = {\n ...sourceNode,\n properties: { ...(sourceNode.properties ?? {}) },\n bindings: { ...(sourceNode.bindings ?? {}) },\n children: Array.isArray(sourceNode.children) ? lowerNamedComponentSlots(sourceNode.children, target) : sourceNode.children,\n ...(sourceNode.slots ? {\n slots: Object.fromEntries(Object.entries(sourceNode.slots).map(([name, children]) => [name, lowerNamedComponentSlots(children as MNode[], target)])),\n } : {}),\n };\n\n if (target === \"builder\" && node.slots) {\n for (const slotChildren of Object.values(node.slots) as MNode[][]) slotChildren.forEach(decodeSlotText);\n } else if (target === \"solid\" && node.slots) {\n for (const [slotName, slotChildren] of Object.entries(node.slots) as [string, MNode[]][]) {\n if (slotChildren.length !== 1) continue;\n const slotChild = decodeSlotText(slotChildren[0]);\n if (Object.hasOwn(slotChild.bindings ?? {}, \"_text\")) node.bindings[slotName] = slotChild.bindings._text;\n else if (typeof slotChild.properties?._text === \"string\") node.properties[slotName] = slotChild.properties._text;\n }\n delete node.slots;\n } else if (target === \"reactNative\" && node.slots) {\n for (const slotChildren of Object.values(node.slots) as MNode[][]) {\n for (const child of slotChildren) {\n const decoded = decodeSlotText(child).properties?._text;\n if (typeof decoded === \"string\" && !Object.hasOwn(child.bindings ?? {}, \"_text\")) {\n child.bindings ??= {};\n child.bindings._text = { code: JSON.stringify(decoded), type: \"single\", bindingType: \"expression\" };\n delete child.properties._text;\n }\n }\n }\n } else if (nativeSlotProjectionTargets.has(target) && node.slots) {\n const projected: MNode[] = [];\n for (const [slotName, slotChildren] of Object.entries(node.slots) as [string, MNode[]][]) {\n const children = slotChildren.map(decodeSlotText);\n if (target === \"vue\" || target === \"svelte\") {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: target === \"vue\" ? \"template\" : \"svelte:fragment\",\n properties: target === \"vue\" ? { [`v-slot:${slotName}`]: \"\" } : { slot: slotName },\n bindings: {},\n meta: {},\n scope: {},\n children,\n });\n continue;\n }\n if (target === \"marko\") {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: `@${slotName}`,\n properties: {},\n bindings: {},\n meta: {},\n scope: {},\n children,\n });\n continue;\n }\n\n const slotAttribute = target === \"qwik\" ? \"q:slot\" : target === \"angular\" ? slotName : \"slot\";\n for (const child of children) {\n if (isMitosisTextNode(child)) {\n projected.push({\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"span\",\n properties: { [slotAttribute]: slotName },\n bindings: {},\n meta: {},\n scope: {},\n children: [child],\n });\n } else {\n child.properties ??= {};\n child.properties[slotAttribute] = slotAttribute === slotName ? \"\" : slotName;\n projected.push(child);\n }\n }\n }\n node.children = [...(node.children ?? []), ...projected];\n delete node.slots;\n }\n\n if (node.name === \"Slot\" && target === \"marko\") {\n node.name = node.properties.name ? `@${node.properties.name}` : \"@renderBody\";\n delete node.properties.name;\n } else if (node.name === \"Slot\" && target === \"solid\") {\n const slotName = node.properties.name;\n const code = typeof slotName === \"string\" && slotName !== \"default\" ? `props.${slotName}` : \"props.children\";\n const valueNode: MNode = {\n \"@type\": \"@builder.io/mitosis/node\",\n name: \"div\",\n properties: {},\n bindings: { _text: { code, type: \"single\", bindingType: \"expression\" } },\n meta: {},\n scope: {},\n children: [],\n };\n if (node.children?.length) {\n node.name = \"Show\";\n node.properties = {};\n node.bindings = { when: { code, type: \"single\", bindingType: \"expression\" } };\n node.meta = { ...node.meta, else: { \"@type\": \"@builder.io/mitosis/node\", name: \"Fragment\", properties: {}, bindings: {}, meta: {}, scope: {}, children: node.children } };\n node.children = [valueNode];\n } else {\n node.name = valueNode.name;\n node.properties = valueNode.properties;\n node.bindings = valueNode.bindings;\n node.meta = valueNode.meta;\n node.children = [];\n }\n } else if (node.name === \"Slot\" && nativeSlotOutletTargets.has(target)) node.name = \"slot\";\n result.push(node);\n }\n return result;\n}\n\nfunction resultFiles(value: unknown, target: string, name: string): { path: string; contents: string; kind: \"component\" | \"style\" | \"metadata\" }[] {\n if (typeof value === \"string\") return [{ path: `${name}.${extensionFor(target)}`, contents: value, kind: \"component\" }];\n if (value && typeof value === \"object\") {\n const obj = value as Record<string, unknown>;\n if (typeof obj.code === \"string\") return [{ path: `${name}.${extensionFor(target)}`, contents: obj.code, kind: \"component\" }];\n if (Array.isArray(obj.files)) return obj.files.flatMap((f: any, i: number) => typeof f === \"string\" ? [{ path: `${name}${i ? `-${i}` : \"\"}.${extensionFor(target)}`, contents: f, kind: \"component\" as const }] : typeof f?.contents === \"string\" ? [{ path: f.path || `${name}${i ? `-${i}` : \"\"}.${extensionFor(target)}`, contents: f.contents, kind: f.kind === \"style\" ? \"style\" as const : \"component\" as const }] : []);\n }\n return [{ path: `${name}.${extensionFor(target)}`, contents: JSON.stringify(value, null, 2), kind: \"component\" }];\n}\nfunction extensionFor(target: string): string {\n const extensions: Record<string, string> = { builder: \"json\", webcomponent: \"js\", react: \"tsx\", preact: \"tsx\", reactNative: \"tsx\", solid: \"tsx\", angular: \"ts\", vue: \"vue\", svelte: \"svelte\", qwik: \"tsx\", stencil: \"tsx\", lit: \"ts\", html: \"html\", customElement: \"js\", liquid: \"liquid\", alpine: \"html\", marko: \"marko\", mitosis: \"lite.tsx\", swift: \"swift\", taro: \"tsx\", template: \"template\", rsc: \"tsx\" };\n return extensions[target] ?? \"txt\";\n}\nexport function generateWithMitosis(context: GenerationContext): GenerationResult {\n const target = context.target as MitosisTarget;\n if (!(target in generators)) throw new Error(`Unsupported Mitosis target: ${target}`);\n const component = componentIRToMitosis(context.component);\n component.children = lowerNamedComponentSlots(component.children, target);\n const qwikBaseline = target === \"qwik\" ? JSON.parse(JSON.stringify(component)) as MComponent : undefined;\n const qwikDefaults = target === \"qwik\" ? applyQwikPropDefaults(component, context.component.props) : [];\n if (target === \"swift\") {\n applySwiftPropTypes(component, context.component.props);\n applySwiftPropDefaults(component.children, context.component.props);\n }\n if (expressionPropDefaultTargets.has(target)) applyExpressionPropDefaults(component.children, context.component.props);\n if (target === \"liquid\") component.children = lowerLiquidElseBranches(component.children, component, context.options);\n if (target === \"reactNative\") normalizeReactNativeFragmentLinks(component);\n if (siblingElseTargets.has(target)) component.children = lowerElseBranches(component.children);\n if (target === \"swift\") component.children = normalizeSwiftShowBranches(component.children);\n let output = generators[target](component, context.options);\n let qwikDefaultsInjected = true;\n if (target === \"qwik\" && qwikDefaults.length > 0) {\n const outputWithDefaults = typeof output === \"string\" ? addQwikPropDefaults(output, qwikDefaults) : undefined;\n if (outputWithDefaults === undefined) {\n output = generators.qwik(qwikBaseline as MComponent, context.options);\n qwikDefaultsInjected = false;\n } else {\n output = outputWithDefaults;\n }\n }\n if (target === \"liquid\" && typeof output === \"string\") output = addLiquidPropDefaults(output, context.component);\n if (target === \"swift\" && typeof output === \"string\") output = addSwiftPropDefaults(output, context.component.props);\n const emitsPropTypes = context.options.typescript === true && propTypeTargets.has(target);\n const emitsStateTypes = context.options.typescript === true && stateTypeTargets.has(target);\n const diagnostics: Diagnostic[] = [\n {\n severity: \"warning\",\n code: \"MITOSIS_TARGET_SEMANTICS_UNVERIFIED\",\n message: `DesignOS has smoke-tested code generation for ${target}, but has not verified semantic parity for this target.`,\n path: `target.${target}`,\n },\n ...context.component.props\n .filter((prop) => prop.type !== undefined)\n .filter((prop) => target === \"swift\"\n ? !swiftPrimitiveType(prop.type)\n : !emitsPropTypes || typeof prop.type !== \"string\" || !prop.type.trim())\n .map((prop) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_PROP_TYPE_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the type annotation for prop \"${prop.name}\" with the current target options.`,\n path: `props.${prop.name}.type`,\n })),\n ...context.component.state\n .filter((state) => state.type !== undefined)\n .filter((state) => !emitsStateTypes || typeof state.type !== \"string\" || !state.type.trim())\n .map((state) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_STATE_TYPE_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the type annotation for state \"${state.name}\" with the current target options.`,\n path: `state.${state.name}.type`,\n })),\n ...context.component.props\n .filter((prop) => prop.defaultValue !== undefined)\n .filter((prop) => !preservesPropDefault(target, prop.name, prop.defaultValue, prop.type)\n || (target === \"qwik\" && !qwikDefaultsInjected))\n .map((prop) => ({\n severity: \"warning\" as const,\n code: \"MITOSIS_PROP_DEFAULT_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve the default value for prop \"${prop.name}\".`,\n path: `props.${prop.name}.defaultValue`,\n })),\n ...(hasUnsupportedNamedComponentSlots(context.component.root, target) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_NAMED_COMPONENT_SLOT_NOT_PRESERVED\",\n message: `The ${target} Mitosis output does not preserve named component slots for the current target.`,\n path: \"root.slots\",\n }] : []),\n ...(hasUnsupportedNamedSlotOutlet(context.component.root, target) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_SLOT_OUTLET_NOT_PRESERVED\",\n message: \"The SwiftUI output does not connect a slot outlet to caller-provided content; only fallback markup may render.\",\n path: \"root.slot\",\n }] : []),\n ...(target === \"liquid\" && hasUnsupportedLiquidElse(context.component.root) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_CONDITIONAL_ELSE_NOT_PRESERVED\",\n message: \"The Liquid target cannot safely lower this conditional else expression.\",\n path: \"root.otherwise\",\n }] : []),\n ...(eventlessTargets.has(target) && hasEventHandlers(context.component.root) ? [{\n severity: \"warning\" as const,\n code: \"MITOSIS_EVENT_HANDLER_NOT_PRESERVED\",\n message: `The ${target} target has no interactive event runtime and cannot preserve event handler bindings.`,\n path: \"root.events\",\n }] : []),\n ];\n return { target: context.target, files: resultFiles(output, target, context.component.name), diagnostics };\n}\n\nfunction mitosisNodeHasEventBindings(node: MNode): boolean {\n if (Object.entries(node.bindings ?? {}).some(([name, binding]: [string, any]) =>\n /^on[A-Z]/.test(name) && binding?.bindingType === \"function\",\n )) return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasEventBindings(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasEventBindings(child)));\n}\n\nfunction mitosisNodeHasNamedSlots(node: MNode): boolean {\n if (Object.keys(node.slots ?? {}).some((name) => name !== \"default\")) return true;\n if (typeof node.properties?.slot === \"string\" && node.properties.slot !== \"\" && node.properties.slot !== \"default\") return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasNamedSlots(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasNamedSlots(child)));\n}\n\nfunction mitosisNodeHasSlotOutlet(node: MNode): boolean {\n if (node.name === \"Slot\") return true;\n if ((node.children ?? []).some((child: MNode) => mitosisNodeHasSlotOutlet(child))) return true;\n return Object.values(node.slots ?? {}).some((children: any) => Array.isArray(children) && children.some((child: MNode) => mitosisNodeHasSlotOutlet(child)));\n}\n\n/** Generate directly from Mitosis parser output so hooks, context, refs, subcomponents,\n * target blocks and other upstream semantics are not narrowed through ComponentIR. */\nexport function generateMitosisSourceComponent(\n authoredComponent: MitosisComponent,\n target: MitosisTarget,\n options: Record<string, unknown> = {},\n): GenerationResult {\n if (!(target in generators)) throw new Error(`Unsupported Mitosis target: ${target}`);\n const component = structuredClone(authoredComponent) as MComponent;\n component.children = lowerNamedComponentSlots(component.children ?? [], target);\n if (target === \"liquid\") component.children = lowerLiquidElseBranches(component.children, component, options);\n if (target === \"reactNative\") normalizeReactNativeFragmentLinks(component);\n if (siblingElseTargets.has(target)) component.children = lowerElseBranches(component.children);\n if (target === \"swift\") component.children = normalizeSwiftShowBranches(component.children);\n\n const output = generators[target](component, options);\n const diagnostics: Diagnostic[] = [{\n severity: \"warning\",\n code: \"MITOSIS_TARGET_SEMANTICS_UNVERIFIED\",\n message: `DesignOS has not verified semantic parity for all Mitosis source features on ${target}; output is generated by the upstream Mitosis target emitter.`,\n path: `target.${target}`,\n }];\n if (eventlessTargets.has(target) && (component.hooks?.onEvent?.length || component.children.some((node: MNode) => mitosisNodeHasEventBindings(node)))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_EVENT_HANDLER_NOT_PRESERVED\",\n message: `The ${target} target has no interactive event runtime and cannot preserve event handler bindings.`,\n path: \"source.events\",\n });\n }\n if (target === \"swift\" && component.children.some((node: MNode) => mitosisNodeHasNamedSlots(node))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_NAMED_COMPONENT_SLOT_NOT_PRESERVED\",\n message: \"The Swift target adapter does not preserve named component slot composition.\",\n path: \"source.children.slots\",\n });\n }\n if (target === \"swift\" && component.children.some((node: MNode) => mitosisNodeHasSlotOutlet(node))) {\n diagnostics.push({\n severity: \"warning\",\n code: \"MITOSIS_SLOT_OUTLET_NOT_PRESERVED\",\n message: \"The Swift target output does not connect a Mitosis Slot outlet to caller-provided content; only fallback markup may render.\",\n path: \"source.children.slot\",\n });\n }\n return { target, files: resultFiles(output, target, component.name), diagnostics };\n}\n\nfunction generateProjectRegistry(target: \"react\" | \"vue\", entries: CompilerProjectRegistryEntry[]): GeneratedFile {\n const imports = entries.map((entry, index) => {\n const modulePath = target === \"vue\" ? entry.modulePath : entry.modulePath.replace(/\\.(?:tsx?|jsx?)$/, \"\");\n return `import DesignOSComponent${index} from ${JSON.stringify(`./${modulePath}`)};`;\n });\n const registrations = entries.map((entry, index) => ` ${JSON.stringify(entry.type)}: DesignOSComponent${index},`);\n return {\n path: \"components.ts\",\n kind: \"metadata\",\n contents: [\n ...imports,\n \"\",\n \"export const components = {\",\n ...registrations,\n \"};\",\n \"\",\n \"export default components;\",\n \"\",\n ].join(\"\\n\"),\n };\n}\n\nexport function createMitosisTarget(target: MitosisTarget) {\n return {\n name: target,\n generate: (context: GenerationContext) => generateWithMitosis(context),\n generateMitosis: (component: MitosisComponent, options: Record<string, unknown>) => generateMitosisSourceComponent(component, target, options),\n ...((target === \"react\" || target === \"vue\")\n ? { generateProjectRegistry: (entries: CompilerProjectRegistryEntry[]) => generateProjectRegistry(target, entries) }\n : {}),\n };\n}\nexport function createMitosisCompiler(): TargetRegistry {\n const registry = new TargetRegistry();\n for (const target of mitosisTargets) registry.register(createMitosisTarget(target));\n return registry;\n}\n","import { parseJsx } from \"@builder.io/mitosis\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\n\nexport interface ParseMitosisSourceOptions {\n filePath?: string;\n /** Preserve JSX blocks nested in component props when the upstream parser supports them. */\n enableBlocksSlots?: boolean;\n}\n\ninterface DesignOSSourceProp {\n name: string;\n optional: boolean;\n defaultValue?: unknown;\n}\n\nfunction parseLiteral(value: string): unknown {\n try {\n return JSON.parse(value.trim().replace(/'/g, '\"'));\n } catch {\n return undefined;\n }\n}\n\nfunction findTypeDeclarationBody(source: string, propsTypeRef: string): string | undefined {\n const declaration = source.match(new RegExp(`(?:interface|type)\\\\s+${propsTypeRef}\\\\s*(?:=)?\\\\s*\\\\{`));\n if (!declaration || declaration.index === undefined) return undefined;\n const start = declaration.index + declaration[0].length - 1;\n let depth = 0;\n let quote: string | undefined;\n let escaped = false;\n for (let index = start; index < source.length; index += 1) {\n const character = source[index];\n if (quote) {\n if (escaped) escaped = false;\n else if (character === \"\\\\\") escaped = true;\n else if (character === quote) quote = undefined;\n continue;\n }\n if (character === \"'\" || character === '\"' || character === \"`\") {\n quote = character;\n continue;\n }\n if (character === \"{\") depth += 1;\n else if (character === \"}\" && --depth === 0) return source.slice(start + 1, index);\n }\n return undefined;\n}\n\nfunction splitTopLevelFields(body: string): string[] {\n const fields: string[] = [];\n let start = 0;\n let depth = 0;\n for (let index = 0; index < body.length; index += 1) {\n if (body[index] === \"{\" || body[index] === \"[\" || body[index] === \"<\") depth += 1;\n else if (body[index] === \"}\" || body[index] === \"]\" || body[index] === \">\") depth = Math.max(0, depth - 1);\n else if (body[index] === \";\" && depth === 0) {\n fields.push(body.slice(start, index));\n start = index + 1;\n }\n }\n fields.push(body.slice(start));\n return fields;\n}\n\nfunction extractDesignOSSourceProps(source: string, propsTypeRef: string | undefined): DesignOSSourceProp[] {\n if (!propsTypeRef) return [];\n const body = findTypeDeclarationBody(source, propsTypeRef);\n if (body === undefined) return [];\n const props = new Map<string, DesignOSSourceProp>();\n for (const field of splitTopLevelFields(body)) {\n const match = field.trim().match(/^([A-Za-z_$][\\w$]*)\\s*(\\?)?\\s*:\\s*([^\\n]+)$/);\n if (!match) continue;\n props.set(match[1], { name: match[1], optional: Boolean(match[2]) });\n }\n const destructured = source.match(/function\\s+\\w+\\s*\\(\\s*\\{([\\s\\S]*?)\\}\\s*(?::[^)]*)?\\)/);\n if (destructured) {\n for (const part of destructured[1].split(\",\")) {\n const match = part.trim().match(/^([A-Za-z_$][\\w$]*)\\s*=\\s*(.+)$/);\n if (!match || !props.has(match[1])) continue;\n const value = parseLiteral(match[2]);\n if (value !== undefined) props.get(match[1])!.defaultValue = value;\n }\n }\n return [...props.values()];\n}\n\n/**\n * Parse developer-authored TSX with the same Mitosis parser used by its compiler.\n * The returned Mitosis component is retained intact; it is not reverse-mapped\n * through DesignOS ComponentIR, which cannot represent every Mitosis feature.\n */\nexport function parseMitosisSource(source: string, options: ParseMitosisSourceOptions = {}): MitosisComponent {\n if (typeof source !== \"string\") throw new TypeError(\"Mitosis source must be a string\");\n\n try {\n const component = parseJsx(source, {\n typescript: true,\n enableBlocksSlots: options.enableBlocksSlots ?? true,\n ...(options.filePath ? { filePath: options.filePath } : {}),\n });\n const designosProps = extractDesignOSSourceProps(source, component.propsTypeRef);\n if (designosProps.length > 0) component.meta = { ...component.meta, designosProps: designosProps as any };\n return component;\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new Error(`Unable to parse DesignOS TSX${options.filePath ? ` at ${options.filePath}` : \"\"}: ${message}`, { cause });\n }\n}\n","import type { ComponentManifest, PageNode } from \"@designos/core\";\nimport type { MitosisComponent } from \"@builder.io/mitosis/types\";\n\nexport type CompilerTarget = \"react\" | \"vue\" | \"blade\" | \"angular\" | \"html\" | \"svelte\" | \"solid\" | \"alpine\" | \"builder\" | \"customElement\" | \"liquid\" | \"lit\" | \"marko\" | \"mitosis\" | \"preact\" | \"qwik\" | \"reactNative\" | \"rsc\" | \"stencil\" | \"swift\" | \"taro\" | \"template\" | \"webcomponent\";\n\nexport interface IRImport {\n source: string;\n names: string[];\n typeOnly?: boolean;\n}\n\nexport interface IRProp {\n name: string;\n type?: string;\n optional?: boolean;\n defaultValue?: unknown;\n}\n\nexport interface IRState {\n name: string;\n type?: string;\n initialValue: string;\n}\n\nexport interface IRBinding {\n code: string;\n kind: \"expression\" | \"event\" | \"spread\";\n eventName?: string;\n parameters?: string[];\n}\n\nexport interface IRAttribute {\n name: string;\n value?: string;\n binding?: IRBinding;\n}\n\nexport interface IRTextNode {\n kind: \"text\";\n value: string;\n}\n\nexport interface IRExpressionNode {\n kind: \"expression\";\n binding: IRBinding;\n}\n\nexport interface IRElementNode {\n kind: \"element\";\n tag: string;\n attributes?: IRAttribute[];\n children?: IRNode[];\n}\n\nexport interface IRComponentNode {\n kind: \"component\";\n name: string;\n attributes?: IRAttribute[];\n children?: IRNode[];\n slots?: Record<string, IRNode[]>;\n}\n\nexport interface IRFragmentNode {\n kind: \"fragment\";\n children: IRNode[];\n}\n\nexport interface IRConditionalNode {\n kind: \"conditional\";\n condition: IRBinding;\n then: IRNode[];\n otherwise?: IRNode[];\n}\n\nexport interface IRLoopNode {\n kind: \"loop\";\n collection: IRBinding;\n itemName: string;\n indexName?: string;\n children: IRNode[];\n}\n\nexport interface IRSlotNode {\n kind: \"slot\";\n name?: string;\n fallback?: IRNode[];\n}\n\nexport type IRNode = IRTextNode | IRExpressionNode | IRElementNode | IRComponentNode | IRFragmentNode | IRConditionalNode | IRLoopNode | IRSlotNode;\n\nexport interface ComponentIR {\n version: \"0.1\";\n name: string;\n imports: IRImport[];\n props: IRProp[];\n state: IRState[];\n root: IRNode;\n styles?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface ComponentSource {\n manifest: ComponentManifest;\n implementation: { kind: \"ir\"; component: ComponentIR }\n | { kind: \"mitosis\"; component: MitosisComponent }\n | { kind: \"runtime\"; module: string; exportName?: string };\n}\n\n/** A project-local file used by a component implementation. */\nexport interface ComponentAssetReference {\n /** Path relative to the DesignOS project root; absolute paths and traversal are not allowed. */\n source: string;\n /** Path relative to the generated target directory. Defaults to `source`. */\n outputPath?: string;\n}\n\n/** A component definition that can be compiled for a framework target. */\nexport type CompilerProjectComponent = Omit<ComponentSource, \"implementation\"> & {\n /** Project compilation accepts neutral DesignOS IR or a parsed Mitosis component. */\n implementation: { kind: \"ir\"; component: ComponentIR } | { kind: \"mitosis\"; component: MitosisComponent };\n /** Target-relative module directory; defaults to `components` and preserves relative import layout. */\n outputDirectory?: string;\n /** CSS/resources imported by the generated entry module; copied with the project assets. */\n styles?: ComponentAssetReference[];\n assets?: ComponentAssetReference[];\n};\n\n/** Framework-neutral component source catalog consumed by the future project compiler. */\nexport interface CompilerProject {\n schemaVersion: \"1\";\n components: CompilerProjectComponent[];\n /** Global CSS/resources copied into every target artifact directory. */\n styles?: ComponentAssetReference[];\n}\n\n/** File-based DesignOS source project consumed by the CLI. */\nexport interface CompilerSourceProjectComponent {\n source: string;\n manifest: string;\n exportName?: string;\n outputDirectory?: string;\n styles?: ComponentAssetReference[];\n assets?: ComponentAssetReference[];\n}\n\nexport interface CompilerSourceProject {\n schemaVersion: \"2\";\n components: CompilerSourceProjectComponent[];\n /** Global CSS/resources copied into every target artifact directory. */\n styles?: ComponentAssetReference[];\n}\n\nexport interface Diagnostic {\n severity: \"error\" | \"warning\" | \"info\";\n code: string;\n message: string;\n path?: string;\n}\n\nexport interface GeneratedFile {\n path: string;\n contents: string;\n kind: \"component\" | \"style\" | \"metadata\";\n}\n\nexport interface GenerationContext {\n target: CompilerTarget;\n component: ComponentIR;\n options: Record<string, unknown>;\n}\n\nexport interface GenerationResult {\n target: CompilerTarget;\n files: GeneratedFile[];\n diagnostics: Diagnostic[];\n}\n\nexport interface CompilerPlugin {\n name: string;\n order?: number;\n beforeNormalize?(component: ComponentIR): ComponentIR | void;\n afterNormalize?(component: ComponentIR): ComponentIR | void;\n beforeGenerate?(context: GenerationContext): void | Promise<void>;\n afterGenerate?(result: GenerationResult): GenerationResult | void | Promise<GenerationResult | void>;\n}\n\nexport interface CompilerProjectRegistryEntry {\n /** Framework-neutral serialized component type used by PageNode.type. */\n type: string;\n /** Generated module path relative to the target output directory. */\n modulePath: string;\n}\n\nexport interface CompilerTargetDefinition {\n name: CompilerTarget;\n generate(context: GenerationContext): GenerationResult;\n /** Optional lossless path for components parsed from the Mitosis TSX contract. */\n generateMitosis?(component: MitosisComponent, options: Record<string, unknown>): GenerationResult;\n /** Optional target-specific source file that maps PageNode types to generated framework modules. */\n generateProjectRegistry?(entries: CompilerProjectRegistryEntry[]): GeneratedFile;\n}\n\nexport class TargetRegistry {\n private readonly targets = new Map<CompilerTarget, CompilerTargetDefinition>();\n\n register(target: CompilerTargetDefinition): void {\n if (this.targets.has(target.name)) throw new Error(`Compiler target already registered: ${target.name}`);\n this.targets.set(target.name, target);\n }\n\n get(target: CompilerTarget): CompilerTargetDefinition {\n const definition = this.targets.get(target);\n if (!definition) throw new Error(`Compiler target not registered: ${target}`);\n return definition;\n }\n\n names(): CompilerTarget[] { return [...this.targets.keys()]; }\n}\n\nexport interface CompileOptions {\n target: CompilerTarget;\n targetOptions?: Record<string, unknown>;\n plugins?: CompilerPlugin[];\n}\n\nexport interface CompilerProjectAssetOutput {\n /** Source path relative to the project root. */\n source: string;\n /** Destination path relative to the compiler output directory. */\n outputPath: string;\n}\n\nexport interface CompileProjectResult {\n target: CompilerTarget;\n files: GeneratedFile[];\n assets: CompilerProjectAssetOutput[];\n diagnostics: Diagnostic[];\n}\n\nexport function normalizeComponent(component: ComponentIR): ComponentIR {\n return structuredClone(component);\n}\n\nexport function validateComponentIR(component: ComponentIR): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n if (!component || typeof component !== \"object\") {\n return [{ severity: \"error\", code: \"COMPONENT_IR_REQUIRED\", message: \"ComponentIR must be an object\", path: \"component\" }];\n }\n if (typeof component.name !== \"string\" || !component.name.trim()) diagnostics.push({ severity: \"error\", code: \"COMPONENT_NAME_REQUIRED\", message: \"ComponentIR.name is required\", path: \"name\" });\n if (!component.root || typeof component.root !== \"object\") diagnostics.push({ severity: \"error\", code: \"COMPONENT_ROOT_REQUIRED\", message: \"ComponentIR.root is required\", path: \"root\" });\n if (!Array.isArray(component.imports)) diagnostics.push({ severity: \"error\", code: \"COMPONENT_IMPORTS_INVALID\", message: \"ComponentIR.imports must be an array\", path: \"imports\" });\n if (!Array.isArray(component.state)) diagnostics.push({ severity: \"error\", code: \"COMPONENT_STATE_INVALID\", message: \"ComponentIR.state must be an array\", path: \"state\" });\n if (!Array.isArray(component.props)) {\n diagnostics.push({ severity: \"error\", code: \"COMPONENT_PROPS_INVALID\", message: \"ComponentIR.props must be an array\", path: \"props\" });\n return diagnostics;\n }\n const names = new Set<string>();\n for (const prop of component.props) {\n if (names.has(prop.name)) diagnostics.push({ severity: \"error\", code: \"DUPLICATE_PROP\", message: `Duplicate prop: ${prop.name}`, path: \"props\" });\n names.add(prop.name);\n }\n return diagnostics;\n}\n\nfunction serializedValue(value: unknown): string {\n if (value === undefined) return \"undefined\";\n return JSON.stringify(value, (_key, nested) => {\n if (!nested || typeof nested !== \"object\" || Array.isArray(nested)) return nested;\n return Object.fromEntries(Object.entries(nested).sort(([left], [right]) => left.localeCompare(right)));\n });\n}\n\n/**\n * Manifest defaults populate authored PageNodes; source defaults remain runtime\n * fallbacks. A mismatch is reported instead of silently rewriting either side.\n */\nexport function validateManifestImplementationContract(\n manifest: ComponentManifest,\n implementation: CompilerProjectComponent[\"implementation\"],\n path = \"component\",\n): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n const sourceProps = implementation.kind === \"ir\"\n ? new Map(implementation.component.props.map((prop) => [prop.name, prop]))\n : new Map(\n ((implementation.component.meta as { designosProps?: Array<{ name: string; optional: boolean; defaultValue?: unknown }> } | undefined)?.designosProps ?? [])\n .map((prop) => [prop.name, prop]),\n );\n const manifestFields = new Map(manifest.fields.map((field) => [field.name, field]));\n const supportsChildren = Boolean(\n manifest.capabilities?.canHaveChildren\n || manifest.slots?.some((slot) => slot.name === \"default\" || slot.name === \"children\"),\n );\n\n for (const prop of sourceProps.values()) {\n if (prop.name === \"children\" && supportsChildren) continue;\n if (!manifestFields.has(prop.name)) diagnostics.push({\n severity: \"warning\",\n code: \"COMPILER_PROJECT_SOURCE_PROP_NOT_IN_MANIFEST\",\n message: `Source prop \"${prop.name}\" is not editable through manifest \"${manifest.type}\".`,\n path: `${path}.implementation.component.props.${prop.name}`,\n });\n }\n\n for (const field of manifest.fields) {\n const prop = sourceProps.get(field.name);\n if (!prop) {\n if (field.required) diagnostics.push({\n severity: \"error\",\n code: \"COMPILER_PROJECT_REQUIRED_FIELD_NOT_IN_SOURCE\",\n message: `Required manifest field \"${field.name}\" is not declared by the source component.`,\n path: `${path}.manifest.fields.${field.name}`,\n });\n continue;\n }\n if (field.defaultValue !== undefined && prop.defaultValue !== undefined && serializedValue(field.defaultValue) !== serializedValue(prop.defaultValue)) diagnostics.push({\n severity: \"error\",\n code: \"COMPILER_PROJECT_DEFAULT_MISMATCH\",\n message: `Manifest default for \"${field.name}\" differs from the source runtime default; manifest defaults win for authored page data and source defaults remain runtime fallbacks.`,\n path: `${path}.manifest.fields.${field.name}.defaultValue`,\n });\n }\n\n return diagnostics;\n}\n\nfunction isSafeRelativePath(value: unknown): value is string {\n return typeof value === \"string\"\n && value.length > 0\n && !value.startsWith(\"/\")\n && !value.includes(\"\\\\\")\n && !/^[A-Za-z]:/.test(value)\n && value.split(\"/\").every((part) => part.length > 0 && part !== \".\" && part !== \"..\");\n}\n\nexport function validateCompilerProject(project: CompilerProject): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n if (!project || typeof project !== \"object\" || project.schemaVersion !== \"1\") {\n return [{ severity: \"error\", code: \"COMPILER_PROJECT_SCHEMA_VERSION_UNSUPPORTED\", message: \"CompilerProject.schemaVersion must be \\\"1\\\"\", path: \"schemaVersion\" }];\n }\n if (!Array.isArray(project.components)) {\n return [{ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENTS_REQUIRED\", message: \"CompilerProject.components must be an array\", path: \"components\" }];\n }\n\n const componentTypes = new Set<string>();\n const componentNames = new Set<string>();\n const assetOutputs = new Map<string, string>();\n\n if (project.styles !== undefined && !Array.isArray(project.styles)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_STYLES_INVALID\", message: \"styles must be an array\", path: \"styles\" });\n }\n for (const [styleIndex, style] of (Array.isArray(project.styles) ? project.styles : []).entries()) {\n const stylePath = `styles[${styleIndex}]`;\n if (!isSafeRelativePath(style.source)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_STYLE_SOURCE_PATH_INVALID\", message: \"Style source must be a safe path relative to the project root\", path: `${stylePath}.source` });\n continue;\n }\n const outputPath = style.outputPath ?? style.source;\n if (!isSafeRelativePath(outputPath)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_STYLE_OUTPUT_PATH_INVALID\", message: \"Style outputPath must be a safe path relative to the generated output directory\", path: `${stylePath}.outputPath` });\n continue;\n }\n const normalizedOutputPath = outputPath.toLowerCase();\n const existingSource = assetOutputs.get(normalizedOutputPath);\n if (existingSource && existingSource !== style.source) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_STYLE_OUTPUT_COLLISION\", message: `Different styles target the same output path: ${outputPath}`, path: `${stylePath}.outputPath` });\n } else {\n assetOutputs.set(normalizedOutputPath, style.source);\n }\n }\n\n project.components.forEach((definition, index) => {\n const prefix = `components[${index}]`;\n const manifest = definition?.manifest;\n const implementation = definition?.implementation;\n const type = manifest?.type;\n\n if (typeof type !== \"string\" || !type.trim()) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_TYPE_REQUIRED\", message: \"Component manifest type must be a non-empty string\", path: `${prefix}.manifest.type` });\n } else if (componentTypes.has(type)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_DUPLICATE_COMPONENT_TYPE\", message: `Duplicate component manifest type: ${type}`, path: `${prefix}.manifest.type` });\n } else {\n componentTypes.add(type);\n }\n\n if (!manifest || typeof manifest.displayName !== \"string\" || !manifest.displayName.trim() || !Array.isArray(manifest.fields)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_MANIFEST_INVALID\", message: \"Component manifest requires a displayName and fields array\", path: `${prefix}.manifest` });\n }\n\n if (!implementation || (implementation.kind !== \"ir\" && implementation.kind !== \"mitosis\") || !implementation.component) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_IMPLEMENTATION_INVALID\", message: \"Project compilation requires a DesignOS IR or parsed Mitosis component implementation\", path: `${prefix}.implementation` });\n } else {\n const name: unknown = implementation.component.name;\n if (typeof name !== \"string\" || !/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_COMPONENT_NAME_INVALID\", message: `Component name must be a valid identifier for generated framework components: ${name}`, path: `${prefix}.implementation.component.name` });\n } else if (componentNames.has(name)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_DUPLICATE_COMPONENT_NAME\", message: `Duplicate component implementation name: ${name}`, path: `${prefix}.implementation.component.name` });\n } else {\n componentNames.add(name);\n }\n if (implementation.kind === \"ir\") {\n diagnostics.push(...validateComponentIR(implementation.component).map((diagnostic) => ({\n ...diagnostic,\n path: diagnostic.path ? `${prefix}.implementation.component.${diagnostic.path}` : `${prefix}.implementation.component`,\n })));\n } else if (implementation.component[\"@type\"] !== \"@builder.io/mitosis/component\") {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_MITOSIS_COMPONENT_INVALID\", message: \"Parsed Mitosis implementation has an invalid component discriminator\", path: `${prefix}.implementation.component.@type` });\n }\n if (manifest && Array.isArray(manifest.fields)) diagnostics.push(...validateManifestImplementationContract(manifest, implementation, prefix));\n }\n\n const outputDirectory = definition?.outputDirectory ?? \"components\";\n if (!isSafeRelativePath(outputDirectory)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_OUTPUT_DIRECTORY_INVALID\", message: \"outputDirectory must be a safe path relative to the target output directory\", path: `${prefix}.outputDirectory` });\n }\n\n for (const collection of [\"styles\", \"assets\"] as const) {\n const references = definition?.[collection];\n if (references !== undefined && !Array.isArray(references)) {\n diagnostics.push({ severity: \"error\", code: `COMPILER_PROJECT_${collection.toUpperCase()}_INVALID`, message: `${collection} must be an array`, path: `${prefix}.${collection}` });\n }\n for (const [assetIndex, asset] of (Array.isArray(references) ? references : []).entries()) {\n const assetPath = `${prefix}.${collection}[${assetIndex}]`;\n if (!isSafeRelativePath(asset.source)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_SOURCE_PATH_INVALID\", message: \"Asset source must be a safe path relative to the project root\", path: `${assetPath}.source` });\n continue;\n }\n const outputPath = asset.outputPath ?? asset.source;\n if (!isSafeRelativePath(outputPath)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_OUTPUT_PATH_INVALID\", message: \"Asset outputPath must be a safe path relative to the generated output directory\", path: `${assetPath}.outputPath` });\n continue;\n }\n const normalizedOutputPath = outputPath.toLowerCase();\n const existingSource = assetOutputs.get(normalizedOutputPath);\n if (existingSource && existingSource !== asset.source) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_OUTPUT_COLLISION\", message: `Different assets target the same output path: ${outputPath}`, path: `${assetPath}.outputPath` });\n } else {\n assetOutputs.set(normalizedOutputPath, asset.source);\n }\n }\n }\n });\n\n return diagnostics;\n}\n\nexport async function compileComponent(\n component: ComponentIR,\n registry: TargetRegistry,\n options: CompileOptions,\n): Promise<GenerationResult> {\n const plugins = [...(options.plugins ?? [])].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));\n let normalized = normalizeComponent(component);\n for (const plugin of plugins) normalized = plugin.beforeNormalize?.(normalized) ?? normalized;\n for (const plugin of plugins) normalized = plugin.afterNormalize?.(normalized) ?? normalized;\n const diagnostics = validateComponentIR(normalized);\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], diagnostics };\n }\n const context: GenerationContext = { target: options.target, component: normalized, options: options.targetOptions ?? {} };\n for (const plugin of plugins) await plugin.beforeGenerate?.(context);\n let result = registry.get(options.target).generate(context);\n result = { ...result, diagnostics: [...diagnostics, ...result.diagnostics] };\n for (const plugin of plugins) result = (await plugin.afterGenerate?.(result)) ?? result;\n return result;\n}\n\nfunction relativeModulePath(fromFile: string, toFile: string): string {\n const fromDirectory = fromFile.split(\"/\").slice(0, -1);\n const toParts = toFile.split(\"/\");\n let shared = 0;\n while (shared < fromDirectory.length && shared < toParts.length && fromDirectory[shared] === toParts[shared]) shared++;\n const path = [\n ...Array.from({ length: fromDirectory.length - shared }, () => \"..\"),\n ...toParts.slice(shared),\n ].join(\"/\");\n return path.startsWith(\".\") ? path : `./${path}`;\n}\n\nfunction addStyleImports(contents: string, moduleOutputPath: string, styles: ComponentAssetReference[]): string {\n const statements = [...new Set(styles.map((style) =>\n `import ${JSON.stringify(relativeModulePath(moduleOutputPath, style.outputPath ?? style.source))};`,\n ))].filter((statement) => !contents.includes(statement));\n if (statements.length === 0) return contents;\n const firstLineEnd = contents.indexOf(\"\\n\");\n if (contents.startsWith(\"// @ts-nocheck\") && firstLineEnd >= 0) {\n return `${contents.slice(0, firstLineEnd + 1)}${statements.join(\"\\n\")}\\n${contents.slice(firstLineEnd + 1)}`;\n }\n return `${statements.join(\"\\n\")}\\n${contents}`;\n}\n\nexport async function compileProject(\n project: CompilerProject,\n registry: TargetRegistry,\n options: CompileOptions,\n): Promise<CompileProjectResult> {\n const diagnostics = validateCompilerProject(project);\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], assets: [], diagnostics };\n }\n\n const files: GeneratedFile[] = [];\n const assets = new Map<string, string>();\n const generatedPaths = new Set<string>();\n const registryEntries: CompilerProjectRegistryEntry[] = [];\n const targetDefinition = registry.get(options.target);\n\n for (const style of project.styles ?? []) {\n assets.set(style.outputPath ?? style.source, style.source);\n }\n\n for (const [index, definition] of project.components.entries()) {\n let result: GenerationResult;\n if (definition.implementation.kind === \"ir\") {\n result = await compileComponent(definition.implementation.component, registry, options);\n } else if (targetDefinition.generateMitosis) {\n result = targetDefinition.generateMitosis(definition.implementation.component, options.targetOptions ?? {});\n } else {\n result = {\n target: options.target,\n files: [],\n diagnostics: [{\n severity: \"error\",\n code: \"COMPILER_TARGET_MITOSIS_SOURCE_UNSUPPORTED\",\n message: `Target ${options.target} does not provide a Mitosis source generator.`,\n path: `components[${index}].implementation`,\n }],\n };\n }\n diagnostics.push(...result.diagnostics.map((diagnostic) => ({\n ...diagnostic,\n path: diagnostic.path ? `components[${index}].${diagnostic.path}` : `components[${index}]`,\n })));\n\n const componentName = definition.implementation.component.name;\n for (const file of result.files) {\n if (!isSafeRelativePath(file.path)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_GENERATED_PATH_INVALID\", message: `Target generated an unsafe relative file path: ${file.path}`, path: `components[${index}].output` });\n continue;\n }\n const outputPath = `${definition.outputDirectory ?? \"components\"}/${file.path}`;\n const normalizedPath = outputPath.toLowerCase();\n if (generatedPaths.has(normalizedPath)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_GENERATED_PATH_COLLISION\", message: `Multiple components generated the same output path: ${outputPath}`, path: `components[${index}].output` });\n continue;\n }\n generatedPaths.add(normalizedPath);\n const isEntryModule = file.kind === \"component\" && file.path.split(\"/\").pop()?.startsWith(`${componentName}.`);\n files.push({\n ...file,\n path: outputPath,\n contents: isEntryModule && definition.styles?.length\n ? addStyleImports(file.contents, outputPath, definition.styles)\n : file.contents,\n });\n }\n\n if (targetDefinition.generateProjectRegistry) {\n const entryFiles = result.files.filter((file) => file.kind === \"component\" && file.path.split(\"/\").pop()?.startsWith(`${componentName}.`));\n if (entryFiles.length !== 1) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_ENTRY_AMBIGUOUS\", message: `Expected one generated entry module for ${componentName}; found ${entryFiles.length}`, path: `components[${index}].output` });\n } else {\n registryEntries.push({\n type: definition.manifest.type,\n modulePath: `${definition.outputDirectory ?? \"components\"}/${entryFiles[0].path}`,\n });\n }\n }\n\n for (const asset of [...(definition.styles ?? []), ...(definition.assets ?? [])]) {\n assets.set(asset.outputPath ?? asset.source, asset.source);\n }\n }\n\n if (targetDefinition.generateProjectRegistry) {\n const registryFile = targetDefinition.generateProjectRegistry(registryEntries);\n if (!isSafeRelativePath(registryFile.path)) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_PATH_INVALID\", message: `Target generated an unsafe registry path: ${registryFile.path}`, path: \"target.registry\" });\n } else if (generatedPaths.has(registryFile.path.toLowerCase())) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_REGISTRY_PATH_COLLISION\", message: `Registry output collides with a generated component file: ${registryFile.path}`, path: \"target.registry\" });\n } else {\n generatedPaths.add(registryFile.path.toLowerCase());\n files.push(registryFile);\n }\n } else {\n diagnostics.push({ severity: \"info\", code: \"COMPILER_PROJECT_REGISTRY_NOT_REGISTERED\", message: `Target ${options.target} has no verified project component registry emitter; generated files are emitted without components.ts.`, path: `target.${options.target}` });\n }\n\n for (const outputPath of assets.keys()) {\n if (generatedPaths.has(outputPath.toLowerCase())) {\n diagnostics.push({ severity: \"error\", code: \"COMPILER_PROJECT_ASSET_GENERATED_PATH_COLLISION\", message: `Asset output collides with a generated file: ${outputPath}`, path: \"assets\" });\n }\n }\n\n if (diagnostics.some((diagnostic) => diagnostic.severity === \"error\")) {\n return { target: options.target, files: [], assets: [], diagnostics };\n }\n\n return {\n target: options.target,\n files,\n assets: [...assets.entries()].map(([outputPath, source]) => ({ source, outputPath })),\n diagnostics,\n };\n}\n\nexport function pageNodeToComponentIR(node: PageNode): ComponentIR {\n return {\n version: \"0.1\",\n name: node.type,\n imports: [],\n props: Object.keys(node.props).map((name) => ({ name, defaultValue: node.props[name] })),\n state: [],\n root: { kind: \"component\", name: node.type, attributes: Object.keys(node.props).map((name) => ({ name, binding: { kind: \"expression\", code: `props.${name}` } })) },\n metadata: { sourceNodeId: node.id },\n };\n}\n\nexport { componentIRToMitosis, createMitosisCompiler, createMitosisTarget, generateMitosisSourceComponent, generateWithMitosis, mitosisTargets, mitosisTargetCapabilities } from \"./mitosis\";\nexport type { MitosisTarget, MitosisTargetCapability } from \"./mitosis\";\nexport { par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,CAAC;AAAA,IACR,MAAM,EAAE,MAAM,aAAa,MAAM,KAAK,MAAM,YAAY,OAAO,KAAK,KAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,SAAS,EAAE,MAAM,cAAc,MAAM,SAAS,IAAI,GAAG,EAAE,EAAE,EAAE;AAAA,IAClK,UAAU,EAAE,cAAc,KAAK,GAAG;AAAA,EACpC;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designos/compiler-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"private": false,
|
|
5
6
|
"type": "module",
|
|
6
7
|
"exports": {
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@builder.io/mitosis": "0.14.1",
|
|
14
|
-
"@designos/core": "0.1
|
|
15
|
+
"@designos/core": "0.2.1"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"tsup": "^8.5.0",
|