From 7d9c6eafbfd8434c92737a0e9edf8e610984ac90 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 16:53:13 +0900 Subject: Add support for nested methods within type declarations. Make sure they render without a callPath. --- packages/react-docs/src/components/interface.tsx | 3 +-- packages/react-docs/src/components/type.tsx | 1 - packages/react-docs/src/utils/typedoc_utils.ts | 10 +++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'packages/react-docs') diff --git a/packages/react-docs/src/components/interface.tsx b/packages/react-docs/src/components/interface.tsx index 541e164e3..bdfdf47c4 100644 --- a/packages/react-docs/src/components/interface.tsx +++ b/packages/react-docs/src/components/interface.tsx @@ -19,7 +19,7 @@ export function Interface(props: InterfaceProps) { return ( {property.name}:{' '} - {property.type.typeDocType !== TypeDocTypes.Reflection ? ( + {property.type && property.type.typeDocType !== TypeDocTypes.Reflection ? ( ) : ( { - const childTypeIfExists = !_.isUndefined(child.type) + let childTypeIfExists = !_.isUndefined(child.type) ? typeDocUtils._convertType(child.type, sections, sectionName, docId) : undefined; + if (child.kindString === KindString.Method) { + childTypeIfExists = { + name: child.name, + typeDocType: TypeDocTypes.Reflection, + method: this._convertMethod(child, isConstructor, sections, sectionName, docId), + }; + } const c: CustomTypeChild = { name: child.name, type: childTypeIfExists, -- cgit v1.2.3 From 1e13e927d022ff9b5eb4297430e13c2a79fa4508 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 17:36:01 +0900 Subject: Add missing space in property declaration --- packages/react-docs/src/components/documentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/react-docs') diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index 14fe175cf..800892dc8 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -337,7 +337,7 @@ export class Documentation extends React.Component - {property.name}: + {property.name}:{' '} {property.source && ( -- cgit v1.2.3 From bce97c2543d8f1f4fef3e65086d25ed37977b361 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 17:39:30 +0900 Subject: Add support for displaying default param values --- packages/react-docs/src/components/signature.tsx | 2 ++ packages/react-docs/src/types.ts | 1 + packages/react-docs/src/utils/typedoc_utils.ts | 1 + 3 files changed, 4 insertions(+) (limited to 'packages/react-docs') diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx index 83fb1e246..1d3c90261 100644 --- a/packages/react-docs/src/components/signature.tsx +++ b/packages/react-docs/src/components/signature.tsx @@ -91,6 +91,7 @@ function renderParameters( ) { const params = _.map(parameters, (p: Parameter) => { const isOptional = p.isOptional; + const hasDefaultValue = !_.isUndefined(p.defaultValue); const type = ( {p.name} {isOptional && '?'}: {type} + {hasDefaultValue && ` = ${p.defaultValue}`} ); }); diff --git a/packages/react-docs/src/types.ts b/packages/react-docs/src/types.ts index 2a300c164..3b4a57ad5 100644 --- a/packages/react-docs/src/types.ts +++ b/packages/react-docs/src/types.ts @@ -140,6 +140,7 @@ export interface Parameter { comment: string; isOptional: boolean; type: Type; + defaultValue?: string; } export interface TypeParameter { diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts index e9035def0..9c89b135a 100644 --- a/packages/react-docs/src/utils/typedoc_utils.ts +++ b/packages/react-docs/src/utils/typedoc_utils.ts @@ -395,6 +395,7 @@ export const typeDocUtils = { name: entity.name, comment, isOptional, + defaultValue: entity.defaultValue, type, }; return parameter; -- cgit v1.2.3 From 40f4dd91e95386c0d292c49dce335b2943039468 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 18:33:01 +0900 Subject: Update CHANGELOG --- packages/react-docs/CHANGELOG.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'packages/react-docs') diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 0a85bb32d..2c06e5c1c 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,4 +1,17 @@ [ + { + "version": "0.0.7", + "changes": [ + { + "note": "Added support for rendering default param values", + "pr": 519 + }, + { + "note": "Added support for rendering nested function types within interface types", + "pr": 519 + } + ] + }, { "timestamp": 1522673609, "version": "0.0.6", -- cgit v1.2.3 From 631e7e9c58c5bacd080ceb971d2708c81e932502 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 11 Apr 2018 18:00:39 +0200 Subject: Updated CHANGELOGS --- packages/react-docs/CHANGELOG.json | 9 +++++++++ packages/react-docs/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/react-docs') diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json index 0a85bb32d..d8655277a 100644 --- a/packages/react-docs/CHANGELOG.json +++ b/packages/react-docs/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1523462196, + "version": "0.0.7", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1522673609, "version": "0.0.6", diff --git a/packages/react-docs/CHANGELOG.md b/packages/react-docs/CHANGELOG.md index 3bb01feff..bb531f8b3 100644 --- a/packages/react-docs/CHANGELOG.md +++ b/packages/react-docs/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v0.0.7 - _April 11, 2018_ + + * Dependencies updated + ## v0.0.6 - _April 2, 2018_ * Dependencies updated -- cgit v1.2.3 From e8d4f6d5322930cf8618abcb9fea7c773a87ecd7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 11 Apr 2018 18:00:46 +0200 Subject: Publish - 0x.js@0.36.0 - @0xproject/abi-gen@0.2.10 - @0xproject/assert@0.2.6 - @0xproject/base-contract@0.2.0 - @0xproject/connect@0.6.9 - contracts@2.1.22 - @0xproject/deployer@0.4.0 - @0xproject/dev-utils@0.3.5 - @0xproject/json-schemas@0.7.20 - @0xproject/metacoin@0.0.3 - @0xproject/monorepo-scripts@0.1.17 - @0xproject/react-docs-example@0.0.7 - @0xproject/react-docs@0.0.7 - @0xproject/react-shared@0.1.2 - @0xproject/sol-cov@0.0.7 - @0xproject/sra-report@0.0.8 - @0xproject/subproviders@0.8.5 - @0xproject/testnet-faucets@1.0.23 - @0xproject/tslint-config@0.4.15 - @0xproject/types@0.6.0 - @0xproject/typescript-typings@0.1.0 - @0xproject/utils@0.5.1 - @0xproject/web3-wrapper@0.6.0 - @0xproject/website@0.0.25 --- packages/react-docs/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/react-docs') diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index 12f438f53..f2af1cb64 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/react-docs", - "version": "0.0.6", + "version": "0.0.7", "description": "React documentation component for rendering TypeDoc & Doxity generated JSON", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -22,17 +22,17 @@ "url": "https://github.com/0xProject/0x-monorepo.git" }, "devDependencies": { - "@0xproject/dev-utils": "^0.3.4", - "@0xproject/monorepo-scripts": "^0.1.16", - "@0xproject/tslint-config": "^0.4.14", + "@0xproject/dev-utils": "^0.3.5", + "@0xproject/monorepo-scripts": "^0.1.17", + "@0xproject/tslint-config": "^0.4.15", "copyfiles": "^1.2.0", "shx": "^0.2.2", "tslint": "^5.9.1", "typescript": "2.7.1" }, "dependencies": { - "@0xproject/react-shared": "^0.1.1", - "@0xproject/utils": "^0.5.0", + "@0xproject/react-shared": "^0.1.2", + "@0xproject/utils": "^0.5.1", "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", -- cgit v1.2.3