Skip to content

Commit dbeda13

Browse files
authored
Fix docs (#1024)
* Fix docs * change docs:build script * Fix docs:build script * dont include docs building in CI build due to issues
1 parent 800483c commit dbeda13

File tree

6 files changed

+31
-24
lines changed

6 files changed

+31
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"log": "react-native log-ios | grep 'ethan -'",
3434
"docs:install": "(cd ./uilib-docs && rm -rf node_modules && rm -rf package-lock.json && npm install)",
3535
"docs:deploy": "(cd ./uilib-docs && gatsby build --prefix-paths && gh-pages -d public --branch gh-pages)",
36-
"docs:build": "(cd ./uilib-docs && gatsby build --prefix-paths)",
36+
"docs:build": "(cd ./uilib-docs && npm install && gatsby build --prefix-paths && gh-pages -d public --branch gh-pages)",
3737
"docs:develop": "(cd ./uilib-docs && gatsby develop)",
3838
"bump:patch": "npm version patch",
3939
"demo": "./scripts/demo.sh",

src/.babelrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": ["@babel/preset-typescript" /* , "@babel/preset-react" */],
3-
"plugins": ["babel-plugin-typescript-to-proptypes"],
3+
"plugins": [["babel-plugin-typescript-to-proptypes", {"comments": true}]],
44
"compact": false,
55
"minified": false
66
}

uilib-docs/configurations/plugins.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const componentsDocgenPlugin = [
2929
{
3030
resolve: 'gatsby-source-filesystem',
3131
options: {
32-
path: `${__dirname}/../../src/components/`
32+
path: `${__dirname}/../../src/components/`,
33+
ignore: ['**/\*.tsx']
3334
}
3435
}
3536
];
@@ -39,7 +40,8 @@ const incubatorComponentsDocgenPlugin = [
3940
{
4041
resolve: 'gatsby-source-filesystem',
4142
options: {
42-
path: `${__dirname}/../../src/incubator/`
43+
path: `${__dirname}/../../src/incubator/`,
44+
ignore: ['**/\*.tsx']
4345
}
4446
}
4547
];
@@ -49,7 +51,8 @@ const nativeComponentsDocgenPlugin = [
4951
{
5052
resolve: 'gatsby-source-filesystem',
5153
options: {
52-
path: `${__dirname}/../../lib/components/`
54+
path: `${__dirname}/../../lib/components/`,
55+
ignore: ['**/\*.tsx']
5356
}
5457
}
5558
];

uilib-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Kyle Mathews <[email protected]>",
77
"dependencies": {
88
"classnames": "^2.2.6",
9-
"gatsby": "2.23.22-static-query-template.8",
9+
"gatsby": "^2.0.0",
1010
"gatsby-image": "^2.0.34",
1111
"gatsby-plugin-layout": "^1.3.10",
1212
"gatsby-plugin-manifest": "^2.0.24",

uilib-docs/src/components/navbar/index.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,35 @@ class Navbar extends Component {
2424
getCurrentPage = () => {
2525
if (typeof window !== 'undefined') {
2626
const path = window.location.href;
27-
return _.chain(path)
28-
.split('/')
29-
.filter(item => !_.isEmpty(item))
30-
.last()
31-
.value();
27+
28+
return _.flow(
29+
p => _.split(p, '/'),
30+
items => _.filter(items, i => !_.isEmpty(i)),
31+
_.last,
32+
)(path);
3233
}
3334
};
3435

3536
getMarkdownPages(data) {
3637
const markdownPages = data.allFile.edges;
37-
const pages = _.chain(markdownPages)
38-
.map(({node}) => node.childMarkdownRemark.frontmatter)
39-
.sortBy('index')
40-
.value();
38+
const pages = _.flow(pages =>
39+
_.map(
40+
pages,
41+
({node}) => node.childMarkdownRemark.frontmatter,
42+
items => _.sortBy(items, 'index')
43+
)
44+
)(markdownPages);
4145

4246
return pages;
4347
}
4448

4549
getNavbarComponents(data) {
4650
const components = data.allComponentMetadata.edges;
47-
const filteredComponents = _.chain(components)
48-
.filter(component => component.node.displayName !== 'IGNORE')
49-
.uniqBy('node.displayName')
50-
.sortBy('node.displayName')
51-
.value();
51+
const filteredComponents = _.flow(
52+
components => _.filter(components, component => component.node.displayName !== 'IGNORE'),
53+
components => _.uniqBy(components, 'node.displayName'),
54+
components => _.sortBy(components, 'node.displayName')
55+
)(components);
5256

5357
return filteredComponents;
5458
}

uilib-docs/src/templates/component.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export default class ComponentTemplate extends Component {
4040
const {pageContext} = this.props;
4141
const allComponents = pageContext.components;
4242

43-
const extendedComponents = _.chain(componentInfo.extends)
44-
.replace(/ /g, '')
45-
.split(',')
46-
.value();
43+
const extendedComponents = _.flow(
44+
text => _.replace(text, / /g, ''),
45+
text => _.split(text, ',')
46+
)(componentInfo.extends);
4747

4848
return _.map(extendedComponents, (component, index) => {
4949
const isLast = index === _.size(extendedComponents) - 1;

0 commit comments

Comments
 (0)