-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into korey/support-localization
- Loading branch information
Showing
83 changed files
with
7,113 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
}, | ||
plugins: ["@builder.io/mitosis"], | ||
parser: "@typescript-eslint/parser", | ||
extends: [], | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
rules: { | ||
"@builder.io/mitosis/no-conditional-render": "warn", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Metadata example for Mitosis | ||
|
||
This is an example to showcase the ``useMetadata`` hook. You can use this to set predefined configuration parameters for each component. Or you can add additional parameters to use them in a plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const metadataPlugin = () => ({ | ||
code: { | ||
pre: (code, json) => { | ||
if (json.meta.useMetadata) { | ||
return ` | ||
/** | ||
useMetadata: | ||
${JSON.stringify(json.meta.useMetadata)} | ||
*/ | ||
${code}`; | ||
} | ||
|
||
return code; | ||
}, | ||
}, | ||
}); | ||
|
||
module.exports = { | ||
files: 'src/**', | ||
commonOptions: { | ||
plugins: [metadataPlugin], | ||
}, | ||
targets: [ | ||
'react', | ||
// still unsupported | ||
// 'qwik', | ||
// 'builder', | ||
'vue', | ||
'html', | ||
// TO-DO: fix error causing svelte output not to work | ||
// 'svelte', | ||
'solid', | ||
'angular', | ||
'webcomponent', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@builder.io/metadata-example", | ||
"private": true, | ||
"scripts": { | ||
"build": "mitosis build", | ||
"lint": "eslint" | ||
}, | ||
"exports": { | ||
"./react/*": "./dist/react/src/*", | ||
"./qwik/*": "./dist/qwik/src/*", | ||
"./vue/*": "./dist/vue/src/*", | ||
"./svelte/*": "./dist/svelte/src/*", | ||
"./angular/*": "./dist/angular/src/*", | ||
"./html/*": "./dist/html/src/*", | ||
"./solid/*": "./dist/solid/src/*" | ||
}, | ||
"dependencies": { | ||
"@builder.io/mitosis": "workspace:*", | ||
"@builder.io/mitosis-cli": "workspace:*", | ||
"eslint": "^7.21.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ComponentMetadata } from '@builder.io/mitosis'; | ||
import { customMetaData } from '../shared/data'; | ||
|
||
export const metadata: ComponentMetadata = { | ||
regularKey: 'abc', | ||
'some-key': customMetaData, | ||
react: { | ||
forwardRef: 'xxx', | ||
}, | ||
vue: { | ||
customKey: 'yyy', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useMetadata } from '@builder.io/mitosis'; | ||
import { metadata } from './data'; | ||
|
||
useMetadata({ ...metadata }); | ||
|
||
export default function MetadataExample() { | ||
return <div>Metadata</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CustomMetadata } from './model'; | ||
|
||
export const customMetaData: CustomMetadata = { | ||
a: 'custom', | ||
b: 1, | ||
c: { | ||
d: 'nested', | ||
}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type CustomMetadata = { | ||
a: string; | ||
b: number; | ||
c: Object; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"strict": true, | ||
"jsx": "preserve", | ||
"moduleResolution": "node", | ||
"jsxImportSource": "@builder.io/mitosis" | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
# @builder.io/mitosis-cli | ||
|
||
## 0.5.27 | ||
|
||
### Patch Changes | ||
|
||
- 92ad2c6: Misc: stop using `fs-extra-promise` dependency | ||
- Updated dependencies [92ad2c6] | ||
- @builder.io/[email protected] | ||
|
||
## 0.5.26 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [57bdffe] | ||
- @builder.io/[email protected] | ||
|
||
## 0.5.25 | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [af43f50] | ||
- Updated dependencies [20ad8dc] | ||
- @builder.io/[email protected] | ||
|
||
## 0.5.24 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.