aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-docs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/react-docs')
-rw-r--r--packages/react-docs/CHANGELOG.json22
-rw-r--r--packages/react-docs/CHANGELOG.md4
-rw-r--r--packages/react-docs/package.json12
-rw-r--r--packages/react-docs/src/components/documentation.tsx2
-rw-r--r--packages/react-docs/src/components/interface.tsx3
-rw-r--r--packages/react-docs/src/components/signature.tsx2
-rw-r--r--packages/react-docs/src/components/type.tsx1
-rw-r--r--packages/react-docs/src/types.ts1
-rw-r--r--packages/react-docs/src/utils/typedoc_utils.ts11
9 files changed, 47 insertions, 11 deletions
diff --git a/packages/react-docs/CHANGELOG.json b/packages/react-docs/CHANGELOG.json
index 0a85bb32d..951ed84e0 100644
--- a/packages/react-docs/CHANGELOG.json
+++ b/packages/react-docs/CHANGELOG.json
@@ -1,5 +1,27 @@
[
{
+ "version": "0.0.8",
+ "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": 1523462196,
+ "version": "0.0.7",
+ "changes": [
+ {
+ "note": "Dependencies updated"
+ }
+ ]
+ },
+ {
"timestamp": 1522673609,
"version": "0.0.6",
"changes": [
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
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",
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<DocumentationProps, Documenta
return (
<div key={`property-${property.name}-${property.type.name}`} className="pb3">
<code className={`hljs ${constants.TYPE_TO_SYNTAX[this.props.docsInfo.type]}`}>
- {property.name}:
+ {property.name}:{' '}
<Type type={property.type} sectionName={sectionName} docsInfo={this.props.docsInfo} />
</code>
{property.source && (
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 (
<span key={`property-${property.name}-${property.type}-${type.name}`}>
{property.name}:{' '}
- {property.type.typeDocType !== TypeDocTypes.Reflection ? (
+ {property.type && property.type.typeDocType !== TypeDocTypes.Reflection ? (
<Type type={property.type} sectionName={props.sectionName} docsInfo={props.docsInfo} />
) : (
<Signature
@@ -27,7 +27,6 @@ export function Interface(props: InterfaceProps) {
returnType={property.type.method.returnType}
parameters={property.type.method.parameters}
typeParameter={property.type.method.typeParameter}
- callPath={property.type.method.callPath}
sectionName={props.sectionName}
shouldHideMethodName={true}
shouldUseArrowSyntax={true}
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 = (
<Type
type={p.type}
@@ -103,6 +104,7 @@ function renderParameters(
<span key={`param-${p.type}-${p.name}`}>
{p.name}
{isOptional && '?'}: {type}
+ {hasDefaultValue && ` = ${p.defaultValue}`}
</span>
);
});
diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx
index fd4562ce3..2b7b49672 100644
--- a/packages/react-docs/src/components/type.tsx
+++ b/packages/react-docs/src/components/type.tsx
@@ -109,7 +109,6 @@ export function Type(props: TypeProps): any {
returnType={type.method.returnType}
parameters={type.method.parameters}
typeParameter={type.method.typeParameter}
- callPath={type.method.callPath}
sectionName={props.sectionName}
shouldHideMethodName={true}
shouldUseArrowSyntax={true}
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 02f5b4049..9c89b135a 100644
--- a/packages/react-docs/src/utils/typedoc_utils.ts
+++ b/packages/react-docs/src/utils/typedoc_utils.ts
@@ -14,6 +14,7 @@ import {
Type,
TypeDocNode,
TypeDocType,
+ TypeDocTypes,
TypeParameter,
TypescriptFunction,
TypescriptMethod,
@@ -221,9 +222,16 @@ export const typeDocUtils = {
const childrenIfExist = !_.isUndefined(entity.children)
? _.map(entity.children, (child: TypeDocNode) => {
- 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,
@@ -387,6 +395,7 @@ export const typeDocUtils = {
name: entity.name,
comment,
isOptional,
+ defaultValue: entity.defaultValue,
type,
};
return parameter;