-
Notifications
You must be signed in to change notification settings - Fork 1
/
styleguide.config.js
45 lines (42 loc) · 1.27 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
const path = require('path');
const camelCase = require('lodash/camelCase');
const upperFirst = require('lodash/upperFirst');
const webpackConfig = require('./styleguide.webpack.js');
const { name, version } = require('./package.json');
module.exports = {
title: `AQ components | ${version}`,
template: {
head: {
links: [
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700'
}
]
}
},
styleguideComponents: {
StyleGuideRenderer: path.join(__dirname, 'src/styleguide/components/styleGuide'),
},
sections: [
{
name: 'UI',
components: () => ([ path.resolve(__dirname, 'src/components/ui/*', 'index.js') ])
},
{
name: 'Form',
components: () => ([ path.resolve(__dirname, 'src/components/form/*', 'index.js') ])
},
{
name: 'Widgets',
components: () => ([ path.resolve(__dirname, 'src/components/widgets/*', 'index.js') ])
}
],
skipComponentsWithoutExample: true,
getComponentPathLine: (componentPath) => {
const dirname = path.dirname(componentPath, '.js');
const componentName = upperFirst(camelCase(dirname.split('/').slice(-1)[0]));
return `import { ${componentName} } from '${name}'`;
},
webpackConfig
};