aboutsummaryrefslogtreecommitdiffstats
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
parent538914aa523115c7be5ac8c03cc9f5afc262ead3 (diff)
downloaddexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.gz
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.tar.zst
dexon-sol-tools-170e5589f95e33298212ec708ee538a711dcd133.zip
Fix 0x.js docs to include types from generated contract wrappers
-rw-r--r--packages/0x.js/package.json2
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts8
-rw-r--r--packages/website/ts/containers/zero_ex_js_documentation.ts9
3 files changed, 16 insertions, 3 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json
index 77f360cd3..5f5b32aac 100644
--- a/packages/0x.js/package.json
+++ b/packages/0x.js/package.json
@@ -39,7 +39,7 @@
"packages/0x.js/_bundles/index.min.js"
],
"docPublishConfigs": {
- "extraFileIncludes": ["../types/src/index.ts"],
+ "extraFileIncludes": ["../types/src/index.ts", "./src/contract_wrappers/generated/ether_token.ts", "./src/contract_wrappers/generated/token.ts", "./src/contract_wrappers/generated/exchange.ts"],
"s3BucketPath": "s3://doc-jsons/0x.js/",
"s3StagingBucketPath": "s3://staging-doc-jsons/0x.js/"
}
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);
}
diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts
index ec30780c3..3107a2a82 100644
--- a/packages/website/ts/containers/zero_ex_js_documentation.ts
+++ b/packages/website/ts/containers/zero_ex_js_documentation.ts
@@ -90,7 +90,14 @@ const docsInfoConfig: DocsInfoConfig = {
'"0x.js/src/order_watcher/order_state_watcher"',
'"src/order_watcher/order_state_watcher"',
],
- [zeroExJsDocSections.types]: ['"0x.js/src/types"', '"src/types"', '"types/src/index"'],
+ [zeroExJsDocSections.types]: [
+ '"0x.js/src/types"',
+ '"src/types"',
+ '"types/src/index"',
+ '"0x.js/src/contract_wrappers/generated/ether_token"',
+ '"0x.js/src/contract_wrappers/generated/token"',
+ '"0x.js/src/contract_wrappers/generated/exchange"',
+ ],
},
menuSubsectionToVersionWhenIntroduced: {
[zeroExJsDocSections.etherToken]: '0.7.1',