Skip to content

Commit

Permalink
fix svelte on: for svelte:element (#1329)
Browse files Browse the repository at this point in the history
* f

* rl

* fix

* rl

* rl

* fix react check

* fix

* f

* rl
  • Loading branch information
samijaber authored Jan 12, 2024
1 parent f84e2c7 commit e862056
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 88 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"typescript.format.enable": true,
"editor.formatOnSave": true,
Expand Down
3 changes: 3 additions & 0 deletions .yarn/versions/db85d6c2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
undecided:
- "@builder.io/mitosis-repo"
- "@builder.io/mitosis"
6 changes: 3 additions & 3 deletions e2e/e2e-app/tests/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ test.describe('e2e', () => {
});

test('script tag', async ({ page, packageName }) => {
if (['e2e-solid', 'e2e-react'].includes(packageName)) {
test.skip();
}
test.skip(
packageName === 'e2e-solid' || packageName === 'e2e-react' || packageName === 'e2e-svelte',
);

const consoleMsg: string[] = [];
page.on('console', (msg) => consoleMsg.push(msg.text()));
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/mitosis-cli",
"version": "0.0.96",
"version": "0.0.100",
"description": "mitosis CLI",
"types": "build/types/types.d.ts",
"bin": {
Expand Down Expand Up @@ -47,6 +47,7 @@
"micromatch": "^4.0.4",
"parse5": "^3.0.3",
"prettier": "^2.6.1",
"rimraf": "^5.0.5",
"ts-morph": "^19.0.0",
"vue-template-es2015-compiler": "^1.9.1",
"vue-template-validator": "^1.1.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "Builder.io",
"url": "https://www.builder.io"
},
"version": "0.0.137",
"version": "0.0.141",
"homepage": "https://github.com/BuilderIO/mitosis",
"main": "./dist/src/index.js",
"exports": {
Expand Down
32 changes: 14 additions & 18 deletions packages/core/src/__tests__/__snapshots__/preact.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,10 @@ function Column(props) {
}

function getColumnCssWidth(index) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -581,7 +581,7 @@ function ContentSlotJsxCode(props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -1459,9 +1459,7 @@ function SmileReviews(props) {
<div className=\\"review\\" key={review.id}>
<img className=\\"img\\" src={review.avatar} />

<div
className={state.showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}
>
<div className={showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}>
<div>
N:
{index}
Expand Down Expand Up @@ -1542,7 +1540,7 @@ function Text(props) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down Expand Up @@ -3890,10 +3888,10 @@ function Column(props: ColumnProps) {
}

function getColumnCssWidth(index: number) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -3980,7 +3978,7 @@ function ContentSlotJsxCode(props: Props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -4992,9 +4990,7 @@ function SmileReviews(props: SmileReviewsProps) {
<div className=\\"review\\" key={review.id}>
<img className=\\"img\\" src={review.avatar} />

<div
className={state.showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}
>
<div className={showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}>
<div>
N:
{index}
Expand Down Expand Up @@ -5089,7 +5085,7 @@ function Text(props: TextProps) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down Expand Up @@ -7169,7 +7165,7 @@ function MyComponent(props) {
return (
<input
className={\`form-input \${props.disabled ? \\"disabled\\" : \\"\\"} \${
state.focus ? \\"focus\\" : \\"\\"
focus ? \\"focus\\" : \\"\\"
}\`}
/>
);
Expand Down Expand Up @@ -7579,7 +7575,7 @@ function MyComponent(props: any) {
return (
<input
className={\`form-input \${props.disabled ? \\"disabled\\" : \\"\\"} \${
state.focus ? \\"focus\\" : \\"\\"
focus ? \\"focus\\" : \\"\\"
}\`}
/>
);
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/__tests__/__snapshots__/react-native.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ function Column(props) {
}

function getColumnCssWidth(index) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -682,7 +682,7 @@ function ContentSlotJsxCode(props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -1716,7 +1716,7 @@ function Text(props) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down Expand Up @@ -4568,10 +4568,10 @@ function Column(props: ColumnProps) {
}

function getColumnCssWidth(index: number) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -4654,7 +4654,7 @@ function ContentSlotJsxCode(props: Props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -5836,7 +5836,7 @@ function Text(props: TextProps) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down
36 changes: 15 additions & 21 deletions packages/core/src/__tests__/__snapshots__/react.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@ function Column(props) {
}

function getColumnCssWidth(index) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -576,7 +576,7 @@ function ContentSlotJsxCode(props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -1445,9 +1445,7 @@ function SmileReviews(props) {
<div className=\\"review\\" key={review.id}>
<img className=\\"img\\" src={review.avatar} />

<div
className={state.showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}
>
<div className={showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}>
<div>
N:
{index}
Expand Down Expand Up @@ -1527,7 +1525,7 @@ function Text(props) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down Expand Up @@ -3839,10 +3837,10 @@ function Column(props: ColumnProps) {
}

function getColumnCssWidth(index: number) {
const columns = state.getColumns();
const gutterSize = state.getGutterSize();
const columns = getColumns();
const gutterSize = getGutterSize();
const subtractWidth = (gutterSize * (columns.length - 1)) / columns.length;
return \`calc(\${state.getWidth(index)}% - \${subtractWidth}px)\`;
return \`calc(\${getWidth(index)}% - \${subtractWidth}px)\`;
}

return (
Expand Down Expand Up @@ -3928,7 +3926,7 @@ function ContentSlotJsxCode(props: Props) {
const [showContent, setShowContent] = useState(() => false);

function cls() {
return props.slotContent && props.children ? \`\${state.name}-content\` : \\"\\";
return props.slotContent && props.children ? \`\${name}-content\` : \\"\\";
}

function show() {
Expand Down Expand Up @@ -4931,9 +4929,7 @@ function SmileReviews(props: SmileReviewsProps) {
<div className=\\"review\\" key={review.id}>
<img className=\\"img\\" src={review.avatar} />

<div
className={state.showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}
>
<div className={showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}>
<div>
N:
{index}
Expand Down Expand Up @@ -5027,7 +5023,7 @@ function Text(props: TextProps) {
__html:
props.text ||
props.content ||
state.name ||
name ||
'<p class=\\"text-lg\\">my name</p>',
}}
/>
Expand Down Expand Up @@ -7128,9 +7124,7 @@ function SmileReviews(props) {
<div className=\\"review-4d59d085\\" key={review.id}>
<img className=\\"img-4d59d085\\" src={review.avatar} />

<div
className={state.showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}
>
<div className={showReviewPrompt ? \\"bg-primary\\" : \\"bg-secondary\\"}>
<div>
N:
{index}
Expand Down Expand Up @@ -7289,7 +7283,7 @@ function MyComponent(props) {
return (
<input
className={\`form-input \${props.disabled ? \\"disabled\\" : \\"\\"} \${
state.focus ? \\"focus\\" : \\"\\"
focus ? \\"focus\\" : \\"\\"
}\`}
/>
);
Expand Down Expand Up @@ -7697,7 +7691,7 @@ function MyComponent(props: any) {
return (
<input
className={\`form-input \${props.disabled ? \\"disabled\\" : \\"\\"} \${
state.focus ? \\"focus\\" : \\"\\"
focus ? \\"focus\\" : \\"\\"
}\`}
/>
);
Expand Down
Loading

1 comment on commit e862056

@vercel
Copy link

@vercel vercel bot commented on e862056 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.