-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstyleguide.config.js
40 lines (39 loc) · 1.28 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
const Path = require('path');
const upperFirst = require('lodash/upperFirst');
const camelCase = require('lodash/camelCase');
const {
name, version, description,
} = require('./package.json');
const { styles, theme } = require('./styleguide.styles');
module.exports = {
title: `${upperFirst(camelCase(name))} v${version}`,
ribbon: {
url: 'https://github.com/unfoldingWord-box3/datatable-translatable',
text: 'View me on GitHub',
},
webpackConfig: require('react-scripts/config/webpack.config')('development'),
serverPort: 6060,
styles,
theme,
getComponentPathLine: (componentPath) => {
const file = Path.parse(componentPath).base;
const componentName = file.replace(/\.js$/, '');
return `import { ${componentName} } from "${name}";`;
},
usageMode: 'expand',
exampleMode: 'expand',
pagePerSection: true,
sections: [
{
name: upperFirst(camelCase(name)),
description,
content: './readme.md',
components: () => ([
Path.resolve(__dirname, `src/components/datatable`, `DataTable.js`),
Path.resolve(__dirname, `src/components/datatable`, `TestDatatable.js`),
Path.resolve(__dirname, `src/components/cell`, `Cell.js`),
Path.resolve(__dirname, `src/components/toolbar`, `Toolbar.js`),
]),
},
],
};