-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
108 lines (101 loc) · 2.72 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const glob = require("glob");
const path = require("path");
const fs = require("fs");
module.exports = {
components: () => {
return glob.sync("src/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").withCustomConfig(
"./tsconfig.json"
).parse,
webpackConfig: Object.assign({}, require("./webpack.config"), {}),
require: [path.join(__dirname, "./tests.config.js")],
styleguideComponents: {
Logo: __dirname + "/src/styleguide/Logo.tsx",
},
styleguideDir: "docs",
skipComponentsWithoutExample: true,
tocMode: "expand",
sections: [
{
name: "Introduction",
content: "doc/introduction/introduction.md",
sections: [
{
name: "Theme Colors",
content: "doc/introduction/themes.md",
},
{
name: "How to use Components",
content: "doc/introduction/howtouse.md",
},
],
},
{
name: "Components",
content: "doc/introduction/introduction.md",
sections: [
{
name: "Atoms",
content: "doc/components/atoms.md",
components: "src/components/atoms/**/*.tsx",
},
{
name: "Molecules",
content: "doc/components/molecules.md",
components: "src/components/molecules/**/*.tsx",
},
{
name: "Organisms",
content: "doc/components/organisms.md",
components: "src/components/organisms/**/*.tsx",
},
{
name: "Players",
content: "doc/components/players.md",
components: "src/components/players/**/*.tsx",
},
{
name: "Quizzes",
content: "doc/components/quizzes.md",
components: "src/components/quizzes/**/*.tsx",
},
],
},
{
name: "Advanced Topics",
sections: [
{
name: "Grid",
content: "doc/advanced/grid.md",
},
{
name: "Responsive Design",
content: "doc/advanced/responsive.md",
},
{
name: "Forms",
content: "doc/advanced/forms.md",
},
{
name: "Translations",
content: "doc/advanced/translations.md",
},
{
name: "Accessibility ",
content: "doc/advanced/a11y.md",
},
],
},
],
};