forked from KaiHotz/react-rollup-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
64 lines (62 loc) · 1.57 KB
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path')
const pkg = require('./package.json')
const webpackConfig = require('./config/webpack.js')
module.exports = {
title: `${pkg.name} v${pkg.version}`,
components: 'src/lib/components/**/[A-Z]*.{jsx,tsx}',
moduleAliases: {
[pkg.name]: path.resolve(__dirname, 'src/lib'),
},
ribbon: {
url: 'https://github.com/KaiHotz/react-rollup-boilerplate',
text: 'Fork me on GitHub',
},
showSidebar: true,
usageMode: 'expand',
skipComponentsWithoutExample: true,
theme: {
color: {
link: '#065fd4',
linkHover: '#00adef',
},
font: ['Helvetica', 'sans-serif'],
},
styles: {
Ribbon: {
root: {
backgroundImage: 'url("https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png")',
backgroundSize: '50px 50px',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'right top',
},
link: {
backgroundColor: '#065fd4',
},
},
Heading: {
heading2: {
fontSize: 26,
},
},
ReactComponent: {
root: {
marginBottom: 20,
},
header: {
marginBottom: 0,
},
tabs: {
marginBottom: 0,
},
},
},
propsParser: require('react-docgen-typescript').withDefaultConfig('./tsconfig.json').parse,
webpackConfig,
getExampleFilename(componentPath) {
return componentPath.replace(/\.(jsx?|tsx?)$/, '.examples.md')
},
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, '{.tsx, .jsx}')
return `import { ${name} } from '${pkg.name}';`
},
}