-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add explicitFileExtension for MitosisConfig (#1635)
- Loading branch information
Showing
8 changed files
with
220 additions
and
9 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,34 @@ | ||
--- | ||
'@builder.io/mitosis': patch | ||
'@builder.io/mitosis-cli': patch | ||
--- | ||
|
||
[All] Add new `explicitBuildFileExtensions` to `MitosisConfig`. This allows users to manage the extension of some components explicitly. This is very useful for plugins: | ||
|
||
```ts | ||
/** | ||
* Can be used for cli builds. Preserves explicit filename extensions when regex matches, e.g.: | ||
* { | ||
* explicitBuildFileExtension: { | ||
* ".ts":/*.figma.lite.tsx/g, | ||
* ".md":/*.docs.lite.tsx/g | ||
* } | ||
* } | ||
*/ | ||
explicitBuildFileExtensions?: Record<string, RegExp>; | ||
|
||
``` | ||
|
||
[All] Add new `pluginData` object to `MitosisComponent` which will be filled during build via cli. Users get some additional information to use them for plugins: | ||
|
||
```ts | ||
/** | ||
* This data is filled inside cli to provide more data for plugins | ||
*/ | ||
pluginData?: { | ||
target?: Target; | ||
path?: string; | ||
outputDir?: string; | ||
outputFilePath?: string; | ||
}; | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useMetadata } from '@builder.io/mitosis'; | ||
import ComponentWithTypes from './component-with-types.lite'; | ||
|
||
useMetadata({ | ||
docs: { | ||
name: 'This is the name', | ||
}, | ||
}); | ||
|
||
export default function AbcButton(props: any) { | ||
return <ComponentWithTypes name={props.name}></ComponentWithTypes>; | ||
} |
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
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