From e1ea65525f9328891c131468ab08538a74014a1e Mon Sep 17 00:00:00 2001 From: fabioberger Date: Sat, 16 Nov 2019 08:09:56 +0000 Subject: [PATCH] Add doc generation to several more packages and fix up their index.ts files so all public interface types are exported --- contracts/asset-proxy/package.json | 6 +- contracts/asset-proxy/src/index.ts | 62 +++++++++++++- contracts/asset-proxy/typedoc-tsconfig.json | 7 ++ contracts/coordinator/package.json | 6 +- contracts/coordinator/src/index.ts | 40 +++++++++- contracts/coordinator/typedoc-tsconfig.json | 7 ++ contracts/dev-utils/package.json | 6 +- contracts/dev-utils/src/index.ts | 32 +++++++- contracts/dev-utils/typedoc-tsconfig.json | 7 ++ contracts/erc1155/package.json | 6 +- contracts/erc1155/src/index.ts | 46 ++++++++++- contracts/erc1155/typedoc-tsconfig.json | 7 ++ contracts/erc20/package.json | 6 +- contracts/erc20/src/index.ts | 44 +++++++++- contracts/erc20/typedoc-tsconfig.json | 7 ++ contracts/erc721/package.json | 6 +- contracts/erc721/src/index.ts | 37 ++++++++- contracts/erc721/typedoc-tsconfig.json | 7 ++ contracts/exchange-forwarder/package.json | 6 +- contracts/exchange-forwarder/src/index.ts | 32 +++++++- .../exchange-forwarder/typedoc-tsconfig.json | 7 ++ contracts/exchange-libs/package.json | 6 +- contracts/exchange-libs/src/index.ts | 40 +++++++++- contracts/exchange/package.json | 6 +- contracts/exchange/src/index.ts | 67 +++++++++++++++- contracts/exchange/typedoc-tsconfig.json | 7 ++ contracts/extensions/package.json | 6 +- contracts/extensions/src/index.ts | 32 +++++++- contracts/extensions/src/wrappers.ts | 3 - contracts/extensions/typedoc-tsconfig.json | 7 ++ contracts/integrations/src/index.ts | 2 +- .../test/framework/balances/types.ts | 8 +- contracts/multisig/src/index.ts | 2 +- contracts/staking/package.json | 6 +- contracts/staking/src/index.ts | 80 ++++++++++++++++--- contracts/staking/typedoc-tsconfig.json | 7 ++ contracts/tests/src/index.ts | 2 +- contracts/utils/src/index.ts | 2 +- package.json | 2 +- .../test-cli/test_typescript/src/index.ts | 2 +- packages/dev-utils/package.json | 9 ++- packages/dev-utils/src/index.ts | 60 +++++++++++++- packages/orderbook/package.json | 6 +- packages/orderbook/src/index.ts | 6 ++ packages/orderbook/typedoc-tsconfig.json | 7 ++ 45 files changed, 701 insertions(+), 58 deletions(-) create mode 100644 contracts/asset-proxy/typedoc-tsconfig.json create mode 100644 contracts/coordinator/typedoc-tsconfig.json create mode 100644 contracts/dev-utils/typedoc-tsconfig.json create mode 100644 contracts/erc1155/typedoc-tsconfig.json create mode 100644 contracts/erc20/typedoc-tsconfig.json create mode 100644 contracts/erc721/typedoc-tsconfig.json create mode 100644 contracts/exchange-forwarder/typedoc-tsconfig.json create mode 100644 contracts/exchange/typedoc-tsconfig.json create mode 100644 contracts/extensions/typedoc-tsconfig.json create mode 100644 contracts/staking/typedoc-tsconfig.json create mode 100644 packages/orderbook/typedoc-tsconfig.json diff --git a/contracts/asset-proxy/package.json b/contracts/asset-proxy/package.json index c252175762..d7b808e293 100644 --- a/contracts/asset-proxy/package.json +++ b/contracts/asset-proxy/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "ERC1155Proxy,ERC20Proxy,ERC721Proxy,MultiAssetProxy,StaticCallProxy,ERC20BridgeProxy,Eth2DaiBridge,IAssetData,IAssetProxy,UniswapBridge,TestStaticCallTarget", @@ -58,6 +60,8 @@ "@0x/sol-compiler": "^3.2.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", "@0x/types": "^2.5.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/asset-proxy/src/index.ts b/contracts/asset-proxy/src/index.ts index c09b5adde2..03cb1951c3 100644 --- a/contracts/asset-proxy/src/index.ts +++ b/contracts/asset-proxy/src/index.ts @@ -1,6 +1,64 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { + ERC1155ProxyContract, + ERC20BridgeProxyContract, + ERC20ProxyContract, + ERC721ProxyContract, + Eth2DaiBridgeContract, + IAssetDataContract, + IAssetProxyContract, + MultiAssetProxyContract, + StaticCallProxyContract, + TestStaticCallTargetContract, + UniswapBridgeContract, +} from './wrappers'; export { ERC20Wrapper } from './erc20_wrapper'; export { ERC721Wrapper } from './erc721_wrapper'; export { ERC1155ProxyWrapper } from './erc1155_proxy_wrapper'; +export { Erc1155Wrapper, ERC1155MintableContract } from '@0x/contracts-erc1155'; +export { DummyERC20TokenContract } from '@0x/contracts-erc20'; +export { DummyERC721TokenContract } from '@0x/contracts-erc721'; +export { + ERC1155HoldingsByOwner, + ERC20BalancesByOwner, + ERC721TokenIdsByOwner, + ERC1155FungibleHoldingsByOwner, + ERC1155NonFungibleHoldingsByOwner, +} from '@0x/contracts-test-utils'; +export { + TransactionReceiptWithDecodedLogs, + Provider, + ZeroExProvider, + JSONRPCRequestPayload, + JSONRPCErrorCallback, + TransactionReceiptStatus, + JSONRPCResponsePayload, + JSONRPCResponseError, + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/asset-proxy/typedoc-tsconfig.json b/contracts/asset-proxy/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/asset-proxy/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/coordinator/package.json b/contracts/coordinator/package.json index f38e9bfd05..218eafd3a1 100644 --- a/contracts/coordinator/package.json +++ b/contracts/coordinator/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "Coordinator,CoordinatorRegistry,LibCoordinatorApproval,LibCoordinatorRichErrors,LibEIP712CoordinatorDomain,LibConstants", @@ -62,6 +64,8 @@ "@0x/sol-compiler": "^3.2.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/coordinator/src/index.ts b/contracts/coordinator/src/index.ts index afa6f1d0c6..e104091c78 100644 --- a/contracts/coordinator/src/index.ts +++ b/contracts/coordinator/src/index.ts @@ -1,5 +1,41 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { + CoordinatorContract, + CoordinatorRegistryContract, + LibConstantsContract, + LibCoordinatorApprovalContract, + LibCoordinatorRichErrorsContract, + LibEIP712CoordinatorDomainContract, +} from './wrappers'; export import CoordinatorRevertErrors = require('./revert_errors'); export { ApprovalFactory } from './approval_factory'; export { SignedCoordinatorApproval } from './types'; +export { SignatureType, SignedZeroExTransaction, EIP712DomainWithDefaultSchema } from '@0x/types'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/coordinator/typedoc-tsconfig.json b/contracts/coordinator/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/coordinator/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/dev-utils/package.json b/contracts/dev-utils/package.json index faf09aac3b..1386326161 100644 --- a/contracts/dev-utils/package.json +++ b/contracts/dev-utils/package.json @@ -22,7 +22,9 @@ "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", "quantify_bytecode": "echo EVM bytecode object lengths:;for i in ./test/generated-artifacts/*.json; do node -e \"console.log('$i\t' + (require('$i').compilerOutput.evm.bytecode.object.length - 2) / 2)\"; done", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "DevUtils,LibAssetData,LibTransactionDecoder", @@ -44,6 +46,8 @@ "@0x/contracts-gen": "^1.1.0-beta.2", "@0x/sol-compiler": "^3.2.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/node": "*", "ethers": "~4.0.4", "npm-run-all": "^4.1.2", diff --git a/contracts/dev-utils/src/index.ts b/contracts/dev-utils/src/index.ts index d55f08ea2d..51c47928b1 100644 --- a/contracts/dev-utils/src/index.ts +++ b/contracts/dev-utils/src/index.ts @@ -1,2 +1,30 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { DevUtilsContract, LibAssetDataContract, LibTransactionDecoderContract } from './wrappers'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/dev-utils/typedoc-tsconfig.json b/contracts/dev-utils/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/dev-utils/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/erc1155/package.json b/contracts/erc1155/package.json index a21e6672c8..21bae4856e 100644 --- a/contracts/erc1155/package.json +++ b/contracts/erc1155/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "ERC1155,ERC1155Mintable,IERC1155Receiver,DummyERC1155Receiver", @@ -57,6 +59,8 @@ "@0x/sol-compiler": "^3.2.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", "@0x/types": "^2.5.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/erc1155/src/index.ts b/contracts/erc1155/src/index.ts index 9b5503a9b4..724d7805ac 100644 --- a/contracts/erc1155/src/index.ts +++ b/contracts/erc1155/src/index.ts @@ -1,3 +1,45 @@ -export * from './wrappers'; -export * from './artifacts'; +export { + DummyERC1155ReceiverContract, + ERC1155Contract, + ERC1155MintableContract, + IERC1155ReceiverContract, + DummyERC1155ReceiverBatchTokenReceivedEventArgs, + ERC1155TransferSingleEventArgs, +} from './wrappers'; +export { artifacts } from './artifacts'; export { Erc1155Wrapper } from './erc1155_wrapper'; +export { + Provider, + TransactionReceiptWithDecodedLogs, + JSONRPCRequestPayload, + JSONRPCResponsePayload, + JSONRPCResponseError, + JSONRPCErrorCallback, + TransactionReceiptStatus, + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/erc1155/typedoc-tsconfig.json b/contracts/erc1155/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/erc1155/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/erc20/package.json b/contracts/erc20/package.json index 2cf4874e59..733a3b7bb4 100644 --- a/contracts/erc20/package.json +++ b/contracts/erc20/package.json @@ -32,7 +32,9 @@ "test:circleci": "yarn test", "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", - "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "DummyERC20Token,ERC20Token,WETH9,ZRXToken,DummyNoReturnERC20Token,DummyMultipleReturnERC20Token", @@ -58,6 +60,8 @@ "@0x/tslint-config": "^3.1.0-beta.2", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/erc20/src/index.ts b/contracts/erc20/src/index.ts index 91dd7e0e3e..24874ce905 100644 --- a/contracts/erc20/src/index.ts +++ b/contracts/erc20/src/index.ts @@ -1,2 +1,42 @@ -export * from './wrappers'; -export * from './artifacts'; +export { + DummyERC20TokenContract, + DummyMultipleReturnERC20TokenContract, + DummyNoReturnERC20TokenContract, + WETH9Contract, + ZRXTokenContract, + DummyERC20TokenTransferEventArgs, + ERC20TokenEventArgs, + ERC20TokenEvents, + ERC20TokenTransferEventArgs, + ERC20TokenApprovalEventArgs, + ERC20TokenContract, +} from './wrappers'; +export { artifacts } from './artifacts'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/erc20/typedoc-tsconfig.json b/contracts/erc20/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/erc20/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/erc721/package.json b/contracts/erc721/package.json index 1ef04cea8a..763cb44d54 100644 --- a/contracts/erc721/package.json +++ b/contracts/erc721/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "DummyERC721Token,ERC721Token,IERC721Receiver,DummyERC721Receiver", @@ -60,6 +62,8 @@ "@0x/types": "^2.5.0-beta.2", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/erc721/src/index.ts b/contracts/erc721/src/index.ts index 91dd7e0e3e..47507e4420 100644 --- a/contracts/erc721/src/index.ts +++ b/contracts/erc721/src/index.ts @@ -1,2 +1,35 @@ -export * from './wrappers'; -export * from './artifacts'; +export { + DummyERC721ReceiverContract, + DummyERC721TokenContract, + ERC721TokenContract, + IERC721ReceiverContract, +} from './wrappers'; +export { artifacts } from './artifacts'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/erc721/typedoc-tsconfig.json b/contracts/erc721/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/erc721/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/exchange-forwarder/package.json b/contracts/exchange-forwarder/package.json index 44f42630bb..b15d866684 100644 --- a/contracts/exchange-forwarder/package.json +++ b/contracts/exchange-forwarder/package.json @@ -32,7 +32,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "Forwarder", @@ -66,6 +68,8 @@ "@0x/types": "^2.5.0-beta.2", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/exchange-forwarder/src/index.ts b/contracts/exchange-forwarder/src/index.ts index 573031ae1b..af6bcb28b2 100644 --- a/contracts/exchange-forwarder/src/index.ts +++ b/contracts/exchange-forwarder/src/index.ts @@ -1,3 +1,31 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { ForwarderContract } from './wrappers'; export import ForwarderRevertErrors = require('./revert_errors'); +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/exchange-forwarder/typedoc-tsconfig.json b/contracts/exchange-forwarder/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/exchange-forwarder/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/exchange-libs/package.json b/contracts/exchange-libs/package.json index 3f5328e472..9b794b6722 100644 --- a/contracts/exchange-libs/package.json +++ b/contracts/exchange-libs/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "IWallet,LibEIP712ExchangeDomain,LibExchangeRichErrors,LibMath,LibMathRichErrors,LibOrder,LibZeroExTransaction", @@ -58,6 +60,8 @@ "@0x/subproviders": "^5.1.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/exchange-libs/src/index.ts b/contracts/exchange-libs/src/index.ts index 44b3dd4d82..029a1c093e 100644 --- a/contracts/exchange-libs/src/index.ts +++ b/contracts/exchange-libs/src/index.ts @@ -1,6 +1,42 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { + IWalletContract, + LibEIP712ExchangeDomainContract, + LibExchangeRichErrorsContract, + LibMathContract, + LibMathRichErrorsContract, + LibOrderContract, + LibZeroExTransactionContract, +} from './wrappers'; export import LibMathRevertErrors = require('./lib_math_revert_errors'); import * as ReferenceFunctionsToExport from './reference_functions'; export import ReferenceFunctions = ReferenceFunctionsToExport; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/exchange/package.json b/contracts/exchange/package.json index b6fce6b248..6e6cb4a0f5 100644 --- a/contracts/exchange/package.json +++ b/contracts/exchange/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "Exchange,IExchange", @@ -62,6 +64,8 @@ "@0x/sol-compiler": "^3.2.0-beta.2", "@0x/tslint-config": "^3.1.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/exchange/src/index.ts b/contracts/exchange/src/index.ts index d3b1d4e71c..f1ffa38690 100644 --- a/contracts/exchange/src/index.ts +++ b/contracts/exchange/src/index.ts @@ -1,4 +1,67 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { + IExchangeContract, + IExchangeEvents, + IExchangeFillEventArgs, + ExchangeEventArgs, + ExchangeEvents, + ExchangeSignatureValidatorApprovalEventArgs, + ExchangeFillEventArgs, + ExchangeCancelEventArgs, + ExchangeCancelUpToEventArgs, + ExchangeAssetProxyRegisteredEventArgs, + ExchangeContract, + ExchangeProtocolFeeCollectorAddressEventArgs, + ExchangeProtocolFeeMultiplierEventArgs, + ExchangeTransactionExecutionEventArgs, +} from './wrappers'; export import ExchangeRevertErrors = require('./revert_errors'); export { exchangeDataEncoder } from './exchange_data_encoder'; +export { + TokenOwnersByName, + TokenContractsByName, + TokenIds, + ERC1155TokenIds, + ERC721TokenIds, + TokenData, + Named, +} from './balance_stores/types'; +export { SignedOrder } from '@0x/types'; +export { + Numberish, + TokenBalances, + ExchangeFunctionName, + ERC1155Holdings, + ERC20BalancesByOwner, + ERC721TokenIdsByOwner, + EthBalancesByOwner, +} from '@0x/contracts-test-utils'; +export { DevUtilsContract } from '@0x/contracts-dev-utils'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/exchange/typedoc-tsconfig.json b/contracts/exchange/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/exchange/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 7739c94a85..18ab377f92 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -33,7 +33,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "DutchAuction,OrderMatcher,BalanceThresholdFilter", @@ -67,6 +69,8 @@ "@0x/types": "^2.5.0-beta.2", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "@types/node": "*", diff --git a/contracts/extensions/src/index.ts b/contracts/extensions/src/index.ts index d55f08ea2d..2e5b9b2140 100644 --- a/contracts/extensions/src/index.ts +++ b/contracts/extensions/src/index.ts @@ -1,2 +1,30 @@ -export * from './artifacts'; -export * from './wrappers'; +export { artifacts } from './artifacts'; +export { BalanceThresholdFilterContract, DutchAuctionContract, OrderMatcherContract } from './wrappers'; +export { + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/extensions/src/wrappers.ts b/contracts/extensions/src/wrappers.ts index 26ae645ceb..db081bf3e5 100644 --- a/contracts/extensions/src/wrappers.ts +++ b/contracts/extensions/src/wrappers.ts @@ -5,7 +5,4 @@ */ export * from '../generated-wrappers/balance_threshold_filter'; export * from '../generated-wrappers/dutch_auction'; -export * from '../generated-wrappers/exchange'; -export * from '../generated-wrappers/exchange_wrapper'; export * from '../generated-wrappers/order_matcher'; -export * from '../generated-wrappers/weth9'; diff --git a/contracts/extensions/typedoc-tsconfig.json b/contracts/extensions/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/extensions/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/integrations/src/index.ts b/contracts/integrations/src/index.ts index d55f08ea2d..cb85aa0d18 100644 --- a/contracts/integrations/src/index.ts +++ b/contracts/integrations/src/index.ts @@ -1,2 +1,2 @@ -export * from './artifacts'; +export { artifacts } from './artifacts'; export * from './wrappers'; diff --git a/contracts/integrations/test/framework/balances/types.ts b/contracts/integrations/test/framework/balances/types.ts index 75789b614b..d9b1d449b0 100644 --- a/contracts/integrations/test/framework/balances/types.ts +++ b/contracts/integrations/test/framework/balances/types.ts @@ -6,7 +6,7 @@ import { BigNumber } from '@0x/utils'; // alias for clarity type address = string; -interface TokenData { +export interface TokenData { erc20: TERC20; erc721: TERC721; erc1155: TERC1155; @@ -20,7 +20,7 @@ export type TokenContracts = TokenData< ERC1155MintableContract[] >; -interface Named { +export interface Named { [readableName: string]: T; } @@ -34,11 +34,11 @@ export type TokenContractsByName = TokenData< Named >; -interface ERC721TokenIds { +export interface ERC721TokenIds { [tokenAddress: string]: BigNumber[]; } -interface ERC1155TokenIds { +export interface ERC1155TokenIds { [tokenAddress: string]: { fungible: BigNumber[]; nonFungible: BigNumber[]; diff --git a/contracts/multisig/src/index.ts b/contracts/multisig/src/index.ts index d55f08ea2d..cb85aa0d18 100644 --- a/contracts/multisig/src/index.ts +++ b/contracts/multisig/src/index.ts @@ -1,2 +1,2 @@ -export * from './artifacts'; +export { artifacts } from './artifacts'; export * from './wrappers'; diff --git a/contracts/staking/package.json b/contracts/staking/package.json index 25eec2bdab..d8529df29a 100644 --- a/contracts/staking/package.json +++ b/contracts/staking/package.json @@ -34,7 +34,9 @@ "contracts:gen": "contracts-gen generate", "contracts:copy": "contracts-gen copy", "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol", - "compile:truffle": "truffle compile" + "compile:truffle": "truffle compile", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "publicInterfaceContracts": "IStaking,IStakingEvents,IStakingProxy,IZrxVault,LibStakingRichErrors,Staking,StakingProxy,ZrxVault,TestStaking", @@ -64,6 +66,8 @@ "@0x/tslint-config": "^3.1.0-beta.2", "@0x/types": "^2.5.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/lodash": "4.14.104", "@types/node": "*", "chai": "^4.0.1", diff --git a/contracts/staking/src/index.ts b/contracts/staking/src/index.ts index 50939c7de4..cb25f19ce5 100644 --- a/contracts/staking/src/index.ts +++ b/contracts/staking/src/index.ts @@ -1,13 +1,75 @@ -export * from './wrappers'; -export * from './artifacts'; +export { + IStakingContract, + IStakingEventsContract, + IStakingProxyContract, + IZrxVaultContract, + LibStakingRichErrorsContract, + TestStakingContract, + ZrxVaultContract, + StakingAuthorizedAddressAddedEventArgs, + StakingAuthorizedAddressRemovedEventArgs, + StakingContract, + StakingEpochEndedEventArgs, + StakingEpochFinalizedEventArgs, + StakingEventArgs, + StakingEvents, + StakingExchangeAddedEventArgs, + StakingExchangeRemovedEventArgs, + StakingMakerStakingPoolSetEventArgs, + StakingMoveStakeEventArgs, + StakingOperatorShareDecreasedEventArgs, + StakingOwnershipTransferredEventArgs, + StakingParamsSetEventArgs, + StakingRewardsPaidEventArgs, + StakingStakeEventArgs, + StakingStakingPoolCreatedEventArgs, + StakingStakingPoolEarnedRewardsInEpochEventArgs, + StakingUnstakeEventArgs, + StakingProxyAuthorizedAddressAddedEventArgs, + StakingProxyAuthorizedAddressRemovedEventArgs, + StakingProxyContract, + StakingProxyEventArgs, + StakingProxyEvents, + StakingProxyOwnershipTransferredEventArgs, + StakingProxyStakingContractAttachedToProxyEventArgs, + StakingProxyStakingContractDetachedFromProxyEventArgs, + IStakingEventsStakingPoolEarnedRewardsInEpochEventArgs, + TestStakingEvents, + IStakingEventsEpochEndedEventArgs, + IStakingEventsEpochFinalizedEventArgs, + IStakingEventsEvents, + IStakingEventsRewardsPaidEventArgs, +} from './wrappers'; +export { artifacts } from './artifacts'; export import FixedMathRevertErrors = require('./fixed_math_revert_errors'); export import StakingRevertErrors = require('./staking_revert_errors'); export { constants } from './constants'; +export { StakeInfo, StakeStatus, StoredBalance } from './types'; export { - GlobalStakeByStatus, - OwnerStakeByStatus, - StakeInfo, - StakingPoolById, - StakeStatus, - StoredBalance, -} from './types'; + ContractArtifact, + ContractChains, + CompilerOpts, + StandardContractOutput, + CompilerSettings, + ContractChainData, + ContractAbi, + DevdocOutput, + EvmOutput, + CompilerSettingsMetadata, + OptimizerSettings, + OutputField, + ParamDescription, + EvmBytecodeOutput, + AbiDefinition, + FunctionAbi, + EventAbi, + RevertErrorAbi, + EventParameter, + DataItem, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + StateMutability, +} from 'ethereum-types'; diff --git a/contracts/staking/typedoc-tsconfig.json b/contracts/staking/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/contracts/staking/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} diff --git a/contracts/tests/src/index.ts b/contracts/tests/src/index.ts index 01206c99a9..4daeed8d51 100644 --- a/contracts/tests/src/index.ts +++ b/contracts/tests/src/index.ts @@ -1 +1 @@ -export * from './artifacts'; +export { artifacts } from './artifacts'; diff --git a/contracts/utils/src/index.ts b/contracts/utils/src/index.ts index 4f155f1863..c5f5bb8b4e 100644 --- a/contracts/utils/src/index.ts +++ b/contracts/utils/src/index.ts @@ -1,4 +1,4 @@ -export * from './artifacts'; +export { artifacts } from './artifacts'; export * from './wrappers'; import * as ReferenceFunctionsToExport from './reference_functions'; diff --git a/package.json b/package.json index f10ca3d81b..62bd804b4c 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "config": { "contractsPackages": "@0x/contracts-asset-proxy @0x/contracts-dev-utils @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-integrations @0x/contracts-multisig @0x/contracts-staking @0x/contracts-test-utils @0x/contracts-utils @0x/contracts-coordinator @0x/contracts-tests", "mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic", - "packagesWithDocPages": "contract-wrappers 0x.js connect json-schemas subproviders web3-wrapper order-utils sol-compiler sol-coverage sol-profiler sol-trace ethereum-types asset-swapper migrations", + "packagesWithDocPages": "0x.js @0x/contract-wrappers @0x/connect @0x/json-schemas @0x/subproviders @0x/web3-wrapper @0x/order-utils @0x/sol-compiler @0x/sol-coverage @0x/sol-profiler @0x/sol-trace @0x/dev-utils @0x/asset-swapper @0x/migrations @0x/orderbook @0x/contracts-asset-proxy @0x/contracts-coordinator @0x/contracts-dev-utils @0x/contracts-erc20 @0x/contracts-erc721 @0x/contracts-erc1155 @0x/contracts-exchange @0x/contracts-exchange-forwarder @0x/contracts-exchange-libs @0x/contracts-extensions @0x/contracts-staking", "ignoreDependencyVersions": "@types/styled-components @types/node", "ignoreDependencyVersionsForPackage": "instant contract-wrappers" }, diff --git a/packages/abi-gen/test-cli/test_typescript/src/index.ts b/packages/abi-gen/test-cli/test_typescript/src/index.ts index d55f08ea2d..cb85aa0d18 100644 --- a/packages/abi-gen/test-cli/test_typescript/src/index.ts +++ b/packages/abi-gen/test-cli/test_typescript/src/index.ts @@ -1,2 +1,2 @@ -export * from './artifacts'; +export { artifacts } from './artifacts'; export * from './wrappers'; diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 672351863c..27abc182b9 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -18,7 +18,9 @@ "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "clean": "shx rm -rf lib", "lint": "tslint --format stylish --project .", - "fix": "tslint --format stylish --fix --project ." + "fix": "tslint --format stylish --fix --project .", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "license": "Apache-2.0", "repository": { @@ -31,6 +33,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/dev-utils/README.md", "devDependencies": { "@0x/tslint-config": "^3.1.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", "@types/lodash": "4.14.104", "@types/mocha": "^5.2.7", "make-promises-safe": "^1.1.0", @@ -39,7 +42,8 @@ "nyc": "^11.0.1", "shx": "^0.2.2", "tslint": "5.11.0", - "typescript": "3.0.1" + "typescript": "3.0.1", + "typedoc": "^0.15.0" }, "dependencies": { "@0x/subproviders": "^5.1.0-beta.2", @@ -47,6 +51,7 @@ "@0x/typescript-typings": "^4.4.0-beta.2", "@0x/utils": "^4.6.0-beta.2", "@0x/web3-wrapper": "^6.1.0-beta.2", + "web3-provider-engine": "14.0.6", "@types/web3-provider-engine": "^14.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", diff --git a/packages/dev-utils/src/index.ts b/packages/dev-utils/src/index.ts index d3ef1cfe5f..674f4739ae 100644 --- a/packages/dev-utils/src/index.ts +++ b/packages/dev-utils/src/index.ts @@ -1,7 +1,63 @@ export { BlockchainLifecycle } from './blockchain_lifecycle'; -export { web3Factory } from './web3_factory'; +export { web3Factory, Web3Config } from './web3_factory'; export { constants as devConstants } from './constants'; -export { env, EnvVars } from './env'; +export { env } from './env'; export { callbackErrorReporter } from './callback_error_reporter'; export { chaiSetup } from './chai_setup'; export { tokenUtils } from './token_utils'; +export { Web3Wrapper, NodeType } from '@0x/web3-wrapper'; +export import Web3ProviderEngine = require('web3-provider-engine'); +export { DoneCallback } from '@0x/types'; +export { AbiDecoder, DecodedCalldata } from '@0x/utils'; +export { + SupportedProvider, + CallData, + TransactionReceiptWithDecodedLogs, + BlockParam, + TxData, + BlockWithoutTransactionData, + BlockWithTransactionData, + FilterObject, + LogEntry, + Transaction, + TransactionReceipt, + TraceParams, + TransactionTrace, + JSONRPCRequestPayload, + LogTopic, + DecodedLogEntry, + LogEntryEvent, + TransactionReceiptStatus, + StructLog, + TxDataPayable, + BlockParamLiteral, + Web3JsProvider, + GanacheProvider, + EIP1193Provider, + ZeroExProvider, + AbiDefinition, + DecodedLogArgs, + LogWithDecodedArgs, + RawLog, + ContractEventArg, + DecodedLogEntryEvent, + EIP1193Event, + JSONRPCErrorCallback, + OpCode, + FunctionAbi, + EventAbi, + RevertErrorAbi, + Web3JsV1Provider, + Web3JsV2Provider, + Web3JsV3Provider, + EventParameter, + DataItem, + JSONRPCResponsePayload, + MethodAbi, + ConstructorAbi, + FallbackAbi, + ConstructorStateMutability, + TupleDataItem, + JSONRPCResponseError, + StateMutability, +} from 'ethereum-types'; diff --git a/packages/orderbook/package.json b/packages/orderbook/package.json index 18930da844..bbf6838e13 100644 --- a/packages/orderbook/package.json +++ b/packages/orderbook/package.json @@ -24,13 +24,17 @@ "watch": "tsc -w -p tsconfig.json", "prettier": "prettier --write 'src/**/*.ts' --config .prettierrc", "test:circleci": "yarn test:coverage", - "lint": "tslint --project . --format stylish" + "lint": "tslint --project . --format stylish", + "docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json", + "docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "author": "Jacob Evans", "license": "Apache-2.0", "devDependencies": { "@0x/tslint-config": "^3.1.0-beta.2", "@0x/types": "^2.5.0-beta.2", + "@0x/ts-doc-gen": "^0.0.22", + "typedoc": "^0.15.0", "@types/jest": "^24.0.17", "@types/sinon": "^2.2.2", "@types/websocket": "^0.0.39", diff --git a/packages/orderbook/src/index.ts b/packages/orderbook/src/index.ts index 665773365a..b4d77caa0d 100644 --- a/packages/orderbook/src/index.ts +++ b/packages/orderbook/src/index.ts @@ -13,5 +13,11 @@ export { AddedRemovedOrders, RejectedOrder, } from './types'; +export { + SignedOrder, + AssetPairsItem, + APIOrder, + Asset, +} from '@0x/types'; export { WSOpts } from '@0x/mesh-rpc-client'; diff --git a/packages/orderbook/typedoc-tsconfig.json b/packages/orderbook/typedoc-tsconfig.json new file mode 100644 index 0000000000..c9b0af1ae6 --- /dev/null +++ b/packages/orderbook/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +}