forked from GetStream/react-native-activity-feed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
134 lines (130 loc) · 3.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* globals __dirname */
/* eslint-env commonjs*/
const path = require('path');
const webpack = require('webpack');
const notBabeledDeps = [
'react-native-safe-area-view',
'react-native-sticky-keyboard-accessory',
'react-native-keyboard-spacer',
];
module.exports = {
title: 'React native activity feeds - Docs',
require: ['babel-polyfill'],
styleguideDir: 'docs',
serverPort: 6068,
sortProps: (props) => props,
resolver(ast, recast) {
return require('react-docgen').resolver.findAllExportedComponentDefinitions(
ast,
recast,
);
},
styleguideComponents: {
PathlineRenderer: path.join(
__dirname,
'src/styleguideComponents/PathlineRenderer.js',
),
},
sections: [
{
name: 'Introduction',
content: 'docs/setup.md',
},
{
name: 'Top Level Components',
content: 'docs/top-level-components.md',
components: [
'src/Context/StreamApp.js',
'src/components/FlatFeed.js',
'src/components/NotificationFeed.js',
'src/components/SinglePost.js',
],
exampleMode: 'collapse',
usageMode: 'expand',
},
{
name: 'UI Components',
content: 'docs/other-components.md',
components: 'src/components/[A-Z]*.js',
ignore: [
'**/FlatFeed.js',
'**/NotificationFeed.js',
'**/SinglePost.js',
'**/CommentsContainer.js',
],
exampleMode: 'collapse',
usageMode: 'expand',
},
{
name: 'Cookbook',
content: 'docs/cookbook.md',
},
{
name: 'Internationalisation (i18n)',
content: 'docs/Streami18n.md',
},
{
name: 'Styles',
content: 'docs/styles.md',
},
],
template: {
favicon: 'https://getstream.imgix.net/images/favicons/favicon-96x96.png',
},
webpackConfig: {
devtool: 'source-map',
resolve: {
// auto resolves any react-native import as react-native-web
alias: {
'react-native': 'react-native-web',
'react-native-gesture-handler': 'react-native-web',
},
extensions: ['.web.js', '.js', '.ts', '.tsx'],
},
devServer: {
clientLogLevel: 'warn',
},
module: {
rules: [
{
test: /\.(js|jsx|ts|tsx)$/,
loader: 'babel-loader',
include: [
path.join(__dirname, 'src'),
...notBabeledDeps.map((dep) =>
path.join(__dirname, 'node_modules', dep),
),
],
options: {
comments: true,
plugins: ['module-resolver', 'react-native-web'],
presets: ['module:metro-react-native-babel-preset'],
babelrc: false,
},
},
{
test: /\.(jpe?g|png|gif|ttf)$/i,
use: [
{
loader: 'file-loader',
options: {
hash: 'sha512',
digest: 'hex',
name: '[hash].[ext]',
outputPath: 'build/images',
},
},
],
},
],
},
// Most react native projects will need some extra plugin configuration.
plugins: [
// Add __DEV__ flag to browser example.
new webpack.DefinePlugin({
// eslint-disable-next-line no-undef
__DEV__: process.env,
}),
],
},
};