-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathstyleguide.config.js
More file actions
27 lines (26 loc) · 886 Bytes
/
styleguide.config.js
File metadata and controls
27 lines (26 loc) · 886 Bytes
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
const glob = require("glob");
const path = require("path");
const fs = require("fs");
module.exports = {
components: () => {
return glob.sync("src/shared/components/**/*.{ts,tsx}").filter(file => {
// Take only connect component if exists, ignore others.
if (file.match(/connect.tsx$/)) {
return true
} else {
const pathObject = path.parse(file);
pathObject.ext = `.connect${pathObject.ext}`
const { root, dir, ext, name } = pathObject;
return !fs.existsSync(path.format({ root, dir, ext, name }));
}
});
},
propsParser: require("react-docgen-typescript").withDefaultConfig({
savePropValueAsString: true,
}).parse,
webpackConfig: Object.assign({}, require("./webpack.config"), {}),
styleguideComponents: {
Wrapper: __dirname + "/src/styleguide/Wrapper.tsx",
},
styleguideDir: "docs",
};