aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs/src/utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-23 04:03:42 +0800
committerFabio Berger <me@fabioberger.com>2018-03-23 04:03:42 +0800
commit170e5589f95e33298212ec708ee538a711dcd133 (patch)
tree0d08e12b93824dc2a7ab617830f0a2b58546c4fa /packages/react-docs/src/utils
parent538914aa523115c7be5ac8c03cc9f5afc262ead3 (diff)
downloaddexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.gz
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.bz2
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.lz
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.xz
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.zst
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.zip
Fix 0x.js docs to include types from generated contract wrappers
Diffstat (limited to 'packages/react-docs/src/utils')
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts
index 21f2dcabb..02f5b4049 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -88,7 +88,7 @@ export const typeDocUtils = {
const classChildren = _.filter(packageDefinitionWithMergedChildren.children, (child: TypeDocNode) => {
return child.kindString === KindString.Class;
});
- if (classChildren.length > 1) {
+ if (classChildren.length > 1 && sectionName !== 'types') {
throw new Error('`react-docs` only supports projects with 1 exported class per file');
}
const isClassExport = packageDefinitionWithMergedChildren.children[0].kindString === KindString.Class;
@@ -183,6 +183,12 @@ export const typeDocUtils = {
}
break;
+ case KindString.Class:
+ // We currently do not support more then a single class per file
+ // except for the types section, where we ignore classes since we
+ // only want to render type definitions.
+ break;
+
default:
throw utils.spawnSwitchErr('kindString', entity.kindString);
}