🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@builder.io/mitosis

Package Overview
Dependencies
Maintainers
21
Versions
375
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/mitosis - npm Package Compare versions

Comparing version

to
0.8.0

6

dist/src/parsers/builder/builder.d.ts

@@ -16,2 +16,8 @@ import { MitosisComponent, MitosisState } from '../../types/mitosis-component';

includeMeta?: boolean;
/**
* When `true`, invalid bindings will be escaped as strings with special comments.
* This can then be used to have LLMs such as Claude attempt to repair the broken code.
* Defaults to `false`.
*/
escapeInvalidCode?: boolean;
};

@@ -18,0 +24,0 @@ export declare const builderElementToMitosisNode: (block: BuilderElement, options: BuilderToMitosisOptions, _internalOptions?: InternalOptions) => MitosisNode;

28

dist/src/parsers/builder/builder.js

@@ -130,5 +130,16 @@ "use strict";

}
let code = ((_b = (_a = block.code) === null || _a === void 0 ? void 0 : _a.bindings) === null || _b === void 0 ? void 0 : _b[key]) || block.bindings[key];
const verifyCode = verifyIsValid(code);
if (!verifyCode.valid) {
if (options.escapeInvalidCode) {
code = '`' + code + ' [INVALID CODE]`';
}
else {
console.warn(`Dropping binding "${key}" due to invalid code: ${code}`);
continue;
}
}
if (key.includes('style')) {
const styleProperty = key.split('.')[1];
styleBindings[styleProperty] = convertExportDefaultToReturn(((_b = (_a = block.code) === null || _a === void 0 ? void 0 : _a.bindings) === null || _b === void 0 ? void 0 : _b[key]) || block.bindings[key]);
styleBindings[styleProperty] = convertExportDefaultToReturn(code);
/**

@@ -156,3 +167,3 @@ * responsiveStyles that are bound need to be merged into media queries.

...responsiveStyles[objKey],
[prop]: block.bindings[key],
[prop]: code,
};

@@ -677,4 +688,15 @@ }

if (!useKey.includes('.')) {
let code = blockBindings[key].code || blockBindings[key];
const verifyCode = verifyIsValid(code);
if (!verifyCode.valid) {
if (options.escapeInvalidCode) {
code = '`' + code + ' [INVALID CODE]`';
}
else {
console.warn(`Dropping binding "${key}" due to invalid code: ${code}`);
continue;
}
}
bindings[useKey] = (0, bindings_1.createSingleBinding)({
code: blockBindings[key].code || blockBindings[key],
code,
});

@@ -681,0 +703,0 @@ }

2

package.json

@@ -25,3 +25,3 @@ {

},
"version": "0.7.6",
"version": "0.8.0",
"homepage": "https://github.com/BuilderIO/mitosis",

@@ -28,0 +28,0 @@ "main": "./dist/src/index.js",