chore(docz-core): use findAllExportedComponentDefinitions for react-docgen

This commit is contained in:
Pedro Nauck
2018-06-21 01:16:14 -03:00
parent 35a0653cbf
commit 4b959b9c95
17 changed files with 20 additions and 35 deletions

View File

@@ -17,7 +17,7 @@ const AlertStyled = styled('div')`
background: ${({ kind = 'info' }) => kinds[kind]};
`
const Alert = props => <AlertStyled {...props} />
export const Alert = props => <AlertStyled {...props} />
Alert.propTypes = {
kind: t.oneOf(['info', 'positive', 'negative', 'warning']),
@@ -26,5 +26,3 @@ Alert.propTypes = {
Alert.defaultProps = {
kind: 'info',
}
export default Alert

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Alert from './Alert'
import { Alert } from './Alert'
# Alert

View File

@@ -58,7 +58,7 @@ const ButtonStyled = styled('button')`
border-radius: 3px;
`
const Button = ({ children, ...props }) => (
export const Button = ({ children, ...props }) => (
<ButtonStyled {...props}>{children}</ButtonStyled>
)
@@ -73,5 +73,3 @@ Button.defaultProps = {
kind: 'primary',
outline: false,
}
export default Button

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Button from './Button'
import { Button } from './Button'
# Button

View File

@@ -17,7 +17,7 @@ const AlertStyled = styled('div')`
background: ${({ kind = 'info' }) => kinds[kind]};
`
const Alert = props => <AlertStyled {...props} />
export const Alert = props => <AlertStyled {...props} />
Alert.propTypes = {
kind: t.oneOf(['info', 'positive', 'negative', 'warning']),
@@ -26,5 +26,3 @@ Alert.propTypes = {
Alert.defaultProps = {
kind: 'info',
}
export default Alert

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Alert from './Alert'
import { Alert } from './Alert'
# Alert

View File

@@ -58,7 +58,7 @@ const ButtonStyled = styled('button')`
border-radius: 3px;
`
const Button = ({ children, ...props }) => (
export const Button = ({ children, ...props }) => (
<ButtonStyled {...props}>{children}</ButtonStyled>
)
@@ -73,5 +73,3 @@ Button.defaultProps = {
kind: 'primary',
outline: false,
}
export default Button

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Button from './Button'
import { Button } from './Button'
# Button

View File

@@ -27,8 +27,6 @@ const AlertStyled = styled('div')`
background: ${({ kind = 'info' }) => kinds[kind]};
`
const Alert = ({ kind = 'info', ...props }: AlertProps) => (
export const Alert = ({ kind = 'info', ...props }: AlertProps) => (
<AlertStyled {...props} kind={kind} />
)
export default Alert

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Alert from './Alert'
import { Alert } from './Alert'
# Alert

View File

@@ -65,7 +65,7 @@ type ButtonProps = {
children: Node,
}
const Button = ({
export const Button = ({
scale = 'normal',
kind = 'primary',
outline = false,
@@ -75,5 +75,3 @@ const Button = ({
{children}
</ButtonStyled>
)
export default Button

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Button from './Button'
import { Button } from './Button'
# Button

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Alert from './Alert'
import { Alert } from './Alert'
# Alert

View File

@@ -27,8 +27,6 @@ const AlertStyled = styled('div')`
background: ${({ kind = 'info' }: AlertProps) => kinds[kind]};
`
const Alert: SFC<AlertProps> = ({ kind, ...props }) => (
export const Alert: SFC<AlertProps> = ({ kind, ...props }) => (
<AlertStyled {...props} kind={kind} />
)
export default Alert

View File

@@ -4,7 +4,7 @@ menu: Components
---
import { Playground, PropsTable } from 'docz'
import Button from './Button'
import { Button } from './Button'
# Button

View File

@@ -67,8 +67,6 @@ const ButtonStyled = styled('button')`
border-radius: 3px;
`
const Button: SFC<ButtonProps> = ({ children, ...props }) => (
export const Button: SFC<ButtonProps> = ({ children, ...props }) => (
<ButtonStyled {...props}>{children}</ButtonStyled>
)
export default Button

View File

@@ -27,9 +27,10 @@ export const setupHappypack = (config: Config, args: Args, babelrc: any) => {
}
if (args.propsParser && !args.typescript) {
babelLoader.options.plugins.push(
require.resolve('babel-plugin-react-docgen')
)
babelLoader.options.plugins.push([
require.resolve('babel-plugin-react-docgen'),
{ resolver: 'findAllExportedComponentDefinitions' },
])
}
if (args.propsParser && args.typescript) {