From 3bdf6004ca74dd9eb380aa61cf9e69c47725116a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 1 Aug 2018 17:36:37 +0200 Subject: Start refactoring docs to remove unnecessary configs given more concise TypeDoc JSON --- .../monorepo-scripts/src/utils/publish_utils.ts | 68 ++++++-- packages/react-docs-example/ts/docs.tsx | 25 --- .../react-docs/src/components/documentation.tsx | 44 +++--- .../react-docs/src/components/property_block.tsx | 70 +++++++++ packages/react-docs/src/components/type.tsx | 29 +--- .../react-docs/src/components/type_definition.tsx | 3 - packages/react-docs/src/docs_info.ts | 56 ++----- packages/react-docs/src/index.ts | 10 +- packages/react-docs/src/types.ts | 19 ++- packages/react-docs/src/utils/typedoc_utils.ts | 135 ++++++++-------- .../website/ts/containers/connect_documentation.ts | 30 ---- .../ts/containers/ethereum_types_documentation.ts | 52 ------- .../ts/containers/json_schemas_documentation.ts | 8 - .../ts/containers/order_utils_documentation.ts | 25 --- .../ts/containers/smart_contracts_documentation.ts | 1 - .../ts/containers/sol_compiler_documentation.ts | 9 -- .../website/ts/containers/sol_cov_documentation.ts | 32 ---- .../ts/containers/subproviders_documentation.ts | 47 ------ .../ts/containers/web3_wrapper_documentation.ts | 47 ------ .../ts/containers/zero_ex_js_documentation.ts | 172 --------------------- .../website/ts/pages/documentation/doc_page.tsx | 2 +- packages/website/ts/utils/doc_utils.ts | 4 +- 22 files changed, 263 insertions(+), 625 deletions(-) create mode 100644 packages/react-docs/src/components/property_block.tsx (limited to 'packages') diff --git a/packages/monorepo-scripts/src/utils/publish_utils.ts b/packages/monorepo-scripts/src/utils/publish_utils.ts index ff65c779c..01d44a369 100644 --- a/packages/monorepo-scripts/src/utils/publish_utils.ts +++ b/packages/monorepo-scripts/src/utils/publish_utils.ts @@ -13,6 +13,20 @@ import * as ts from 'typescript'; import { ExportPathToExportedItems } from '../types'; +interface ExportInfo { + exportPathToExportedItems: ExportPathToExportedItems; + exportPathOrder: string[]; +} + +interface ExportNameToTypedocName { + [exportName: string]: string; +} + +interface Metadata { + exportPathToTypedocName: ExportNameToTypedocName; + exportPathOrder: string[]; +} + const publishReleaseAsync = promisify(publishRelease); export async function publishReleaseNotesAsync(updatedPublishPackages: Package[]): Promise { // Git push a tag representing this publish (publish-{commit-hash}) (truncate hash) @@ -107,7 +121,7 @@ function getReleaseNotesForPackage(packageName: string, version: string): string export async function generateAndUploadDocsAsync(packageName: string, isStaging: boolean): Promise { const pathToPackage = `${constants.monorepoRootPath}/packages/${packageName}`; const indexPath = `${pathToPackage}/src/index.ts`; - const exportPathToExportedItems = getExportPathToExportedItems(indexPath); + const { exportPathToExportedItems, exportPathOrder } = getExportPathToExportedItems(indexPath); const monorepoPackages = utils.getPackages(constants.monorepoRootPath); const pkg = _.find(monorepoPackages, monorepoPackage => { @@ -151,7 +165,8 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging: const typeDocSourceIncludes = new Set(); const pathToIndex = `${pathIfExists}/src/index.ts`; - const innerExportPathToExportedItems = getExportPathToExportedItems(pathToIndex); + const exportInfo = getExportPathToExportedItems(pathToIndex); + const innerExportPathToExportedItems = exportInfo.exportPathToExportedItems; _.each(exportedItems, exportName => { _.each(innerExportPathToExportedItems, (innerExportItems, innerExportPath) => { if (!_.includes(innerExportItems, exportName)) { @@ -200,13 +215,18 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging: _.each(typedocOutput.children, (child, i) => { if (!_.includes(child.name, '/src/')) { const nameWithoutQuotes = child.name.replace(/"/g, ''); - finalTypeDocOutput.children[i].name = `"${packageName}/src/${nameWithoutQuotes}"`; + const standardizedName = `"${packageName}/src/${nameWithoutQuotes}"`; + finalTypeDocOutput.children[i].name = standardizedName; } }); // For each entry, see if it was exported in index.ts. If not, remove it. + const exportPathToTypedocName: ExportNameToTypedocName = {}; _.each(typedocOutput.children, (file, i) => { - const exportItems = findExportItemsGivenTypedocName(exportPathToExportedItems, packageName, file.name); + const exportPath = findExportPathGivenTypedocName(exportPathToExportedItems, packageName, file.name); + exportPathToTypedocName[exportPath] = file.name; + + const exportItems = exportPathToExportedItems[exportPath]; _.each(file.children, (child, j) => { if (!_.includes(exportItems, child.name)) { delete finalTypeDocOutput.children[i].children[j]; @@ -214,8 +234,22 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging: }); finalTypeDocOutput.children[i].children = _.compact(finalTypeDocOutput.children[i].children); }); + + // TODO: Add extra metadata for Class properties that are class instances + // Look in file for imports of that class, get the import name and construct a link to + // it's definition on another docs page. + + // Since we need additional metadata included in the doc JSON, we nest the TypeDoc JSON + const docJson = { + metadata: { + exportPathToTypedocName, + exportPathOrder, + }, + typedocJson: finalTypeDocOutput, + }; + // Write modified TypeDoc JSON, without all the unexported stuff - writeFileSync(jsonFilePath, JSON.stringify(finalTypeDocOutput, null, 2)); + writeFileSync(jsonFilePath, JSON.stringify(docJson, null, 2)); const fileName = `v${packageJson.version}.json`; utils.log(`GENERATE_UPLOAD_DOCS: Doc generation successful, uploading docs... as ${fileName}`); @@ -234,11 +268,11 @@ export async function generateAndUploadDocsAsync(packageName: string, isStaging: }); } -function findExportItemsGivenTypedocName( +function findExportPathGivenTypedocName( exportPathToExportedItems: ExportPathToExportedItems, packageName: string, typedocName: string, -): string[] { +): string { const typeDocNameWithoutQuotes = _.replace(typedocName, '"', ''); const sanitizedExportPathToExportPath: { [sanitizedName: string]: string } = {}; const exportPaths = _.keys(exportPathToExportedItems); @@ -264,22 +298,23 @@ function findExportItemsGivenTypedocName( throw new Error(`Didn't find an exportPath for ${typeDocNameWithoutQuotes}`); } const matchingExportPath = sanitizedExportPathToExportPath[matchingSanitizedExportPathIfExists]; - return exportPathToExportedItems[matchingExportPath]; + return matchingExportPath; } -function getExportPathToExportedItems(pkgPath: string): ExportPathToExportedItems { +function getExportPathToExportedItems(filePath: string): ExportInfo { const sourceFile = ts.createSourceFile( 'indexFile', - readFileSync(pkgPath).toString(), + readFileSync(filePath).toString(), ts.ScriptTarget.ES2017, /*setParentNodes */ true, ); - const exportPathToExportedItems = _getExportPathToExportedItems(sourceFile); - return exportPathToExportedItems; + const exportInfo = _getExportPathToExportedItems(sourceFile); + return exportInfo; } -function _getExportPathToExportedItems(sf: ts.SourceFile): ExportPathToExportedItems { +function _getExportPathToExportedItems(sf: ts.SourceFile): ExportInfo { const exportPathToExportedItems: ExportPathToExportedItems = {}; + const exportPathOrder: string[] = []; processNode(sf); function processNode(node: ts.Node): void { @@ -287,6 +322,7 @@ function _getExportPathToExportedItems(sf: ts.SourceFile): ExportPathToExportedI case ts.SyntaxKind.ExportDeclaration: const exportClause = (node as any).exportClause; const pkgName = exportClause.parent.moduleSpecifier.text; + exportPathOrder.push(pkgName); _.each(exportClause.elements, element => { exportPathToExportedItems[pkgName] = _.isUndefined(exportPathToExportedItems[pkgName]) ? [element.name.escapedText] @@ -301,5 +337,9 @@ function _getExportPathToExportedItems(sf: ts.SourceFile): ExportPathToExportedI ts.forEachChild(node, processNode); } - return exportPathToExportedItems; + const exportInfo = { + exportPathToExportedItems, + exportPathOrder, + }; + return exportInfo; } diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx index bb605806f..9ac94bd00 100644 --- a/packages/react-docs-example/ts/docs.tsx +++ b/packages/react-docs-example/ts/docs.tsx @@ -32,33 +32,8 @@ const docsInfoConfig: DocsInfoConfig = { web3Wrapper: [docSections.web3Wrapper], types: [docSections.types], }, - sectionNameToMarkdownByVersion: { - '0.0.1': { - [docSections.introduction]: IntroMarkdownV1, - }, - }, - sectionNameToModulePath: { - [docSections.web3Wrapper]: ['"web3-wrapper/src/index"'], - [docSections.types]: ['"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [docSections.web3Wrapper], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'TxData', - 'TransactionReceipt', - 'RawLogEntry', - 'BlockParam', - 'ContractAbi', - 'FilterObject', - 'LogEntry', - 'BlockWithoutTransactionData', - 'CallData', - 'LogEntryEvent', - ], typeNameToExternalLink: { Web3: 'https://github.com/ethereum/wiki/wiki/JavaScript-API', Provider: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L150', diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx index ff33220d2..4f776b237 100644 --- a/packages/react-docs/src/components/documentation.tsx +++ b/packages/react-docs/src/components/documentation.tsx @@ -1,7 +1,9 @@ import { + AnchorTitle, colors, constants as sharedConstants, EtherscanLinkSuffixes, + HeaderSizes, MarkdownSection, NestedSidebarMenu, Networks, @@ -32,8 +34,7 @@ import { Badge } from './badge'; import { Comment } from './comment'; import { EventDefinition } from './event_definition'; import { SignatureBlock } from './signature_block'; -import { SourceLink } from './source_link'; -import { Type } from './type'; +import { PropertyBlock } from './property_block'; import { TypeDefinition } from './type_definition'; const networkNameToColor: { [network: string]: string } = { @@ -129,7 +130,7 @@ export class Documentation extends React.Component @@ -172,7 +173,7 @@ export class Documentation extends React.Component {docSection.comment && } - {!_.isEmpty(docSection.constructors) && - this.props.docsInfo.isVisibleConstructor(sectionName) && ( -
-

Constructor

- {this._renderConstructors(docSection.constructors, sectionName, typeDefinitionByName)} -
- )} + {!_.isEmpty(docSection.constructors) && ( +
+

Constructor

+ {this._renderConstructors(docSection.constructors, sectionName, typeDefinitionByName)} +
+ )} {!_.isEmpty(docSection.properties) && (

Properties

@@ -345,20 +345,14 @@ export class Documentation extends React.Component - - {property.name}:{' '} - - - {property.source && ( - - )} - {property.comment && } -
+ ); } private _renderSignatureBlocks( diff --git a/packages/react-docs/src/components/property_block.tsx b/packages/react-docs/src/components/property_block.tsx new file mode 100644 index 000000000..6e7f90c6c --- /dev/null +++ b/packages/react-docs/src/components/property_block.tsx @@ -0,0 +1,70 @@ +import { AnchorTitle, HeaderSizes } from '@0xproject/react-shared'; +import * as React from 'react'; + +import { DocsInfo } from '../docs_info'; +import { Property } from '../types'; +import { constants } from '../utils/constants'; + +import { Comment } from './comment'; +import { Type } from './type'; +import { SourceLink } from './source_link'; + +export interface PropertyBlockProps { + property: Property; + sectionName: string; + docsInfo: DocsInfo; + sourceUrl: string; + selectedVersion: string; +} + +export interface PropertyBlockState { + shouldShowAnchor: boolean; +} + +export class PropertyBlock extends React.Component { + constructor(props: PropertyBlockProps) { + super(props); + this.state = { + shouldShowAnchor: false, + }; + } + public render(): React.ReactNode { + const property = this.props.property; + const sectionName = this.props.sectionName; + return ( +
+
+ +
+ + {property.name}:{' '} + + + {property.source && ( + + )} + {property.comment && } +
+ ); + } + private _setAnchorVisibility(shouldShowAnchor: boolean): void { + this.setState({ + shouldShowAnchor, + }); + } +} diff --git a/packages/react-docs/src/components/type.tsx b/packages/react-docs/src/components/type.tsx index 04fcd9998..3504be303 100644 --- a/packages/react-docs/src/components/type.tsx +++ b/packages/react-docs/src/components/type.tsx @@ -9,6 +9,7 @@ import { DocsInfo } from '../docs_info'; import { Type as TypeDef, TypeDefinitionByName, TypeDocTypes } from '../types'; import { Signature } from './signature'; +import { constants } from '../utils/constants'; import { TypeDefinition } from './type_definition'; export interface TypeProps { @@ -43,7 +44,7 @@ export function Type(props: TypeProps): any { - {_.isUndefined(typeDefinition) || sharedUtils.isUserOnMobile() ? ( - - {typeName} - + {sharedUtils.isUserOnMobile() ? ( + {typeName} ) : ( { - const versionIntroducedIfExists = this._docsInfo.menuSubsectionToVersionWhenIntroduced[contractName]; - if (!_.isUndefined(versionIntroducedIfExists)) { - const doesExistInSelectedVersion = compareVersions(selectedVersion, versionIntroducedIfExists) >= 0; - return doesExistInSelectedVersion; - } else { - return true; - } - }); - return finalMenu; + return this._docsInfo.menu; } public getMenuSubsectionsBySection(docAgnosticFormat?: DocAgnosticFormat): MenuSubsectionsBySection { const menuSubsectionsBySection = {} as MenuSubsectionsBySection; @@ -96,12 +67,18 @@ export class DocsInfo { const sortedEventNames = _.sortBy(docSection.events, 'name'); eventNames = _.map(sortedEventNames, m => m.name); } - const sortedMethodNames = _.sortBy(docSection.methods, 'name'); - const methodNames = _.map(sortedMethodNames, m => m.name); - menuSubsectionsBySection[sectionName] = [...methodNames, ...eventNames]; + const propertiesSortedByName = _.sortBy(docSection.properties, 'name'); + const propertyNames = _.map(propertiesSortedByName, m => m.name); + const methodsSortedByName = _.sortBy(docSection.methods, 'name'); + const methodNames = _.map(methodsSortedByName, m => m.name); const sortedFunctionNames = _.sortBy(docSection.functions, 'name'); const functionNames = _.map(sortedFunctionNames, m => m.name); - menuSubsectionsBySection[sectionName] = [...eventNames, ...functionNames, ...methodNames]; + menuSubsectionsBySection[sectionName] = [ + ...eventNames, + ...propertyNames, + ...functionNames, + ...methodNames, + ]; } }); return menuSubsectionsBySection; @@ -115,14 +92,11 @@ export class DocsInfo { const typeDefinitionByName = _.keyBy(typeDocSection.types, 'name') as any; return typeDefinitionByName; } - public isVisibleConstructor(sectionName: string): boolean { - return _.includes(this._docsInfo.visibleConstructors, sectionName); - } - public convertToDocAgnosticFormat(docObj: DoxityDocObj | TypeDocNode): DocAgnosticFormat { + public convertToDocAgnosticFormat(docObj: DoxityDocObj | GeneratedDocJson): DocAgnosticFormat { if (this.type === SupportedDocJson.Doxity) { return doxityUtils.convertToDocAgnosticFormat(docObj as DoxityDocObj); } else { - return typeDocUtils.convertToDocAgnosticFormat(docObj as TypeDocNode, this); + return typeDocUtils.convertToDocAgnosticFormat(docObj as GeneratedDocJson, this); } } } diff --git a/packages/react-docs/src/index.ts b/packages/react-docs/src/index.ts index 30f5011b7..e4424f679 100644 --- a/packages/react-docs/src/index.ts +++ b/packages/react-docs/src/index.ts @@ -15,6 +15,14 @@ export { Type } from './components/type'; export { DocsInfo } from './docs_info'; -export { DocsInfoConfig, DocAgnosticFormat, DoxityDocObj, DocsMenu, SupportedDocJson, TypeDocNode } from './types'; +export { + DocsInfoConfig, + DocAgnosticFormat, + DoxityDocObj, + DocsMenu, + SupportedDocJson, + TypeDocNode, + GeneratedDocJson, +} from './types'; export { constants } from './utils/constants'; diff --git a/packages/react-docs/src/types.ts b/packages/react-docs/src/types.ts index cbc774c2e..83ad157d1 100644 --- a/packages/react-docs/src/types.ts +++ b/packages/react-docs/src/types.ts @@ -10,18 +10,13 @@ export interface DocsInfoConfig { menu: DocsMenu; sections: SectionsMap; sectionNameToMarkdownByVersion: SectionNameToMarkdownByVersion; - visibleConstructors: string[]; - sectionNameToModulePath?: { [sectionName: string]: string[] }; - menuSubsectionToVersionWhenIntroduced?: { [sectionName: string]: string }; contractsByVersionByNetworkId?: ContractsByVersionByNetworkId; typeConfigs?: DocsInfoTypeConfigs; } export interface DocsInfoTypeConfigs { typeNameToExternalLink?: { [typeName: string]: string }; - publicTypes?: string[]; typeNameToPrefix?: { [typeName: string]: string }; - typeNameToDocSection?: { [typeName: string]: string }; } export interface DocsMenu { @@ -292,3 +287,17 @@ export enum AbiTypes { Function = 'function', Event = 'event', } + +export interface ExportNameToTypedocName { + [exportName: string]: string; +} + +export interface Metadata { + exportPathToTypedocName: ExportNameToTypedocName; + exportPathOrder: string[]; +} + +export interface GeneratedDocJson { + metadata: Metadata; + typedocJson: TypeDocNode; +} diff --git a/packages/react-docs/src/utils/typedoc_utils.ts b/packages/react-docs/src/utils/typedoc_utils.ts index a6d938e94..1e7c29ce8 100644 --- a/packages/react-docs/src/utils/typedoc_utils.ts +++ b/packages/react-docs/src/utils/typedoc_utils.ts @@ -19,8 +19,11 @@ import { TypeParameter, TypescriptFunction, TypescriptMethod, + GeneratedDocJson, } from '../types'; +import { constants } from './constants'; + export const typeDocUtils = { isType(entity: TypeDocNode): boolean { return ( @@ -55,62 +58,68 @@ export const typeDocUtils = { }); return moduleDefinitions; }, - convertToDocAgnosticFormat(typeDocJson: TypeDocNode, docsInfo: DocsInfo): DocAgnosticFormat { - const subMenus = _.values(docsInfo.getMenu()); - const orderedSectionNames = _.flatten(subMenus); + convertToDocAgnosticFormat(generatedDocJson: GeneratedDocJson, docsInfo: DocsInfo): DocAgnosticFormat { + const exportPathOrder = generatedDocJson.metadata.exportPathOrder; + const exportPathToTypedocName = generatedDocJson.metadata.exportPathToTypedocName; + const typeDocJson = generatedDocJson.typedocJson; + + const typeDocNameOrder = _.map(exportPathOrder, exportPath => { + return exportPathToTypedocName[exportPath]; + }); + const docAgnosticFormat: DocAgnosticFormat = {}; - _.each(orderedSectionNames, sectionName => { - const modulePathsIfExists = docsInfo.getModulePathsIfExists(sectionName); - if (_.isUndefined(modulePathsIfExists)) { - return; // no-op - } - const packageDefinitions = typeDocUtils.getModuleDefinitionsBySectionName(typeDocJson, modulePathsIfExists); - let packageDefinitionWithMergedChildren; - if (_.isEmpty(packageDefinitions)) { - return; // no-op - } else if (packageDefinitions.length === 1) { - packageDefinitionWithMergedChildren = packageDefinitions[0]; - } else { - // HACK: For now, if there are two modules to display in a single section, - // we simply concat the children. This works for our limited use-case where - // we want to display types stored in two files under a single section - packageDefinitionWithMergedChildren = packageDefinitions[0]; - for (let i = 1; i < packageDefinitions.length; i++) { - packageDefinitionWithMergedChildren.children = [ - ...packageDefinitionWithMergedChildren.children, - ...packageDefinitions[i].children, - ]; + const typeEntities: TypeDocNode[] = []; + _.each(typeDocNameOrder, typeDocName => { + const fileChildIndex = _.findIndex(typeDocJson.children, child => child.name === typeDocName); + const fileChild = typeDocJson.children[fileChildIndex]; + let sectionName: string; + _.each(fileChild.children, (child, j) => { + switch (child.kindString) { + case KindString.Class: + case KindString.ObjectLiteral: { + sectionName = child.name; + docsInfo.sections[sectionName] = sectionName; + docsInfo.menu[sectionName] = [sectionName]; + const entities = child.children; + const commentObj = child.comment; + const sectionComment = !_.isUndefined(commentObj) ? commentObj.shortText : ''; + const docSection = typeDocUtils._convertEntitiesToDocSection(entities, docsInfo, sectionName); + docSection.comment = sectionComment; + docAgnosticFormat[sectionName] = docSection; + break; + } + case KindString.Function: { + sectionName = child.name; + docsInfo.sections[sectionName] = sectionName; + docsInfo.menu[sectionName] = [sectionName]; + const entities = [child]; + const commentObj = child.comment; + const SectionComment = !_.isUndefined(commentObj) ? commentObj.shortText : ''; + const docSection = typeDocUtils._convertEntitiesToDocSection(entities, docsInfo, sectionName); + docSection.comment = SectionComment; + docAgnosticFormat[sectionName] = docSection; + break; + } + case KindString.Interface: + case KindString.Variable: + case KindString.Enumeration: + case KindString.TypeAlias: + typeEntities.push(child); + break; + default: + throw errorUtils.spawnSwitchErr('kindString', child.kindString); } - } - - let entities; - let packageComment = ''; - // HACK: We assume 1 exported class per file - const classChildren = _.filter(packageDefinitionWithMergedChildren.children, (child: TypeDocNode) => { - return child.kindString === KindString.Class; }); - 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; - const isObjectLiteralExport = - packageDefinitionWithMergedChildren.children[0].kindString === KindString.ObjectLiteral; - if (isClassExport) { - entities = packageDefinitionWithMergedChildren.children[0].children; - const commentObj = packageDefinitionWithMergedChildren.children[0].comment; - packageComment = !_.isUndefined(commentObj) ? commentObj.shortText : packageComment; - } else if (isObjectLiteralExport) { - entities = packageDefinitionWithMergedChildren.children[0].children; - const commentObj = packageDefinitionWithMergedChildren.children[0].comment; - packageComment = !_.isUndefined(commentObj) ? commentObj.shortText : packageComment; - } else { - entities = packageDefinitionWithMergedChildren.children; - } - - const docSection = typeDocUtils._convertEntitiesToDocSection(entities, docsInfo, sectionName); - docSection.comment = packageComment; - docAgnosticFormat[sectionName] = docSection; }); + docsInfo.sections[constants.TYPES_SECTION_NAME] = constants.TYPES_SECTION_NAME; + docsInfo.menu[constants.TYPES_SECTION_NAME] = [constants.TYPES_SECTION_NAME]; + const docSection = typeDocUtils._convertEntitiesToDocSection( + typeEntities, + docsInfo, + constants.TYPES_SECTION_NAME, + ); + docAgnosticFormat[constants.TYPES_SECTION_NAME] = docSection; + return docAgnosticFormat; }, _convertEntitiesToDocSection(entities: TypeDocNode[], docsInfo: DocsInfo, sectionName: string): DocSection { @@ -175,18 +184,16 @@ export const typeDocUtils = { case KindString.Variable: case KindString.Enumeration: case KindString.TypeAlias: - if (docsInfo.isPublicType(entity.name)) { - const customType = typeDocUtils._convertCustomType( - entity, - docsInfo.sections, - sectionName, - docsInfo.id, - ); - const seenTypeNames = _.map(docSection.types, t => t.name); - const isUnseen = !_.includes(seenTypeNames, customType.name); - if (isUnseen) { - docSection.types.push(customType); - } + const customType = typeDocUtils._convertCustomType( + entity, + docsInfo.sections, + sectionName, + docsInfo.id, + ); + const seenTypeNames = _.map(docSection.types, t => t.name); + const isUnseen = !_.includes(seenTypeNames, customType.name); + if (isUnseen) { + docSection.types.push(customType); } break; diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts index abf419347..74464e650 100644 --- a/packages/website/ts/containers/connect_documentation.ts +++ b/packages/website/ts/containers/connect_documentation.ts @@ -40,42 +40,12 @@ const docsInfoConfig: DocsInfoConfig = { [connectDocSections.installation]: InstallationMarkdownV1, }, }, - sectionNameToModulePath: { - [connectDocSections.httpClient]: ['"src/http_client"'], - [connectDocSections.webSocketOrderbookChannel]: ['"src/ws_orderbook_channel"'], - [connectDocSections.types]: ['"src/types"', '"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: connectDocSections, - visibleConstructors: [connectDocSections.httpClient, connectDocSections.webSocketOrderbookChannel], typeConfigs: { typeNameToExternalLink: { Provider: constants.URL_WEB3_PROVIDER_DOCS, BigNumber: constants.URL_BIGNUMBERJS_GITHUB, }, - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'Client', - 'FeesRequest', - 'FeesResponse', - 'OrderbookChannel', - 'OrderbookChannelHandler', - 'OrderbookChannelSubscriptionOpts', - 'OrderbookRequest', - 'OrderbookResponse', - 'OrdersRequest', - 'OrdersRequestOpts', - 'PagedRequestOpts', - 'TokenPairsItem', - 'TokenPairsRequest', - 'TokenPairsRequestOpts', - 'TokenTradeInfo', - 'WebSocketOrderbookChannelConfig', - 'Order', - 'SignedOrder', - 'ECSignature', - ], }, }; const docsInfo = new DocsInfo(docsInfoConfig); diff --git a/packages/website/ts/containers/ethereum_types_documentation.ts b/packages/website/ts/containers/ethereum_types_documentation.ts index 0be8dd3bc..041a6bea3 100644 --- a/packages/website/ts/containers/ethereum_types_documentation.ts +++ b/packages/website/ts/containers/ethereum_types_documentation.ts @@ -36,60 +36,8 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.installation]: InstallationMarkdown, }, }, - sectionNameToModulePath: { - [docSections.types]: ['"index"'], - }, - visibleConstructors: [], - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'Provider', - 'JSONRPCErrorCallback', - 'Provider', - 'ContractAbi', - 'AbiDefinition', - 'FunctionAbi', - 'ConstructorStateMutability', - 'StateMutability', - 'MethodAbi', - 'ConstructorAbi', - 'FallbackAbi', - 'EventParameter', - 'EventAbi', - 'DataItem', - 'OpCode', - // 'StructLog', // TODO: This type breaks the docs so we don't render it for now - 'TransactionTrace', - 'Unit', - 'JSONRPCRequestPayload', - 'JSONRPCResponsePayload', - 'BlockWithoutTransactionData', - 'BlockWithTransactionData', - 'Transaction', - 'TxData', - 'CallData', - 'FilterObject', - 'LogTopic', - 'DecodedLogEntry', - 'DecodedLogEntryEvent', - 'LogEntryEvent', - 'LogEntry', - 'TxDataPayable', - 'TransactionReceipt', - 'AbiType', - 'ContractEventArg', - 'DecodedLogArgs', - 'LogWithDecodedArgs', - 'RawLog', - 'BlockParamLiteral', - 'BlockParam', - 'RawLogEntry', - 'SolidityTypes', - 'TransactionReceiptWithDecodedLogs', - ], typeNameToExternalLink: { BigNumber: constants.URL_BIGNUMBERJS_GITHUB, }, diff --git a/packages/website/ts/containers/json_schemas_documentation.ts b/packages/website/ts/containers/json_schemas_documentation.ts index 523777114..3ecc0f312 100644 --- a/packages/website/ts/containers/json_schemas_documentation.ts +++ b/packages/website/ts/containers/json_schemas_documentation.ts @@ -43,16 +43,8 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.usage]: UsageMarkdownV1, }, }, - sectionNameToModulePath: { - [docSections.schemaValidator]: ['"json-schemas/src/schema_validator"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [docSections.schemaValidator], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [], typeNameToExternalLink: { Schema: 'https://github.com/tdegrunt/jsonschema/blob/5c2edd4baba149964aec0f23c87ad12c25a50dfb/lib/index.d.ts#L49', diff --git a/packages/website/ts/containers/order_utils_documentation.ts b/packages/website/ts/containers/order_utils_documentation.ts index c6570f514..29cbf9501 100644 --- a/packages/website/ts/containers/order_utils_documentation.ts +++ b/packages/website/ts/containers/order_utils_documentation.ts @@ -38,33 +38,8 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.installation]: InstallationMarkdownV1, }, }, - sectionNameToModulePath: { - [docSections.usage]: [ - '"order-utils/src/order_hash"', - '"order-utils/src/signature_utils"', - '"order-utils/src/order_factory"', - '"order-utils/src/salt"', - '"order-utils/src/assert"', - '"order-utils/src/constants"', - ], - [docSections.types]: ['"order-utils/src/types"', '"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'OrderError', - 'Order', - 'SignedOrder', - 'ECSignature', - 'Provider', - 'JSONRPCRequestPayload', - 'JSONRPCResponsePayload', - 'JSONRPCErrorCallback', - ], typeNameToExternalLink: { BigNumber: constants.URL_BIGNUMBERJS_GITHUB, }, diff --git a/packages/website/ts/containers/smart_contracts_documentation.ts b/packages/website/ts/containers/smart_contracts_documentation.ts index b0a712477..e3a1bd7a6 100644 --- a/packages/website/ts/containers/smart_contracts_documentation.ts +++ b/packages/website/ts/containers/smart_contracts_documentation.ts @@ -34,7 +34,6 @@ const docsInfoConfig: DocsInfoConfig = { TokenRegistry: Sections.TokenRegistry, ZRXToken: Sections.ZRXToken, }, - visibleConstructors: [Sections.Exchange, Sections.TokenRegistry, Sections.ZRXToken, Sections.TokenTransferProxy], contractsByVersionByNetworkId: { '1.0.0': { [Networks.Mainnet]: { diff --git a/packages/website/ts/containers/sol_compiler_documentation.ts b/packages/website/ts/containers/sol_compiler_documentation.ts index b289c8f34..bd6a85c83 100644 --- a/packages/website/ts/containers/sol_compiler_documentation.ts +++ b/packages/website/ts/containers/sol_compiler_documentation.ts @@ -41,17 +41,8 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.usage]: UsageMarkdown, }, }, - sectionNameToModulePath: { - [docSections.compiler]: ['"sol-compiler/src/compiler"'], - [docSections.types]: ['"sol-compiler/src/utils/types"', '"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [docSections.compiler], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: ['CompilerOptions'], typeNameToExternalLink: {}, typeNameToPrefix: {}, }, diff --git a/packages/website/ts/containers/sol_cov_documentation.ts b/packages/website/ts/containers/sol_cov_documentation.ts index d78c450ed..5567eb97e 100644 --- a/packages/website/ts/containers/sol_cov_documentation.ts +++ b/packages/website/ts/containers/sol_cov_documentation.ts @@ -47,42 +47,10 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.usage]: UsageMarkdown, }, }, - sectionNameToModulePath: { - [docSections.coverageSubprovider]: ['"sol-cov/src/coverage_subprovider"'], - [docSections.abstractArtifactAdapter]: ['"sol-cov/src/artifact_adapters/abstract_artifact_adapter"'], - [docSections.solCompilerArtifactAdapter]: ['"sol-cov/src/artifact_adapters/sol_compiler_artifact_adapter"'], - [docSections.truffleArtifactAdapter]: ['"sol-cov/src/artifact_adapters/truffle_artifact_adapter"'], - [docSections.types]: ['"subproviders/src/types"', '"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [ - docSections.coverageSubprovider, - docSections.abstractArtifactAdapter, - docSections.solCompilerArtifactAdapter, - docSections.truffleArtifactAdapter, - ], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'JSONRPCRequestPayload', - 'NextCallback', - 'ErrorCallback', - 'AbstractArtifactAdapter', - 'CoverageSubprovider', - 'TruffleArtifactAdapter', - 'SolCompilerArtifactAdapter', - 'ContractData', - ], typeNameToExternalLink: {}, typeNameToPrefix: {}, - typeNameToDocSection: { - AbstractArtifactAdapter: docSections.abstractArtifactAdapter, - CoverageSubprovider: docSections.coverageSubprovider, - TruffleArtifactAdapter: docSections.truffleArtifactAdapter, - SolCompilerArtifactAdapter: docSections.solCompilerArtifactAdapter, - }, }, }; const docsInfo = new DocsInfo(docsInfoConfig); diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts index 0e9150d7b..76c71902e 100644 --- a/packages/website/ts/containers/subproviders_documentation.ts +++ b/packages/website/ts/containers/subproviders_documentation.ts @@ -64,55 +64,8 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown, }, }, - sectionNameToModulePath: { - [docSections.subprovider]: ['"subproviders/src/subproviders/subprovider"'], - [docSections.ledgerSubprovider]: ['"subproviders/src/subproviders/ledger"'], - [docSections.privateKeyWalletSubprovider]: ['"subproviders/src/subproviders/private_key_wallet"'], - [docSections.mnemonicWalletSubprovider]: ['"subproviders/src/subproviders/mnemonic_wallet"'], - [docSections.factoryMethods]: ['"subproviders/src/index"'], - [docSections.emptyWalletSubprovider]: ['"subproviders/src/subproviders/empty_wallet_subprovider"'], - [docSections.fakeGasEstimateSubprovider]: ['"subproviders/src/subproviders/fake_gas_estimate_subprovider"'], - [docSections.injectedWeb3Subprovider]: ['"subproviders/src/subproviders/injected_web3"'], - [docSections.signerSubprovider]: ['"subproviders/src/subproviders/signer"'], - [docSections.redundantRPCSubprovider]: ['"subproviders/src/subproviders/redundant_rpc"'], - [docSections.ganacheSubprovider]: ['"subproviders/src/subproviders/ganache"'], - [docSections.nonceTrackerSubprovider]: ['"subproviders/src/subproviders/nonce_tracker"'], - [docSections.types]: ['"sol-compiler/src/utils/types"', '"types/src/index"', '"subproviders/src/types"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [ - docSections.subprovider, - docSections.ledgerSubprovider, - docSections.privateKeyWalletSubprovider, - docSections.mnemonicWalletSubprovider, - docSections.emptyWalletSubprovider, - docSections.fakeGasEstimateSubprovider, - docSections.injectedWeb3Subprovider, - docSections.redundantRPCSubprovider, - docSections.ganacheSubprovider, - docSections.nonceTrackerSubprovider, - ], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'Callback', - 'NextCallback', - 'ErrorCallback', - 'ECSignature', - 'JSONRPCRequestPayloadWithMethod', - 'JSONRPCRequestPayload', - 'JSONRPCResponsePayload', - 'AccountFetchingConfigs', - 'LedgerEthereumClientFactoryAsync', - 'PartialTxParams', - 'LedgerEthereumClient', - 'LedgerSubproviderConfigs', - 'MnemonicWalletSubproviderConfigs', - 'OnNextCompleted', - 'Provider', - ], typeNameToExternalLink: { Web3: constants.URL_WEB3_DOCS, BigNumber: constants.URL_BIGNUMBERJS_GITHUB, diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts index 8d98d9476..1a4101f5d 100644 --- a/packages/website/ts/containers/web3_wrapper_documentation.ts +++ b/packages/website/ts/containers/web3_wrapper_documentation.ts @@ -38,60 +38,13 @@ const docsInfoConfig: DocsInfoConfig = { [docSections.installation]: InstallationMarkdownV1, }, }, - sectionNameToModulePath: { - [docSections.web3Wrapper]: ['"web3-wrapper/src/web3_wrapper"'], - [docSections.types]: ['"types/src/index"'], - }, - menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, - visibleConstructors: [docSections.web3Wrapper], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( - publicTypes: [ - 'TxData', - 'TransactionReceipt', - 'RawLogEntry', - 'ContractAbi', - 'BlockParam', - 'FilterObject', - 'LogEntry', - 'BlockWithoutTransactionData', - 'CallData', - 'LogEntryEvent', - 'Provider', - 'AbiDefinition', - 'LogTopic', - 'JSONRPCRequestPayload', - 'JSONRPCResponsePayload', - 'BlockParamLiteral', - 'FunctionAbi', - 'EventAbi', - 'JSONRPCErrorCallback', - 'MethodAbi', - 'ConstructorAbi', - 'FallbackAbi', - 'EventParameter', - 'DataItem', - 'StateMutability', - 'Function', - 'Fallback', - 'Constructor', - 'Event', - 'ConstructorStateMutability', - 'TransactionReceiptWithDecodedLogs', - 'DecodedLogArgs', - 'LogWithDecodedArgs', - 'ContractEventArg', - ], typeNameToExternalLink: { Web3: constants.URL_WEB3_DOCS, BigNumber: constants.URL_BIGNUMBERJS_GITHUB, }, typeNameToPrefix: {}, - typeNameToDocSection: { - Web3Wrapper: docSections.web3Wrapper, - }, }, }; const docsInfo = new DocsInfo(docsInfoConfig); diff --git a/packages/website/ts/containers/zero_ex_js_documentation.ts b/packages/website/ts/containers/zero_ex_js_documentation.ts index 6be54595d..3b706f262 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.ts +++ b/packages/website/ts/containers/zero_ex_js_documentation.ts @@ -27,14 +27,6 @@ const zeroExJsDocSections = { async: 'async', errors: 'errors', versioning: 'versioning', - zeroEx: 'zeroEx', - exchange: 'exchange', - token: 'token', - tokenRegistry: 'tokenRegistry', - etherToken: 'etherToken', - proxy: 'proxy', - orderWatcher: 'orderWatcher', - types: docConstants.TYPES_SECTION_NAME, }; const docsInfoConfig: DocsInfoConfig = { @@ -46,16 +38,6 @@ const docsInfoConfig: DocsInfoConfig = { introduction: [zeroExJsDocSections.introduction], install: [zeroExJsDocSections.installation], topics: [zeroExJsDocSections.async, zeroExJsDocSections.errors, zeroExJsDocSections.versioning], - zeroEx: [zeroExJsDocSections.zeroEx], - contracts: [ - zeroExJsDocSections.exchange, - zeroExJsDocSections.token, - zeroExJsDocSections.tokenRegistry, - zeroExJsDocSections.etherToken, - zeroExJsDocSections.proxy, - ], - orderWatcher: [zeroExJsDocSections.orderWatcher], - types: [zeroExJsDocSections.types], }, sectionNameToMarkdownByVersion: { '0.0.1': { @@ -74,166 +56,12 @@ const docsInfoConfig: DocsInfoConfig = { [zeroExJsDocSections.errors]: ErrorsMarkdownV1, }, }, - sectionNameToModulePath: { - [zeroExJsDocSections.zeroEx]: ['"0x.js/src/0x"', '"src/0x"'], - [zeroExJsDocSections.exchange]: [ - '"0x.js/src/contract_wrappers/exchange_wrapper"', - '"src/contract_wrappers/exchange_wrapper"', - '"contract-wrappers/src/contract_wrappers/exchange_wrapper"', - ], - [zeroExJsDocSections.tokenRegistry]: [ - '"0x.js/src/contract_wrappers/token_registry_wrapper"', - '"src/contract_wrappers/token_registry_wrapper"', - '"contract-wrappers/src/contract_wrappers/token_registry_wrapper"', - ], - [zeroExJsDocSections.token]: [ - '"0x.js/src/contract_wrappers/token_wrapper"', - '"src/contract_wrappers/token_wrapper"', - '"contract-wrappers/src/contract_wrappers/token_wrapper"', - ], - [zeroExJsDocSections.etherToken]: [ - '"0x.js/src/contract_wrappers/ether_token_wrapper"', - '"src/contract_wrappers/ether_token_wrapper"', - '"contract-wrappers/src/contract_wrappers/ether_token_wrapper"', - ], - [zeroExJsDocSections.proxy]: [ - '"0x.js/src/contract_wrappers/proxy_wrapper"', - '"0x.js/src/contract_wrappers/token_transfer_proxy_wrapper"', - '"contract-wrappers/src/contract_wrappers/token_transfer_proxy_wrapper"', - ], - [zeroExJsDocSections.orderWatcher]: [ - '"0x.js/src/order_watcher/order_state_watcher"', - '"src/order_watcher/order_state_watcher"', - '"order-watcher/src/order_watcher/order_watcher"', - ], - [zeroExJsDocSections.types]: [ - '"0x.js/src/types"', - '"src/types"', - '"types/src/index"', - '"contract-wrappers/src/types"', - '"0x.js/src/contract_wrappers/generated/ether_token"', - '"0x.js/src/contract_wrappers/generated/token"', - '"0x.js/src/contract_wrappers/generated/exchange"', - '"0x.js/src/generated_contract_wrappers/ether_token"', - '"0x.js/src/generated_contract_wrappers/token"', - '"0x.js/src/generated_contract_wrappers/exchange"', - ], - }, - menuSubsectionToVersionWhenIntroduced: { - [zeroExJsDocSections.etherToken]: '0.7.1', - [zeroExJsDocSections.proxy]: '0.8.0', - [zeroExJsDocSections.orderWatcher]: '0.27.1', - }, sections: zeroExJsDocSections, - visibleConstructors: [zeroExJsDocSections.zeroEx], typeConfigs: { - // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is - // currently no way to extract the re-exported types from index.ts via TypeDoc :( Make sure to only - // ADD types here, DO NOT REMOVE types since they might still be needed for older supported versions - publicTypes: [ - 'Order', - 'SignedOrder', - 'ECSignature', - 'ContractWrappersError', - 'EventCallback', - 'EventCallbackAsync', - 'EventCallbackSync', - 'ExchangeContractErrs', - 'ContractEvent', - 'Token', - 'Provider', - 'ExchangeEvents', - 'IndexedFilterValues', - 'SubscriptionOpts', - 'BlockRange', - 'BlockParam', - 'OrderFillOrKillRequest', - 'OrderCancellationRequest', - 'OrderFillRequest', - 'ContractEventEmitter', - 'Web3Provider', - 'ContractEventArgs', - 'LogCancelArgs', - 'LogFillArgs', - 'LogErrorContractEventArgs', - 'LogFillContractEventArgs', - 'LogCancelContractEventArgs', - 'EtherTokenContractEventArgs', - 'WithdrawalContractEventArgs', - 'DepositContractEventArgs', - 'TokenEvents', - 'ExchangeContractEventArgs', - 'TransferContractEventArgs', - 'ApprovalContractEventArgs', - 'TokenContractEventArgs', - 'ZeroExConfig', - 'TransactionReceipt', - 'TransactionReceiptWithDecodedLogs', - 'LogWithDecodedArgs', - 'EtherTokenEvents', - 'BlockParamLiteral', - 'DecodedLogArgs', - 'MethodOpts', - 'ValidateOrderFillableOpts', - 'OrderTransactionOpts', - 'TransactionOpts', - 'ContractEventArg', - 'LogEvent', - 'DecodedLogEvent', - 'EventWatcherCallback', - 'OnOrderStateChangeCallback', - 'OrderStateValid', - 'OrderStateInvalid', - 'OrderState', - 'OrderStateWatcherConfig', - 'OrderWatcherConfig', - 'FilterObject', - 'OrderRelevantState', - 'JSONRPCRequestPayload', - 'JSONRPCResponsePayload', - 'JSONRPCErrorCallback', - 'LogEntryEvent', - 'LogEntry', - 'ERC20AssetData', - 'ERC721AssetData', - 'AssetProxyId', - 'WETH9Events', - 'WETH9WithdrawalEventArgs', - 'WETH9ApprovalEventArgs', - 'WETH9EventArgs', - 'WETH9DepositEventArgs', - 'WETH9TransferEventArgs', - 'ERC20TokenTransferEventArgs', - 'ERC20TokenApprovalEventArgs', - 'ERC20TokenEvents', - 'ERC20TokenEventArgs', - 'ERC721TokenApprovalEventArgs', - 'ERC721TokenApprovalForAllEventArgs', - 'ERC721TokenTransferEventArgs', - 'ERC721TokenEvents', - 'ExchangeCancelUpToEventArgs', - 'ExchangeAssetProxyRegisteredEventArgs', - 'ExchangeFillEventArgs', - 'ExchangeCancelEventArgs', - 'ExchangeEventArgs', - 'ContractWrappersConfig', - 'MessagePrefixType', - 'MessagePrefixOpts', - 'OrderInfo', - ], typeNameToPrefix: {}, typeNameToExternalLink: { BigNumber: constants.URL_BIGNUMBERJS_GITHUB, }, - typeNameToDocSection: { - ExchangeWrapper: 'exchange', - TokenWrapper: 'token', - TokenRegistryWrapper: 'tokenRegistry', - EtherTokenWrapper: 'etherToken', - ProxyWrapper: 'proxy', - TokenTransferProxyWrapper: 'proxy', - OrderStateWatcher: 'orderWatcher', - }, }, }; const docsInfo = new DocsInfo(docsInfoConfig); diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx index 8159bbd49..6e11dead9 100644 --- a/packages/website/ts/pages/documentation/doc_page.tsx +++ b/packages/website/ts/pages/documentation/doc_page.tsx @@ -84,7 +84,7 @@ export class DocPage extends React.Component { location={this.props.location} docsVersion={this.props.docsVersion} availableDocVersions={this.props.availableDocVersions} - menu={this.props.docsInfo.getMenu(this.props.docsVersion)} + menu={this.props.docsInfo.menu} menuSubsectionsBySection={menuSubsectionsBySection} docsInfo={this.props.docsInfo} translate={this.props.translate} diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts index b9084bba7..e313648bd 100644 --- a/packages/website/ts/utils/doc_utils.ts +++ b/packages/website/ts/utils/doc_utils.ts @@ -1,4 +1,4 @@ -import { DoxityDocObj, TypeDocNode } from '@0xproject/react-docs'; +import { DoxityDocObj, GeneratedDocJson } from '@0xproject/react-docs'; import { fetchAsync, logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import { S3FileObject, VersionToFilePath } from 'ts/types'; @@ -70,7 +70,7 @@ export const docUtils = { }); return versionFilePaths; }, - async getJSONDocFileAsync(filePath: string, s3DocJsonRoot: string): Promise { + async getJSONDocFileAsync(filePath: string, s3DocJsonRoot: string): Promise { const endpoint = `${s3DocJsonRoot}/${filePath}`; const response = await fetchAsync(endpoint); if (response.status !== 200) { -- cgit v1.2.3