From 02ede26893d5801c827f68d4ffb24c216b873a09 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 16:22:42 +0100 Subject: Rename onDeployCommand to onDeployCommandAsync and onCompileCommand to onCompileCommandAsync --- packages/deployer/src/cli.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts index 7913c6344..b131a96d8 100644 --- a/packages/deployer/src/cli.ts +++ b/packages/deployer/src/cli.ts @@ -24,7 +24,7 @@ const DEFAULT_CONTRACTS_LIST = '*'; * Compiles all contracts with options passed in through CLI. * @param argv Instance of process.argv provided by yargs. */ -async function onCompileCommand(argv: CliOptions): Promise { +async function onCompileCommandAsync(argv: CliOptions): Promise { const opts: CompilerOptions = { contractsDir: argv.contractsDir, networkId: argv.networkId, @@ -38,7 +38,7 @@ async function onCompileCommand(argv: CliOptions): Promise { * Deploys a single contract with provided name and args. * @param argv Instance of process.argv provided by yargs. */ -async function onDeployCommand(argv: CliOptions): Promise { +async function onDeployCommandAsync(argv: CliOptions): Promise { const url = argv.jsonrpcUrl; const web3Provider = new Web3.providers.HttpProvider(url); const web3Wrapper = new Web3Wrapper(web3Provider); @@ -142,7 +142,12 @@ function deployCommandBuilder(yargsInstance: any) { default: DEFAULT_CONTRACTS_LIST, description: 'comma separated list of contracts to compile', }) - .command('compile', 'compile contracts', identityCommandBuilder, onCompileCommand) - .command('deploy', 'deploy a single contract with provided arguments', deployCommandBuilder, onDeployCommand) + .command('compile', 'compile contracts', identityCommandBuilder, onCompileCommandAsync) + .command( + 'deploy', + 'deploy a single contract with provided arguments', + deployCommandBuilder, + onDeployCommandAsync, + ) .help().argv; })(); -- cgit v1.2.3 From 3c36135d6c9c4b4deb1985bd71ba6f4002d16d0e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 16:29:55 +0100 Subject: Stop printing help on error --- packages/deployer/src/cli.ts | 5 +++-- packages/deployer/src/utils/error_reporter.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 packages/deployer/src/utils/error_reporter.ts diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts index b131a96d8..176eaf973 100644 --- a/packages/deployer/src/cli.ts +++ b/packages/deployer/src/cli.ts @@ -10,6 +10,7 @@ import * as yargs from 'yargs'; import { commands } from './commands'; import { constants } from './utils/constants'; +import { consoleReporter } from './utils/error_reporter'; import { CliOptions, CompilerOptions, DeployerOptions } from './utils/types'; const DEFAULT_OPTIMIZER_ENABLED = false; @@ -142,12 +143,12 @@ function deployCommandBuilder(yargsInstance: any) { default: DEFAULT_CONTRACTS_LIST, description: 'comma separated list of contracts to compile', }) - .command('compile', 'compile contracts', identityCommandBuilder, onCompileCommandAsync) + .command('compile', 'compile contracts', identityCommandBuilder, consoleReporter(onCompileCommandAsync)) .command( 'deploy', 'deploy a single contract with provided arguments', deployCommandBuilder, - onDeployCommandAsync, + consoleReporter(onDeployCommandAsync), ) .help().argv; })(); diff --git a/packages/deployer/src/utils/error_reporter.ts b/packages/deployer/src/utils/error_reporter.ts new file mode 100644 index 000000000..b28e4fbbe --- /dev/null +++ b/packages/deployer/src/utils/error_reporter.ts @@ -0,0 +1,13 @@ +import { logUtils } from '@0xproject/utils'; + +export function consoleReporter(asyncFn: (arg: T) => Promise) { + const noThrowFnAsync = async (arg: T) => { + try { + const result = await asyncFn(arg); + return result; + } catch (err) { + logUtils.log(`${err}`); + } + }; + return noThrowFnAsync; +} -- cgit v1.2.3 From 8fd705d2afe6ddcb53a16973256a0674e180be67 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 16:30:18 +0100 Subject: Throw an error if contract file doesn't contain the contract with the same name --- packages/deployer/src/compiler.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 83977709b..206f333f6 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -228,6 +228,11 @@ export class Compiler { } const contractName = path.basename(fileName, constants.SOLIDITY_FILE_EXTENSION); const contractIdentifier = `${fileName}:${contractName}`; + if (_.isUndefined(compiled.contracts[contractIdentifier])) { + throw new Error( + `Contract ${contractName} not found in ${fileName}. Please make sure your contract has the same name as a file`, + ); + } const abi: Web3.ContractAbi = JSON.parse(compiled.contracts[contractIdentifier].interface); const bytecode = `0x${compiled.contracts[contractIdentifier].bytecode}`; const runtimeBytecode = `0x${compiled.contracts[contractIdentifier].runtimeBytecode}`; -- cgit v1.2.3 From c4b4bb9e8e50af5a21091f4e8f54176ffb337739 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 16:42:36 +0100 Subject: Compile contracts sequentially --- packages/deployer/src/compiler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 206f333f6..4563752f6 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -162,7 +162,9 @@ export class Compiler { _.forEach(fileNames, fileName => { this._setSourceTreeHash(fileName); }); - await Promise.all(_.map(fileNames, async fileName => this._compileContractAsync(fileName))); + for (const fileName of fileNames) { + await this._compileContractAsync(fileName); + } this._solcErrors.forEach(errMsg => { logUtils.log(errMsg); }); -- cgit v1.2.3 From 32feadee424b1ea8d96073d63790f5c5731dd30e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 17:07:57 +0100 Subject: Change version ranges to only support patch version increments --- .../src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol | 2 +- .../multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol | 2 +- .../MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol | 2 +- packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol | 2 +- .../src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol | 2 +- .../current/protocol/TokenTransferProxy/TokenTransferProxy.sol | 2 +- packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol | 2 +- .../src/contracts/current/test/MaliciousToken/MaliciousToken.sol | 2 +- packages/contracts/src/contracts/current/test/Mintable/Mintable.sol | 2 +- .../contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol | 2 +- packages/contracts/src/contracts/current/tokens/Token/Token.sol | 2 +- .../current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol | 2 +- packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol | 2 +- packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol | 2 +- .../contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol | 2 +- .../src/contracts/current/tutorials/EtherDelta/AccountLevels.sol | 2 +- .../contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol | 2 +- packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol | 2 +- packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol | 2 +- packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol | 2 +- packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol | 2 +- packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol | 2 +- packages/contracts/src/contracts/previous/Token/Token_v1.sol | 2 +- .../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol index 79fd92029..56c4d20a9 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.10; +pragma solidity ~0.4.10; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol index a545d9813..791c01af8 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.10; +pragma solidity ~0.4.10; import { MultiSigWallet } from "../MultiSigWallet/MultiSigWallet.sol"; diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol index 3c6a3d2ef..ca2989483 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.10; +pragma solidity ~0.4.10; import { MultiSigWalletWithTimeLock } from "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol index 8dacf797c..b1bf8a260 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.14; +pragma solidity ~0.4.14; import { TokenTransferProxy } from "../TokenTransferProxy/TokenTransferProxy.sol"; import { Token_v1 as Token } from "../../../previous/Token/Token_v1.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol b/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol index 3bd2fbfaf..9ab72f72d 100644 --- a/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol +++ b/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; import { Ownable_v1 as Ownable } from "../../../previous/Ownable/Ownable_v1.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol b/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol index 1ce949fa6..e78d264d4 100644 --- a/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol +++ b/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; import { Token_v1 as Token } from "../../../previous/Token/Token_v1.sol"; import { Ownable_v1 as Ownable } from "../../../previous/Ownable/Ownable_v1.sol"; diff --git a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol b/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol index ab04f4d16..0cd04312d 100644 --- a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol +++ b/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; import { Mintable } from "../Mintable/Mintable.sol"; import { Ownable } from "../../utils/Ownable/Ownable.sol"; diff --git a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol b/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol index 9e502616c..c5d6207e8 100644 --- a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol +++ b/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; import { ERC20Token } from "../../tokens/ERC20Token/ERC20Token.sol"; diff --git a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol index cf7ee35a5..33022cfc6 100644 --- a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol +++ b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; import { UnlimitedAllowanceToken } from "../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol"; import { SafeMath } from "../../utils/SafeMath/SafeMath.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol index 0e5b87aa4..c59ab3e7a 100644 --- a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol +++ b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; import { Token } from "../Token/Token.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/Token/Token.sol b/packages/contracts/src/contracts/current/tokens/Token/Token.sol index bf4e71dcd..6bf83cd51 100644 --- a/packages/contracts/src/contracts/current/tokens/Token/Token.sol +++ b/packages/contracts/src/contracts/current/tokens/Token/Token.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; contract Token { diff --git a/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol b/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol index 699f535d2..569b4f021 100644 --- a/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol +++ b/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; import { ERC20Token } from "../ERC20Token/ERC20Token.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol b/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol index 733ca414b..22df0600c 100644 --- a/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol +++ b/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; contract WETH9 { string public name = "Wrapped Ether"; diff --git a/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol b/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol index 7f5e1f849..b12a6a186 100644 --- a/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol +++ b/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "../../../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol"; diff --git a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol b/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol index a9f3c22e6..1867781fb 100644 --- a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol +++ b/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.19; +pragma solidity ~0.4.19; import { Exchange } from "../../protocol/Exchange/Exchange.sol"; import { EtherDelta } from "../EtherDelta/EtherDelta.sol"; diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol b/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol index 8d7a930d3..17d839eb7 100644 --- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol +++ b/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.19; +pragma solidity ~0.4.19; contract AccountLevels { //given a user, returns an account level diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol b/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol index 49847ab48..fc5e5f9de 100644 --- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol +++ b/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.19; +pragma solidity ~0.4.19; import { SafeMath } from "../../utils/SafeMath/SafeMath.sol"; import { AccountLevels } from "./AccountLevels.sol"; diff --git a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol index 9b3d6b9cf..9416c8f8e 100644 --- a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol +++ b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; /* * Ownable diff --git a/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol b/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol index 955a9e379..c816b3fd1 100644 --- a/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol +++ b/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.18; +pragma solidity ~0.4.18; contract SafeMath { function safeMul(uint a, uint b) diff --git a/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol b/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol index e05ee2d5e..b2a5636ae 100644 --- a/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol +++ b/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; import { Token_v1 as Token } from "../Token/Token_v1.sol"; diff --git a/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol b/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol index c87438fa4..c1b67956e 100644 --- a/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol +++ b/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; /* * Ownable diff --git a/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol b/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol index 341d611ec..ea8f899ef 100644 --- a/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol +++ b/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; contract SafeMath_v1 { function safeMul(uint a, uint b) diff --git a/packages/contracts/src/contracts/previous/Token/Token_v1.sol b/packages/contracts/src/contracts/previous/Token/Token_v1.sol index de619fb7e..5a9c82ded 100644 --- a/packages/contracts/src/contracts/previous/Token/Token_v1.sol +++ b/packages/contracts/src/contracts/previous/Token/Token_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; contract Token_v1 { diff --git a/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol b/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol index 6376f3f2c..ccb4f8d28 100644 --- a/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol +++ b/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol @@ -16,7 +16,7 @@ */ -pragma solidity ^0.4.11; +pragma solidity ~0.4.11; import { ERC20Token_v1 as ERC20Token } from "../ERC20Token/ERC20Token_v1.sol"; -- cgit v1.2.3 From f45191d0e81e3ad3873e78c3891fdd5f9e9fd55c Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 15 Mar 2018 17:08:48 +0100 Subject: Support proper semver version ranges --- packages/deployer/package.json | 2 ++ packages/deployer/src/compiler.ts | 35 ++++++++++++++++++++--------------- packages/deployer/src/utils/types.ts | 2 +- yarn.lock | 4 ++++ 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/packages/deployer/package.json b/packages/deployer/package.json index e6e8dcc4b..3982c0067 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -33,6 +33,7 @@ "@0xproject/monorepo-scripts": "^0.1.14", "@0xproject/tslint-config": "^0.4.12", "@types/require-from-string": "^1.2.0", + "@types/semver": "^5.5.0", "@types/yargs": "^11.0.0", "chai": "^4.0.1", "copyfiles": "^1.2.0", @@ -54,6 +55,7 @@ "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", "require-from-string": "^2.0.1", + "semver": "^5.5.0", "solc": "^0.4.18", "web3": "^0.20.0", "web3-eth-abi": "^1.0.0-beta.24", diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 4563752f6..942777458 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -5,6 +5,7 @@ import 'isomorphic-fetch'; import * as _ from 'lodash'; import * as path from 'path'; import * as requireFromString from 'require-from-string'; +import * as semver from 'semver'; import solc = require('solc'); import * as Web3 from 'web3'; @@ -23,7 +24,7 @@ import { import { utils } from './utils/utils'; const ALL_CONTRACTS_IDENTIFIER = '*'; -const SOLIDITY_VERSION_REGEX = /(?:solidity\s\^?)(\d+\.\d+\.\d+)/; +const SOLIDITY_VERSION_RANGE_REGEX = /pragma solidity (.*);/; const SOLIDITY_FILE_EXTENSION_REGEX = /(.*\.sol)/; const IMPORT_REGEX = /(import\s)/; const DEPENDENCY_PATH_REGEX = /"([^"]+)"/; // Source: https://github.com/BlockChainCompany/soljitsu/blob/master/lib/shared.js @@ -85,10 +86,10 @@ export class Compiler { private static _getContractSpecificSourceData(source: string): ContractSpecificSourceData { const dependencies: string[] = []; const sourceHash = ethUtil.sha3(source); - const solcVersion = Compiler._parseSolidityVersion(source); + const solcVersionRange = Compiler._parseSolidityVersionRange(source); const contractSpecificSourceData: ContractSpecificSourceData = { dependencies, - solcVersion, + solcVersionRange, sourceHash, }; const lines = source.split('\n'); @@ -105,17 +106,17 @@ export class Compiler { return contractSpecificSourceData; } /** - * Searches Solidity source code for compiler version. + * Searches Solidity source code for compiler version range. * @param source Source code of contract. - * @return Solc compiler version. + * @return Solc compiler version range. */ - private static _parseSolidityVersion(source: string): string { - const solcVersionMatch = source.match(SOLIDITY_VERSION_REGEX); - if (_.isNull(solcVersionMatch)) { - throw new Error('Could not find Solidity version in source'); + private static _parseSolidityVersionRange(source: string): string { + const solcVersionRangeMatch = source.match(SOLIDITY_VERSION_RANGE_REGEX); + if (_.isNull(solcVersionRangeMatch)) { + throw new Error('Could not find Solidity version range in source'); } - const solcVersion = solcVersionMatch[1]; - return solcVersion; + const solcVersionRange = solcVersionRangeMatch[1]; + return solcVersionRange; } /** * Normalizes the path found in the error message. @@ -189,8 +190,12 @@ export class Compiler { if (!shouldCompile) { return; } - - const fullSolcVersion = binPaths[contractSpecificSourceData.solcVersion]; + const availableCompilerVersions = _.keys(binPaths); + const solcVersion = semver.maxSatisfying( + availableCompilerVersions, + contractSpecificSourceData.solcVersionRange, + ); + const fullSolcVersion = binPaths[solcVersion]; const compilerBinFilename = path.join(__dirname, '../../solc_bin', fullSolcVersion); let solcjs: string; const isCompilerAvailableLocally = fs.existsSync(compilerBinFilename); @@ -208,7 +213,7 @@ export class Compiler { } const solcInstance = solc.setupMethods(requireFromString(solcjs, compilerBinFilename)); - logUtils.log(`Compiling ${fileName}...`); + logUtils.log(`Compiling ${fileName} with Solidity v${solcVersion}...`); const source = this._contractSources[fileName]; const input = { [fileName]: source, @@ -243,7 +248,7 @@ export class Compiler { const sources = _.keys(compiled.sources); const updated_at = Date.now(); const contractNetworkData: ContractNetworkData = { - solc_version: contractSpecificSourceData.solcVersion, + solc_version: solcVersion, keccak256: sourceHash, source_tree_hash: sourceTreeHash, optimizer_enabled: this._optimizerEnabled, diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index 0068faf6a..f33f8f66a 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -84,7 +84,7 @@ export interface ContractSourceData { export interface ContractSpecificSourceData { dependencies: string[]; - solcVersion: string; + solcVersionRange: string; sourceHash: Buffer; sourceTreeHashIfExists?: Buffer; } diff --git a/yarn.lock b/yarn.lock index ddc3e2bc6..8b0a5a544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -324,6 +324,10 @@ version "1.2.0" resolved "https://registry.yarnpkg.com/@types/require-from-string/-/require-from-string-1.2.0.tgz#c18cfc8a2c1a0259e5841d1fef2b5e9d01c64242" +"@types/semver@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" + "@types/serve-static@*": version "1.13.1" resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.1.tgz#1d2801fa635d274cd97d4ec07e26b21b44127492" -- cgit v1.2.3 From 439e8640859cf790bac51c1beeec4cf65aa33c57 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 16 Mar 2018 11:09:12 +0100 Subject: Change the type of optimizerEnabled to boolean and convert it to number only before passing to a compiler --- packages/deployer/src/cli.ts | 4 ++-- packages/deployer/src/compiler.ts | 4 ++-- packages/deployer/src/utils/types.ts | 4 ++-- packages/deployer/test/util/constants.ts | 2 +- packages/deployer/tsconfig.json | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts index 176eaf973..efbf56bb0 100644 --- a/packages/deployer/src/cli.ts +++ b/packages/deployer/src/cli.ts @@ -29,7 +29,7 @@ async function onCompileCommandAsync(argv: CliOptions): Promise { const opts: CompilerOptions = { contractsDir: argv.contractsDir, networkId: argv.networkId, - optimizerEnabled: argv.shouldOptimize ? 1 : 0, + optimizerEnabled: argv.shouldOptimize, artifactsDir: argv.artifactsDir, specifiedContracts: getContractsSetFromList(argv.contracts), }; @@ -47,7 +47,7 @@ async function onDeployCommandAsync(argv: CliOptions): Promise { const compilerOpts: CompilerOptions = { contractsDir: argv.contractsDir, networkId, - optimizerEnabled: argv.shouldOptimize ? 1 : 0, + optimizerEnabled: argv.shouldOptimize, artifactsDir: argv.artifactsDir, specifiedContracts: getContractsSetFromList(argv.contracts), }; diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 942777458..28232a661 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -32,7 +32,7 @@ const DEPENDENCY_PATH_REGEX = /"([^"]+)"/; // Source: https://github.com/BlockCh export class Compiler { private _contractsDir: string; private _networkId: number; - private _optimizerEnabled: number; + private _optimizerEnabled: boolean; private _artifactsDir: string; private _contractSources?: ContractSources; private _solcErrors: Set = new Set(); @@ -223,7 +223,7 @@ export class Compiler { }; const compiled = solcInstance.compile( sourcesToCompile, - this._optimizerEnabled, + Number(this._optimizerEnabled), this._findImportsIfSourcesExist.bind(this), ); diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index f33f8f66a..13b24b9b7 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -20,7 +20,7 @@ export interface ContractNetworks { export interface ContractNetworkData { solc_version: string; - optimizer_enabled: number; + optimizer_enabled: boolean; keccak256: string; source_tree_hash: string; abi: Web3.ContractAbi; @@ -53,7 +53,7 @@ export interface CliOptions extends yargs.Arguments { export interface CompilerOptions { contractsDir: string; networkId: number; - optimizerEnabled: number; + optimizerEnabled: boolean; artifactsDir: string; specifiedContracts: Set; } diff --git a/packages/deployer/test/util/constants.ts b/packages/deployer/test/util/constants.ts index 7b6960359..7ba94c1f2 100644 --- a/packages/deployer/test/util/constants.ts +++ b/packages/deployer/test/util/constants.ts @@ -3,7 +3,7 @@ import { BigNumber } from '@0xproject/utils'; export const constants = { networkId: 0, jsonrpcUrl: 'http://localhost:8545', - optimizerEnabled: 0, + optimizerEnabled: true, gasPrice: new BigNumber(20000000000), timeoutMs: 20000, zrxTokenAddress: '0xe41d2489571d322189246dafa5ebde1f4699f498', diff --git a/packages/deployer/tsconfig.json b/packages/deployer/tsconfig.json index 897446b66..befcde5b7 100644 --- a/packages/deployer/tsconfig.json +++ b/packages/deployer/tsconfig.json @@ -2,8 +2,7 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "lib", - "strictFunctionTypes": false, - "strictNullChecks": false + "strictFunctionTypes": false }, "include": [ "./src/**/*", -- cgit v1.2.3 From 18b9fe525622d9e18491f76136d7697806996a09 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 16 Mar 2018 15:09:11 +0100 Subject: Enable strictNullChecks --- packages/deployer/src/cli.ts | 4 +- packages/deployer/src/commands.ts | 2 +- packages/deployer/src/compiler.ts | 210 +++++++++----------------------- packages/deployer/src/utils/compiler.ts | 118 ++++++++++++++++++ packages/deployer/src/utils/types.ts | 2 +- packages/deployer/test/deploy_test.ts | 2 +- 6 files changed, 182 insertions(+), 156 deletions(-) create mode 100644 packages/deployer/src/utils/compiler.ts diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts index efbf56bb0..d1bd645b3 100644 --- a/packages/deployer/src/cli.ts +++ b/packages/deployer/src/cli.ts @@ -63,9 +63,9 @@ async function onDeployCommandAsync(argv: CliOptions): Promise { networkId, defaults, }; - const deployerArgsString = argv.args; + const deployerArgsString = argv.args as string; const deployerArgs = deployerArgsString.split(','); - await commands.deployAsync(argv.contract, deployerArgs, deployerOpts); + await commands.deployAsync(argv.contract as string, deployerArgs, deployerOpts); } /** * Creates a set of contracts to compile. diff --git a/packages/deployer/src/commands.ts b/packages/deployer/src/commands.ts index 32af7fc3f..8e544a60b 100644 --- a/packages/deployer/src/commands.ts +++ b/packages/deployer/src/commands.ts @@ -5,7 +5,7 @@ import { CompilerOptions, DeployerOptions } from './utils/types'; export const commands = { async compileAsync(opts: CompilerOptions): Promise { const compiler = new Compiler(opts); - await compiler.compileAllAsync(); + await compiler.compileAsync(); }, async deployAsync(contractName: string, args: any[], opts: DeployerOptions): Promise { const deployer = new Deployer(opts); diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 28232a661..d9571488e 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -10,6 +10,14 @@ import solc = require('solc'); import * as Web3 from 'web3'; import { binPaths } from './solc/bin_paths'; +import { + createArtifactsDirIfDoesNotExistAsync, + findImportIfExist, + getContractArtifactIfExistsAsync, + getNormalizedErrMsg, + parseDependencies, + parseSolidityVersionRange, +} from './utils/compiler'; import { constants } from './utils/constants'; import { fsWrapper } from './utils/fs_wrapper'; import { @@ -24,17 +32,13 @@ import { import { utils } from './utils/utils'; const ALL_CONTRACTS_IDENTIFIER = '*'; -const SOLIDITY_VERSION_RANGE_REGEX = /pragma solidity (.*);/; -const SOLIDITY_FILE_EXTENSION_REGEX = /(.*\.sol)/; -const IMPORT_REGEX = /(import\s)/; -const DEPENDENCY_PATH_REGEX = /"([^"]+)"/; // Source: https://github.com/BlockChainCompany/soljitsu/blob/master/lib/shared.js export class Compiler { private _contractsDir: string; private _networkId: number; private _optimizerEnabled: boolean; private _artifactsDir: string; - private _contractSources?: ContractSources; + private _contractSources!: ContractSources; private _solcErrors: Set = new Set(); private _specifiedContracts: Set = new Set(); private _contractSourceData: ContractSourceData = {}; @@ -78,64 +82,6 @@ export class Compiler { } return sources; } - /** - * Gets contract dependendencies and keccak256 hash from source. - * @param source Source code of contract. - * @return Object with contract dependencies and keccak256 hash of source. - */ - private static _getContractSpecificSourceData(source: string): ContractSpecificSourceData { - const dependencies: string[] = []; - const sourceHash = ethUtil.sha3(source); - const solcVersionRange = Compiler._parseSolidityVersionRange(source); - const contractSpecificSourceData: ContractSpecificSourceData = { - dependencies, - solcVersionRange, - sourceHash, - }; - const lines = source.split('\n'); - _.forEach(lines, line => { - if (!_.isNull(line.match(IMPORT_REGEX))) { - const dependencyMatch = line.match(DEPENDENCY_PATH_REGEX); - if (!_.isNull(dependencyMatch)) { - const dependencyPath = dependencyMatch[1]; - const fileName = path.basename(dependencyPath); - contractSpecificSourceData.dependencies.push(fileName); - } - } - }); - return contractSpecificSourceData; - } - /** - * Searches Solidity source code for compiler version range. - * @param source Source code of contract. - * @return Solc compiler version range. - */ - private static _parseSolidityVersionRange(source: string): string { - const solcVersionRangeMatch = source.match(SOLIDITY_VERSION_RANGE_REGEX); - if (_.isNull(solcVersionRangeMatch)) { - throw new Error('Could not find Solidity version range in source'); - } - const solcVersionRange = solcVersionRangeMatch[1]; - return solcVersionRange; - } - /** - * Normalizes the path found in the error message. - * Example: converts 'base/Token.sol:6:46: Warning: Unused local variable' - * to 'Token.sol:6:46: Warning: Unused local variable' - * This is used to prevent logging the same error multiple times. - * @param errMsg An error message from the compiled output. - * @return The error message with directories truncated from the contract path. - */ - private static _getNormalizedErrMsg(errMsg: string): string { - const errPathMatch = errMsg.match(SOLIDITY_FILE_EXTENSION_REGEX); - if (_.isNull(errPathMatch)) { - throw new Error('Could not find a path in error message'); - } - const errPath = errPathMatch[0]; - const baseContract = path.basename(errPath); - const normalizedErrMsg = errMsg.replace(errPath, baseContract); - return normalizedErrMsg; - } /** * Instantiates a new instance of the Compiler class. * @param opts Options specifying directories, network, and optimization settings. @@ -149,20 +95,15 @@ export class Compiler { this._specifiedContracts = opts.specifiedContracts; } /** - * Compiles all Solidity files found in contractsDir and writes JSON artifacts to artifactsDir. + * Compiles selected Solidity files and writes JSON artifacts to artifactsDir. */ - public async compileAllAsync(): Promise { - await this._createArtifactsDirIfDoesNotExistAsync(); + public async compileAsync(): Promise { + await createArtifactsDirIfDoesNotExistAsync(this._artifactsDir); this._contractSources = await Compiler._getContractSourcesAsync(this._contractsDir); - _.forIn(this._contractSources, (source, fileName) => { - this._contractSourceData[fileName] = Compiler._getContractSpecificSourceData(source); - }); + _.forIn(this._contractSources, this._setContractSpecificSourceData.bind(this)); const fileNames = this._specifiedContracts.has(ALL_CONTRACTS_IDENTIFIER) ? _.keys(this._contractSources) : Array.from(this._specifiedContracts.values()); - _.forEach(fileNames, fileName => { - this._setSourceTreeHash(fileName); - }); for (const fileName of fileNames) { await this._compileContractAsync(fileName); } @@ -179,14 +120,19 @@ export class Compiler { throw new Error('Contract sources not yet initialized'); } const contractSpecificSourceData = this._contractSourceData[fileName]; - const currentArtifactIfExists = (await this._getContractArtifactIfExistsAsync(fileName)) as ContractArtifact; + const currentArtifactIfExists = await getContractArtifactIfExistsAsync(this._artifactsDir, fileName); const sourceHash = `0x${contractSpecificSourceData.sourceHash.toString('hex')}`; - const sourceTreeHash = `0x${contractSpecificSourceData.sourceTreeHashIfExists.toString('hex')}`; + const sourceTreeHash = `0x${contractSpecificSourceData.sourceTreeHash.toString('hex')}`; - const shouldCompile = - _.isUndefined(currentArtifactIfExists) || - currentArtifactIfExists.networks[this._networkId].optimizer_enabled !== this._optimizerEnabled || - currentArtifactIfExists.networks[this._networkId].source_tree_hash !== sourceTreeHash; + let shouldCompile = false; + if (_.isUndefined(currentArtifactIfExists)) { + shouldCompile = true; + } else { + const currentArtifact = currentArtifactIfExists as ContractArtifact; + shouldCompile = + currentArtifact.networks[this._networkId].optimizer_enabled !== this._optimizerEnabled || + currentArtifact.networks[this._networkId].source_tree_hash !== sourceTreeHash; + } if (!shouldCompile) { return; } @@ -221,15 +167,13 @@ export class Compiler { const sourcesToCompile = { sources: input, }; - const compiled = solcInstance.compile( - sourcesToCompile, - Number(this._optimizerEnabled), - this._findImportsIfSourcesExist.bind(this), + const compiled = solcInstance.compile(sourcesToCompile, Number(this._optimizerEnabled), importPath => + findImportIfExist(this._contractSources, importPath), ); if (!_.isUndefined(compiled.errors)) { _.forEach(compiled.errors, errMsg => { - const normalizedErrMsg = Compiler._getNormalizedErrMsg(errMsg); + const normalizedErrMsg = getNormalizedErrMsg(errMsg); this._solcErrors.add(normalizedErrMsg); }); } @@ -263,10 +207,11 @@ export class Compiler { let newArtifact: ContractArtifact; if (!_.isUndefined(currentArtifactIfExists)) { + const currentArtifact = currentArtifactIfExists as ContractArtifact; newArtifact = { - ...currentArtifactIfExists, + ...currentArtifact, networks: { - ...currentArtifactIfExists.networks, + ...currentArtifact.networks, [this._networkId]: contractNetworkData, }, }; @@ -285,79 +230,42 @@ export class Compiler { logUtils.log(`${fileName} artifact saved!`); } /** - * Sets the source tree hash for a file and its dependencies. - * @param fileName Name of contract file. - */ - private _setSourceTreeHash(fileName: string): void { - const contractSpecificSourceData = this._contractSourceData[fileName]; - if (_.isUndefined(contractSpecificSourceData)) { - throw new Error(`Contract data for ${fileName} not yet set`); - } - if (_.isUndefined(contractSpecificSourceData.sourceTreeHashIfExists)) { - const dependencies = contractSpecificSourceData.dependencies; - if (dependencies.length === 0) { - contractSpecificSourceData.sourceTreeHashIfExists = contractSpecificSourceData.sourceHash; - } else { - _.forEach(dependencies, dependency => { - this._setSourceTreeHash(dependency); - }); - const dependencySourceTreeHashes = _.map( - dependencies, - dependency => this._contractSourceData[dependency].sourceTreeHashIfExists, - ); - const sourceTreeHashesBuffer = Buffer.concat([ - contractSpecificSourceData.sourceHash, - ...dependencySourceTreeHashes, - ]); - contractSpecificSourceData.sourceTreeHashIfExists = ethUtil.sha3(sourceTreeHashesBuffer); - } - } - } - /** - * Callback to resolve dependencies with `solc.compile`. - * Throws error if contractSources not yet initialized. - * @param importPath Path to an imported dependency. - * @return Import contents object containing source code of dependency. + * Gets contract dependendencies and keccak256 hash from source. + * @param source Source code of contract. + * @return Object with contract dependencies and keccak256 hash of source. */ - private _findImportsIfSourcesExist(importPath: string): solc.ImportContents { - const fileName = path.basename(importPath); - const source = this._contractSources[fileName]; - if (_.isUndefined(source)) { - throw new Error(`Contract source not found for ${fileName}`); + private _setContractSpecificSourceData(source: string, fileName: string): void { + if (!_.isUndefined(this._contractSourceData[fileName])) { + return; } - const importContents: solc.ImportContents = { - contents: source, + const sourceHash = ethUtil.sha3(source); + const solcVersionRange = parseSolidityVersionRange(source); + const dependencies = parseDependencies(source); + const sourceTreeHash = this._getSourceTreeHash(fileName, sourceHash, dependencies); + this._contractSourceData[fileName] = { + dependencies, + solcVersionRange, + sourceHash, + sourceTreeHash, }; - return importContents; - } - /** - * Creates the artifacts directory if it does not already exist. - */ - private async _createArtifactsDirIfDoesNotExistAsync(): Promise { - if (!fsWrapper.doesPathExistSync(this._artifactsDir)) { - logUtils.log('Creating artifacts directory...'); - await fsWrapper.mkdirAsync(this._artifactsDir); - } } /** - * Gets contract data on network or returns if an artifact does not exist. + * Gets the source tree hash for a file and its dependencies. * @param fileName Name of contract file. - * @return Contract data on network or undefined. */ - private async _getContractArtifactIfExistsAsync(fileName: string): Promise { - let contractArtifact; - const contractName = path.basename(fileName, constants.SOLIDITY_FILE_EXTENSION); - const currentArtifactPath = `${this._artifactsDir}/${contractName}.json`; - try { - const opts = { - encoding: 'utf8', - }; - const contractArtifactString = await fsWrapper.readFileAsync(currentArtifactPath, opts); - contractArtifact = JSON.parse(contractArtifactString); - return contractArtifact; - } catch (err) { - logUtils.log(`Artifact for ${fileName} does not exist`); - return undefined; + private _getSourceTreeHash(fileName: string, sourceHash: Buffer, dependencies: string[]): Buffer { + if (dependencies.length === 0) { + return sourceHash; + } else { + const dependencySourceTreeHashes = _.map(dependencies, dependency => { + const source = this._contractSources[dependency]; + this._setContractSpecificSourceData(source, dependency); + const sourceData = this._contractSourceData[dependency]; + return this._getSourceTreeHash(dependency, sourceData.sourceHash, sourceData.dependencies); + }); + const sourceTreeHashesBuffer = Buffer.concat([sourceHash, ...dependencySourceTreeHashes]); + const sourceTreeHash = ethUtil.sha3(sourceTreeHashesBuffer); + return sourceTreeHash; } } } diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts new file mode 100644 index 000000000..3fb35e9ed --- /dev/null +++ b/packages/deployer/src/utils/compiler.ts @@ -0,0 +1,118 @@ +import { logUtils } from '@0xproject/utils'; +import * as _ from 'lodash'; +import * as path from 'path'; +import * as solc from 'solc'; + +import { constants } from './constants'; +import { fsWrapper } from './fs_wrapper'; +import { ContractArtifact, ContractSources } from './types'; + +/** + * Gets contract data on network or returns if an artifact does not exist. + * @param fileName Name of contract file. + * @return Contract data on network or undefined. + */ +export async function getContractArtifactIfExistsAsync( + artifactsDir: string, + fileName: string, +): Promise { + let contractArtifact; + const contractName = path.basename(fileName, constants.SOLIDITY_FILE_EXTENSION); + const currentArtifactPath = `${artifactsDir}/${contractName}.json`; + try { + const opts = { + encoding: 'utf8', + }; + const contractArtifactString = await fsWrapper.readFileAsync(currentArtifactPath, opts); + contractArtifact = JSON.parse(contractArtifactString); + return contractArtifact; + } catch (err) { + logUtils.log(`Artifact for ${fileName} does not exist`); + return undefined; + } +} + +/** + * Creates the artifacts directory if it does not already exist. + */ +export async function createArtifactsDirIfDoesNotExistAsync(artifactsDir: string): Promise { + if (!fsWrapper.doesPathExistSync(artifactsDir)) { + logUtils.log('Creating artifacts directory...'); + await fsWrapper.mkdirAsync(artifactsDir); + } +} + +/** + * Searches Solidity source code for compiler version range. + * @param source Source code of contract. + * @return Solc compiler version range. + */ +export function parseSolidityVersionRange(source: string): string { + const SOLIDITY_VERSION_RANGE_REGEX = /pragma solidity (.*);/; + const solcVersionRangeMatch = source.match(SOLIDITY_VERSION_RANGE_REGEX); + if (_.isNull(solcVersionRangeMatch)) { + throw new Error('Could not find Solidity version range in source'); + } + const solcVersionRange = solcVersionRangeMatch[1]; + return solcVersionRange; +} + +/** + * Normalizes the path found in the error message. + * Example: converts 'base/Token.sol:6:46: Warning: Unused local variable' + * to 'Token.sol:6:46: Warning: Unused local variable' + * This is used to prevent logging the same error multiple times. + * @param errMsg An error message from the compiled output. + * @return The error message with directories truncated from the contract path. + */ +export function getNormalizedErrMsg(errMsg: string): string { + const SOLIDITY_FILE_EXTENSION_REGEX = /(.*\.sol)/; + const errPathMatch = errMsg.match(SOLIDITY_FILE_EXTENSION_REGEX); + if (_.isNull(errPathMatch)) { + throw new Error('Could not find a path in error message'); + } + const errPath = errPathMatch[0]; + const baseContract = path.basename(errPath); + const normalizedErrMsg = errMsg.replace(errPath, baseContract); + return normalizedErrMsg; +} + +export function parseDependencies(source: string): string[] { + // TODO: Use a proper parser + const IMPORT_REGEX = /(import\s)/; + const DEPENDENCY_PATH_REGEX = /"([^"]+)"/; // Source: https://github.com/BlockChainCompany/soljitsu/blob/master/lib/shared.js + const dependencies: string[] = []; + const lines = source.split('\n'); + _.forEach(lines, line => { + if (!_.isNull(line.match(IMPORT_REGEX))) { + const dependencyMatch = line.match(DEPENDENCY_PATH_REGEX); + if (!_.isNull(dependencyMatch)) { + const dependencyPath = dependencyMatch[1]; + const basenName = path.basename(dependencyPath); + dependencies.push(basenName); + } + } + }); + return dependencies; +} + +/** + * Callback to resolve dependencies with `solc.compile`. + * Throws error if contractSources not yet initialized. + * @param importPath Path to an imported dependency. + * @return Import contents object containing source code of dependency. + */ +export function findImportIfExist(contractSources: ContractSources, importPath: string): solc.ImportContents { + const fileName = path.basename(importPath); + if (_.isUndefined(contractSources)) { + throw new Error('Contract sources not yet initialized'); + } + const source = contractSources[fileName]; + if (_.isUndefined(source)) { + throw new Error(`Contract source not found for ${fileName}`); + } + const importContents: solc.ImportContents = { + contents: source, + }; + return importContents; +} diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index 13b24b9b7..72ee0df2f 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -86,7 +86,7 @@ export interface ContractSpecificSourceData { dependencies: string[]; solcVersionRange: string; sourceHash: Buffer; - sourceTreeHashIfExists?: Buffer; + sourceTreeHash: Buffer; } // TODO: Consolidate with 0x.js definitions once types are moved into a separate package. diff --git a/packages/deployer/test/deploy_test.ts b/packages/deployer/test/deploy_test.ts index 26ce337ef..f67cd8234 100644 --- a/packages/deployer/test/deploy_test.ts +++ b/packages/deployer/test/deploy_test.ts @@ -38,7 +38,7 @@ beforeEach(function(done: DoneCallback) { if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { await fsWrapper.removeFileAsync(exchangeArtifactPath); } - await compiler.compileAllAsync(); + await compiler.compileAsync(); done(); })().catch(done); }); -- cgit v1.2.3 From 8b52793f2fa21bcb23a3c38b6d3773cfc20186fd Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 16 Mar 2018 16:34:02 +0100 Subject: Add tests for compiler utils --- packages/deployer/package.json | 5 +- packages/deployer/src/globals.d.ts | 2 + packages/deployer/src/utils/compiler.ts | 5 +- packages/deployer/src/utils/fs_wrapper.ts | 1 + packages/deployer/test/compiler_test.ts | 47 ++++++++++++++ packages/deployer/test/compiler_utils_test.ts | 74 +++++++++++++++++++++ packages/deployer/test/deploy_test.ts | 93 --------------------------- packages/deployer/test/deployer_test.ts | 76 ++++++++++++++++++++++ 8 files changed, 205 insertions(+), 98 deletions(-) create mode 100644 packages/deployer/test/compiler_test.ts create mode 100644 packages/deployer/test/compiler_utils_test.ts delete mode 100644 packages/deployer/test/deploy_test.ts create mode 100644 packages/deployer/test/deployer_test.ts diff --git a/packages/deployer/package.json b/packages/deployer/package.json index 3982c0067..77f017ef3 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -7,7 +7,8 @@ "scripts": { "build:watch": "tsc -w", "build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", - "test": "npm run build; mocha lib/test/*_test.js", + "test": "run-s build run_mocha", + "run_mocha": "mocha lib/test/*_test.js", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "compile": "npm run build; node lib/src/cli.js compile", @@ -37,6 +38,7 @@ "@types/yargs": "^11.0.0", "chai": "^4.0.1", "copyfiles": "^1.2.0", + "dirty-chai": "^2.0.1", "ethers-typescript-typings": "^0.0.4", "mocha": "^4.0.1", "nyc": "^11.0.1", @@ -51,6 +53,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "npm-run-all": "^4.1.2", "ethereumjs-util": "^5.1.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", diff --git a/packages/deployer/src/globals.d.ts b/packages/deployer/src/globals.d.ts index 3cff8a909..83db346f9 100644 --- a/packages/deployer/src/globals.d.ts +++ b/packages/deployer/src/globals.d.ts @@ -1,3 +1,5 @@ +declare module 'dirty-chai'; + // tslint:disable:completed-docs declare module 'solc' { import * as Web3 from 'web3'; diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts index 3fb35e9ed..1d21d7d31 100644 --- a/packages/deployer/src/utils/compiler.ts +++ b/packages/deployer/src/utils/compiler.ts @@ -48,7 +48,7 @@ export async function createArtifactsDirIfDoesNotExistAsync(artifactsDir: string * @return Solc compiler version range. */ export function parseSolidityVersionRange(source: string): string { - const SOLIDITY_VERSION_RANGE_REGEX = /pragma solidity (.*);/; + const SOLIDITY_VERSION_RANGE_REGEX = /pragma\s+solidity\s+(.*);/; const solcVersionRangeMatch = source.match(SOLIDITY_VERSION_RANGE_REGEX); if (_.isNull(solcVersionRangeMatch)) { throw new Error('Could not find Solidity version range in source'); @@ -104,9 +104,6 @@ export function parseDependencies(source: string): string[] { */ export function findImportIfExist(contractSources: ContractSources, importPath: string): solc.ImportContents { const fileName = path.basename(importPath); - if (_.isUndefined(contractSources)) { - throw new Error('Contract sources not yet initialized'); - } const source = contractSources[fileName]; if (_.isUndefined(source)) { throw new Error(`Contract source not found for ${fileName}`); diff --git a/packages/deployer/src/utils/fs_wrapper.ts b/packages/deployer/src/utils/fs_wrapper.ts index 34c7caa0e..e02c83f27 100644 --- a/packages/deployer/src/utils/fs_wrapper.ts +++ b/packages/deployer/src/utils/fs_wrapper.ts @@ -7,5 +7,6 @@ export const fsWrapper = { writeFileAsync: promisify(fs.writeFile), mkdirAsync: promisify(fs.mkdir), doesPathExistSync: fs.existsSync, + rmdirSync: fs.rmdirSync, removeFileAsync: promisify(fs.unlink), }; diff --git a/packages/deployer/test/compiler_test.ts b/packages/deployer/test/compiler_test.ts new file mode 100644 index 000000000..1c4d3c697 --- /dev/null +++ b/packages/deployer/test/compiler_test.ts @@ -0,0 +1,47 @@ +import * as chai from 'chai'; +import 'mocha'; + +import { Compiler } from '../src/compiler'; +import { fsWrapper } from '../src/utils/fs_wrapper'; +import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback } from '../src/utils/types'; + +import { exchange_binary } from './fixtures/exchange_bin'; +import { constants } from './util/constants'; + +const expect = chai.expect; + +describe('#Compiler', () => { + const artifactsDir = `${__dirname}/fixtures/artifacts`; + const contractsDir = `${__dirname}/fixtures/contracts`; + const exchangeArtifactPath = `${artifactsDir}/Exchange.json`; + const compilerOpts: CompilerOptions = { + artifactsDir, + contractsDir, + networkId: constants.networkId, + optimizerEnabled: constants.optimizerEnabled, + specifiedContracts: new Set(constants.specifiedContracts), + }; + const compiler = new Compiler(compilerOpts); + beforeEach(function(done: DoneCallback) { + this.timeout(constants.timeoutMs); + (async () => { + if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { + await fsWrapper.removeFileAsync(exchangeArtifactPath); + } + await compiler.compileAsync(); + done(); + })().catch(done); + }); + it('should create an Exchange artifact with the correct unlinked binary', async () => { + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; + // The last 43 bytes of the binaries are metadata which may not be equivalent + const unlinkedBinaryWithoutMetadata = exchangeContractData.bytecode.slice(0, -86); + const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86); + expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); + }); +}); diff --git a/packages/deployer/test/compiler_utils_test.ts b/packages/deployer/test/compiler_utils_test.ts new file mode 100644 index 000000000..f86a44862 --- /dev/null +++ b/packages/deployer/test/compiler_utils_test.ts @@ -0,0 +1,74 @@ +import * as chai from 'chai'; +import * as dirtyChai from 'dirty-chai'; +import 'mocha'; + +import { + createArtifactsDirIfDoesNotExistAsync, + getNormalizedErrMsg, + parseDependencies, + parseSolidityVersionRange, +} from '../src/utils/compiler'; +import { fsWrapper } from '../src/utils/fs_wrapper'; + +chai.use(dirtyChai); +const expect = chai.expect; + +describe.only('Compiler utils', () => { + describe('#getNormalizedErrorMessage', () => { + it('normalizes the error message', () => { + const errMsg = 'base/Token.sol:6:46: Warning: Unused local variable'; + const normalizedErrMsg = getNormalizedErrMsg(errMsg); + expect(normalizedErrMsg).to.be.equal('Token.sol:6:46: Warning: Unused local variable'); + }); + }); + describe('#createArtifactsDirIfDoesNotExistAsync', () => { + it('creates artifacts dir', async () => { + const artifactsDir = `${__dirname}/artifacts`; + expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.false(); + await createArtifactsDirIfDoesNotExistAsync(artifactsDir); + expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.true(); + fsWrapper.rmdirSync(artifactsDir); + expect(fsWrapper.doesPathExistSync(artifactsDir)).to.be.false(); + }); + }); + describe('#parseSolidityVersionRange', () => { + it('correctly parses the version range', () => { + expect(parseSolidityVersionRange('pragma solidity ^0.0.1;')).to.be.equal('^0.0.1'); + expect(parseSolidityVersionRange('\npragma solidity 0.0.1;')).to.be.equal('0.0.1'); + expect(parseSolidityVersionRange('pragma solidity <=1.0.1;')).to.be.equal('<=1.0.1'); + expect(parseSolidityVersionRange('pragma solidity ~1.0.1;')).to.be.equal('~1.0.1'); + }); + // TODO: For now that doesn't work. This will work after we switch to a grammar-based parser + it.skip('correctly parses the version range with comments', () => { + expect(parseSolidityVersionRange('// pragma solidity ~1.0.1;\npragma solidity ~1.0.2;')).to.be.equal( + '~1.0.2', + ); + }); + }); + describe('#parseDependencies', () => { + it('correctly parses Exchange dependencies', async () => { + const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/Exchange.sol`, { + encoding: 'utf8', + }); + expect(parseDependencies(exchangeSource)).to.be.deep.equal([ + 'TokenTransferProxy.sol', + 'Token.sol', + 'SafeMath.sol', + ]); + }); + it('correctly parses TokenTransferProxy dependencies', async () => { + const exchangeSource = await fsWrapper.readFileAsync( + `${__dirname}/fixtures/contracts/TokenTransferProxy.sol`, + { + encoding: 'utf8', + }, + ); + expect(parseDependencies(exchangeSource)).to.be.deep.equal(['Token.sol', 'Ownable.sol']); + }); + // TODO: For now that doesn't work. This will work after we switch to a grammar-based parser + it.skip('correctly parses commented out dependencies', async () => { + const contractWithCommentedOutDependencies = `// import "./TokenTransferProxy.sol";`; + expect(parseDependencies(contractWithCommentedOutDependencies)).to.be.deep.equal([]); + }); + }); +}); diff --git a/packages/deployer/test/deploy_test.ts b/packages/deployer/test/deploy_test.ts deleted file mode 100644 index f67cd8234..000000000 --- a/packages/deployer/test/deploy_test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import * as chai from 'chai'; -import 'mocha'; - -import { Compiler } from '../src/compiler'; -import { Deployer } from '../src/deployer'; -import { fsWrapper } from '../src/utils/fs_wrapper'; -import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback } from '../src/utils/types'; - -import { constructor_args, exchange_binary } from './fixtures/exchange_bin'; -import { constants } from './util/constants'; - -const expect = chai.expect; -const artifactsDir = `${__dirname}/fixtures/artifacts`; -const contractsDir = `${__dirname}/fixtures/contracts`; -const exchangeArtifactPath = `${artifactsDir}/Exchange.json`; -const compilerOpts: CompilerOptions = { - artifactsDir, - contractsDir, - networkId: constants.networkId, - optimizerEnabled: constants.optimizerEnabled, - specifiedContracts: new Set(constants.specifiedContracts), -}; -const compiler = new Compiler(compilerOpts); -const deployerOpts = { - artifactsDir, - networkId: constants.networkId, - jsonrpcUrl: constants.jsonrpcUrl, - defaults: { - gasPrice: constants.gasPrice, - }, -}; -const deployer = new Deployer(deployerOpts); - -/* tslint:disable */ -beforeEach(function(done: DoneCallback) { - this.timeout(constants.timeoutMs); - (async () => { - if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { - await fsWrapper.removeFileAsync(exchangeArtifactPath); - } - await compiler.compileAsync(); - done(); - })().catch(done); -}); -/* tslint:enable */ - -describe('#Compiler', () => { - it('should create an Exchange artifact with the correct unlinked binary', async () => { - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; - // The last 43 bytes of the binaries are metadata which may not be equivalent - const unlinkedBinaryWithoutMetadata = exchangeContractData.bytecode.slice(0, -86); - const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86); - expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); - }); -}); -describe('#Deployer', () => { - describe('#deployAsync', () => { - it('should deploy the Exchange contract without updating the Exchange artifact', async () => { - const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; - const exchangeContractInstance = await deployer.deployAsync('Exchange', exchangeConstructorArgs); - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; - const exchangeAddress = exchangeContractInstance.address; - expect(exchangeAddress).to.not.equal(undefined); - expect(exchangeContractData.address).to.equal(undefined); - expect(exchangeContractData.constructor_args).to.equal(undefined); - }); - }); - describe('#deployAndSaveAsync', () => { - it('should save the correct contract address and constructor arguments to the Exchange artifact', async () => { - const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; - const exchangeContractInstance = await deployer.deployAndSaveAsync('Exchange', exchangeConstructorArgs); - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; - const exchangeAddress = exchangeContractInstance.address; - expect(exchangeAddress).to.be.equal(exchangeContractData.address); - expect(constructor_args).to.be.equal(exchangeContractData.constructor_args); - }); - }); -}); diff --git a/packages/deployer/test/deployer_test.ts b/packages/deployer/test/deployer_test.ts new file mode 100644 index 000000000..9c34d74aa --- /dev/null +++ b/packages/deployer/test/deployer_test.ts @@ -0,0 +1,76 @@ +import * as chai from 'chai'; +import 'mocha'; + +import { Compiler } from '../src/compiler'; +import { Deployer } from '../src/deployer'; +import { fsWrapper } from '../src/utils/fs_wrapper'; +import { CompilerOptions, ContractArtifact, ContractNetworkData, DoneCallback } from '../src/utils/types'; + +import { constructor_args, exchange_binary } from './fixtures/exchange_bin'; +import { constants } from './util/constants'; + +const expect = chai.expect; + +describe('#Deployer', () => { + const artifactsDir = `${__dirname}/fixtures/artifacts`; + const contractsDir = `${__dirname}/fixtures/contracts`; + const exchangeArtifactPath = `${artifactsDir}/Exchange.json`; + const compilerOpts: CompilerOptions = { + artifactsDir, + contractsDir, + networkId: constants.networkId, + optimizerEnabled: constants.optimizerEnabled, + specifiedContracts: new Set(constants.specifiedContracts), + }; + const compiler = new Compiler(compilerOpts); + const deployerOpts = { + artifactsDir, + networkId: constants.networkId, + jsonrpcUrl: constants.jsonrpcUrl, + defaults: { + gasPrice: constants.gasPrice, + }, + }; + const deployer = new Deployer(deployerOpts); + beforeEach(function(done: DoneCallback) { + this.timeout(constants.timeoutMs); + (async () => { + if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { + await fsWrapper.removeFileAsync(exchangeArtifactPath); + } + await compiler.compileAsync(); + done(); + })().catch(done); + }); + describe('#deployAsync', () => { + it('should deploy the Exchange contract without updating the Exchange artifact', async () => { + const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; + const exchangeContractInstance = await deployer.deployAsync('Exchange', exchangeConstructorArgs); + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; + const exchangeAddress = exchangeContractInstance.address; + expect(exchangeAddress).to.not.equal(undefined); + expect(exchangeContractData.address).to.equal(undefined); + expect(exchangeContractData.constructor_args).to.equal(undefined); + }); + }); + describe('#deployAndSaveAsync', () => { + it('should save the correct contract address and constructor arguments to the Exchange artifact', async () => { + const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; + const exchangeContractInstance = await deployer.deployAndSaveAsync('Exchange', exchangeConstructorArgs); + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId]; + const exchangeAddress = exchangeContractInstance.address; + expect(exchangeAddress).to.be.equal(exchangeContractData.address); + expect(constructor_args).to.be.equal(exchangeContractData.constructor_args); + }); + }); +}); -- cgit v1.2.3 From 477daf416805633d02c6d387be26bee6ed747ebe Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 16 Mar 2018 16:54:48 +0100 Subject: Add function docs --- packages/deployer/src/utils/compiler.ts | 5 +++++ packages/deployer/src/utils/error_reporter.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts index 1d21d7d31..d8b5f78c9 100644 --- a/packages/deployer/src/utils/compiler.ts +++ b/packages/deployer/src/utils/compiler.ts @@ -77,6 +77,11 @@ export function getNormalizedErrMsg(errMsg: string): string { return normalizedErrMsg; } +/** + * Parses the contract source code and extracts the dendencies + * @param source Contract source code + * @return List of dependendencies + */ export function parseDependencies(source: string): string[] { // TODO: Use a proper parser const IMPORT_REGEX = /(import\s)/; diff --git a/packages/deployer/src/utils/error_reporter.ts b/packages/deployer/src/utils/error_reporter.ts index b28e4fbbe..bf3f96a7c 100644 --- a/packages/deployer/src/utils/error_reporter.ts +++ b/packages/deployer/src/utils/error_reporter.ts @@ -1,5 +1,6 @@ import { logUtils } from '@0xproject/utils'; +// Makes an async function no-throw printing errors to the console export function consoleReporter(asyncFn: (arg: T) => Promise) { const noThrowFnAsync = async (arg: T) => { try { -- cgit v1.2.3 From 111f7e917ed3cb16de9930e093ea7dbcb9451d19 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 15:24:41 +0100 Subject: Add function docs --- packages/deployer/src/utils/error_reporter.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/deployer/src/utils/error_reporter.ts b/packages/deployer/src/utils/error_reporter.ts index bf3f96a7c..4e73307f0 100644 --- a/packages/deployer/src/utils/error_reporter.ts +++ b/packages/deployer/src/utils/error_reporter.ts @@ -1,7 +1,11 @@ import { logUtils } from '@0xproject/utils'; -// Makes an async function no-throw printing errors to the console -export function consoleReporter(asyncFn: (arg: T) => Promise) { +/** + * Makes an async function no-throw printing errors to the console + * @param asyncFn async function to wrap + * @return Wrapped version of the passed function + */ +export function consoleReporter(asyncFn: (arg: T) => Promise): (arg: T) => Promise { const noThrowFnAsync = async (arg: T) => { try { const result = await asyncFn(arg); -- cgit v1.2.3 From d118116548950c82541b372fe5d3781982c25b45 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 16:34:57 +0100 Subject: Revert version range changes --- .../src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol | 2 +- .../multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol | 2 +- .../MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol | 2 +- packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol | 2 +- .../src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol | 2 +- .../current/protocol/TokenTransferProxy/TokenTransferProxy.sol | 2 +- packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol | 2 +- .../src/contracts/current/test/MaliciousToken/MaliciousToken.sol | 2 +- packages/contracts/src/contracts/current/test/Mintable/Mintable.sol | 2 +- .../contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol | 2 +- packages/contracts/src/contracts/current/tokens/Token/Token.sol | 2 +- .../current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol | 2 +- packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol | 2 +- packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol | 2 +- .../contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol | 2 +- .../src/contracts/current/tutorials/EtherDelta/AccountLevels.sol | 2 +- .../contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol | 2 +- packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol | 2 +- packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol | 2 +- packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol | 2 +- packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol | 2 +- packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol | 2 +- packages/contracts/src/contracts/previous/Token/Token_v1.sol | 2 +- .../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol index 56c4d20a9..79fd92029 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWallet/MultiSigWallet.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.10; +pragma solidity ^0.4.10; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol index 791c01af8..a545d9813 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.10; +pragma solidity ^0.4.10; import { MultiSigWallet } from "../MultiSigWallet/MultiSigWallet.sol"; diff --git a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol index ca2989483..3c6a3d2ef 100644 --- a/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol +++ b/packages/contracts/src/contracts/current/multisig/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress/MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.10; +pragma solidity ^0.4.10; import { MultiSigWalletWithTimeLock } from "../MultiSigWalletWithTimeLock/MultiSigWalletWithTimeLock.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol index b1bf8a260..8dacf797c 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.14; +pragma solidity ^0.4.14; import { TokenTransferProxy } from "../TokenTransferProxy/TokenTransferProxy.sol"; import { Token_v1 as Token } from "../../../previous/Token/Token_v1.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol b/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol index 9ab72f72d..3bd2fbfaf 100644 --- a/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol +++ b/packages/contracts/src/contracts/current/protocol/TokenRegistry/TokenRegistry.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; import { Ownable_v1 as Ownable } from "../../../previous/Ownable/Ownable_v1.sol"; diff --git a/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol b/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol index e78d264d4..1ce949fa6 100644 --- a/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol +++ b/packages/contracts/src/contracts/current/protocol/TokenTransferProxy/TokenTransferProxy.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; import { Token_v1 as Token } from "../../../previous/Token/Token_v1.sol"; import { Ownable_v1 as Ownable } from "../../../previous/Ownable/Ownable_v1.sol"; diff --git a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol b/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol index 0cd04312d..ab04f4d16 100644 --- a/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol +++ b/packages/contracts/src/contracts/current/test/DummyToken/DummyToken.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; import { Mintable } from "../Mintable/Mintable.sol"; import { Ownable } from "../../utils/Ownable/Ownable.sol"; diff --git a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol b/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol index c5d6207e8..9e502616c 100644 --- a/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol +++ b/packages/contracts/src/contracts/current/test/MaliciousToken/MaliciousToken.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; import { ERC20Token } from "../../tokens/ERC20Token/ERC20Token.sol"; diff --git a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol index 33022cfc6..cf7ee35a5 100644 --- a/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol +++ b/packages/contracts/src/contracts/current/test/Mintable/Mintable.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; import { UnlimitedAllowanceToken } from "../../tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol"; import { SafeMath } from "../../utils/SafeMath/SafeMath.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol index c59ab3e7a..0e5b87aa4 100644 --- a/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol +++ b/packages/contracts/src/contracts/current/tokens/ERC20Token/ERC20Token.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; import { Token } from "../Token/Token.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/Token/Token.sol b/packages/contracts/src/contracts/current/tokens/Token/Token.sol index 6bf83cd51..bf4e71dcd 100644 --- a/packages/contracts/src/contracts/current/tokens/Token/Token.sol +++ b/packages/contracts/src/contracts/current/tokens/Token/Token.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; contract Token { diff --git a/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol b/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol index 569b4f021..699f535d2 100644 --- a/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol +++ b/packages/contracts/src/contracts/current/tokens/UnlimitedAllowanceToken/UnlimitedAllowanceToken.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; import { ERC20Token } from "../ERC20Token/ERC20Token.sol"; diff --git a/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol b/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol index 22df0600c..733ca414b 100644 --- a/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol +++ b/packages/contracts/src/contracts/current/tokens/WETH9/WETH9.sol @@ -13,7 +13,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; contract WETH9 { string public name = "Wrapped Ether"; diff --git a/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol b/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol index b12a6a186..7f5e1f849 100644 --- a/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol +++ b/packages/contracts/src/contracts/current/tokens/ZRXToken/ZRXToken.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; import { UnlimitedAllowanceToken_v1 as UnlimitedAllowanceToken } from "../../../previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol"; diff --git a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol b/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol index 1867781fb..a9f3c22e6 100644 --- a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol +++ b/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.19; +pragma solidity ^0.4.19; import { Exchange } from "../../protocol/Exchange/Exchange.sol"; import { EtherDelta } from "../EtherDelta/EtherDelta.sol"; diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol b/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol index 17d839eb7..8d7a930d3 100644 --- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol +++ b/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.19; +pragma solidity ^0.4.19; contract AccountLevels { //given a user, returns an account level diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol b/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol index fc5e5f9de..49847ab48 100644 --- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol +++ b/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.19; +pragma solidity ^0.4.19; import { SafeMath } from "../../utils/SafeMath/SafeMath.sol"; import { AccountLevels } from "./AccountLevels.sol"; diff --git a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol index 9416c8f8e..9b3d6b9cf 100644 --- a/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol +++ b/packages/contracts/src/contracts/current/utils/Ownable/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; /* * Ownable diff --git a/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol b/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol index c816b3fd1..955a9e379 100644 --- a/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol +++ b/packages/contracts/src/contracts/current/utils/SafeMath/SafeMath.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.18; +pragma solidity ^0.4.18; contract SafeMath { function safeMul(uint a, uint b) diff --git a/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol b/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol index b2a5636ae..e05ee2d5e 100644 --- a/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol +++ b/packages/contracts/src/contracts/previous/ERC20Token/ERC20Token_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; import { Token_v1 as Token } from "../Token/Token_v1.sol"; diff --git a/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol b/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol index c1b67956e..c87438fa4 100644 --- a/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol +++ b/packages/contracts/src/contracts/previous/Ownable/Ownable_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; /* * Ownable diff --git a/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol b/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol index ea8f899ef..341d611ec 100644 --- a/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol +++ b/packages/contracts/src/contracts/previous/SafeMath/SafeMath_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; contract SafeMath_v1 { function safeMul(uint a, uint b) diff --git a/packages/contracts/src/contracts/previous/Token/Token_v1.sol b/packages/contracts/src/contracts/previous/Token/Token_v1.sol index 5a9c82ded..de619fb7e 100644 --- a/packages/contracts/src/contracts/previous/Token/Token_v1.sol +++ b/packages/contracts/src/contracts/previous/Token/Token_v1.sol @@ -1,4 +1,4 @@ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; contract Token_v1 { diff --git a/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol b/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol index ccb4f8d28..6376f3f2c 100644 --- a/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol +++ b/packages/contracts/src/contracts/previous/UnlimitedAllowanceToken/UnlimitedAllowanceToken_v1.sol @@ -16,7 +16,7 @@ */ -pragma solidity ~0.4.11; +pragma solidity ^0.4.11; import { ERC20Token_v1 as ERC20Token } from "../ERC20Token/ERC20Token_v1.sol"; -- cgit v1.2.3 From 2c7fdac5cd52ceb24cc2cb19ade124fc1acc8c9d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 16:39:37 +0100 Subject: Remove .only --- packages/deployer/test/compiler_utils_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deployer/test/compiler_utils_test.ts b/packages/deployer/test/compiler_utils_test.ts index f86a44862..1867177dc 100644 --- a/packages/deployer/test/compiler_utils_test.ts +++ b/packages/deployer/test/compiler_utils_test.ts @@ -13,7 +13,7 @@ import { fsWrapper } from '../src/utils/fs_wrapper'; chai.use(dirtyChai); const expect = chai.expect; -describe.only('Compiler utils', () => { +describe('Compiler utils', () => { describe('#getNormalizedErrorMessage', () => { it('normalizes the error message', () => { const errMsg = 'base/Token.sol:6:46: Warning: Unused local variable'; -- cgit v1.2.3 From ee77b81551e6aa879e68d56cb55e9a81be895296 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 17:19:46 +0100 Subject: Revert optimizer config --- packages/deployer/test/util/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deployer/test/util/constants.ts b/packages/deployer/test/util/constants.ts index 7ba94c1f2..5d3aab47c 100644 --- a/packages/deployer/test/util/constants.ts +++ b/packages/deployer/test/util/constants.ts @@ -3,7 +3,7 @@ import { BigNumber } from '@0xproject/utils'; export const constants = { networkId: 0, jsonrpcUrl: 'http://localhost:8545', - optimizerEnabled: true, + optimizerEnabled: false, gasPrice: new BigNumber(20000000000), timeoutMs: 20000, zrxTokenAddress: '0xe41d2489571d322189246dafa5ebde1f4699f498', -- cgit v1.2.3 From 629edd3108425c4ff8541b6e66921d4812c40de2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 17:20:30 +0100 Subject: Move npm-run-all to devDependencies --- packages/deployer/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deployer/package.json b/packages/deployer/package.json index 77f017ef3..3f0613677 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -36,6 +36,7 @@ "@types/require-from-string": "^1.2.0", "@types/semver": "^5.5.0", "@types/yargs": "^11.0.0", + "npm-run-all": "^4.1.2", "chai": "^4.0.1", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", @@ -53,7 +54,6 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", - "npm-run-all": "^4.1.2", "ethereumjs-util": "^5.1.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", -- cgit v1.2.3 From 32b85625c10279e53d75488fe81e3723afce0a1b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 17:23:07 +0100 Subject: Add a comment --- packages/deployer/src/compiler.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index d9571488e..fcff9e22f 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -38,6 +38,7 @@ export class Compiler { private _networkId: number; private _optimizerEnabled: boolean; private _artifactsDir: string; + // This get's set in the beggining of `compileAsync` function. It's not called from a constructor, but it's the only public method of that class and could as well be. private _contractSources!: ContractSources; private _solcErrors: Set = new Set(); private _specifiedContracts: Set = new Set(); -- cgit v1.2.3 From 73f8ae9a47b151d518d759d0d7cf79f6bea794d3 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 18:01:26 +0100 Subject: Fix a comment --- packages/deployer/src/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index fcff9e22f..712169c89 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -182,7 +182,7 @@ export class Compiler { const contractIdentifier = `${fileName}:${contractName}`; if (_.isUndefined(compiled.contracts[contractIdentifier])) { throw new Error( - `Contract ${contractName} not found in ${fileName}. Please make sure your contract has the same name as a file`, + `Contract ${contractName} not found in ${fileName}. Please make sure your contract has the same name as it's file name`, ); } const abi: Web3.ContractAbi = JSON.parse(compiled.contracts[contractIdentifier].interface); -- cgit v1.2.3 From e31ba2e12e90cca10037d2f6bf8ae17fe42e1991 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 21 Mar 2018 18:06:50 +0100 Subject: Add missing param comments --- packages/deployer/src/utils/compiler.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts index d8b5f78c9..9c8fef26d 100644 --- a/packages/deployer/src/utils/compiler.ts +++ b/packages/deployer/src/utils/compiler.ts @@ -9,6 +9,7 @@ import { ContractArtifact, ContractSources } from './types'; /** * Gets contract data on network or returns if an artifact does not exist. + * @param artifactsDir Path to the artifacts directory. * @param fileName Name of contract file. * @return Contract data on network or undefined. */ @@ -34,6 +35,7 @@ export async function getContractArtifactIfExistsAsync( /** * Creates the artifacts directory if it does not already exist. + * @param artifactsDir Path to the artifacts directory. */ export async function createArtifactsDirIfDoesNotExistAsync(artifactsDir: string): Promise { if (!fsWrapper.doesPathExistSync(artifactsDir)) { @@ -104,6 +106,7 @@ export function parseDependencies(source: string): string[] { /** * Callback to resolve dependencies with `solc.compile`. * Throws error if contractSources not yet initialized. + * @param contractSources Source codes of contracts. * @param importPath Path to an imported dependency. * @return Import contents object containing source code of dependency. */ -- cgit v1.2.3 From e476682922ac57e268cf3bb7b3f46f8fba47497d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 22 Mar 2018 12:37:44 +0100 Subject: Remove redundant types --- packages/deployer/src/utils/types.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index 72ee0df2f..540b31aff 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -89,24 +89,6 @@ export interface ContractSpecificSourceData { sourceTreeHash: Buffer; } -// TODO: Consolidate with 0x.js definitions once types are moved into a separate package. -export enum ZeroExError { - ContractDoesNotExist = 'CONTRACT_DOES_NOT_EXIST', - ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST', - UnhandledError = 'UNHANDLED_ERROR', - UserHasNoAssociatedAddress = 'USER_HAS_NO_ASSOCIATED_ADDRESSES', - InvalidSignature = 'INVALID_SIGNATURE', - ContractNotDeployedOnNetwork = 'CONTRACT_NOT_DEPLOYED_ON_NETWORK', - InsufficientAllowanceForTransfer = 'INSUFFICIENT_ALLOWANCE_FOR_TRANSFER', - InsufficientBalanceForTransfer = 'INSUFFICIENT_BALANCE_FOR_TRANSFER', - InsufficientEthBalanceForDeposit = 'INSUFFICIENT_ETH_BALANCE_FOR_DEPOSIT', - InsufficientWEthBalanceForWithdrawal = 'INSUFFICIENT_WETH_BALANCE_FOR_WITHDRAWAL', - InvalidJump = 'INVALID_JUMP', - OutOfGas = 'OUT_OF_GAS', - NoNetworkId = 'NO_NETWORK_ID', - SubscriptionNotFound = 'SUBSCRIPTION_NOT_FOUND', -} - export interface Token { address?: string; name: string; -- cgit v1.2.3 From 7ef6bd4b14b7502617c6929010d4a9991e1d577d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 22 Mar 2018 14:26:24 +0100 Subject: Set timeout for compiler tests --- packages/deployer/test/compiler_test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/deployer/test/compiler_test.ts b/packages/deployer/test/compiler_test.ts index 1c4d3c697..b03ae7935 100644 --- a/packages/deployer/test/compiler_test.ts +++ b/packages/deployer/test/compiler_test.ts @@ -10,7 +10,8 @@ import { constants } from './util/constants'; const expect = chai.expect; -describe('#Compiler', () => { +describe('#Compiler', function() { + this.timeout(constants.timeoutMs); const artifactsDir = `${__dirname}/fixtures/artifacts`; const contractsDir = `${__dirname}/fixtures/contracts`; const exchangeArtifactPath = `${artifactsDir}/Exchange.json`; @@ -22,8 +23,7 @@ describe('#Compiler', () => { specifiedContracts: new Set(constants.specifiedContracts), }; const compiler = new Compiler(compilerOpts); - beforeEach(function(done: DoneCallback) { - this.timeout(constants.timeoutMs); + beforeEach((done: DoneCallback) => { (async () => { if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { await fsWrapper.removeFileAsync(exchangeArtifactPath); -- cgit v1.2.3 From 109fc41474f5319a27052ab09234cc0426eb22ce Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 25 Mar 2018 00:22:06 +0000 Subject: Add error popover if TokenRegistry on network user is browsing on don't include the requisite default tokens for 0x Portal to function --- packages/website/ts/blockchain.ts | 16 ++++++++++++++++ .../ts/components/dialogs/blockchain_err_dialog.tsx | 14 ++++++++++++++ packages/website/ts/types.ts | 1 + 3 files changed, 31 insertions(+) diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index a3427baee..2268bf1ab 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -544,6 +544,22 @@ export class Blockchain { ? {} : trackedTokenStorage.getTrackedTokensByAddress(this._userAddressIfExists, this.networkId); const tokenRegistryTokens = _.values(tokenRegistryTokensByAddress); + const tokenRegistryTokenSymbols = _.map(tokenRegistryTokens, t => t.symbol); + const defaultTrackedTokensInRegistry = _.intersection( + tokenRegistryTokenSymbols, + configs.DEFAULT_TRACKED_TOKEN_SYMBOLS, + ); + if (defaultTrackedTokensInRegistry.length !== configs.DEFAULT_TRACKED_TOKEN_SYMBOLS.length) { + this._dispatcher.updateShouldBlockchainErrDialogBeOpen(true); + this._dispatcher.encounteredBlockchainError(BlockchainErrs.DefaultTokensNotInTokenRegistry); + const err = new Error( + `Default tracked tokens (${JSON.stringify( + configs.DEFAULT_TRACKED_TOKEN_SYMBOLS, + )}) not found in tokenRegistry: ${JSON.stringify(tokenRegistryTokens)}`, + ); + await errorReporter.reportAsync(err); + return; + } if (_.isEmpty(trackedTokensByAddress)) { _.each(configs.DEFAULT_TRACKED_TOKEN_SYMBOLS, symbol => { const token = _.find(tokenRegistryTokens, t => t.symbol === symbol); diff --git a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx index e71a0f7d1..1c3b7458d 100644 --- a/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx +++ b/packages/website/ts/components/dialogs/blockchain_err_dialog.tsx @@ -52,6 +52,8 @@ export class BlockchainErrDialog extends React.Component ); } + private _renderDefaultTokenNotInTokenRegistry() { + return ( +
+ The TokenRegistry deployed on your network does not contain the needed default tokens for 0x Portal to + operate. Please try one of the supported networks (Mainnet, Kovan, Ropsten, Rinkeby). If on a local + Testnet, make sure the TokenRegistry contract is deployed and loaded with some default tokens (i.e WETH + & ZRX). +
+ ); + } private _renderUnexpectedErrorExplanation() { return
We encountered an unexpected error. Please try refreshing the page.
; } diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index 104d2e50f..901483327 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -223,6 +223,7 @@ export enum AlertTypes { export enum BlockchainErrs { AContractNotDeployedOnNetwork = 'A_CONTRACT_NOT_DEPLOYED_ON_NETWORK', DisconnectedFromEthereumNode = 'DISCONNECTED_FROM_ETHEREUM_NODE', + DefaultTokensNotInTokenRegistry = 'DEFAULT_TOKENS_NOT_IN_TOKEN_REGISTRY', NoError = 'NO_ERROR', } -- cgit v1.2.3 From 125ace351924ee124d45c79c400966a11db24042 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Mon, 26 Mar 2018 16:43:12 +1100 Subject: Portal fill with mixed decimals When the token pair has different decimal precison we can end up with a remainder when multiplying by an exchange rate (as one is in 18 decimals and the other is 6 for example) --- packages/website/ts/components/fill_order.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index a6144bd6b..ea94e0987 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -198,11 +198,13 @@ export class FillOrder extends React.Component { symbol: takerToken.symbol, }; const parsedOrderExpiration = new BigNumber(this.state.parsedOrder.signedOrder.expirationUnixTimestampSec); - const exchangeRate = orderMakerAmount.div(orderTakerAmount); let orderReceiveAmount = 0; if (!_.isUndefined(this.props.orderFillAmount)) { - const orderReceiveAmountBigNumber = exchangeRate.mul(this.props.orderFillAmount); + const orderReceiveAmountBigNumber = orderMakerAmount + .times(this.props.orderFillAmount) + .dividedBy(orderTakerAmount) + .floor(); orderReceiveAmount = this._formatCurrencyAmount(orderReceiveAmountBigNumber, makerToken.decimals); } const isUserMaker = -- cgit v1.2.3 From 0a8b7cb49402d440df41ea0119f8a75d6f6c7a50 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Mar 2018 13:21:02 +0100 Subject: Improve rounding error message --- packages/website/ts/utils/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 25d7e449b..75597a7e2 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -219,7 +219,8 @@ export const utils = { [ExchangeContractErrs.OrderFillAmountZero]: "Order fill amount can't be 0", [ExchangeContractErrs.OrderRemainingFillAmountZero]: 'This order has already been completely filled or cancelled', - [ExchangeContractErrs.OrderFillRoundingError]: 'Rounding error will occur when filling this order', + [ExchangeContractErrs.OrderFillRoundingError]: + 'Rounding error will occur when filling this order. Please try filling a different amount.', [ExchangeContractErrs.InsufficientTakerBalance]: 'Taker no longer has a sufficient balance to complete this order', [ExchangeContractErrs.InsufficientTakerAllowance]: -- cgit v1.2.3 From 3b45d4727b14d2ad15784a18f4a47cf0deb40f27 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 26 Mar 2018 17:33:39 +0100 Subject: Revert TokenRegistry address on Kovan --- packages/0x.js/CHANGELOG.md | 1 - packages/0x.js/src/artifacts/TokenRegistry.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index fa3b3db91..820c25449 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -2,7 +2,6 @@ ## v0.34.0 - _TBD_ - * Update Kovan EtherToken artifact address to match TokenRegistry. * Fix the bug causing `zeroEx.exchange.fillOrdersUpToAsync` validation to fail if there were some extra orders passed (#470) ## v0.33.2 - _March 18, 2018_ diff --git a/packages/0x.js/src/artifacts/TokenRegistry.json b/packages/0x.js/src/artifacts/TokenRegistry.json index 95bee4b1d..0f583628c 100644 --- a/packages/0x.js/src/artifacts/TokenRegistry.json +++ b/packages/0x.js/src/artifacts/TokenRegistry.json @@ -538,7 +538,7 @@ "address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6" }, "42": { - "address": "0xd0a1e359811322d97991e03f863a0c30c2cf029c" + "address": "0xf18e504561f4347bea557f3d4558f559dddbae7f" }, "50": { "address": "0x0b1ba0af832d7c05fd64161e0db78e85978e8082" -- cgit v1.2.3 From 3e3b6673660b7358ff31a2ae2c5766b265e57cb0 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 27 Mar 2018 11:38:22 +0100 Subject: Remove WETH hack now that updated WETH address is in TokenRegistry --- packages/website/ts/blockchain.ts | 22 +--------------------- packages/website/ts/utils/configs.ts | 7 ------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 2268bf1ab..72cb94c02 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -151,13 +151,6 @@ export class Blockchain { } public async isAddressInTokenRegistryAsync(tokenAddress: string): Promise { utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); - // HACK: temporarily whitelist the new WETH token address `as if` they were - // already in the tokenRegistry. - // TODO: Remove this hack once we've updated the TokenRegistries - // Airtable task: https://airtable.com/tblFe0Q9JuKJPYbTn/viwsOG2Y97qdIeCIO/recv3VGmIorFzHBVz - if (configs.SHOULD_DEPRECATE_OLD_WETH_TOKEN && tokenAddress === configs.NEW_WRAPPED_ETHERS[this.networkId]) { - return true; - } const tokenIfExists = await this._zeroEx.tokenRegistry.getTokenIfExistsAsync(tokenAddress); return !_.isUndefined(tokenIfExists); } @@ -744,22 +737,9 @@ export class Blockchain { // HACK: For now we have a hard-coded list of iconUrls for the dummyTokens // TODO: Refactor this out and pull the iconUrl directly from the TokenRegistry const iconUrl = configs.ICON_URL_BY_SYMBOL[t.symbol]; - // HACK: Temporarily we hijack the WETH addresses fetched from the tokenRegistry - // so that we can take our time with actually updating it. This ensures that when - // we deploy the new WETH page, everyone will re-fill their trackedTokens with the - // new canonical WETH. - // TODO: Remove this hack once we've updated the TokenRegistries - // Airtable task: https://airtable.com/tblFe0Q9JuKJPYbTn/viwsOG2Y97qdIeCIO/recv3VGmIorFzHBVz - let address = t.address; - if (configs.SHOULD_DEPRECATE_OLD_WETH_TOKEN && t.symbol === 'WETH') { - const newEtherTokenAddressIfExists = configs.NEW_WRAPPED_ETHERS[this.networkId]; - if (!_.isUndefined(newEtherTokenAddressIfExists)) { - address = newEtherTokenAddressIfExists; - } - } const token: Token = { iconUrl, - address, + address: t.address, name: t.name, symbol: t.symbol, decimals: t.decimals, diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 597e9689a..a54fc56a8 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -65,12 +65,6 @@ export const configs = { GOOGLE_ANALYTICS_ID: 'UA-98720122-1', LAST_LOCAL_STORAGE_FILL_CLEARANCE_DATE: '2017-11-22', LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2017-12-19', - // NEW_WRAPPED_ETHERS is temporary until we remove the SHOULD_DEPRECATE_OLD_WETH_TOKEN flag - // and add the new WETHs to the tokenRegistry - NEW_WRAPPED_ETHERS: { - 1: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', - 42: '0xd0a1e359811322d97991e03f863a0c30c2cf029c', - } as { [networkId: string]: string }, OUTDATED_WRAPPED_ETHERS: [ { 42: { @@ -96,7 +90,6 @@ export const configs = { [3]: [`https://ropsten.infura.io/${INFURA_API_KEY}`], [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, - SHOULD_DEPRECATE_OLD_WETH_TOKEN: true, SYMBOLS_OF_MINTABLE_KOVAN_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS: [ 'TKN0', -- cgit v1.2.3 From 343191e9367655a0329b12d9060520da54a584a7 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 27 Mar 2018 16:24:44 +0100 Subject: Remove nested .gitignore files since `yarn publish` gets confused by them and ignores their contents on the top-level scope --- .gitignore | 7 +++++++ packages/0x.js/src/contract_wrappers/generated/.gitignore | 1 - packages/contracts/src/contract_wrappers/generated/.gitignore | 1 - packages/deployer/solc_bin/.gitignore | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 packages/0x.js/src/contract_wrappers/generated/.gitignore delete mode 100644 packages/contracts/src/contract_wrappers/generated/.gitignore delete mode 100644 packages/deployer/solc_bin/.gitignore diff --git a/.gitignore b/.gitignore index 1b5d40348..c37cf438e 100644 --- a/.gitignore +++ b/.gitignore @@ -76,5 +76,12 @@ bin/ # generated contract artifacts packages/contracts/src/artifacts +# generated contract wrappers +packages/0x.js/src/contract_wrappers/generated/ +packages/contracts/src/contract_wrappers/generated/ + +# solc-bin in deployer +packages/deployer/solc_bin/ + # Monorepo scripts packages/*/scripts/ diff --git a/packages/0x.js/src/contract_wrappers/generated/.gitignore b/packages/0x.js/src/contract_wrappers/generated/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/packages/0x.js/src/contract_wrappers/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/packages/contracts/src/contract_wrappers/generated/.gitignore b/packages/contracts/src/contract_wrappers/generated/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/packages/contracts/src/contract_wrappers/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/packages/deployer/solc_bin/.gitignore b/packages/deployer/solc_bin/.gitignore deleted file mode 100644 index a6c7c2852..000000000 --- a/packages/deployer/solc_bin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.js -- cgit v1.2.3 From a2e4aaa9a394c359b9bf817ff154572eb33d4fb5 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 26 Mar 2018 13:00:56 +0200 Subject: Add clean-state tests --- .circleci/config.yml | 13 + README.md | 57 +- package.json | 2 + packages/0x.js/README.md | 9 +- packages/0x.js/package.json | 7 +- packages/0x.js/test/0x.js_test.ts | 2 +- packages/0x.js/tsconfig.json | 6 +- packages/abi-gen/package.json | 4 +- packages/abi-gen/tsconfig.json | 2 +- packages/assert/README.md | 16 +- packages/assert/package.json | 2 +- packages/assert/tsconfig.json | 7 +- packages/base-contract/README.md | 9 +- packages/base-contract/package.json | 5 +- packages/base-contract/tsconfig.json | 6 +- .../chai-as-promised-typescript-typings/.npmignore | 3 - .../CHANGELOG.md | 3 - .../chai-as-promised-typescript-typings/README.md | 43 - .../chai-as-promised-typescript-typings/index.d.ts | 268 --- .../monorepo_scripts/globals.d.ts | 6 - .../monorepo_scripts/postpublish.ts | 8 - .../package.json | 35 - .../tsconfig.json | 7 - .../tslint.json | 3 - packages/chai-typescript-typings/.npmignore | 3 - packages/chai-typescript-typings/CHANGELOG.md | 3 - packages/chai-typescript-typings/README.md | 43 - packages/chai-typescript-typings/index.d.ts | 1254 ----------- .../monorepo_scripts/globals.d.ts | 6 - .../monorepo_scripts/postpublish.ts | 8 - packages/chai-typescript-typings/package.json | 28 - packages/chai-typescript-typings/tsconfig.json | 7 - packages/chai-typescript-typings/tslint.json | 3 - packages/connect/README.md | 8 +- packages/connect/package.json | 6 +- packages/connect/tsconfig.json | 8 +- packages/contracts/package.json | 5 +- packages/contracts/tsconfig.json | 5 - packages/deployer/README.md | 8 + packages/deployer/package.json | 2 +- packages/deployer/tsconfig.json | 5 +- packages/dev-utils/README.md | 8 +- packages/dev-utils/package.json | 2 +- packages/dev-utils/tsconfig.json | 3 - packages/ethers-typescript-typings/.npmignore | 3 - packages/ethers-typescript-typings/CHANGELOG.md | 5 - packages/ethers-typescript-typings/README.md | 49 - packages/ethers-typescript-typings/index.d.ts | 28 - .../monorepo_scripts/globals.d.ts | 6 - .../monorepo_scripts/postpublish.ts | 8 - packages/ethers-typescript-typings/package.json | 36 - packages/ethers-typescript-typings/tsconfig.json | 7 - packages/ethers-typescript-typings/tslint.json | 3 - packages/json-schemas/README.md | 12 +- packages/json-schemas/package.json | 2 +- packages/json-schemas/tsconfig.json | 7 +- packages/monorepo-scripts/package.json | 4 + packages/monorepo-scripts/src/globals.d.ts | 19 + packages/monorepo-scripts/src/test_installation.ts | 57 + packages/monorepo-scripts/tsconfig.json | 2 +- packages/react-docs-example/package.json | 4 +- packages/react-docs/README.md | 8 + packages/react-docs/package.json | 4 +- packages/react-docs/tsconfig.json | 2 +- packages/react-shared/README.md | 8 + packages/react-shared/package.json | 4 +- packages/sol-cov/package.json | 2 +- packages/sol-cov/tsconfig.json | 2 - packages/sra-report/package.json | 3 +- packages/sra-report/tsconfig.json | 9 +- packages/subproviders/README.md | 8 +- packages/subproviders/package.json | 6 +- packages/subproviders/tsconfig.json | 5 +- packages/testnet-faucets/package.json | 2 +- packages/testnet-faucets/tsconfig.json | 4 +- packages/tslint-config/tsconfig.json | 2 +- packages/types/README.md | 8 +- packages/types/package.json | 4 +- packages/types/tsconfig.json | 2 +- packages/typescript-typings/.npmignore | 3 + packages/typescript-typings/CHANGELOG.md | 3 + packages/typescript-typings/README.md | 45 + .../monorepo_scripts/globals.d.ts | 6 + .../monorepo_scripts/postpublish.ts | 8 + packages/typescript-typings/package.json | 33 + packages/typescript-typings/tsconfig.json | 7 + packages/typescript-typings/tslint.json | 3 + .../types/chai-as-promised/index.d.ts | 268 +++ packages/typescript-typings/types/chai/index.d.ts | 1254 +++++++++++ .../types/ethers-contracts/index.d.ts | 28 + packages/typescript-typings/types/web3/index.d.ts | 440 ++++ packages/utils/README.md | 8 +- packages/utils/package.json | 5 +- packages/utils/tsconfig.json | 6 +- packages/web3-typescript-typings/.npmignore | 3 - packages/web3-typescript-typings/CHANGELOG.md | 16 - packages/web3-typescript-typings/README.md | 49 - packages/web3-typescript-typings/index.d.ts | 440 ---- .../monorepo_scripts/globals.d.ts | 6 - .../monorepo_scripts/postpublish.ts | 8 - packages/web3-typescript-typings/package.json | 40 - packages/web3-typescript-typings/tsconfig.json | 7 - packages/web3-typescript-typings/tslint.json | 3 - packages/web3-wrapper/README.md | 8 +- packages/web3-wrapper/package.json | 5 +- packages/web3-wrapper/tsconfig.json | 6 +- packages/website/package.json | 7 +- .../dialogs/eth_weth_conversion_dialog.tsx | 4 +- .../website/ts/components/dialogs/send_dialog.tsx | 4 +- packages/website/ts/components/footer.tsx | 2 +- packages/website/tsconfig.json | 6 +- tsconfig.json | 1 + yarn.lock | 2237 +++++++++++++------- 113 files changed, 3780 insertions(+), 3462 deletions(-) delete mode 100644 packages/chai-as-promised-typescript-typings/.npmignore delete mode 100644 packages/chai-as-promised-typescript-typings/CHANGELOG.md delete mode 100644 packages/chai-as-promised-typescript-typings/README.md delete mode 100644 packages/chai-as-promised-typescript-typings/index.d.ts delete mode 100644 packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts delete mode 100644 packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts delete mode 100644 packages/chai-as-promised-typescript-typings/package.json delete mode 100644 packages/chai-as-promised-typescript-typings/tsconfig.json delete mode 100644 packages/chai-as-promised-typescript-typings/tslint.json delete mode 100644 packages/chai-typescript-typings/.npmignore delete mode 100644 packages/chai-typescript-typings/CHANGELOG.md delete mode 100644 packages/chai-typescript-typings/README.md delete mode 100644 packages/chai-typescript-typings/index.d.ts delete mode 100644 packages/chai-typescript-typings/monorepo_scripts/globals.d.ts delete mode 100644 packages/chai-typescript-typings/monorepo_scripts/postpublish.ts delete mode 100644 packages/chai-typescript-typings/package.json delete mode 100644 packages/chai-typescript-typings/tsconfig.json delete mode 100644 packages/chai-typescript-typings/tslint.json delete mode 100644 packages/ethers-typescript-typings/.npmignore delete mode 100644 packages/ethers-typescript-typings/CHANGELOG.md delete mode 100644 packages/ethers-typescript-typings/README.md delete mode 100644 packages/ethers-typescript-typings/index.d.ts delete mode 100644 packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts delete mode 100644 packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts delete mode 100644 packages/ethers-typescript-typings/package.json delete mode 100644 packages/ethers-typescript-typings/tsconfig.json delete mode 100644 packages/ethers-typescript-typings/tslint.json create mode 100644 packages/monorepo-scripts/src/test_installation.ts create mode 100644 packages/typescript-typings/.npmignore create mode 100644 packages/typescript-typings/CHANGELOG.md create mode 100644 packages/typescript-typings/README.md create mode 100644 packages/typescript-typings/monorepo_scripts/globals.d.ts create mode 100644 packages/typescript-typings/monorepo_scripts/postpublish.ts create mode 100644 packages/typescript-typings/package.json create mode 100644 packages/typescript-typings/tsconfig.json create mode 100644 packages/typescript-typings/tslint.json create mode 100644 packages/typescript-typings/types/chai-as-promised/index.d.ts create mode 100644 packages/typescript-typings/types/chai/index.d.ts create mode 100644 packages/typescript-typings/types/ethers-contracts/index.d.ts create mode 100644 packages/typescript-typings/types/web3/index.d.ts delete mode 100644 packages/web3-typescript-typings/.npmignore delete mode 100644 packages/web3-typescript-typings/CHANGELOG.md delete mode 100644 packages/web3-typescript-typings/README.md delete mode 100644 packages/web3-typescript-typings/index.d.ts delete mode 100644 packages/web3-typescript-typings/monorepo_scripts/globals.d.ts delete mode 100644 packages/web3-typescript-typings/monorepo_scripts/postpublish.ts delete mode 100644 packages/web3-typescript-typings/package.json delete mode 100644 packages/web3-typescript-typings/tsconfig.json delete mode 100644 packages/web3-typescript-typings/tslint.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 31a58a963..d4ffe62ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,16 @@ jobs: key: repo-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo + test-installation: + docker: + - image: circleci/node:6.12 + working_directory: ~/repo + steps: + - restore_cache: + keys: + - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: yarn lerna:exec 'yarn pack --filename package.tgz' + - run: yarn test:installation test-0xjs: docker: - image: circleci/node:6.12 @@ -174,6 +184,9 @@ workflows: main: jobs: - build + - test-installation: + requires: + - build - test-0xjs: requires: - build diff --git a/README.md b/README.md index 9718c1529..3a873fa46 100644 --- a/README.md +++ b/README.md @@ -18,35 +18,27 @@ This repository is a monorepo including the 0x protocol smart contracts and nume ### Published Packages -| Package | Version | Description | -| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol | -| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs | -| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages | -| [`@0xproject/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0xproject/base-contract.svg)](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts | -| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the Standard Relayer API | -| [`@0xproject/deployer`](/packages/deployer) | [![npm](https://img.shields.io/npm/v/@0xproject/deployer.svg)](https://www.npmjs.com/package/@0xproject/deployer) | Solidity project compiler and deployer framework | -| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages | -| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas | -| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [![npm](https://img.shields.io/npm/v/@0xproject/monorepo-scripts.svg)](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts | -| [`@0xproject/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0xproject/react-docs.svg)](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON | -| [`@0xproject/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0xproject/react-shared.svg)](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components | -| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance | -| [`@0xproject/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-cov.svg)](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool tool | -| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) | -| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules | -| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations | -| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities | -| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | - -### TypeScript Typings - -| Package | Version | Description | -| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| [`chai-as-promised-typescript-typings`](/packages/chai-as-promised-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-as-promised-typescript-typings.svg)](https://www.npmjs.com/package/chai-as-promised-typescript-typings) | Chai as promised typescript typings | -| [`chai-typescript-typings`](/packages/chai-typescript-typings) | [![npm](https://img.shields.io/npm/v/chai-typescript-typings.svg)](https://www.npmjs.com/package/chai-typescript-typings) | Chai typescript typings | -| [`ethers-typescript-typings`](/packages/ethers-typescript-typings) | [![npm](https://img.shields.io/npm/v/@0xproject/deployer.svg)](https://www.npmjs.com/package/ethers-typescript-typings) | [Ethers.js](https://github.com/ethers-io/ethers.js/) typescript typings | -| [`web3-typescript-typings`](/packages/web3-typescript-typings) | [![npm](https://img.shields.io/npm/v/web3-typescript-typings.svg)](https://www.npmjs.com/package/web3-typescript-typings) | Web3 typescript typings | +| Package | Version | Description | +| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| [`0x.js`](/packages/0x.js) | [![npm](https://img.shields.io/npm/v/0x.js.svg)](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol | +| [`@0xproject/abi-gen`](/packages/abi-gen) | [![npm](https://img.shields.io/npm/v/@0xproject/abi-gen.svg)](https://www.npmjs.com/package/@0xproject/abi-gen) | Tool to generate TS wrappers from smart contract ABIs | +| [`@0xproject/assert`](/packages/assert) | [![npm](https://img.shields.io/npm/v/@0xproject/assert.svg)](https://www.npmjs.com/package/@0xproject/assert) | Type and schema assertions used by our packages | +| [`@0xproject/base-contract`](/packages/base-contract) | [![npm](https://img.shields.io/npm/v/@0xproject/base-contract.svg)](https://www.npmjs.com/package/@0xproject/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts | +| [`@0xproject/connect`](/packages/connect) | [![npm](https://img.shields.io/npm/v/@0xproject/connect.svg)](https://www.npmjs.com/package/@0xproject/connect) | A Javascript library for interacting with the Standard Relayer API | +| [`@0xproject/deployer`](/packages/deployer) | [![npm](https://img.shields.io/npm/v/@0xproject/deployer.svg)](https://www.npmjs.com/package/@0xproject/deployer) | Solidity project compiler and deployer framework | +| [`@0xproject/dev-utils`](/packages/dev-utils) | [![npm](https://img.shields.io/npm/v/@0xproject/dev-utils.svg)](https://www.npmjs.com/package/@0xproject/dev-utils) | Dev utils to be shared across 0x projects and packages | +| [`@0xproject/json-schemas`](/packages/json-schemas) | [![npm](https://img.shields.io/npm/v/@0xproject/json-schemas.svg)](https://www.npmjs.com/package/@0xproject/json-schemas) | 0x-related json schemas | +| [`@0xproject/monorepo-scripts`](/packages/monorepo-scripts) | [![npm](https://img.shields.io/npm/v/@0xproject/monorepo-scripts.svg)](https://www.npmjs.com/package/@0xproject/monorepo-scripts) | Monorepo scripts | +| [`@0xproject/react-docs`](/packages/react-docs) | [![npm](https://img.shields.io/npm/v/@0xproject/react-docs.svg)](https://www.npmjs.com/package/@0xproject/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON | +| [`@0xproject/react-shared`](/packages/react-shared) | [![npm](https://img.shields.io/npm/v/@0xproject/react-shared.svg)](https://www.npmjs.com/package/@0xproject/react-shared) | 0x shared react components | +| [`@0xproject/sra-report`](/packages/sra-report) | [![npm](https://img.shields.io/npm/v/@0xproject/sra-report.svg)](https://www.npmjs.com/package/@0xproject/sra-report) | Generate reports for standard relayer API compliance | +| [`@0xproject/sol-cov`](/packages/sol-cov) | [![npm](https://img.shields.io/npm/v/@0xproject/sol-cov.svg)](https://www.npmjs.com/package/@0xproject/sol-cov) | Solidity test coverage tool tool | +| [`@0xproject/subproviders`](/packages/subproviders) | [![npm](https://img.shields.io/npm/v/@0xproject/subproviders.svg)](https://www.npmjs.com/package/@0xproject/subproviders) | Useful web3 subproviders (e.g LedgerSubprovider) | +| [`@0xproject/tslint-config`](/packages/tslint-config) | [![npm](https://img.shields.io/npm/v/@0xproject/tslint-config.svg)](https://www.npmjs.com/package/@0xproject/tslint-config) | Custom 0x development TSLint rules | +| [`@0xproject/types`](/packages/types) | [![npm](https://img.shields.io/npm/v/@0xproject/types.svg)](https://www.npmjs.com/package/@0xproject/types) | Shared type declarations | +| [`@0xproject/typescript-typings`](/packages/typescript-typings) | [![npm](https://img.shields.io/npm/v/@0xproject/typescript-typings.svg)](https://www.npmjs.com/package/@0xproject/typescript-typings) | Repository of types for external packages | +| [`@0xproject/utils`](/packages/utils) | [![npm](https://img.shields.io/npm/v/@0xproject/utils.svg)](https://www.npmjs.com/package/@0xproject/utils) | Shared utilities | +| [`@0xproject/web3-wrapper`](/packages/web3-wrapper) | [![npm](https://img.shields.io/npm/v/@0xproject/web3-wrapper.svg)](https://www.npmjs.com/package/@0xproject/web3-wrapper) | Web3 wrapper | ### Private Packages @@ -66,6 +58,13 @@ Dedicated documentation pages: * [Smart contracts](https://0xproject.com/docs/contracts) * [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/blob/master/README.md) +Most of the packages require additional typings for external dependencies. +You can include those by prepending @0xproject/typescript-typings package to your [`typeRoots`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) config. + +```json +"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +``` + ## Contributing We strongly recommend that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/package.json b/package.json index 4d587aec7..1a2d917c0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc", "prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc", "report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls", + "test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", "lerna:run": "lerna run", + "lerna:exec": "lerna exec", "lerna:rebuild": "lerna run clean; lerna run build;", "lerna:publish": "yarn install; lerna run clean; lerna run build; lerna publish --registry=https://registry.npmjs.org/" diff --git a/packages/0x.js/README.md b/packages/0x.js/README.md index 2d0394726..5b17dac8b 100644 --- a/packages/0x.js/README.md +++ b/packages/0x.js/README.md @@ -20,11 +20,10 @@ import { ZeroEx } from '0x.js'; If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", - "./node_modules/ethers-typescript-typings/index.d.ts" -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` #### UMD: diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 5f5b32aac..49d96235c 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -68,9 +68,7 @@ "awesome-typescript-loader": "^3.1.3", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", "chai-bignumber": "^2.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "json-loader": "^0.5.4", @@ -99,18 +97,17 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "bintrees": "^1.0.2", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "js-sha3": "^0.7.0", "lodash": "^4.17.4", "uuid": "^3.1.0", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index d61847d1d..8ba2e53f7 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -216,7 +216,7 @@ describe('ZeroEx library', () => { s: '0x050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb02', }; stubs = [ - Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)), + Sinon.stub((zeroEx as any)._web3Wrapper, 'signMessageAsync').returns(Promise.resolve(signature)), Sinon.stub(ZeroEx, 'isValidSignature').returns(true), ]; diff --git a/packages/0x.js/tsconfig.json b/packages/0x.js/tsconfig.json index a6b5c71c2..ddf5a910e 100644 --- a/packages/0x.js/tsconfig.json +++ b/packages/0x.js/tsconfig.json @@ -8,10 +8,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index fc1adeb06..2fdf19320 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", @@ -45,8 +46,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "tslint": "5.8.0", - "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2" + "typescript": "2.7.1" }, "publishConfig": { "access": "public" diff --git a/packages/abi-gen/tsconfig.json b/packages/abi-gen/tsconfig.json index 5e0c7c6d3..e35816553 100644 --- a/packages/abi-gen/tsconfig.json +++ b/packages/abi-gen/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "./test/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/assert/README.md b/packages/assert/README.md index 1ea6acfb5..7f80e7e5d 100644 --- a/packages/assert/README.md +++ b/packages/assert/README.md @@ -8,14 +8,6 @@ Standard type and schema assertions to be used across all 0x projects and packag yarn add @0xproject/assert ``` -If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: - -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] -``` - ## Usage ```typescript @@ -24,6 +16,14 @@ import { assert } from '@0xproject/assert'; assert.isValidBaseUnitAmount('baseUnitAmount', baseUnitAmount); ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/assert/package.json b/packages/assert/package.json index 73b3b7f37..3df7eab8d 100644 --- a/packages/assert/package.json +++ b/packages/assert/package.json @@ -32,7 +32,6 @@ "@types/mocha": "^2.2.42", "@types/valid-url": "^1.0.2", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", @@ -45,6 +44,7 @@ "dependencies": { "@0xproject/json-schemas": "^0.7.17", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "lodash": "^4.17.4", "valid-url": "^1.0.9" }, diff --git a/packages/assert/tsconfig.json b/packages/assert/tsconfig.json index 10354fa33..e35816553 100644 --- a/packages/assert/tsconfig.json +++ b/packages/assert/tsconfig.json @@ -3,10 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/base-contract/README.md b/packages/base-contract/README.md index fa2f3da10..a689d0130 100644 --- a/packages/base-contract/README.md +++ b/packages/base-contract/README.md @@ -10,11 +10,10 @@ yarn add @0xproject/base-contract If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", - "./node_modules/ethers-typescript-typings/index.d.ts" -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index 4e0260417..554f0a41c 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -32,11 +32,10 @@ "dependencies": { "@0xproject/types": "^0.4.1", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/base-contract/tsconfig.json b/packages/base-contract/tsconfig.json index 8114d99cd..c56d255d5 100644 --- a/packages/base-contract/tsconfig.json +++ b/packages/base-contract/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/chai-as-promised-typescript-typings/.npmignore b/packages/chai-as-promised-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/chai-as-promised-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/chai-as-promised-typescript-typings/CHANGELOG.md b/packages/chai-as-promised-typescript-typings/CHANGELOG.md deleted file mode 100644 index 8c52570da..000000000 --- a/packages/chai-as-promised-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# CHANGELOG - -## v0.x.x - _TBD, 2018_ diff --git a/packages/chai-as-promised-typescript-typings/README.md b/packages/chai-as-promised-typescript-typings/README.md deleted file mode 100644 index 72784ef53..000000000 --- a/packages/chai-as-promised-typescript-typings/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## chai-as-promised-typescript-typings - -Fork of type definitions for chai-as-promised that includes changes made by dirty-chai - -## Installation - -```bash -yarn add -D chai-as-promised-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/chai-as-promised-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/chai-as-promised-typescript-typings/index.d.ts b/packages/chai-as-promised-typescript-typings/index.d.ts deleted file mode 100644 index ba6dabdcc..000000000 --- a/packages/chai-as-promised-typescript-typings/index.d.ts +++ /dev/null @@ -1,268 +0,0 @@ -// Type definitions for chai-as-promised -// Project: https://github.com/domenic/chai-as-promised/ -// Definitions by: jt000 , Yuki Kokubun -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'chai-as-promised' { - function chaiAsPromised(chai: any, utils: any): void; - namespace chaiAsPromised { - - } - export = chaiAsPromised; -} - -// tslint:disable:no-namespace ban-types member-ordering -declare namespace Chai { - // For BDD API - interface Assertion extends LanguageChains, NumericComparison, TypeComparison { - eventually: PromisedAssertion; - fulfilled: PromisedAssertion; - become(expected: any): PromisedAssertion; - rejected(): PromisedAssertion; - rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; - notify(fn: Function): PromisedAssertion; - } - - // Eventually does not have .then(), but PromisedAssertion have. - interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { - // From chai-as-promised - become(expected: PromiseLike): PromisedAssertion; - fulfilled: PromisedAssertion; - rejected: () => PromisedAssertion; - rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; - notify(fn: Function): PromisedAssertion; - - // From chai - not: PromisedAssertion; - deep: PromisedDeep; - all: PromisedKeyFilter; - a: PromisedTypeComparison; - an: PromisedTypeComparison; - include: PromisedInclude; - contain: PromisedInclude; - ok: PromisedAssertion; - true: () => PromisedAssertion; - false: () => PromisedAssertion; - null: PromisedAssertion; - undefined: PromisedAssertion; - exist: PromisedAssertion; - empty: PromisedAssertion; - arguments: PromisedAssertion; - Arguments: PromisedAssertion; - equal: PromisedEqual; - equals: PromisedEqual; - eq: PromisedEqual; - eql: PromisedEqual; - eqls: PromisedEqual; - property: PromisedProperty; - ownProperty: PromisedOwnProperty; - haveOwnProperty: PromisedOwnProperty; - length: PromisedLength; - lengthOf: PromisedLength; - match(regexp: RegExp | string, message?: string): PromisedAssertion; - string(string: string, message?: string): PromisedAssertion; - keys: PromisedKeys; - key(string: string): PromisedAssertion; - throw: PromisedThrow; - throws: PromisedThrow; - Throw: PromisedThrow; - respondTo(method: string, message?: string): PromisedAssertion; - itself: PromisedAssertion; - satisfy(matcher: Function, message?: string): PromisedAssertion; - closeTo(expected: number, delta: number, message?: string): PromisedAssertion; - members: PromisedMembers; - } - - interface PromisedAssertion extends Eventually, PromiseLike {} - - interface PromisedLanguageChains { - eventually: Eventually; - - // From chai - to: PromisedAssertion; - be: PromisedAssertion; - been: PromisedAssertion; - is: PromisedAssertion; - that: PromisedAssertion; - which: PromisedAssertion; - and: PromisedAssertion; - has: PromisedAssertion; - have: PromisedAssertion; - with: PromisedAssertion; - at: PromisedAssertion; - of: PromisedAssertion; - same: PromisedAssertion; - } - - interface PromisedNumericComparison { - above: PromisedNumberComparer; - gt: PromisedNumberComparer; - greaterThan: PromisedNumberComparer; - least: PromisedNumberComparer; - gte: PromisedNumberComparer; - below: PromisedNumberComparer; - lt: PromisedNumberComparer; - lessThan: PromisedNumberComparer; - most: PromisedNumberComparer; - lte: PromisedNumberComparer; - within(start: number, finish: number, message?: string): PromisedAssertion; - } - - type PromisedNumberComparer = (value: number, message?: string) => PromisedAssertion; - - interface PromisedTypeComparison { - (type: string, message?: string): PromisedAssertion; - instanceof: PromisedInstanceOf; - instanceOf: PromisedInstanceOf; - } - - type PromisedInstanceOf = (constructor: Object, message?: string) => PromisedAssertion; - - interface PromisedDeep { - equal: PromisedEqual; - include: PromisedInclude; - property: PromisedProperty; - } - - interface PromisedKeyFilter { - keys: PromisedKeys; - } - - type PromisedEqual = (value: any, message?: string) => PromisedAssertion; - - type PromisedProperty = (name: string, value?: any, message?: string) => PromisedAssertion; - - type PromisedOwnProperty = (name: string, message?: string) => PromisedAssertion; - - interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison { - (length: number, message?: string): PromisedAssertion; - } - - interface PromisedInclude { - (value: Object | string | number, message?: string): PromisedAssertion; - keys: PromisedKeys; - members: PromisedMembers; - all: PromisedKeyFilter; - } - - interface PromisedKeys { - (...keys: string[]): PromisedAssertion; - (keys: any[]): PromisedAssertion; - } - - interface PromisedThrow { - (): PromisedAssertion; - (expected: string | RegExp, message?: string): PromisedAssertion; - (constructor: Error | Function, expected?: string | RegExp, message?: string): PromisedAssertion; - } - - type PromisedMembers = (set: any[], message?: string) => PromisedAssertion; - - // For Assert API - interface Assert { - eventually: PromisedAssert; - isFulfilled(promise: PromiseLike, message?: string): PromiseLike; - becomes(promise: PromiseLike, expected: any, message?: string): PromiseLike; - doesNotBecome(promise: PromiseLike, expected: any, message?: string): PromiseLike; - isRejected(promise: PromiseLike, message?: string): PromiseLike; - isRejected(promise: PromiseLike, expected: any | RegExp, message?: string): PromiseLike; - notify(fn: Function): PromiseLike; - } - - export interface PromisedAssert { - fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike; - - ok(val: any, msg?: string): PromiseLike; - notOk(val: any, msg?: string): PromiseLike; - - equal(act: any, exp: any, msg?: string): PromiseLike; - notEqual(act: any, exp: any, msg?: string): PromiseLike; - - strictEqual(act: any, exp: any, msg?: string): PromiseLike; - notStrictEqual(act: any, exp: any, msg?: string): PromiseLike; - - deepEqual(act: any, exp: any, msg?: string): PromiseLike; - notDeepEqual(act: any, exp: any, msg?: string): PromiseLike; - - isTrue(val: any, msg?: string): PromiseLike; - isFalse(val: any, msg?: string): PromiseLike; - - isNull(val: any, msg?: string): PromiseLike; - isNotNull(val: any, msg?: string): PromiseLike; - - isUndefined(val: any, msg?: string): PromiseLike; - isDefined(val: any, msg?: string): PromiseLike; - - isFunction(val: any, msg?: string): PromiseLike; - isNotFunction(val: any, msg?: string): PromiseLike; - - isObject(val: any, msg?: string): PromiseLike; - isNotObject(val: any, msg?: string): PromiseLike; - - isArray(val: any, msg?: string): PromiseLike; - isNotArray(val: any, msg?: string): PromiseLike; - - isString(val: any, msg?: string): PromiseLike; - isNotString(val: any, msg?: string): PromiseLike; - - isNumber(val: any, msg?: string): PromiseLike; - isNotNumber(val: any, msg?: string): PromiseLike; - - isBoolean(val: any, msg?: string): PromiseLike; - isNotBoolean(val: any, msg?: string): PromiseLike; - - typeOf(val: any, type: string, msg?: string): PromiseLike; - notTypeOf(val: any, type: string, msg?: string): PromiseLike; - - instanceOf(val: any, type: Function, msg?: string): PromiseLike; - notInstanceOf(val: any, type: Function, msg?: string): PromiseLike; - - include(exp: string | any[], inc: any, msg?: string): PromiseLike; - - notInclude(exp: string | any[], inc: any, msg?: string): PromiseLike; - - match(exp: any, re: RegExp, msg?: string): PromiseLike; - notMatch(exp: any, re: RegExp, msg?: string): PromiseLike; - - property(obj: Object, prop: string, msg?: string): PromiseLike; - notProperty(obj: Object, prop: string, msg?: string): PromiseLike; - deepProperty(obj: Object, prop: string, msg?: string): PromiseLike; - notDeepProperty(obj: Object, prop: string, msg?: string): PromiseLike; - - propertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - - deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - - lengthOf(exp: any, len: number, msg?: string): PromiseLike; - // alias frenzy - throw(fn: Function, msg?: string): PromiseLike; - throw(fn: Function, regExp: RegExp): PromiseLike; - throw(fn: Function, errType: Function, msg?: string): PromiseLike; - throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - - throws(fn: Function, msg?: string): PromiseLike; - throws(fn: Function, regExp: RegExp): PromiseLike; - throws(fn: Function, errType: Function, msg?: string): PromiseLike; - throws(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - - Throw(fn: Function, msg?: string): PromiseLike; - Throw(fn: Function, regExp: RegExp): PromiseLike; - Throw(fn: Function, errType: Function, msg?: string): PromiseLike; - Throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - - doesNotThrow(fn: Function, msg?: string): PromiseLike; - doesNotThrow(fn: Function, regExp: RegExp): PromiseLike; - doesNotThrow(fn: Function, errType: Function, msg?: string): PromiseLike; - doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - - operator(val: any, operator: string, val2: any, msg?: string): PromiseLike; - closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike; - - sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike; - includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike; - - ifError(val: any, msg?: string): PromiseLike; - } -} diff --git a/packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts b/packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/chai-as-promised-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts b/packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/chai-as-promised-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/chai-as-promised-typescript-typings/package.json b/packages/chai-as-promised-typescript-typings/package.json deleted file mode 100644 index cbf2630ec..000000000 --- a/packages/chai-as-promised-typescript-typings/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "chai-as-promised-typescript-typings", - "version": "0.0.12", - "description": "Typescript type definitions for chai-as-promised", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "author": "Fabio Berger", - "contributors": [ - "Leonid Logvinov " - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/chai-as-promised-typescript-typings#readme", - "dependencies": { - "chai-typescript-typings": "^0.0.6" - }, - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "copyfiles": "^1.2.0", - "shx": "^0.2.2" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/chai-as-promised-typescript-typings/tsconfig.json b/packages/chai-as-promised-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/chai-as-promised-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/chai-as-promised-typescript-typings/tslint.json b/packages/chai-as-promised-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/chai-as-promised-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/chai-typescript-typings/.npmignore b/packages/chai-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/chai-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/chai-typescript-typings/CHANGELOG.md b/packages/chai-typescript-typings/CHANGELOG.md deleted file mode 100644 index 8c52570da..000000000 --- a/packages/chai-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# CHANGELOG - -## v0.x.x - _TBD, 2018_ diff --git a/packages/chai-typescript-typings/README.md b/packages/chai-typescript-typings/README.md deleted file mode 100644 index 9bd0574d1..000000000 --- a/packages/chai-typescript-typings/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## chai-typescript-typings - -Fork of type definitions for chai that includes changes made by dirty-chai - -## Installation - -```bash -yarn add -D chai-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/chai-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/chai-typescript-typings/index.d.ts b/packages/chai-typescript-typings/index.d.ts deleted file mode 100644 index 8b3e4c079..000000000 --- a/packages/chai-typescript-typings/index.d.ts +++ /dev/null @@ -1,1254 +0,0 @@ -// Type definitions for chai 4.0.0 -// Project: http://chaijs.com/ -// Definitions by: Jed Mao , -// Bart van der Schoor , -// Andrew Brown , -// Olivier Chevet , -// Matt Wistrand , -// Josh Goldberg -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// - -// tslint:disable:no-namespace member-ordering ban-types unified-signatures variable-name callable-types -declare namespace Chai { - interface ChaiStatic { - expect: ExpectStatic; - should(): Should; - /** - * Provides a way to extend the internals of Chai - */ - use(fn: (chai: any, utils: any) => void): ChaiStatic; - assert: AssertStatic; - config: Config; - AssertionError: typeof AssertionError; - version: string; - } - - export interface ExpectStatic extends AssertionStatic { - fail(actual?: any, expected?: any, message?: string, operator?: Operator): void; - } - - export interface AssertStatic extends Assert {} - - type AssertionStatic = (target: any, message?: string) => Assertion; - - export type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!=="; - - export type OperatorComparable = boolean | null | number | string | undefined | Date; - - interface ShouldAssertion { - equal(value1: any, value2: any, message?: string): void; - Throw: ShouldThrow; - throw: ShouldThrow; - exist(value: any, message?: string): void; - } - - interface Should extends ShouldAssertion { - not: ShouldAssertion; - fail(actual: any, expected: any, message?: string, operator?: Operator): void; - } - - interface ShouldThrow { - (actual: Function): void; - (actual: Function, expected: string | RegExp, message?: string): void; - (actual: Function, constructor: Error | Function, expected?: string | RegExp, message?: string): void; - } - - interface Assertion extends LanguageChains, NumericComparison, TypeComparison { - not: Assertion; - deep: Deep; - nested: Nested; - any: KeyFilter; - all: KeyFilter; - a: TypeComparison; - an: TypeComparison; - include: Include; - includes: Include; - contain: Include; - contains: Include; - ok: Assertion; - true: () => Assertion; - false: () => Assertion; - null: () => Assertion; - undefined: () => Assertion; - NaN: Assertion; - exist: Assertion; - empty: Assertion; - arguments: Assertion; - Arguments: Assertion; - equal: Equal; - equals: Equal; - eq: Equal; - eql: Equal; - eqls: Equal; - property: Property; - ownProperty: OwnProperty; - haveOwnProperty: OwnProperty; - ownPropertyDescriptor: OwnPropertyDescriptor; - haveOwnPropertyDescriptor: OwnPropertyDescriptor; - length: Length; - lengthOf: Length; - match: Match; - matches: Match; - string(string: string, message?: string): Assertion; - keys: Keys; - key(string: string): Assertion; - throw: (message?: string) => Assertion; - throws: Throw; - Throw: Throw; - respondTo: RespondTo; - respondsTo: RespondTo; - itself: Assertion; - satisfy: Satisfy; - satisfies: Satisfy; - closeTo: CloseTo; - approximately: CloseTo; - members: Members; - increase: PropertyChange; - increases: PropertyChange; - decrease: PropertyChange; - decreases: PropertyChange; - change: PropertyChange; - changes: PropertyChange; - extensible: Assertion; - sealed: Assertion; - frozen: Assertion; - oneOf(list: any[], message?: string): Assertion; - } - - interface LanguageChains { - to: Assertion; - be: Assertion; - been: Assertion; - is: Assertion; - that: Assertion; - which: Assertion; - and: Assertion; - has: Assertion; - have: Assertion; - with: Assertion; - at: Assertion; - of: Assertion; - same: Assertion; - } - - interface NumericComparison { - above: NumberComparer; - gt: NumberComparer; - greaterThan: NumberComparer; - least: NumberComparer; - gte: NumberComparer; - below: NumberComparer; - lt: NumberComparer; - lessThan: NumberComparer; - most: NumberComparer; - lte: NumberComparer; - within(start: number, finish: number, message?: string): Assertion; - } - - interface NumberComparer { - (value: number, message?: string): Assertion; - } - - interface TypeComparison { - (type: string, message?: string): Assertion; - instanceof: InstanceOf; - instanceOf: InstanceOf; - } - - interface InstanceOf { - (constructor: Object, message?: string): Assertion; - } - - interface CloseTo { - (expected: number, delta: number, message?: string): Assertion; - } - - interface Nested { - include: Include; - property: Property; - members: Members; - } - - interface Deep { - equal: Equal; - equals: Equal; - eq: Equal; - include: Include; - property: Property; - members: Members; - } - - interface KeyFilter { - keys: Keys; - } - - interface Equal { - (value: any, message?: string): Assertion; - } - - interface Property { - (name: string, value?: any, message?: string): Assertion; - } - - interface OwnProperty { - (name: string, message?: string): Assertion; - } - - interface OwnPropertyDescriptor { - (name: string, descriptor: PropertyDescriptor, message?: string): Assertion; - (name: string, message?: string): Assertion; - } - - interface Length extends LanguageChains, NumericComparison { - (length: number, message?: string): Assertion; - } - - interface Include { - (value: Object | string | number, message?: string): Assertion; - keys: Keys; - members: Members; - any: KeyFilter; - all: KeyFilter; - } - - interface Match { - (regexp: RegExp | string, message?: string): Assertion; - } - - interface Keys { - (...keys: string[]): Assertion; - (keys: any[]): Assertion; - (keys: Object): Assertion; - } - - interface Throw { - (): Assertion; - (expected: string, message?: string): Assertion; - (expected: RegExp, message?: string): Assertion; - (constructor: Error, expected?: string, message?: string): Assertion; - (constructor: Error, expected?: RegExp, message?: string): Assertion; - (constructor: Function, expected?: string, message?: string): Assertion; - (constructor: Function, expected?: RegExp, message?: string): Assertion; - } - - interface RespondTo { - (method: string, message?: string): Assertion; - } - - interface Satisfy { - (matcher: Function, message?: string): Assertion; - } - - interface Members { - (set: any[], message?: string): Assertion; - } - - interface PropertyChange { - (object: Object, property: string, message?: string): Assertion; - } - - export interface Assert { - /** - * @param expression Expression to test for truthiness. - * @param message Message to display on error. - */ - (expression: any, message?: string): void; - - /** - * Throws a failure. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - * @param operator Comparison operator, if not strict equality. - * @remarks Node.js assert module-compatible. - */ - fail(actual?: T, expected?: T, message?: string, operator?: Operator): void; - - /** - * Asserts that object is truthy. - * - * @type T Type of object. - * @param object Object to test. - * @param message Message to display on error. - */ - isOk(value: T, message?: string): void; - - /** - * Asserts that object is truthy. - * - * @type T Type of object. - * @param object Object to test. - * @param message Message to display on error. - */ - ok(value: T, message?: string): void; - - /** - * Asserts that object is falsy. - * - * @type T Type of object. - * @param object Object to test. - * @param message Message to display on error. - */ - isNotOk(value: T, message?: string): void; - - /** - * Asserts that object is falsy. - * - * @type T Type of object. - * @param object Object to test. - * @param message Message to display on error. - */ - notOk(value: T, message?: string): void; - - /** - * Asserts non-strict equality (==) of actual and expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - equal(actual: T, expected: T, message?: string): void; - - /** - * Asserts non-strict inequality (==) of actual and expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - notEqual(actual: T, expected: T, message?: string): void; - - /** - * Asserts strict equality (===) of actual and expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - strictEqual(actual: T, expected: T, message?: string): void; - - /** - * Asserts strict inequality (==) of actual and expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - notStrictEqual(actual: T, expected: T, message?: string): void; - - /** - * Asserts that actual is deeply equal to expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - deepEqual(actual: T, expected: T, message?: string): void; - - /** - * Asserts that actual is not deeply equal to expected. - * - * @type T Type of the objects. - * @param actual Actual value. - * @param expected Potential expected value. - * @param message Message to display on error. - */ - notDeepEqual(actual: T, expected: T, message?: string): void; - - /** - * Asserts valueToCheck is strictly greater than (>) valueToBeAbove. - * - * @param valueToCheck Actual value. - * @param valueToBeAbove Minimum Potential expected value. - * @param message Message to display on error. - */ - isAbove(valueToCheck: number, valueToBeAbove: number, message?: string): void; - - /** - * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtLeast. - * - * @param valueToCheck Actual value. - * @param valueToBeAtLeast Minimum Potential expected value. - * @param message Message to display on error. - */ - isAtLeast(valueToCheck: number, valueToBeAtLeast: number, message?: string): void; - - /** - * Asserts valueToCheck is strictly less than (<) valueToBeBelow. - * - * @param valueToCheck Actual value. - * @param valueToBeBelow Minimum Potential expected value. - * @param message Message to display on error. - */ - isBelow(valueToCheck: number, valueToBeBelow: number, message?: string): void; - - /** - * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtMost. - * - * @param valueToCheck Actual value. - * @param valueToBeAtMost Minimum Potential expected value. - * @param message Message to display on error. - */ - isAtMost(valueToCheck: number, valueToBeAtMost: number, message?: string): void; - - /** - * Asserts that value is true. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isTrue(value: T, message?: string): void; - - /** - * Asserts that value is false. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isFalse(value: T, message?: string): void; - - /** - * Asserts that value is not true. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotTrue(value: T, message?: string): void; - - /** - * Asserts that value is not false. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotFalse(value: T, message?: string): void; - - /** - * Asserts that value is null. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNull(value: T, message?: string): void; - - /** - * Asserts that value is not null. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotNull(value: T, message?: string): void; - - /** - * Asserts that value is not null. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNaN(value: T, message?: string): void; - - /** - * Asserts that value is not null. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotNaN(value: T, message?: string): void; - - /** - * Asserts that value is undefined. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isUndefined(value: T, message?: string): void; - - /** - * Asserts that value is not undefined. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isDefined(value: T, message?: string): void; - - /** - * Asserts that value is a function. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isFunction(value: T, message?: string): void; - - /** - * Asserts that value is not a function. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotFunction(value: T, message?: string): void; - - /** - * Asserts that value is an object of type 'Object' - * (as revealed by Object.prototype.toString). - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - * @remarks The assertion does not match subclassed objects. - */ - isObject(value: T, message?: string): void; - - /** - * Asserts that value is not an object of type 'Object' - * (as revealed by Object.prototype.toString). - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotObject(value: T, message?: string): void; - - /** - * Asserts that value is an array. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isArray(value: T, message?: string): void; - - /** - * Asserts that value is not an array. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotArray(value: T, message?: string): void; - - /** - * Asserts that value is a string. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isString(value: T, message?: string): void; - - /** - * Asserts that value is not a string. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotString(value: T, message?: string): void; - - /** - * Asserts that value is a number. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNumber(value: T, message?: string): void; - - /** - * Asserts that value is not a number. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotNumber(value: T, message?: string): void; - - /** - * Asserts that value is a boolean. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isBoolean(value: T, message?: string): void; - - /** - * Asserts that value is not a boolean. - * - * @type T Type of value. - * @param value Actual value. - * @param message Message to display on error. - */ - isNotBoolean(value: T, message?: string): void; - - /** - * Asserts that value's type is name, as determined by Object.prototype.toString. - * - * @type T Type of value. - * @param value Actual value. - * @param name Potential expected type name of value. - * @param message Message to display on error. - */ - typeOf(value: T, name: string, message?: string): void; - - /** - * Asserts that value's type is not name, as determined by Object.prototype.toString. - * - * @type T Type of value. - * @param value Actual value. - * @param name Potential expected type name of value. - * @param message Message to display on error. - */ - notTypeOf(value: T, name: string, message?: string): void; - - /** - * Asserts that value is an instance of constructor. - * - * @type T Type of value. - * @param value Actual value. - * @param constructor Potential expected contructor of value. - * @param message Message to display on error. - */ - instanceOf(value: T, constructor: Function, message?: string): void; - - /** - * Asserts that value is not an instance of constructor. - * - * @type T Type of value. - * @param value Actual value. - * @param constructor Potential expected contructor of value. - * @param message Message to display on error. - */ - notInstanceOf(value: T, type: Function, message?: string): void; - - /** - * Asserts that haystack includes needle. - * - * @param haystack Container string. - * @param needle Potential expected substring of haystack. - * @param message Message to display on error. - */ - include(haystack: string, needle: string, message?: string): void; - - /** - * Asserts that haystack includes needle. - * - * @type T Type of values in haystack. - * @param haystack Container array. - * @param needle Potential value contained in haystack. - * @param message Message to display on error. - */ - include(haystack: T[], needle: T, message?: string): void; - - /** - * Asserts that haystack does not include needle. - * - * @param haystack Container string. - * @param needle Potential expected substring of haystack. - * @param message Message to display on error. - */ - notInclude(haystack: string, needle: any, message?: string): void; - - /** - * Asserts that haystack does not include needle. - * - * @type T Type of values in haystack. - * @param haystack Container array. - * @param needle Potential value contained in haystack. - * @param message Message to display on error. - */ - notInclude(haystack: any[], needle: any, message?: string): void; - - /** - * Asserts that value matches the regular expression regexp. - * - * @param value Actual value. - * @param regexp Potential match of value. - * @param message Message to display on error. - */ - match(value: string, regexp: RegExp, message?: string): void; - - /** - * Asserts that value does not match the regular expression regexp. - * - * @param value Actual value. - * @param regexp Potential match of value. - * @param message Message to display on error. - */ - notMatch(expected: any, regexp: RegExp, message?: string): void; - - /** - * Asserts that object has a property named by property. - * - * @type T Type of object. - * @param object Container object. - * @param property Potential contained property of object. - * @param message Message to display on error. - */ - property(object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that object has a property named by property. - * - * @type T Type of object. - * @param object Container object. - * @param property Potential contained property of object. - * @param message Message to display on error. - */ - notProperty(object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that object has a property named by property, which can be a string - * using dot- and bracket-notation for deep reference. - * - * @type T Type of object. - * @param object Container object. - * @param property Potential contained property of object. - * @param message Message to display on error. - */ - deepProperty(object: T, property: string, message?: string): void; - - /** - * Asserts that object does not have a property named by property, which can be a - * string using dot- and bracket-notation for deep reference. - * - * @type T Type of object. - * @param object Container object. - * @param property Potential contained property of object. - * @param message Message to display on error. - */ - notDeepProperty(object: T, property: string, message?: string): void; - - /** - * Asserts that object has a property named by property with value given by value. - * - * @type T Type of object. - * @type V Type of value. - * @param object Container object. - * @param property Potential contained property of object. - * @param value Potential expected property value. - * @param message Message to display on error. - */ - propertyVal(object: T, property: string /* keyof T */, value: V, message?: string): void; - - /** - * Asserts that object has a property named by property with value given by value. - * - * @type T Type of object. - * @type V Type of value. - * @param object Container object. - * @param property Potential contained property of object. - * @param value Potential expected property value. - * @param message Message to display on error. - */ - propertyNotVal(object: T, property: string /* keyof T */, value: V, message?: string): void; - - /** - * Asserts that object has a property named by property, which can be a string - * using dot- and bracket-notation for deep reference. - * - * @type T Type of object. - * @type V Type of value. - * @param object Container object. - * @param property Potential contained property of object. - * @param value Potential expected property value. - * @param message Message to display on error. - */ - deepPropertyVal(object: T, property: string, value: V, message?: string): void; - - /** - * Asserts that object does not have a property named by property, which can be a - * string using dot- and bracket-notation for deep reference. - * - * @type T Type of object. - * @type V Type of value. - * @param object Container object. - * @param property Potential contained property of object. - * @param value Potential expected property value. - * @param message Message to display on error. - */ - deepPropertyNotVal(object: T, property: string, value: V, message?: string): void; - - /** - * Asserts that object has a length property with the expected value. - * - * @type T Type of object. - * @param object Container object. - * @param length Potential expected length of object. - * @param message Message to display on error. - */ - lengthOf(object: T, length: number, message?: string): void; - - /** - * Asserts that fn will throw an error. - * - * @param fn Function that may throw. - * @param message Message to display on error. - */ - throw(fn: Function, message?: string): void; - - /** - * Asserts that function will throw an error with message matching regexp. - * - * @param fn Function that may throw. - * @param regExp Potential expected message match. - * @param message Message to display on error. - */ - throw(fn: Function, regExp: RegExp): void; - - /** - * Asserts that function will throw an error that is an instance of constructor. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - throw(fn: Function, constructor: Function, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor - * and an error with message matching regexp. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - throw(fn: Function, constructor: Function, regExp: RegExp): void; - - /** - * Asserts that fn will throw an error. - * - * @param fn Function that may throw. - * @param message Message to display on error. - */ - throws(fn: Function, message?: string): void; - - /** - * Asserts that function will throw an error with message matching regexp. - * - * @param fn Function that may throw. - * @param regExp Potential expected message match. - * @param message Message to display on error. - */ - throws(fn: Function, regExp: RegExp, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - throws(fn: Function, errType: Function, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor - * and an error with message matching regexp. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - throws(fn: Function, errType: Function, regExp: RegExp): void; - - /** - * Asserts that fn will throw an error. - * - * @param fn Function that may throw. - * @param message Message to display on error. - */ - Throw(fn: Function, message?: string): void; - - /** - * Asserts that function will throw an error with message matching regexp. - * - * @param fn Function that may throw. - * @param regExp Potential expected message match. - * @param message Message to display on error. - */ - Throw(fn: Function, regExp: RegExp): void; - - /** - * Asserts that function will throw an error that is an instance of constructor. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - Throw(fn: Function, errType: Function, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor - * and an error with message matching regexp. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - Throw(fn: Function, errType: Function, regExp: RegExp): void; - - /** - * Asserts that fn will not throw an error. - * - * @param fn Function that may throw. - * @param message Message to display on error. - */ - doesNotThrow(fn: Function, message?: string): void; - - /** - * Asserts that function will throw an error with message matching regexp. - * - * @param fn Function that may throw. - * @param regExp Potential expected message match. - * @param message Message to display on error. - */ - doesNotThrow(fn: Function, regExp: RegExp): void; - - /** - * Asserts that function will throw an error that is an instance of constructor. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - doesNotThrow(fn: Function, errType: Function, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor - * and an error with message matching regexp. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; - - /** - * Compares two values using operator. - * - * @param val1 Left value during comparison. - * @param operator Comparison operator. - * @param val2 Right value during comparison. - * @param message Message to display on error. - */ - operator(val1: OperatorComparable, operator: Operator, val2: OperatorComparable, message?: string): void; - - /** - * Asserts that the target is equal to expected, to within a +/- delta range. - * - * @param actual Actual value - * @param expected Potential expected value. - * @param delta Maximum differenced between values. - * @param message Message to display on error. - */ - closeTo(actual: number, expected: number, delta: number, message?: string): void; - - /** - * Asserts that the target is equal to expected, to within a +/- delta range. - * - * @param actual Actual value - * @param expected Potential expected value. - * @param delta Maximum differenced between values. - * @param message Message to display on error. - */ - approximately(act: number, exp: number, delta: number, message?: string): void; - - /** - * Asserts that set1 and set2 have the same members. Order is not take into account. - * - * @type T Type of set values. - * @param set1 Actual set of values. - * @param set2 Potential expected set of values. - * @param message Message to display on error. - */ - sameMembers(set1: T[], set2: T[], message?: string): void; - - /** - * Asserts that set1 and set2 have the same members using deep equality checking. - * Order is not take into account. - * - * @type T Type of set values. - * @param set1 Actual set of values. - * @param set2 Potential expected set of values. - * @param message Message to display on error. - */ - sameDeepMembers(set1: T[], set2: T[], message?: string): void; - - /** - * Asserts that subset is included in superset. Order is not take into account. - * - * @type T Type of set values. - * @param superset Actual set of values. - * @param subset Potential contained set of values. - * @param message Message to display on error. - */ - includeMembers(superset: T[], subset: T[], message?: string): void; - - /** - * Asserts that subset is included in superset using deep equality checking. - * Order is not take into account. - * - * @type T Type of set values. - * @param superset Actual set of values. - * @param subset Potential contained set of values. - * @param message Message to display on error. - */ - includeDeepMembers(superset: T[], subset: T[], message?: string): void; - - /** - * Asserts that non-object, non-array value inList appears in the flat array list. - * - * @type T Type of list values. - * @param inList Value expected to be in the list. - * @param list List of values. - * @param message Message to display on error. - */ - oneOf(inList: T, list: T[], message?: string): void; - - /** - * Asserts that a function changes the value of a property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected to be modified. - * @param message Message to display on error. - */ - changes(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that a function does not change the value of a property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected not to be modified. - * @param message Message to display on error. - */ - doesNotChange(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that a function increases an object property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected to be increased. - * @param message Message to display on error. - */ - increases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that a function does not increase an object property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected not to be increased. - * @param message Message to display on error. - */ - doesNotIncrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that a function decreases an object property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected to be decreased. - * @param message Message to display on error. - */ - decreases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts that a function does not decrease an object property. - * - * @type T Type of object. - * @param modifier Function to run. - * @param object Container object. - * @param property Property of object expected not to be decreased. - * @param message Message to display on error. - */ - doesNotDecrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; - - /** - * Asserts if value is not a false value, and throws if it is a true value. - * - * @type T Type of object. - * @param object Actual value. - * @param message Message to display on error. - * @remarks This is added to allow for chai to be a drop-in replacement for - * Node’s assert class. - */ - ifError(object: T, message?: string): void; - - /** - * Asserts that object is extensible (can have new properties added to it). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isExtensible(object: T, message?: string): void; - - /** - * Asserts that object is extensible (can have new properties added to it). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - extensible(object: T, message?: string): void; - - /** - * Asserts that object is not extensible. - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isNotExtensible(object: T, message?: string): void; - - /** - * Asserts that object is not extensible. - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - notExtensible(object: T, message?: string): void; - - /** - * Asserts that object is sealed (can have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isSealed(object: T, message?: string): void; - - /** - * Asserts that object is sealed (can have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - sealed(object: T, message?: string): void; - - /** - * Asserts that object is not sealed. - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isNotSealed(object: T, message?: string): void; - - /** - * Asserts that object is not sealed. - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - notSealed(object: T, message?: string): void; - - /** - * Asserts that object is frozen (cannot have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isFrozen(object: T, message?: string): void; - - /** - * Asserts that object is frozen (cannot have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - frozen(object: T, message?: string): void; - - /** - * Asserts that object is not frozen (cannot have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - isNotFrozen(object: T, message?: string): void; - - /** - * Asserts that object is not frozen (cannot have new properties added to it - * and its existing properties cannot be removed). - * - * @type T Type of object - * @param object Actual value. - * @param message Message to display on error. - */ - notFrozen(object: T, message?: string): void; - } - - export interface Config { - /** - * Default: false - */ - includeStack: boolean; - - /** - * Default: true - */ - showDiff: boolean; - - /** - * Default: 40 - */ - truncateThreshold: number; - } - - export class AssertionError { - constructor(message: string, _props?: any, ssf?: Function); - public name: string; - public message: string; - public showDiff: boolean; - public stack: string; - } -} - -declare const chai: Chai.ChaiStatic; - -declare module 'chai' { - export = chai; -} - -interface Object { - should: Chai.Assertion; -} diff --git a/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts b/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/chai-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts b/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/chai-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/chai-typescript-typings/package.json b/packages/chai-typescript-typings/package.json deleted file mode 100644 index 96b58cce3..000000000 --- a/packages/chai-typescript-typings/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "chai-typescript-typings", - "version": "0.0.6", - "description": "Typescript type definitions for chai", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/chai-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "copyfiles": "^1.2.0", - "shx": "^0.2.2" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/chai-typescript-typings/tsconfig.json b/packages/chai-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/chai-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/chai-typescript-typings/tslint.json b/packages/chai-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/chai-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/connect/README.md b/packages/connect/README.md index 393ea70a0..7087214d6 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -10,10 +10,10 @@ yarn add @0xproject/connect If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/connect/package.json b/packages/connect/package.json index ae243f288..3e9f3053c 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -53,6 +53,7 @@ "@0xproject/json-schemas": "^0.7.17", "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", "query-string": "^5.0.1", @@ -69,8 +70,6 @@ "async-child-process": "^1.1.1", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "fetch-mock": "^5.13.1", @@ -80,8 +79,7 @@ "shx": "^0.2.2", "tslint": "5.8.0", "typedoc": "~0.8.0", - "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2" + "typescript": "2.7.1" }, "publishConfig": { "access": "public" diff --git a/packages/connect/tsconfig.json b/packages/connect/tsconfig.json index fd9e604ad..e35816553 100644 --- a/packages/connect/tsconfig.json +++ b/packages/connect/tsconfig.json @@ -3,11 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 377fba473..0c931344d 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -49,12 +49,9 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", "chai-bignumber": "^2.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", - "ethers-typescript-typings": "^0.0.4", "mocha": "^4.0.1", "npm-run-all": "^4.1.2", "prettier": "^1.11.1", @@ -64,7 +61,6 @@ "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "yargs": "^10.0.3" }, "dependencies": { @@ -74,6 +70,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "bluebird": "^3.5.0", "bn.js": "^4.11.8", "ethereumjs-abi": "^0.6.4", diff --git a/packages/contracts/tsconfig.json b/packages/contracts/tsconfig.json index 490531eeb..f32a3682a 100644 --- a/packages/contracts/tsconfig.json +++ b/packages/contracts/tsconfig.json @@ -8,11 +8,6 @@ "allowJs": true }, "include": [ - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", "../../node_modules/types-ethereumjs-util/index.d.ts", "../../node_modules/types-bn/index.d.ts", "./globals.d.ts", diff --git a/packages/deployer/README.md b/packages/deployer/README.md index 8fe82f59e..812e8c31b 100644 --- a/packages/deployer/README.md +++ b/packages/deployer/README.md @@ -18,6 +18,14 @@ yarn global add @0xproject/deployer yarn add @0xproject/deployer ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + **Import** ```typescript diff --git a/packages/deployer/package.json b/packages/deployer/package.json index a8b847cd0..362bc659e 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -53,7 +53,6 @@ "chai": "^4.0.1", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", - "ethers-typescript-typings": "^0.0.4", "mocha": "^4.0.1", "nyc": "^11.0.1", "shx": "^0.2.2", @@ -68,6 +67,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.1", "isomorphic-fetch": "^2.2.1", "lodash": "^4.17.4", diff --git a/packages/deployer/tsconfig.json b/packages/deployer/tsconfig.json index befcde5b7..a4cbc37c5 100644 --- a/packages/deployer/tsconfig.json +++ b/packages/deployer/tsconfig.json @@ -8,9 +8,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index 0c4175e35..d7e580d9f 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -21,8 +21,8 @@ yarn add @0xproject/dev-utils If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index de18f4354..71c1615e8 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -30,7 +30,6 @@ "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "mocha": "^4.0.1", "npm-run-all": "^4.1.2", @@ -47,6 +46,7 @@ "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.2", "lodash": "^4.17.4", "request-promise-native": "^1.0.5", diff --git a/packages/dev-utils/tsconfig.json b/packages/dev-utils/tsconfig.json index 1ed3fbc9c..7b93af0da 100644 --- a/packages/dev-utils/tsconfig.json +++ b/packages/dev-utils/tsconfig.json @@ -7,9 +7,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/ethers-typescript-typings/.npmignore b/packages/ethers-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/ethers-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/ethers-typescript-typings/CHANGELOG.md b/packages/ethers-typescript-typings/CHANGELOG.md deleted file mode 100644 index 00bf165a4..000000000 --- a/packages/ethers-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# CHANGELOG - -## v0.0.2 - _March 4, 2018_ - - * Initial types (#413) diff --git a/packages/ethers-typescript-typings/README.md b/packages/ethers-typescript-typings/README.md deleted file mode 100644 index 56ce5f138..000000000 --- a/packages/ethers-typescript-typings/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## ethers-typescript-typings - -There currently isn't an official [Ethers][ethers] -type definition included in the [DefinitelyTyped][definitelytyped] project. -Until that happens, we will continue to improve our own type definition. -If it get's close to comprehensive, we'll add it to [DefinitelyTyped][definitelytyped]. - -[ethers]: https://github.com/ethers-io/ethers.js -[definitelytyped]: https://github.com/DefinitelyTyped/DefinitelyTyped - -## Installation - -```bash -yarn add -D ethers-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/ethers-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/ethers-typescript-typings/index.d.ts b/packages/ethers-typescript-typings/index.d.ts deleted file mode 100644 index e5d38819e..000000000 --- a/packages/ethers-typescript-typings/index.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare module 'ethers-contracts' { - export interface TransactionDescription { - name: string; - signature: string; - sighash: string; - data: string; - } - export interface CallDescription extends TransactionDescription { - parse: (...args: any[]) => any; - } - export interface FunctionDescription { - (...params: any[]): TransactionDescription | CallDescription; - inputs: { names: string[]; types: string[] }; - outputs: { names: string[]; types: string[] }; - } - export interface EventDescription { - parse: (...args: any[]) => any; - inputs: { names: string[]; types: string[] }; - signature: string; - topic: string; - } - export class Interface { - public functions: { [functionName: string]: FunctionDescription }; - public events: { [eventName: string]: EventDescription }; - public static decodeParams(types: string[], data: string): any[]; - constructor(abi: any); - } -} diff --git a/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts b/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/ethers-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts b/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/ethers-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/ethers-typescript-typings/package.json b/packages/ethers-typescript-typings/package.json deleted file mode 100644 index d797033e1..000000000 --- a/packages/ethers-typescript-typings/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "ethers-typescript-typings", - "version": "0.0.4", - "description": "Typescript type definitions for ethers.js", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "lint": "tslint index.d.ts", - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "author": "Fabio Berger", - "contributors": [ - "Leonid Logvinov " - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/ethers-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "copyfiles": "^1.2.0", - "shx": "^0.2.2", - "tslint": "5.8.0", - "tslint-config-0xproject": "^0.0.2", - "typescript": "2.7.1" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/ethers-typescript-typings/tsconfig.json b/packages/ethers-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/ethers-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/ethers-typescript-typings/tslint.json b/packages/ethers-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/ethers-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/json-schemas/README.md b/packages/json-schemas/README.md index f320196e9..980d17416 100644 --- a/packages/json-schemas/README.md +++ b/packages/json-schemas/README.md @@ -12,8 +12,8 @@ yarn add @0xproject/json-schemas **Import** -```javascript -import { schemas } from '@0xproject/json-schemas'; +```typescript +import { SchemaValidator, ValidatorResult, schemas } from '@0xproject/json-schemas'; ``` or @@ -22,6 +22,14 @@ or var schemas = require('@0xproject/json-schemas').schemas; ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 1266f964b..f4f4c63b5 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -39,6 +39,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { + "@0xproject/typescript-typings": "^0.0.1", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, @@ -50,7 +51,6 @@ "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "lodash.foreach": "^4.5.0", diff --git a/packages/json-schemas/tsconfig.json b/packages/json-schemas/tsconfig.json index 10354fa33..e35816553 100644 --- a/packages/json-schemas/tsconfig.json +++ b/packages/json-schemas/tsconfig.json @@ -3,10 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/monorepo-scripts/package.json b/packages/monorepo-scripts/package.json index a8f4918ca..5333e6cad 100644 --- a/packages/monorepo-scripts/package.json +++ b/packages/monorepo-scripts/package.json @@ -25,6 +25,8 @@ "@0xproject/tslint-config": "0.4.8", "@types/glob": "^5.0.33", "@types/node": "^8.0.53", + "@types/rimraf": "^2.0.2", + "lerna-get-packages": "^1.0.0", "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "2.7.1" @@ -35,7 +37,9 @@ "es6-promisify": "^5.0.0", "glob": "^7.1.2", "lodash": "^4.17.4", + "promisify-child-process": "^1.0.5", "publish-release": "0xproject/publish-release", + "rimraf": "^2.6.2", "semver-sort": "^0.0.4" }, "publishConfig": { diff --git a/packages/monorepo-scripts/src/globals.d.ts b/packages/monorepo-scripts/src/globals.d.ts index 757ae4097..1d49559f2 100644 --- a/packages/monorepo-scripts/src/globals.d.ts +++ b/packages/monorepo-scripts/src/globals.d.ts @@ -6,3 +6,22 @@ declare module 'es6-promisify'; declare module 'semver-sort' { const desc: (versions: string[]) => string[]; } + +declare interface LernaPackage { + location: string; + package: { + private?: boolean; + name: string; + main?: string; + config?: { + additionalTsTypings?: string[]; + }; + }; +} +declare function lernaGetPackages(path: string): LernaPackage[]; +// lerna-get-packages declarations +declare module 'lerna-get-packages' { + export = lernaGetPackages; +} + +declare module 'promisify-child-process'; diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts new file mode 100644 index 000000000..116b70f3a --- /dev/null +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -0,0 +1,57 @@ +#!/usr/bin/env node + +import * as fs from 'fs'; +import lernaGetPackages = require('lerna-get-packages'); +import * as _ from 'lodash'; +import * as path from 'path'; +import { exec as execAsync } from 'promisify-child-process'; +import * as rimraf from 'rimraf'; + +import { utils } from './utils'; + +(async () => { + const monorepoRootPath = path.join(__dirname, '../../..'); + const lernaPackages = lernaGetPackages(monorepoRootPath); + const installablePackages = _.filter( + lernaPackages, + lernaPackage => + !lernaPackage.package.private && + !_.isUndefined(lernaPackage.package.main) && + lernaPackage.package.main.endsWith('.js'), + ); + for (const installableLernaPackage of installablePackages) { + const packagePath = installableLernaPackage.location; + const packageName = installableLernaPackage.package.name; + utils.log(`Testing ${packageName}`); + let result = await execAsync('npm pack', { cwd: packagePath }); + const packedPackageFileName = result.stdout.trim(); + const testDirectory = path.join(monorepoRootPath, '../test-env'); + fs.mkdirSync(testDirectory); + result = await execAsync('yarn init --yes', { cwd: testDirectory }); + utils.log(`Installing ${packedPackageFileName}`); + result = await execAsync(`yarn add ${packagePath}/${packedPackageFileName}`, { cwd: testDirectory }); + const indexFilePath = path.join(testDirectory, 'index.ts'); + fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}'`); + const tsConfig = { + compilerOptions: { + module: 'commonjs', + target: 'es5', + lib: ['es2017', 'dom'], + declaration: true, + noImplicitReturns: true, + pretty: true, + strict: true, + }, + include: ['index.ts'], + }; + const tsconfigFilePath = path.join(testDirectory, 'tsconfig.json'); + fs.writeFileSync(tsconfigFilePath, JSON.stringify(tsConfig, null, 4)); + utils.log(`Compiling ${packageName}`); + await execAsync('../node_modules/typescript/bin/tsc', { cwd: testDirectory }); + utils.log(`Successfully compiled with ${packageName} as a dependency`); + rimraf.sync(testDirectory); + } +})().catch(err => { + utils.log(err.stdout); + process.exit(1); +}); diff --git a/packages/monorepo-scripts/tsconfig.json b/packages/monorepo-scripts/tsconfig.json index 3d967d05f..c56d255d5 100644 --- a/packages/monorepo-scripts/tsconfig.json +++ b/packages/monorepo-scripts/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/react-docs-example/package.json b/packages/react-docs-example/package.json index 2dce1a0eb..25fa1ecd2 100644 --- a/packages/react-docs-example/package.json +++ b/packages/react-docs-example/package.json @@ -27,8 +27,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-tap-event-plugin": "0.0.30", "awesome-typescript-loader": "^3.1.3", "copyfiles": "^1.2.0", diff --git a/packages/react-docs/README.md b/packages/react-docs/README.md index cad05ca67..9be370f10 100644 --- a/packages/react-docs/README.md +++ b/packages/react-docs/README.md @@ -33,6 +33,14 @@ This package exposes both a single `Documentation` react component that will ren Currently this package still has some external dependencies outside of the `Documentation` component, so please start your project off by copying the [react-docs-example](https://github.com/0xProject/0x-monorepo/tree/development/packages/react-docs-example) directory and modifying it there. If you need changes in the [react-docs](https://github.com/0xProject/0x-monorepo/tree/development/packages/react-docs) package, fork the 0x monorepo, make the required changes and submit a PR. Until we merge it, you can have your project depend on your own custom fork. +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Future improvements Feel free to contribute to these improvements! diff --git a/packages/react-docs/package.json b/packages/react-docs/package.json index ebc445d98..0b0a52efa 100644 --- a/packages/react-docs/package.json +++ b/packages/react-docs/package.json @@ -35,8 +35,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-scroll": "0.0.31", "@types/react-tap-event-plugin": "0.0.30", "basscss": "^8.0.3", diff --git a/packages/react-docs/tsconfig.json b/packages/react-docs/tsconfig.json index 9af6638a2..82f44a62c 100644 --- a/packages/react-docs/tsconfig.json +++ b/packages/react-docs/tsconfig.json @@ -9,5 +9,5 @@ "*": ["node_modules/@types/*", "*"] } }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/react-shared/README.md b/packages/react-shared/README.md index da7ff83af..9165cf78d 100644 --- a/packages/react-shared/README.md +++ b/packages/react-shared/README.md @@ -8,6 +8,14 @@ Contains React components & frontend types/utils shared between 0x projects. yarn add @0xproject/react-shared ``` +If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: + +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} +``` + ## Contributing We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. diff --git a/packages/react-shared/package.json b/packages/react-shared/package.json index e5201536e..8b7a0ebbb 100644 --- a/packages/react-shared/package.json +++ b/packages/react-shared/package.json @@ -33,8 +33,8 @@ "@types/lodash": "4.14.104", "@types/material-ui": "0.18.0", "@types/node": "^8.0.53", - "@types/react": "^15.0.15", - "@types/react-dom": "^0.14.23", + "@types/react": "^16.0.34", + "@types/react-dom": "^16.0.3", "@types/react-scroll": "0.0.31", "basscss": "^8.0.3", "is-mobile": "^0.2.2", diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 106c47d13..6b5183ff2 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -40,6 +40,7 @@ "dependencies": { "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.3.4", + "@0xproject/typescript-typings": "^0.0.1", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -57,7 +58,6 @@ "@types/mocha": "^2.2.42", "@types/node": "^8.0.53", "chai": "^4.0.1", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/sol-cov/tsconfig.json b/packages/sol-cov/tsconfig.json index 44e43719b..7b93af0da 100644 --- a/packages/sol-cov/tsconfig.json +++ b/packages/sol-cov/tsconfig.json @@ -7,8 +7,6 @@ "./src/**/*", "./test/**/*", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/sra-report/package.json b/packages/sra-report/package.json index 78c37e002..d8cbea70e 100644 --- a/packages/sra-report/package.json +++ b/packages/sra-report/package.json @@ -33,6 +33,7 @@ "@0xproject/connect": "^0.6.6", "@0xproject/json-schemas": "^0.7.17", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "chalk": "^2.3.0", "lodash": "^4.17.4", "newman": "^3.9.3", @@ -48,8 +49,6 @@ "@types/yargs": "^10.0.0", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.10", - "chai-typescript-typings": "^0.0.4", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/sra-report/tsconfig.json b/packages/sra-report/tsconfig.json index a0a54410a..e35816553 100644 --- a/packages/sra-report/tsconfig.json +++ b/packages/sra-report/tsconfig.json @@ -3,12 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "./test/**/*", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/subproviders/README.md b/packages/subproviders/README.md index a2bf75768..ac92b89d2 100644 --- a/packages/subproviders/README.md +++ b/packages/subproviders/README.md @@ -14,10 +14,10 @@ yarn add @0xproject/subproviders If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Contributing diff --git a/packages/subproviders/package.json b/packages/subproviders/package.json index 96d3e7f00..411fe22dc 100644 --- a/packages/subproviders/package.json +++ b/packages/subproviders/package.json @@ -36,6 +36,7 @@ "@0xproject/assert": "^0.2.3", "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "@ledgerhq/hw-app-eth": "^4.3.0", "@ledgerhq/hw-transport-u2f": "^4.3.0", "bn.js": "^4.11.8", @@ -47,8 +48,7 @@ "lodash": "^4.17.4", "semaphore-async-await": "^1.5.1", "web3": "^0.20.0", - "web3-provider-engine": "^13.0.1", - "web3-typescript-typings": "^0.10.2" + "web3-provider-engine": "^13.0.1" }, "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.14", @@ -59,8 +59,6 @@ "@types/node": "^8.0.53", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-as-promised-typescript-typings": "^0.0.12", - "chai-typescript-typings": "^0.0.6", "copyfiles": "^1.2.0", "dirty-chai": "^2.0.1", "mocha": "^4.0.1", diff --git a/packages/subproviders/tsconfig.json b/packages/subproviders/tsconfig.json index 9a65a0a97..7b93af0da 100644 --- a/packages/subproviders/tsconfig.json +++ b/packages/subproviders/tsconfig.json @@ -6,10 +6,7 @@ "include": [ "./src/**/*", "./test/**/*", - "../../node_modules/chai-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/chai-as-promised-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json index 7159af988..7b43db4e7 100644 --- a/packages/testnet-faucets/package.json +++ b/packages/testnet-faucets/package.json @@ -18,6 +18,7 @@ "0x.js": "^0.33.6", "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "body-parser": "^1.17.1", "ethereumjs-tx": "^1.3.3", "ethereumjs-util": "^5.1.1", @@ -41,7 +42,6 @@ "types-bn": "^0.0.1", "types-ethereumjs-util": "0xProject/types-ethereumjs-util", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "webpack": "^3.1.0", "webpack-node-externals": "^1.6.0" } diff --git a/packages/testnet-faucets/tsconfig.json b/packages/testnet-faucets/tsconfig.json index 237f62169..b0e7ba00c 100644 --- a/packages/testnet-faucets/tsconfig.json +++ b/packages/testnet-faucets/tsconfig.json @@ -6,9 +6,7 @@ }, "include": [ "./src/ts/**/*", - "../../node_modules/ethers-typescript-typings/index.d.ts", "../../node_modules/types-bn/index.d.ts", - "../../node_modules/types-ethereumjs-util/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" + "../../node_modules/types-ethereumjs-util/index.d.ts" ] } diff --git a/packages/tslint-config/tsconfig.json b/packages/tslint-config/tsconfig.json index 6e5f060a4..85c88035a 100644 --- a/packages/tslint-config/tsconfig.json +++ b/packages/tslint-config/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./rules/**/*", "./monorepo_scripts/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./rules/**/*", "./monorepo_scripts/**/*"] } diff --git a/packages/types/README.md b/packages/types/README.md index 5101ee544..b971eaee7 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -10,10 +10,10 @@ yarn add -D @0xproject/types If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/types/package.json b/packages/types/package.json index e664b06ae..1142d252a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,9 +28,9 @@ "typescript": "2.7.1" }, "dependencies": { + "@0xproject/typescript-typings": "^0.0.1", "bignumber.js": "~4.1.0", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 3d967d05f..c56d255d5 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["./src/**/*", "../../node_modules/web3-typescript-typings/index.d.ts"] + "include": ["./src/**/*"] } diff --git a/packages/typescript-typings/.npmignore b/packages/typescript-typings/.npmignore new file mode 100644 index 000000000..104d718ed --- /dev/null +++ b/packages/typescript-typings/.npmignore @@ -0,0 +1,3 @@ +.* +yarn-error.log +/scripts/ diff --git a/packages/typescript-typings/CHANGELOG.md b/packages/typescript-typings/CHANGELOG.md new file mode 100644 index 000000000..8c52570da --- /dev/null +++ b/packages/typescript-typings/CHANGELOG.md @@ -0,0 +1,3 @@ +# CHANGELOG + +## v0.x.x - _TBD, 2018_ diff --git a/packages/typescript-typings/README.md b/packages/typescript-typings/README.md new file mode 100644 index 000000000..9a74739f3 --- /dev/null +++ b/packages/typescript-typings/README.md @@ -0,0 +1,45 @@ +## @0xproject/typescript-typings + +Type repository for external packages used by 0x. This is like our small version of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) + +## Installation + +```bash +yarn add -D @0xproject/typescript-typings +``` + +## Usage + +Add the following line within an `compilerOptions` section of your `tsconfig.json` + +```json +"typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"] +``` + +This will allow the TS compiler to first look into that repo and then fallback to DT types. + +## Contributing + +We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. + +### Install Dependencies + +If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: + +```bash +yarn config set workspaces-experimental true +``` + +Then install dependencies + +```bash +yarn install +``` + +### Lint + +```bash +yarn lint +``` diff --git a/packages/typescript-typings/monorepo_scripts/globals.d.ts b/packages/typescript-typings/monorepo_scripts/globals.d.ts new file mode 100644 index 000000000..94e63a32d --- /dev/null +++ b/packages/typescript-typings/monorepo_scripts/globals.d.ts @@ -0,0 +1,6 @@ +declare module '*.json' { + const json: any; + /* tslint:disable */ + export default json; + /* tslint:enable */ +} diff --git a/packages/typescript-typings/monorepo_scripts/postpublish.ts b/packages/typescript-typings/monorepo_scripts/postpublish.ts new file mode 100644 index 000000000..dcb99d0f7 --- /dev/null +++ b/packages/typescript-typings/monorepo_scripts/postpublish.ts @@ -0,0 +1,8 @@ +import { postpublishUtils } from '@0xproject/monorepo-scripts'; + +import * as packageJSON from '../package.json'; +import * as tsConfigJSON from '../tsconfig.json'; + +const cwd = `${__dirname}/..`; +// tslint:disable-next-line:no-floating-promises +postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json new file mode 100644 index 000000000..8fce84272 --- /dev/null +++ b/packages/typescript-typings/package.json @@ -0,0 +1,33 @@ +{ + "name": "@0xproject/typescript-typings", + "version": "0.0.1", + "description": "0x project typescript type definitions", + "scripts": { + "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", + "clean": "shx rm -rf scripts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xProject/0x-monorepo.git" + }, + "author": "Fabio Berger", + "contributors": [ + "Leonid Logvinov " + ], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/0xProject/0x-monorepo/issues" + }, + "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", + "dependencies": { + "bignumber.js": "~4.1.0" + }, + "devDependencies": { + "@0xproject/monorepo-scripts": "^0.1.14", + "copyfiles": "^1.2.0", + "shx": "^0.2.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/typescript-typings/tsconfig.json b/packages/typescript-typings/tsconfig.json new file mode 100644 index 000000000..bc453af4b --- /dev/null +++ b/packages/typescript-typings/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./monorepo_scripts/**/*"] +} diff --git a/packages/typescript-typings/tslint.json b/packages/typescript-typings/tslint.json new file mode 100644 index 000000000..9a93a1f74 --- /dev/null +++ b/packages/typescript-typings/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": ["tslint-config-0xproject"] +} diff --git a/packages/typescript-typings/types/chai-as-promised/index.d.ts b/packages/typescript-typings/types/chai-as-promised/index.d.ts new file mode 100644 index 000000000..ba6dabdcc --- /dev/null +++ b/packages/typescript-typings/types/chai-as-promised/index.d.ts @@ -0,0 +1,268 @@ +// Type definitions for chai-as-promised +// Project: https://github.com/domenic/chai-as-promised/ +// Definitions by: jt000 , Yuki Kokubun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'chai-as-promised' { + function chaiAsPromised(chai: any, utils: any): void; + namespace chaiAsPromised { + + } + export = chaiAsPromised; +} + +// tslint:disable:no-namespace ban-types member-ordering +declare namespace Chai { + // For BDD API + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + eventually: PromisedAssertion; + fulfilled: PromisedAssertion; + become(expected: any): PromisedAssertion; + rejected(): PromisedAssertion; + rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; + notify(fn: Function): PromisedAssertion; + } + + // Eventually does not have .then(), but PromisedAssertion have. + interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { + // From chai-as-promised + become(expected: PromiseLike): PromisedAssertion; + fulfilled: PromisedAssertion; + rejected: () => PromisedAssertion; + rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; + notify(fn: Function): PromisedAssertion; + + // From chai + not: PromisedAssertion; + deep: PromisedDeep; + all: PromisedKeyFilter; + a: PromisedTypeComparison; + an: PromisedTypeComparison; + include: PromisedInclude; + contain: PromisedInclude; + ok: PromisedAssertion; + true: () => PromisedAssertion; + false: () => PromisedAssertion; + null: PromisedAssertion; + undefined: PromisedAssertion; + exist: PromisedAssertion; + empty: PromisedAssertion; + arguments: PromisedAssertion; + Arguments: PromisedAssertion; + equal: PromisedEqual; + equals: PromisedEqual; + eq: PromisedEqual; + eql: PromisedEqual; + eqls: PromisedEqual; + property: PromisedProperty; + ownProperty: PromisedOwnProperty; + haveOwnProperty: PromisedOwnProperty; + length: PromisedLength; + lengthOf: PromisedLength; + match(regexp: RegExp | string, message?: string): PromisedAssertion; + string(string: string, message?: string): PromisedAssertion; + keys: PromisedKeys; + key(string: string): PromisedAssertion; + throw: PromisedThrow; + throws: PromisedThrow; + Throw: PromisedThrow; + respondTo(method: string, message?: string): PromisedAssertion; + itself: PromisedAssertion; + satisfy(matcher: Function, message?: string): PromisedAssertion; + closeTo(expected: number, delta: number, message?: string): PromisedAssertion; + members: PromisedMembers; + } + + interface PromisedAssertion extends Eventually, PromiseLike {} + + interface PromisedLanguageChains { + eventually: Eventually; + + // From chai + to: PromisedAssertion; + be: PromisedAssertion; + been: PromisedAssertion; + is: PromisedAssertion; + that: PromisedAssertion; + which: PromisedAssertion; + and: PromisedAssertion; + has: PromisedAssertion; + have: PromisedAssertion; + with: PromisedAssertion; + at: PromisedAssertion; + of: PromisedAssertion; + same: PromisedAssertion; + } + + interface PromisedNumericComparison { + above: PromisedNumberComparer; + gt: PromisedNumberComparer; + greaterThan: PromisedNumberComparer; + least: PromisedNumberComparer; + gte: PromisedNumberComparer; + below: PromisedNumberComparer; + lt: PromisedNumberComparer; + lessThan: PromisedNumberComparer; + most: PromisedNumberComparer; + lte: PromisedNumberComparer; + within(start: number, finish: number, message?: string): PromisedAssertion; + } + + type PromisedNumberComparer = (value: number, message?: string) => PromisedAssertion; + + interface PromisedTypeComparison { + (type: string, message?: string): PromisedAssertion; + instanceof: PromisedInstanceOf; + instanceOf: PromisedInstanceOf; + } + + type PromisedInstanceOf = (constructor: Object, message?: string) => PromisedAssertion; + + interface PromisedDeep { + equal: PromisedEqual; + include: PromisedInclude; + property: PromisedProperty; + } + + interface PromisedKeyFilter { + keys: PromisedKeys; + } + + type PromisedEqual = (value: any, message?: string) => PromisedAssertion; + + type PromisedProperty = (name: string, value?: any, message?: string) => PromisedAssertion; + + type PromisedOwnProperty = (name: string, message?: string) => PromisedAssertion; + + interface PromisedLength extends PromisedLanguageChains, PromisedNumericComparison { + (length: number, message?: string): PromisedAssertion; + } + + interface PromisedInclude { + (value: Object | string | number, message?: string): PromisedAssertion; + keys: PromisedKeys; + members: PromisedMembers; + all: PromisedKeyFilter; + } + + interface PromisedKeys { + (...keys: string[]): PromisedAssertion; + (keys: any[]): PromisedAssertion; + } + + interface PromisedThrow { + (): PromisedAssertion; + (expected: string | RegExp, message?: string): PromisedAssertion; + (constructor: Error | Function, expected?: string | RegExp, message?: string): PromisedAssertion; + } + + type PromisedMembers = (set: any[], message?: string) => PromisedAssertion; + + // For Assert API + interface Assert { + eventually: PromisedAssert; + isFulfilled(promise: PromiseLike, message?: string): PromiseLike; + becomes(promise: PromiseLike, expected: any, message?: string): PromiseLike; + doesNotBecome(promise: PromiseLike, expected: any, message?: string): PromiseLike; + isRejected(promise: PromiseLike, message?: string): PromiseLike; + isRejected(promise: PromiseLike, expected: any | RegExp, message?: string): PromiseLike; + notify(fn: Function): PromiseLike; + } + + export interface PromisedAssert { + fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike; + + ok(val: any, msg?: string): PromiseLike; + notOk(val: any, msg?: string): PromiseLike; + + equal(act: any, exp: any, msg?: string): PromiseLike; + notEqual(act: any, exp: any, msg?: string): PromiseLike; + + strictEqual(act: any, exp: any, msg?: string): PromiseLike; + notStrictEqual(act: any, exp: any, msg?: string): PromiseLike; + + deepEqual(act: any, exp: any, msg?: string): PromiseLike; + notDeepEqual(act: any, exp: any, msg?: string): PromiseLike; + + isTrue(val: any, msg?: string): PromiseLike; + isFalse(val: any, msg?: string): PromiseLike; + + isNull(val: any, msg?: string): PromiseLike; + isNotNull(val: any, msg?: string): PromiseLike; + + isUndefined(val: any, msg?: string): PromiseLike; + isDefined(val: any, msg?: string): PromiseLike; + + isFunction(val: any, msg?: string): PromiseLike; + isNotFunction(val: any, msg?: string): PromiseLike; + + isObject(val: any, msg?: string): PromiseLike; + isNotObject(val: any, msg?: string): PromiseLike; + + isArray(val: any, msg?: string): PromiseLike; + isNotArray(val: any, msg?: string): PromiseLike; + + isString(val: any, msg?: string): PromiseLike; + isNotString(val: any, msg?: string): PromiseLike; + + isNumber(val: any, msg?: string): PromiseLike; + isNotNumber(val: any, msg?: string): PromiseLike; + + isBoolean(val: any, msg?: string): PromiseLike; + isNotBoolean(val: any, msg?: string): PromiseLike; + + typeOf(val: any, type: string, msg?: string): PromiseLike; + notTypeOf(val: any, type: string, msg?: string): PromiseLike; + + instanceOf(val: any, type: Function, msg?: string): PromiseLike; + notInstanceOf(val: any, type: Function, msg?: string): PromiseLike; + + include(exp: string | any[], inc: any, msg?: string): PromiseLike; + + notInclude(exp: string | any[], inc: any, msg?: string): PromiseLike; + + match(exp: any, re: RegExp, msg?: string): PromiseLike; + notMatch(exp: any, re: RegExp, msg?: string): PromiseLike; + + property(obj: Object, prop: string, msg?: string): PromiseLike; + notProperty(obj: Object, prop: string, msg?: string): PromiseLike; + deepProperty(obj: Object, prop: string, msg?: string): PromiseLike; + notDeepProperty(obj: Object, prop: string, msg?: string): PromiseLike; + + propertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + + lengthOf(exp: any, len: number, msg?: string): PromiseLike; + // alias frenzy + throw(fn: Function, msg?: string): PromiseLike; + throw(fn: Function, regExp: RegExp): PromiseLike; + throw(fn: Function, errType: Function, msg?: string): PromiseLike; + throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; + + throws(fn: Function, msg?: string): PromiseLike; + throws(fn: Function, regExp: RegExp): PromiseLike; + throws(fn: Function, errType: Function, msg?: string): PromiseLike; + throws(fn: Function, errType: Function, regExp: RegExp): PromiseLike; + + Throw(fn: Function, msg?: string): PromiseLike; + Throw(fn: Function, regExp: RegExp): PromiseLike; + Throw(fn: Function, errType: Function, msg?: string): PromiseLike; + Throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; + + doesNotThrow(fn: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, regExp: RegExp): PromiseLike; + doesNotThrow(fn: Function, errType: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromiseLike; + + operator(val: any, operator: string, val2: any, msg?: string): PromiseLike; + closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike; + + sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike; + includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike; + + ifError(val: any, msg?: string): PromiseLike; + } +} diff --git a/packages/typescript-typings/types/chai/index.d.ts b/packages/typescript-typings/types/chai/index.d.ts new file mode 100644 index 000000000..8b3e4c079 --- /dev/null +++ b/packages/typescript-typings/types/chai/index.d.ts @@ -0,0 +1,1254 @@ +// Type definitions for chai 4.0.0 +// Project: http://chaijs.com/ +// Definitions by: Jed Mao , +// Bart van der Schoor , +// Andrew Brown , +// Olivier Chevet , +// Matt Wistrand , +// Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// + +// tslint:disable:no-namespace member-ordering ban-types unified-signatures variable-name callable-types +declare namespace Chai { + interface ChaiStatic { + expect: ExpectStatic; + should(): Should; + /** + * Provides a way to extend the internals of Chai + */ + use(fn: (chai: any, utils: any) => void): ChaiStatic; + assert: AssertStatic; + config: Config; + AssertionError: typeof AssertionError; + version: string; + } + + export interface ExpectStatic extends AssertionStatic { + fail(actual?: any, expected?: any, message?: string, operator?: Operator): void; + } + + export interface AssertStatic extends Assert {} + + type AssertionStatic = (target: any, message?: string) => Assertion; + + export type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!=="; + + export type OperatorComparable = boolean | null | number | string | undefined | Date; + + interface ShouldAssertion { + equal(value1: any, value2: any, message?: string): void; + Throw: ShouldThrow; + throw: ShouldThrow; + exist(value: any, message?: string): void; + } + + interface Should extends ShouldAssertion { + not: ShouldAssertion; + fail(actual: any, expected: any, message?: string, operator?: Operator): void; + } + + interface ShouldThrow { + (actual: Function): void; + (actual: Function, expected: string | RegExp, message?: string): void; + (actual: Function, constructor: Error | Function, expected?: string | RegExp, message?: string): void; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + not: Assertion; + deep: Deep; + nested: Nested; + any: KeyFilter; + all: KeyFilter; + a: TypeComparison; + an: TypeComparison; + include: Include; + includes: Include; + contain: Include; + contains: Include; + ok: Assertion; + true: () => Assertion; + false: () => Assertion; + null: () => Assertion; + undefined: () => Assertion; + NaN: Assertion; + exist: Assertion; + empty: Assertion; + arguments: Assertion; + Arguments: Assertion; + equal: Equal; + equals: Equal; + eq: Equal; + eql: Equal; + eqls: Equal; + property: Property; + ownProperty: OwnProperty; + haveOwnProperty: OwnProperty; + ownPropertyDescriptor: OwnPropertyDescriptor; + haveOwnPropertyDescriptor: OwnPropertyDescriptor; + length: Length; + lengthOf: Length; + match: Match; + matches: Match; + string(string: string, message?: string): Assertion; + keys: Keys; + key(string: string): Assertion; + throw: (message?: string) => Assertion; + throws: Throw; + Throw: Throw; + respondTo: RespondTo; + respondsTo: RespondTo; + itself: Assertion; + satisfy: Satisfy; + satisfies: Satisfy; + closeTo: CloseTo; + approximately: CloseTo; + members: Members; + increase: PropertyChange; + increases: PropertyChange; + decrease: PropertyChange; + decreases: PropertyChange; + change: PropertyChange; + changes: PropertyChange; + extensible: Assertion; + sealed: Assertion; + frozen: Assertion; + oneOf(list: any[], message?: string): Assertion; + } + + interface LanguageChains { + to: Assertion; + be: Assertion; + been: Assertion; + is: Assertion; + that: Assertion; + which: Assertion; + and: Assertion; + has: Assertion; + have: Assertion; + with: Assertion; + at: Assertion; + of: Assertion; + same: Assertion; + } + + interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; + least: NumberComparer; + gte: NumberComparer; + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; + most: NumberComparer; + lte: NumberComparer; + within(start: number, finish: number, message?: string): Assertion; + } + + interface NumberComparer { + (value: number, message?: string): Assertion; + } + + interface TypeComparison { + (type: string, message?: string): Assertion; + instanceof: InstanceOf; + instanceOf: InstanceOf; + } + + interface InstanceOf { + (constructor: Object, message?: string): Assertion; + } + + interface CloseTo { + (expected: number, delta: number, message?: string): Assertion; + } + + interface Nested { + include: Include; + property: Property; + members: Members; + } + + interface Deep { + equal: Equal; + equals: Equal; + eq: Equal; + include: Include; + property: Property; + members: Members; + } + + interface KeyFilter { + keys: Keys; + } + + interface Equal { + (value: any, message?: string): Assertion; + } + + interface Property { + (name: string, value?: any, message?: string): Assertion; + } + + interface OwnProperty { + (name: string, message?: string): Assertion; + } + + interface OwnPropertyDescriptor { + (name: string, descriptor: PropertyDescriptor, message?: string): Assertion; + (name: string, message?: string): Assertion; + } + + interface Length extends LanguageChains, NumericComparison { + (length: number, message?: string): Assertion; + } + + interface Include { + (value: Object | string | number, message?: string): Assertion; + keys: Keys; + members: Members; + any: KeyFilter; + all: KeyFilter; + } + + interface Match { + (regexp: RegExp | string, message?: string): Assertion; + } + + interface Keys { + (...keys: string[]): Assertion; + (keys: any[]): Assertion; + (keys: Object): Assertion; + } + + interface Throw { + (): Assertion; + (expected: string, message?: string): Assertion; + (expected: RegExp, message?: string): Assertion; + (constructor: Error, expected?: string, message?: string): Assertion; + (constructor: Error, expected?: RegExp, message?: string): Assertion; + (constructor: Function, expected?: string, message?: string): Assertion; + (constructor: Function, expected?: RegExp, message?: string): Assertion; + } + + interface RespondTo { + (method: string, message?: string): Assertion; + } + + interface Satisfy { + (matcher: Function, message?: string): Assertion; + } + + interface Members { + (set: any[], message?: string): Assertion; + } + + interface PropertyChange { + (object: Object, property: string, message?: string): Assertion; + } + + export interface Assert { + /** + * @param expression Expression to test for truthiness. + * @param message Message to display on error. + */ + (expression: any, message?: string): void; + + /** + * Throws a failure. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + * @param operator Comparison operator, if not strict equality. + * @remarks Node.js assert module-compatible. + */ + fail(actual?: T, expected?: T, message?: string, operator?: Operator): void; + + /** + * Asserts that object is truthy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + isOk(value: T, message?: string): void; + + /** + * Asserts that object is truthy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + ok(value: T, message?: string): void; + + /** + * Asserts that object is falsy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + isNotOk(value: T, message?: string): void; + + /** + * Asserts that object is falsy. + * + * @type T Type of object. + * @param object Object to test. + * @param message Message to display on error. + */ + notOk(value: T, message?: string): void; + + /** + * Asserts non-strict equality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + equal(actual: T, expected: T, message?: string): void; + + /** + * Asserts non-strict inequality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts strict equality (===) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + strictEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts strict inequality (==) of actual and expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notStrictEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts that actual is deeply equal to expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + deepEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts that actual is not deeply equal to expected. + * + * @type T Type of the objects. + * @param actual Actual value. + * @param expected Potential expected value. + * @param message Message to display on error. + */ + notDeepEqual(actual: T, expected: T, message?: string): void; + + /** + * Asserts valueToCheck is strictly greater than (>) valueToBeAbove. + * + * @param valueToCheck Actual value. + * @param valueToBeAbove Minimum Potential expected value. + * @param message Message to display on error. + */ + isAbove(valueToCheck: number, valueToBeAbove: number, message?: string): void; + + /** + * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtLeast. + * + * @param valueToCheck Actual value. + * @param valueToBeAtLeast Minimum Potential expected value. + * @param message Message to display on error. + */ + isAtLeast(valueToCheck: number, valueToBeAtLeast: number, message?: string): void; + + /** + * Asserts valueToCheck is strictly less than (<) valueToBeBelow. + * + * @param valueToCheck Actual value. + * @param valueToBeBelow Minimum Potential expected value. + * @param message Message to display on error. + */ + isBelow(valueToCheck: number, valueToBeBelow: number, message?: string): void; + + /** + * Asserts valueToCheck is greater than or equal to (>=) valueToBeAtMost. + * + * @param valueToCheck Actual value. + * @param valueToBeAtMost Minimum Potential expected value. + * @param message Message to display on error. + */ + isAtMost(valueToCheck: number, valueToBeAtMost: number, message?: string): void; + + /** + * Asserts that value is true. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isTrue(value: T, message?: string): void; + + /** + * Asserts that value is false. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isFalse(value: T, message?: string): void; + + /** + * Asserts that value is not true. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotTrue(value: T, message?: string): void; + + /** + * Asserts that value is not false. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotFalse(value: T, message?: string): void; + + /** + * Asserts that value is null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNull(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNull(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNaN(value: T, message?: string): void; + + /** + * Asserts that value is not null. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNaN(value: T, message?: string): void; + + /** + * Asserts that value is undefined. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isUndefined(value: T, message?: string): void; + + /** + * Asserts that value is not undefined. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isDefined(value: T, message?: string): void; + + /** + * Asserts that value is a function. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isFunction(value: T, message?: string): void; + + /** + * Asserts that value is not a function. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotFunction(value: T, message?: string): void; + + /** + * Asserts that value is an object of type 'Object' + * (as revealed by Object.prototype.toString). + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + * @remarks The assertion does not match subclassed objects. + */ + isObject(value: T, message?: string): void; + + /** + * Asserts that value is not an object of type 'Object' + * (as revealed by Object.prototype.toString). + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotObject(value: T, message?: string): void; + + /** + * Asserts that value is an array. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isArray(value: T, message?: string): void; + + /** + * Asserts that value is not an array. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotArray(value: T, message?: string): void; + + /** + * Asserts that value is a string. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isString(value: T, message?: string): void; + + /** + * Asserts that value is not a string. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotString(value: T, message?: string): void; + + /** + * Asserts that value is a number. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNumber(value: T, message?: string): void; + + /** + * Asserts that value is not a number. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotNumber(value: T, message?: string): void; + + /** + * Asserts that value is a boolean. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isBoolean(value: T, message?: string): void; + + /** + * Asserts that value is not a boolean. + * + * @type T Type of value. + * @param value Actual value. + * @param message Message to display on error. + */ + isNotBoolean(value: T, message?: string): void; + + /** + * Asserts that value's type is name, as determined by Object.prototype.toString. + * + * @type T Type of value. + * @param value Actual value. + * @param name Potential expected type name of value. + * @param message Message to display on error. + */ + typeOf(value: T, name: string, message?: string): void; + + /** + * Asserts that value's type is not name, as determined by Object.prototype.toString. + * + * @type T Type of value. + * @param value Actual value. + * @param name Potential expected type name of value. + * @param message Message to display on error. + */ + notTypeOf(value: T, name: string, message?: string): void; + + /** + * Asserts that value is an instance of constructor. + * + * @type T Type of value. + * @param value Actual value. + * @param constructor Potential expected contructor of value. + * @param message Message to display on error. + */ + instanceOf(value: T, constructor: Function, message?: string): void; + + /** + * Asserts that value is not an instance of constructor. + * + * @type T Type of value. + * @param value Actual value. + * @param constructor Potential expected contructor of value. + * @param message Message to display on error. + */ + notInstanceOf(value: T, type: Function, message?: string): void; + + /** + * Asserts that haystack includes needle. + * + * @param haystack Container string. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + include(haystack: string, needle: string, message?: string): void; + + /** + * Asserts that haystack includes needle. + * + * @type T Type of values in haystack. + * @param haystack Container array. + * @param needle Potential value contained in haystack. + * @param message Message to display on error. + */ + include(haystack: T[], needle: T, message?: string): void; + + /** + * Asserts that haystack does not include needle. + * + * @param haystack Container string. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + notInclude(haystack: string, needle: any, message?: string): void; + + /** + * Asserts that haystack does not include needle. + * + * @type T Type of values in haystack. + * @param haystack Container array. + * @param needle Potential value contained in haystack. + * @param message Message to display on error. + */ + notInclude(haystack: any[], needle: any, message?: string): void; + + /** + * Asserts that value matches the regular expression regexp. + * + * @param value Actual value. + * @param regexp Potential match of value. + * @param message Message to display on error. + */ + match(value: string, regexp: RegExp, message?: string): void; + + /** + * Asserts that value does not match the regular expression regexp. + * + * @param value Actual value. + * @param regexp Potential match of value. + * @param message Message to display on error. + */ + notMatch(expected: any, regexp: RegExp, message?: string): void; + + /** + * Asserts that object has a property named by property. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + property(object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that object has a property named by property. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + notProperty(object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that object has a property named by property, which can be a string + * using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + deepProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object does not have a property named by property, which can be a + * string using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @param object Container object. + * @param property Potential contained property of object. + * @param message Message to display on error. + */ + notDeepProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object has a property named by property with value given by value. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + propertyVal(object: T, property: string /* keyof T */, value: V, message?: string): void; + + /** + * Asserts that object has a property named by property with value given by value. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + propertyNotVal(object: T, property: string /* keyof T */, value: V, message?: string): void; + + /** + * Asserts that object has a property named by property, which can be a string + * using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + deepPropertyVal(object: T, property: string, value: V, message?: string): void; + + /** + * Asserts that object does not have a property named by property, which can be a + * string using dot- and bracket-notation for deep reference. + * + * @type T Type of object. + * @type V Type of value. + * @param object Container object. + * @param property Potential contained property of object. + * @param value Potential expected property value. + * @param message Message to display on error. + */ + deepPropertyNotVal(object: T, property: string, value: V, message?: string): void; + + /** + * Asserts that object has a length property with the expected value. + * + * @type T Type of object. + * @param object Container object. + * @param length Potential expected length of object. + * @param message Message to display on error. + */ + lengthOf(object: T, length: number, message?: string): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + throw(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + throw(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throw(fn: Function, constructor: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throw(fn: Function, constructor: Function, regExp: RegExp): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + throws(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + throws(fn: Function, regExp: RegExp, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throws(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + throws(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Asserts that fn will throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + Throw(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + Throw(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + Throw(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + Throw(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Asserts that fn will not throw an error. + * + * @param fn Function that may throw. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, message?: string): void; + + /** + * Asserts that function will throw an error with message matching regexp. + * + * @param fn Function that may throw. + * @param regExp Potential expected message match. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, regExp: RegExp): void; + + /** + * Asserts that function will throw an error that is an instance of constructor. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, errType: Function, message?: string): void; + + /** + * Asserts that function will throw an error that is an instance of constructor + * and an error with message matching regexp. + * + * @param fn Function that may throw. + * @param constructor Potential expected error constructor. + * @param message Message to display on error. + */ + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; + + /** + * Compares two values using operator. + * + * @param val1 Left value during comparison. + * @param operator Comparison operator. + * @param val2 Right value during comparison. + * @param message Message to display on error. + */ + operator(val1: OperatorComparable, operator: Operator, val2: OperatorComparable, message?: string): void; + + /** + * Asserts that the target is equal to expected, to within a +/- delta range. + * + * @param actual Actual value + * @param expected Potential expected value. + * @param delta Maximum differenced between values. + * @param message Message to display on error. + */ + closeTo(actual: number, expected: number, delta: number, message?: string): void; + + /** + * Asserts that the target is equal to expected, to within a +/- delta range. + * + * @param actual Actual value + * @param expected Potential expected value. + * @param delta Maximum differenced between values. + * @param message Message to display on error. + */ + approximately(act: number, exp: number, delta: number, message?: string): void; + + /** + * Asserts that set1 and set2 have the same members. Order is not take into account. + * + * @type T Type of set values. + * @param set1 Actual set of values. + * @param set2 Potential expected set of values. + * @param message Message to display on error. + */ + sameMembers(set1: T[], set2: T[], message?: string): void; + + /** + * Asserts that set1 and set2 have the same members using deep equality checking. + * Order is not take into account. + * + * @type T Type of set values. + * @param set1 Actual set of values. + * @param set2 Potential expected set of values. + * @param message Message to display on error. + */ + sameDeepMembers(set1: T[], set2: T[], message?: string): void; + + /** + * Asserts that subset is included in superset. Order is not take into account. + * + * @type T Type of set values. + * @param superset Actual set of values. + * @param subset Potential contained set of values. + * @param message Message to display on error. + */ + includeMembers(superset: T[], subset: T[], message?: string): void; + + /** + * Asserts that subset is included in superset using deep equality checking. + * Order is not take into account. + * + * @type T Type of set values. + * @param superset Actual set of values. + * @param subset Potential contained set of values. + * @param message Message to display on error. + */ + includeDeepMembers(superset: T[], subset: T[], message?: string): void; + + /** + * Asserts that non-object, non-array value inList appears in the flat array list. + * + * @type T Type of list values. + * @param inList Value expected to be in the list. + * @param list List of values. + * @param message Message to display on error. + */ + oneOf(inList: T, list: T[], message?: string): void; + + /** + * Asserts that a function changes the value of a property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be modified. + * @param message Message to display on error. + */ + changes(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that a function does not change the value of a property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be modified. + * @param message Message to display on error. + */ + doesNotChange(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that a function increases an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be increased. + * @param message Message to display on error. + */ + increases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that a function does not increase an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be increased. + * @param message Message to display on error. + */ + doesNotIncrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that a function decreases an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected to be decreased. + * @param message Message to display on error. + */ + decreases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts that a function does not decrease an object property. + * + * @type T Type of object. + * @param modifier Function to run. + * @param object Container object. + * @param property Property of object expected not to be decreased. + * @param message Message to display on error. + */ + doesNotDecrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; + + /** + * Asserts if value is not a false value, and throws if it is a true value. + * + * @type T Type of object. + * @param object Actual value. + * @param message Message to display on error. + * @remarks This is added to allow for chai to be a drop-in replacement for + * Node’s assert class. + */ + ifError(object: T, message?: string): void; + + /** + * Asserts that object is extensible (can have new properties added to it). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isExtensible(object: T, message?: string): void; + + /** + * Asserts that object is extensible (can have new properties added to it). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + extensible(object: T, message?: string): void; + + /** + * Asserts that object is not extensible. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotExtensible(object: T, message?: string): void; + + /** + * Asserts that object is not extensible. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notExtensible(object: T, message?: string): void; + + /** + * Asserts that object is sealed (can have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isSealed(object: T, message?: string): void; + + /** + * Asserts that object is sealed (can have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + sealed(object: T, message?: string): void; + + /** + * Asserts that object is not sealed. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotSealed(object: T, message?: string): void; + + /** + * Asserts that object is not sealed. + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notSealed(object: T, message?: string): void; + + /** + * Asserts that object is frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isFrozen(object: T, message?: string): void; + + /** + * Asserts that object is frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + frozen(object: T, message?: string): void; + + /** + * Asserts that object is not frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + isNotFrozen(object: T, message?: string): void; + + /** + * Asserts that object is not frozen (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * @type T Type of object + * @param object Actual value. + * @param message Message to display on error. + */ + notFrozen(object: T, message?: string): void; + } + + export interface Config { + /** + * Default: false + */ + includeStack: boolean; + + /** + * Default: true + */ + showDiff: boolean; + + /** + * Default: 40 + */ + truncateThreshold: number; + } + + export class AssertionError { + constructor(message: string, _props?: any, ssf?: Function); + public name: string; + public message: string; + public showDiff: boolean; + public stack: string; + } +} + +declare const chai: Chai.ChaiStatic; + +declare module 'chai' { + export = chai; +} + +interface Object { + should: Chai.Assertion; +} diff --git a/packages/typescript-typings/types/ethers-contracts/index.d.ts b/packages/typescript-typings/types/ethers-contracts/index.d.ts new file mode 100644 index 000000000..e5d38819e --- /dev/null +++ b/packages/typescript-typings/types/ethers-contracts/index.d.ts @@ -0,0 +1,28 @@ +declare module 'ethers-contracts' { + export interface TransactionDescription { + name: string; + signature: string; + sighash: string; + data: string; + } + export interface CallDescription extends TransactionDescription { + parse: (...args: any[]) => any; + } + export interface FunctionDescription { + (...params: any[]): TransactionDescription | CallDescription; + inputs: { names: string[]; types: string[] }; + outputs: { names: string[]; types: string[] }; + } + export interface EventDescription { + parse: (...args: any[]) => any; + inputs: { names: string[]; types: string[] }; + signature: string; + topic: string; + } + export class Interface { + public functions: { [functionName: string]: FunctionDescription }; + public events: { [eventName: string]: EventDescription }; + public static decodeParams(types: string[], data: string): any[]; + constructor(abi: any); + } +} diff --git a/packages/typescript-typings/types/web3/index.d.ts b/packages/typescript-typings/types/web3/index.d.ts new file mode 100644 index 000000000..cbe067b37 --- /dev/null +++ b/packages/typescript-typings/types/web3/index.d.ts @@ -0,0 +1,440 @@ +declare module 'web3' { + import * as BigNumber from 'bignumber.js'; + + type MixedData = string | number | object | any[] | BigNumber.BigNumber; + + class Web3 { + public static providers: typeof providers; + public currentProvider: Web3.Provider; + + public eth: Web3.EthApi; + public personal: Web3.PersonalApi | undefined; + public version: Web3.VersionApi; + public net: Web3.NetApi; + + public constructor(provider?: Web3.Provider); + + public isConnected(): boolean; + public setProvider(provider: Web3.Provider): void; + public reset(keepIsSyncing: boolean): void; + public toHex(data: MixedData): string; + public toAscii(hex: string): string; + public fromAscii(ascii: string, padding?: number): string; + public toDecimal(hex: string): number; + public fromDecimal(value: number | string): string; + public fromWei(value: number | string, unit: Web3.Unit): string; + public fromWei(value: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; + public toWei(amount: number | string, unit: Web3.Unit): string; + public toWei(amount: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; + public toBigNumber(value: number | string): BigNumber.BigNumber; + public isAddress(address: string): boolean; + public isChecksumAddress(address: string): boolean; + public sha3(value: string, options?: Web3.Sha3Options): string; + } + + namespace providers { + class HttpProvider implements Web3.Provider { + constructor(url?: string, timeout?: number, username?: string, password?: string); + public sendAsync( + payload: Web3.JSONRPCRequestPayload, + callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void, + ): void; + } + } + + namespace Web3 { + type ContractAbi = AbiDefinition[]; + + type AbiDefinition = FunctionAbi | EventAbi; + + type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi; + + enum AbiType { + Function = 'function', + Constructor = 'constructor', + Event = 'event', + Fallback = 'fallback', + } + + type ConstructorStateMutability = 'nonpayable' | 'payable'; + type StateMutability = 'pure' | 'view' | ConstructorStateMutability; + + interface MethodAbi { + type: AbiType.Function; + name: string; + inputs: DataItem[]; + outputs: DataItem[]; + constant: boolean; + stateMutability: StateMutability; + payable: boolean; + } + + interface ConstructorAbi { + type: AbiType.Constructor; + inputs: DataItem[]; + payable: boolean; + stateMutability: ConstructorStateMutability; + } + + interface FallbackAbi { + type: AbiType.Fallback; + payable: boolean; + } + + interface EventParameter extends DataItem { + indexed: boolean; + } + + interface EventAbi { + type: AbiType.Event; + name: string; + inputs: EventParameter[]; + anonymous: boolean; + } + + interface DataItem { + name: string; + type: string; + components: DataItem[]; + } + + interface ContractInstance { + address: string; + abi: Web3.ContractAbi; + [name: string]: any; + } + + interface Contract { + at(address: string): A; + getData(...args: any[]): string; + 'new'(...args: any[]): A; + } + + interface FilterObject { + fromBlock?: number | string; + toBlock?: number | string; + address?: string; + topics?: LogTopic[]; + } + + type LogTopic = null | string | string[]; + + interface DecodedLogEntry extends LogEntry { + event: string; + args: A; + } + + interface DecodedLogEntryEvent extends DecodedLogEntry { + removed: boolean; + } + + interface LogEntryEvent extends LogEntry { + removed: boolean; + } + + interface FilterResult { + get(callback: () => void): void; + watch(callback: (err: Error, result: LogEntryEvent) => void): void; + stopWatching(callback?: () => void): void; + } + + export interface JSONRPCRequestPayload { + params: any[]; + method: string; + id: number; + jsonrpc: string; + } + + export interface JSONRPCResponsePayload { + result: any; + id: number; + jsonrpc: string; + } + + export type OpCode = string; + + export interface StructLog { + depth: number; + error: string; + gas: number; + gasCost: number; + memory: string[]; + op: OpCode; + pc: number; + stack: string[]; + storage: { [location: string]: string }; + } + export interface TransactionTrace { + gas: number; + returnValue: any; + structLogs: StructLog[]; + } + + interface Provider { + sendAsync( + payload: JSONRPCRequestPayload, + callback: (err: Error, result: JSONRPCResponsePayload) => void, + ): void; + } + + interface Sha3Options { + encoding: 'hex'; + } + + interface EthApi { + coinbase: string; + mining: boolean; + hashrate: number; + gasPrice: BigNumber.BigNumber; + accounts: string[]; + blockNumber: number; + defaultAccount?: string; + defaultBlock: Web3.BlockParam; + syncing: Web3.SyncingResult; + compile: { + solidity(sourceString: string, cb?: (err: Error, result: any) => void): object; + }; + getMining(cd: (err: Error, mining: boolean) => void): void; + getHashrate(cd: (err: Error, hashrate: number) => void): void; + getGasPrice(cd: (err: Error, gasPrice: BigNumber.BigNumber) => void): void; + getAccounts(cd: (err: Error, accounts: string[]) => void): void; + getBlockNumber(callback: (err: Error, blockNumber: number) => void): void; + getSyncing(cd: (err: Error, syncing: Web3.SyncingResult) => void): void; + isSyncing(cb: (err: Error, isSyncing: boolean, syncingState: Web3.SyncingState) => void): Web3.IsSyncing; + + getBlock(hashStringOrBlockNumber: string | Web3.BlockParam): Web3.BlockWithoutTransactionData; + getBlock( + hashStringOrBlockNumber: string | Web3.BlockParam, + callback: (err: Error, blockObj: Web3.BlockWithoutTransactionData) => void, + ): void; + getBlock( + hashStringOrBlockNumber: string | Web3.BlockParam, + returnTransactionObjects: true, + ): Web3.BlockWithTransactionData; + getBlock( + hashStringOrBlockNumber: string | Web3.BlockParam, + returnTransactionObjects: true, + callback: (err: Error, blockObj: Web3.BlockWithTransactionData) => void, + ): void; + + getBlockTransactionCount(hashStringOrBlockNumber: string | Web3.BlockParam): number; + getBlockTransactionCount( + hashStringOrBlockNumber: string | Web3.BlockParam, + callback: (err: Error, blockTransactionCount: number) => void, + ): void; + + // TODO returnTransactionObjects + getUncle( + hashStringOrBlockNumber: string | Web3.BlockParam, + uncleNumber: number, + ): Web3.BlockWithoutTransactionData; + getUncle( + hashStringOrBlockNumber: string | Web3.BlockParam, + uncleNumber: number, + callback: (err: Error, uncle: Web3.BlockWithoutTransactionData) => void, + ): void; + + getTransaction(transactionHash: string): Web3.Transaction; + getTransaction( + transactionHash: string, + callback: (err: Error, transaction: Web3.Transaction) => void, + ): void; + + getTransactionFromBlock( + hashStringOrBlockNumber: string | Web3.BlockParam, + indexNumber: number, + ): Web3.Transaction; + getTransactionFromBlock( + hashStringOrBlockNumber: string | Web3.BlockParam, + indexNumber: number, + callback: (err: Error, transaction: Web3.Transaction) => void, + ): void; + + contract(abi: Web3.AbiDefinition[]): Web3.Contract; + + // TODO block param + getBalance(addressHexString: string): BigNumber.BigNumber; + getBalance(addressHexString: string, callback: (err: Error, result: BigNumber.BigNumber) => void): void; + + // TODO block param + getStorageAt(address: string, position: number): string; + getStorageAt(address: string, position: number, callback: (err: Error, storage: string) => void): void; + + // TODO block param + getCode(addressHexString: string): string; + getCode(addressHexString: string, callback: (err: Error, code: string) => void): void; + + filter(value: string | Web3.FilterObject): Web3.FilterResult; + + sendTransaction(txData: Web3.TxData): string; + sendTransaction(txData: Web3.TxData, callback: (err: Error, value: string) => void): void; + + sendRawTransaction(rawTxData: string): string; + sendRawTransaction(rawTxData: string, callback: (err: Error, value: string) => void): void; + + sign(address: string, data: string): string; + sign(address: string, data: string, callback: (err: Error, signature: string) => void): void; + + getTransactionReceipt(txHash: string): Web3.TransactionReceipt | null; + getTransactionReceipt( + txHash: string, + callback: (err: Error, receipt: Web3.TransactionReceipt | null) => void, + ): void; + + // TODO block param + call(callData: Web3.CallData): string; + call(callData: Web3.CallData, callback: (err: Error, result: string) => void): void; + + estimateGas(callData: Web3.CallData): number; + estimateGas(callData: Web3.CallData, callback: (err: Error, gas: number) => void): void; + + // TODO defaultBlock + getTransactionCount(address: string): number; + getTransactionCount(address: string, callback: (err: Error, count: number) => void): void; + } + + interface VersionApi { + api: string; + network: string; + node: string; + ethereum: string; + whisper: string; + getNetwork(cd: (err: Error, networkId: string) => void): void; + getNode(cd: (err: Error, nodeVersion: string) => void): void; + getEthereum(cd: (err: Error, ethereum: string) => void): void; + getWhisper(cd: (err: Error, whisper: string) => void): void; + } + + interface PersonalApi { + listAccounts: string[] | undefined; + newAccount(password?: string): string; + unlockAccount(address: string, password?: string, duration?: number): boolean; + lockAccount(address: string): boolean; + sign(message: string, account: string, password: string): string; + sign(hexMessage: string, account: string, callback: (error: Error, signature: string) => void): void; + } + + interface NetApi { + listening: boolean; + peerCount: number; + getListening(cd: (err: Error, listening: boolean) => void): void; + getPeerCount(cd: (err: Error, peerCount: number) => void): void; + } + + type BlockParam = number | 'earliest' | 'latest' | 'pending'; + + type Unit = + | 'kwei' + | 'ada' + | 'mwei' + | 'babbage' + | 'gwei' + | 'shannon' + | 'szabo' + | 'finney' + | 'ether' + | 'kether' + | 'grand' + | 'einstein' + | 'mether' + | 'gether' + | 'tether'; + + interface SyncingState { + startingBlock: number; + currentBlock: number; + highestBlock: number; + } + type SyncingResult = false | SyncingState; + + interface IsSyncing { + addCallback(cb: (err: Error, isSyncing: boolean, syncingState: SyncingState) => void): void; + stopWatching(): void; + } + + interface AbstractBlock { + number: number | null; + hash: string | null; + parentHash: string; + nonce: string | null; + sha3Uncles: string; + logsBloom: string | null; + transactionsRoot: string; + stateRoot: string; + miner: string; + difficulty: BigNumber.BigNumber; + totalDifficulty: BigNumber.BigNumber; + extraData: string; + size: number; + gasLimit: number; + gasUsed: number; + timestamp: number; + uncles: string[]; + } + interface BlockWithoutTransactionData extends AbstractBlock { + transactions: string[]; + } + interface BlockWithTransactionData extends AbstractBlock { + transactions: Transaction[]; + } + + interface Transaction { + hash: string; + nonce: number; + blockHash: string | null; + blockNumber: number | null; + transactionIndex: number | null; + from: string; + to: string | null; + value: BigNumber.BigNumber; + gasPrice: BigNumber.BigNumber; + gas: number; + input: string; + } + + interface CallTxDataBase { + to?: string; + value?: number | string | BigNumber.BigNumber; + gas?: number | string | BigNumber.BigNumber; + gasPrice?: number | string | BigNumber.BigNumber; + data?: string; + nonce?: number; + } + + interface TxData extends CallTxDataBase { + from: string; + } + + interface CallData extends CallTxDataBase { + from?: string; + } + + interface TransactionReceipt { + blockHash: string; + blockNumber: number; + transactionHash: string; + transactionIndex: number; + from: string; + to: string; + status: null | string | 0 | 1; + cumulativeGasUsed: number; + gasUsed: number; + contractAddress: string | null; + logs: LogEntry[]; + } + + interface LogEntry { + logIndex: number | null; + transactionIndex: number | null; + transactionHash: string; + blockHash: string | null; + blockNumber: number | null; + address: string; + data: string; + topics: string[]; + } + } + /* tslint:disable */ + export = Web3; + /* tslint:enable */ +} diff --git a/packages/utils/README.md b/packages/utils/README.md index 22de85f4a..fde0780a9 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -10,10 +10,10 @@ yarn add @0xproject/utils If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Usage diff --git a/packages/utils/package.json b/packages/utils/package.json index ffdd7fe2e..bc869fe1e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -31,14 +31,13 @@ }, "dependencies": { "@0xproject/types": "^0.4.1", + "@0xproject/typescript-typings": "^0.0.1", "@types/node": "^8.0.53", "bignumber.js": "~4.1.0", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "js-sha3": "^0.7.0", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 8114d99cd..c56d255d5 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/web3-typescript-typings/.npmignore b/packages/web3-typescript-typings/.npmignore deleted file mode 100644 index 104d718ed..000000000 --- a/packages/web3-typescript-typings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.* -yarn-error.log -/scripts/ diff --git a/packages/web3-typescript-typings/CHANGELOG.md b/packages/web3-typescript-typings/CHANGELOG.md deleted file mode 100644 index 845b1ecd2..000000000 --- a/packages/web3-typescript-typings/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# CHANGELOG - -## v0.10.0 - _March 4, 2018_ - - * Support ABIv2 (#401) - * Add types for transaction traces (#426) - -## v0.9.11 - _February 16, 2018_ - - * Fix `web3.net.peerCount` to be of type number instead of boolean (#397) - -## v0.9.3 - _January 11, 2018_ - - * Fix `getTransactionReceipt` not returning null (#338) - * Add type for getData on a contract - * Fixed the `defaultAccount` not allowing for `undefined` value (#320) diff --git a/packages/web3-typescript-typings/README.md b/packages/web3-typescript-typings/README.md deleted file mode 100644 index 95c193287..000000000 --- a/packages/web3-typescript-typings/README.md +++ /dev/null @@ -1,49 +0,0 @@ -## web3-typescript-typings - -There currently isn't an official [Web3][web3] -type definition included in the [DefinitelyTyped][definitelytyped] project. -Until that happens, we will continue to improve our own type definition. -If it get's close to comprehensive, we'll add it to [DefinitelyTyped][definitelytyped]. - -[web3]: https://github.com/ethereum/web3.js/ -[definitelytyped]: https://github.com/DefinitelyTyped/DefinitelyTyped - -## Installation - -```bash -yarn add -D web3-typescript-typings -``` - -## Usage - -Add the following line within an `include` section of your `tsconfig.json` - -```json -"./node_modules/web3-typescript-typings/index.d.ts" -``` - -## Contributing - -We strongly encourage that the community help us make improvements and determine the future direction of the protocol. To report bugs within this package, please create an issue in this repository. - -Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. - -### Install Dependencies - -If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them: - -```bash -yarn config set workspaces-experimental true -``` - -Then install dependencies - -```bash -yarn install -``` - -### Lint - -```bash -yarn lint -``` diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/web3-typescript-typings/index.d.ts deleted file mode 100644 index cbe067b37..000000000 --- a/packages/web3-typescript-typings/index.d.ts +++ /dev/null @@ -1,440 +0,0 @@ -declare module 'web3' { - import * as BigNumber from 'bignumber.js'; - - type MixedData = string | number | object | any[] | BigNumber.BigNumber; - - class Web3 { - public static providers: typeof providers; - public currentProvider: Web3.Provider; - - public eth: Web3.EthApi; - public personal: Web3.PersonalApi | undefined; - public version: Web3.VersionApi; - public net: Web3.NetApi; - - public constructor(provider?: Web3.Provider); - - public isConnected(): boolean; - public setProvider(provider: Web3.Provider): void; - public reset(keepIsSyncing: boolean): void; - public toHex(data: MixedData): string; - public toAscii(hex: string): string; - public fromAscii(ascii: string, padding?: number): string; - public toDecimal(hex: string): number; - public fromDecimal(value: number | string): string; - public fromWei(value: number | string, unit: Web3.Unit): string; - public fromWei(value: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; - public toWei(amount: number | string, unit: Web3.Unit): string; - public toWei(amount: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; - public toBigNumber(value: number | string): BigNumber.BigNumber; - public isAddress(address: string): boolean; - public isChecksumAddress(address: string): boolean; - public sha3(value: string, options?: Web3.Sha3Options): string; - } - - namespace providers { - class HttpProvider implements Web3.Provider { - constructor(url?: string, timeout?: number, username?: string, password?: string); - public sendAsync( - payload: Web3.JSONRPCRequestPayload, - callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void, - ): void; - } - } - - namespace Web3 { - type ContractAbi = AbiDefinition[]; - - type AbiDefinition = FunctionAbi | EventAbi; - - type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi; - - enum AbiType { - Function = 'function', - Constructor = 'constructor', - Event = 'event', - Fallback = 'fallback', - } - - type ConstructorStateMutability = 'nonpayable' | 'payable'; - type StateMutability = 'pure' | 'view' | ConstructorStateMutability; - - interface MethodAbi { - type: AbiType.Function; - name: string; - inputs: DataItem[]; - outputs: DataItem[]; - constant: boolean; - stateMutability: StateMutability; - payable: boolean; - } - - interface ConstructorAbi { - type: AbiType.Constructor; - inputs: DataItem[]; - payable: boolean; - stateMutability: ConstructorStateMutability; - } - - interface FallbackAbi { - type: AbiType.Fallback; - payable: boolean; - } - - interface EventParameter extends DataItem { - indexed: boolean; - } - - interface EventAbi { - type: AbiType.Event; - name: string; - inputs: EventParameter[]; - anonymous: boolean; - } - - interface DataItem { - name: string; - type: string; - components: DataItem[]; - } - - interface ContractInstance { - address: string; - abi: Web3.ContractAbi; - [name: string]: any; - } - - interface Contract { - at(address: string): A; - getData(...args: any[]): string; - 'new'(...args: any[]): A; - } - - interface FilterObject { - fromBlock?: number | string; - toBlock?: number | string; - address?: string; - topics?: LogTopic[]; - } - - type LogTopic = null | string | string[]; - - interface DecodedLogEntry extends LogEntry { - event: string; - args: A; - } - - interface DecodedLogEntryEvent extends DecodedLogEntry { - removed: boolean; - } - - interface LogEntryEvent extends LogEntry { - removed: boolean; - } - - interface FilterResult { - get(callback: () => void): void; - watch(callback: (err: Error, result: LogEntryEvent) => void): void; - stopWatching(callback?: () => void): void; - } - - export interface JSONRPCRequestPayload { - params: any[]; - method: string; - id: number; - jsonrpc: string; - } - - export interface JSONRPCResponsePayload { - result: any; - id: number; - jsonrpc: string; - } - - export type OpCode = string; - - export interface StructLog { - depth: number; - error: string; - gas: number; - gasCost: number; - memory: string[]; - op: OpCode; - pc: number; - stack: string[]; - storage: { [location: string]: string }; - } - export interface TransactionTrace { - gas: number; - returnValue: any; - structLogs: StructLog[]; - } - - interface Provider { - sendAsync( - payload: JSONRPCRequestPayload, - callback: (err: Error, result: JSONRPCResponsePayload) => void, - ): void; - } - - interface Sha3Options { - encoding: 'hex'; - } - - interface EthApi { - coinbase: string; - mining: boolean; - hashrate: number; - gasPrice: BigNumber.BigNumber; - accounts: string[]; - blockNumber: number; - defaultAccount?: string; - defaultBlock: Web3.BlockParam; - syncing: Web3.SyncingResult; - compile: { - solidity(sourceString: string, cb?: (err: Error, result: any) => void): object; - }; - getMining(cd: (err: Error, mining: boolean) => void): void; - getHashrate(cd: (err: Error, hashrate: number) => void): void; - getGasPrice(cd: (err: Error, gasPrice: BigNumber.BigNumber) => void): void; - getAccounts(cd: (err: Error, accounts: string[]) => void): void; - getBlockNumber(callback: (err: Error, blockNumber: number) => void): void; - getSyncing(cd: (err: Error, syncing: Web3.SyncingResult) => void): void; - isSyncing(cb: (err: Error, isSyncing: boolean, syncingState: Web3.SyncingState) => void): Web3.IsSyncing; - - getBlock(hashStringOrBlockNumber: string | Web3.BlockParam): Web3.BlockWithoutTransactionData; - getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - callback: (err: Error, blockObj: Web3.BlockWithoutTransactionData) => void, - ): void; - getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - returnTransactionObjects: true, - ): Web3.BlockWithTransactionData; - getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - returnTransactionObjects: true, - callback: (err: Error, blockObj: Web3.BlockWithTransactionData) => void, - ): void; - - getBlockTransactionCount(hashStringOrBlockNumber: string | Web3.BlockParam): number; - getBlockTransactionCount( - hashStringOrBlockNumber: string | Web3.BlockParam, - callback: (err: Error, blockTransactionCount: number) => void, - ): void; - - // TODO returnTransactionObjects - getUncle( - hashStringOrBlockNumber: string | Web3.BlockParam, - uncleNumber: number, - ): Web3.BlockWithoutTransactionData; - getUncle( - hashStringOrBlockNumber: string | Web3.BlockParam, - uncleNumber: number, - callback: (err: Error, uncle: Web3.BlockWithoutTransactionData) => void, - ): void; - - getTransaction(transactionHash: string): Web3.Transaction; - getTransaction( - transactionHash: string, - callback: (err: Error, transaction: Web3.Transaction) => void, - ): void; - - getTransactionFromBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - indexNumber: number, - ): Web3.Transaction; - getTransactionFromBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - indexNumber: number, - callback: (err: Error, transaction: Web3.Transaction) => void, - ): void; - - contract(abi: Web3.AbiDefinition[]): Web3.Contract; - - // TODO block param - getBalance(addressHexString: string): BigNumber.BigNumber; - getBalance(addressHexString: string, callback: (err: Error, result: BigNumber.BigNumber) => void): void; - - // TODO block param - getStorageAt(address: string, position: number): string; - getStorageAt(address: string, position: number, callback: (err: Error, storage: string) => void): void; - - // TODO block param - getCode(addressHexString: string): string; - getCode(addressHexString: string, callback: (err: Error, code: string) => void): void; - - filter(value: string | Web3.FilterObject): Web3.FilterResult; - - sendTransaction(txData: Web3.TxData): string; - sendTransaction(txData: Web3.TxData, callback: (err: Error, value: string) => void): void; - - sendRawTransaction(rawTxData: string): string; - sendRawTransaction(rawTxData: string, callback: (err: Error, value: string) => void): void; - - sign(address: string, data: string): string; - sign(address: string, data: string, callback: (err: Error, signature: string) => void): void; - - getTransactionReceipt(txHash: string): Web3.TransactionReceipt | null; - getTransactionReceipt( - txHash: string, - callback: (err: Error, receipt: Web3.TransactionReceipt | null) => void, - ): void; - - // TODO block param - call(callData: Web3.CallData): string; - call(callData: Web3.CallData, callback: (err: Error, result: string) => void): void; - - estimateGas(callData: Web3.CallData): number; - estimateGas(callData: Web3.CallData, callback: (err: Error, gas: number) => void): void; - - // TODO defaultBlock - getTransactionCount(address: string): number; - getTransactionCount(address: string, callback: (err: Error, count: number) => void): void; - } - - interface VersionApi { - api: string; - network: string; - node: string; - ethereum: string; - whisper: string; - getNetwork(cd: (err: Error, networkId: string) => void): void; - getNode(cd: (err: Error, nodeVersion: string) => void): void; - getEthereum(cd: (err: Error, ethereum: string) => void): void; - getWhisper(cd: (err: Error, whisper: string) => void): void; - } - - interface PersonalApi { - listAccounts: string[] | undefined; - newAccount(password?: string): string; - unlockAccount(address: string, password?: string, duration?: number): boolean; - lockAccount(address: string): boolean; - sign(message: string, account: string, password: string): string; - sign(hexMessage: string, account: string, callback: (error: Error, signature: string) => void): void; - } - - interface NetApi { - listening: boolean; - peerCount: number; - getListening(cd: (err: Error, listening: boolean) => void): void; - getPeerCount(cd: (err: Error, peerCount: number) => void): void; - } - - type BlockParam = number | 'earliest' | 'latest' | 'pending'; - - type Unit = - | 'kwei' - | 'ada' - | 'mwei' - | 'babbage' - | 'gwei' - | 'shannon' - | 'szabo' - | 'finney' - | 'ether' - | 'kether' - | 'grand' - | 'einstein' - | 'mether' - | 'gether' - | 'tether'; - - interface SyncingState { - startingBlock: number; - currentBlock: number; - highestBlock: number; - } - type SyncingResult = false | SyncingState; - - interface IsSyncing { - addCallback(cb: (err: Error, isSyncing: boolean, syncingState: SyncingState) => void): void; - stopWatching(): void; - } - - interface AbstractBlock { - number: number | null; - hash: string | null; - parentHash: string; - nonce: string | null; - sha3Uncles: string; - logsBloom: string | null; - transactionsRoot: string; - stateRoot: string; - miner: string; - difficulty: BigNumber.BigNumber; - totalDifficulty: BigNumber.BigNumber; - extraData: string; - size: number; - gasLimit: number; - gasUsed: number; - timestamp: number; - uncles: string[]; - } - interface BlockWithoutTransactionData extends AbstractBlock { - transactions: string[]; - } - interface BlockWithTransactionData extends AbstractBlock { - transactions: Transaction[]; - } - - interface Transaction { - hash: string; - nonce: number; - blockHash: string | null; - blockNumber: number | null; - transactionIndex: number | null; - from: string; - to: string | null; - value: BigNumber.BigNumber; - gasPrice: BigNumber.BigNumber; - gas: number; - input: string; - } - - interface CallTxDataBase { - to?: string; - value?: number | string | BigNumber.BigNumber; - gas?: number | string | BigNumber.BigNumber; - gasPrice?: number | string | BigNumber.BigNumber; - data?: string; - nonce?: number; - } - - interface TxData extends CallTxDataBase { - from: string; - } - - interface CallData extends CallTxDataBase { - from?: string; - } - - interface TransactionReceipt { - blockHash: string; - blockNumber: number; - transactionHash: string; - transactionIndex: number; - from: string; - to: string; - status: null | string | 0 | 1; - cumulativeGasUsed: number; - gasUsed: number; - contractAddress: string | null; - logs: LogEntry[]; - } - - interface LogEntry { - logIndex: number | null; - transactionIndex: number | null; - transactionHash: string; - blockHash: string | null; - blockNumber: number | null; - address: string; - data: string; - topics: string[]; - } - } - /* tslint:disable */ - export = Web3; - /* tslint:enable */ -} diff --git a/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts b/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts deleted file mode 100644 index 94e63a32d..000000000 --- a/packages/web3-typescript-typings/monorepo_scripts/globals.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module '*.json' { - const json: any; - /* tslint:disable */ - export default json; - /* tslint:enable */ -} diff --git a/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts b/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/web3-typescript-typings/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/web3-typescript-typings/package.json b/packages/web3-typescript-typings/package.json deleted file mode 100644 index d56b83421..000000000 --- a/packages/web3-typescript-typings/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "web3-typescript-typings", - "version": "0.10.2", - "description": "Typescript type definitions for web3", - "main": "index.d.ts", - "types": "index.d.ts", - "scripts": { - "lint": "tslint index.d.ts", - "build": "tsc && copyfiles -u 1 './lib/**/*' ./scripts", - "clean": "shx rm -rf scripts" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/0xProject/0x-monorepo.git" - }, - "author": "Fabio Berger", - "contributors": [ - "Leonid Logvinov " - ], - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/0xProject/0x-monorepo/issues" - }, - "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-typescript-typings#readme", - "devDependencies": { - "@0xproject/monorepo-scripts": "^0.1.14", - "@types/bignumber.js": "^4.0.2", - "copyfiles": "^1.2.0", - "shx": "^0.2.2", - "tslint": "5.8.0", - "tslint-config-0xproject": "^0.0.2", - "typescript": "2.7.1" - }, - "dependencies": { - "bignumber.js": "~4.1.0" - }, - "publishConfig": { - "access": "public" - } -} diff --git a/packages/web3-typescript-typings/tsconfig.json b/packages/web3-typescript-typings/tsconfig.json deleted file mode 100644 index bc453af4b..000000000 --- a/packages/web3-typescript-typings/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig", - "compilerOptions": { - "outDir": "lib" - }, - "include": ["./monorepo_scripts/**/*"] -} diff --git a/packages/web3-typescript-typings/tslint.json b/packages/web3-typescript-typings/tslint.json deleted file mode 100644 index 9a93a1f74..000000000 --- a/packages/web3-typescript-typings/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["tslint-config-0xproject"] -} diff --git a/packages/web3-wrapper/README.md b/packages/web3-wrapper/README.md index 1fed11407..e7491acb0 100644 --- a/packages/web3-wrapper/README.md +++ b/packages/web3-wrapper/README.md @@ -12,10 +12,10 @@ yarn add @0xproject/web3-wrapper If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`: -``` -"include": [ - "./node_modules/web3-typescript-typings/index.d.ts", -] +```json +"compilerOptions": { + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], +} ``` ## Contributing diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 176f796c8..fa79fa377 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -45,11 +45,10 @@ "dependencies": { "@0xproject/types": "^0.4.1", "@0xproject/utils": "^0.4.3", + "@0xproject/typescript-typings": "^0.0.1", "ethers-contracts": "^2.2.1", - "ethers-typescript-typings": "^0.0.4", "lodash": "^4.17.4", - "web3": "^0.20.0", - "web3-typescript-typings": "^0.10.2" + "web3": "^0.20.0" }, "publishConfig": { "access": "public" diff --git a/packages/web3-wrapper/tsconfig.json b/packages/web3-wrapper/tsconfig.json index 7bae7f9f0..c56d255d5 100644 --- a/packages/web3-wrapper/tsconfig.json +++ b/packages/web3-wrapper/tsconfig.json @@ -3,9 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "./src/**/*", - "../../node_modules/ethers-typescript-typings/index.d.ts", - "../../node_modules/web3-typescript-typings/index.d.ts" - ] + "include": ["./src/**/*"] } diff --git a/packages/website/package.json b/packages/website/package.json index c455306ee..3869fb040 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -24,6 +24,7 @@ "@0xproject/subproviders": "^0.8.2", "@0xproject/utils": "^0.4.3", "@0xproject/web3-wrapper": "^0.3.1", + "@0xproject/typescript-typings": "^0.0.1", "accounting": "^0.4.1", "basscss": "^8.0.3", "blockies": "^0.0.2", @@ -75,9 +76,9 @@ "@types/moment": "^2.13.0", "@types/node": "^8.0.53", "@types/query-string": "^5.0.1", - "@types/react": "^15.0.15", + "@types/react": "^16.0.34", "@types/react-copy-to-clipboard": "^4.2.0", - "@types/react-dom": "^0.14.23", + "@types/react-dom": "^16.0.3", "@types/react-redux": "^4.4.37", "@types/react-router-dom": "^4.0.4", "@types/react-scroll": "0.0.31", @@ -87,7 +88,6 @@ "copy-webpack-plugin": "^4.0.1", "copyfiles": "^1.2.0", "css-loader": "0.23.x", - "ethers-typescript-typings": "^0.0.4", "exports-loader": "0.6.x", "imports-loader": "0.6.x", "json-loader": "^0.5.4", @@ -99,7 +99,6 @@ "tslint": "5.8.0", "tslint-config-0xproject": "^0.0.2", "typescript": "2.7.1", - "web3-typescript-typings": "^0.10.2", "webpack": "^3.1.0", "webpack-dev-middleware": "^1.10.0", "webpack-dev-server": "^2.5.0" diff --git a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx index d1bdb447f..42ca1713d 100644 --- a/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx +++ b/packages/website/ts/components/dialogs/eth_weth_conversion_dialog.tsx @@ -37,8 +37,8 @@ export class EthWethConversionDialog extends React.Component< EthWethConversionDialogState > { private _isUnmounted: boolean; - constructor() { - super(); + constructor(props: EthWethConversionDialogProps) { + super(props); this._isUnmounted = false; this.state = { shouldShowIncompleteErrs: false, diff --git a/packages/website/ts/components/dialogs/send_dialog.tsx b/packages/website/ts/components/dialogs/send_dialog.tsx index d44dd9aab..2af7fd7ac 100644 --- a/packages/website/ts/components/dialogs/send_dialog.tsx +++ b/packages/website/ts/components/dialogs/send_dialog.tsx @@ -27,8 +27,8 @@ interface SendDialogState { } export class SendDialog extends React.Component { - constructor() { - super(); + constructor(props: SendDialogProps) { + super(props); this.state = { recipient: '', shouldShowIncompleteErrs: false, diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx index 957ed2044..6c0186ac0 100644 --- a/packages/website/ts/components/footer.tsx +++ b/packages/website/ts/components/footer.tsx @@ -45,7 +45,7 @@ interface FooterState { export class Footer extends React.Component { constructor(props: FooterProps) { - super(); + super(props); this.state = { selectedLanguage: props.translate.getLanguage(), }; diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index 99f465bc2..34171b51e 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -13,9 +13,5 @@ "*": ["node_modules/@types/*", "*"] } }, - "include": [ - "./ts/**/*", - "../../node_modules/web3-typescript-typings/index.d.ts", - "../../node_modules/ethers-typescript-typings/index.d.ts" - ] + "include": ["./ts/**/*"] } diff --git a/tsconfig.json b/tsconfig.json index b6f95e64d..448f2d752 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "experimentalDecorators": true, "noImplicitReturns": true, "pretty": true, + "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"], "strict": true } } diff --git a/yarn.lock b/yarn.lock index 9db3ed3fb..abc80e324 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,34 +23,38 @@ web3 "^0.20.0" "@ledgerhq/hw-app-eth@^4.3.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.6.0.tgz#2054f02625747178e23040f6f2b60105de82e1bb" + version "4.7.3" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.7.3.tgz#d352e19658ae296532e522c53c8ec2a1a77b64e5" dependencies: - "@ledgerhq/hw-transport" "^4.6.0" + "@ledgerhq/hw-transport" "^4.7.3" "@ledgerhq/hw-transport-node-hid@^4.3.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-4.6.0.tgz#3462e65fdfc63427d68d85b631a3d5d974e2a049" + version "4.7.3" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-node-hid/-/hw-transport-node-hid-4.7.3.tgz#e7634d53161cdffed4f602cddca6a7bc34e7b79b" dependencies: - "@ledgerhq/hw-transport" "^4.6.0" + "@ledgerhq/hw-transport" "^4.7.3" node-hid "^0.7.2" "@ledgerhq/hw-transport-u2f@^4.3.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-4.6.0.tgz#398082f8f12d2090b55b65b9d9d3865047ec1807" + version "4.7.3" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-u2f/-/hw-transport-u2f-4.7.3.tgz#32be84bd2829f0ad0745604355f73a169dceb5e5" dependencies: - "@ledgerhq/hw-transport" "^4.6.0" + "@ledgerhq/hw-transport" "^4.7.3" u2f-api "0.2.7" -"@ledgerhq/hw-transport@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.6.0.tgz#38f01eb33a54a0ad9885d25a3a55509ec820ae2d" +"@ledgerhq/hw-transport@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-4.7.3.tgz#e89cd90d30aaf008adf9fdfa4af317a48fe798ca" dependencies: - events "^1.1.1" + events "^2.0.0" + +"@sindresorhus/is@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" "@sinonjs/formatio@^2.0.0": version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2" + resolved "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2" dependencies: samsam "1.3.0" @@ -58,10 +62,6 @@ version "0.4.1" resolved "https://registry.yarnpkg.com/@types/accounting/-/accounting-0.4.1.tgz#865d9f5694fd7c438fba34eb4bc82eec6f34cdd5" -"@types/bignumber.js@^4.0.2": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/bignumber.js/-/bignumber.js-4.0.3.tgz#e8ce5f28c3025a01c6af7fc6d944494903a9e348" - "@types/bintrees@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@types/bintrees/-/bintrees-1.0.2.tgz#0dfdce4eeebdf90427bd35b0e79dc248b3d157a6" @@ -151,8 +151,8 @@ resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" "@types/istanbul@^0.4.29": - version "0.4.29" - resolved "https://registry.yarnpkg.com/@types/istanbul/-/istanbul-0.4.29.tgz#29c8cbb747ac57280965545dc58514ba0dbb99af" + version "0.4.30" + resolved "https://registry.yarnpkg.com/@types/istanbul/-/istanbul-0.4.30.tgz#073159320ab3296b2cfeb481f756a1f8f4c9c8e4" "@types/jsonschema@^1.1.1": version "1.1.1" @@ -172,7 +172,11 @@ dependencies: "@types/lodash" "*" -"@types/lodash@*", "@types/lodash@4.14.104", "@types/lodash@^4.14.37": +"@types/lodash@*", "@types/lodash@^4.14.37": + version "4.14.106" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.106.tgz#6093e9a02aa567ddecfe9afadca89e53e5dce4dd" + +"@types/lodash@4.14.104": version "4.14.104" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80" @@ -230,12 +234,12 @@ "@types/node" "*" "@types/node@*": - version "9.4.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.7.tgz#57d81cd98719df2c9de118f2d5f3b1120dcd7275" + version "9.6.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.0.tgz#d3480ee666df9784b1001a1872a2f6ccefb6c2d7" "@types/node@^8.0.53": - version "8.9.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.5.tgz#162b864bc70be077e6db212b322754917929e976" + version "8.10.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.0.tgz#f5d649cc49af8ed6507d15dc6e9b43fe8b927540" "@types/query-string@^5.0.1": version "5.1.0" @@ -253,10 +257,11 @@ dependencies: "@types/react" "*" -"@types/react-dom@^0.14.23": - version "0.14.23" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-0.14.23.tgz#cecfcfad754b4c2765fe5d29b81b301889ad6c2e" +"@types/react-dom@^16.0.3": + version "16.0.4" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.4.tgz#2e8fd45f5443780ed49bf2cdd9809e6091177a7d" dependencies: + "@types/node" "*" "@types/react" "*" "@types/react-redux@^4.4.37": @@ -267,16 +272,16 @@ redux "^3.6.0" "@types/react-router-dom@^4.0.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.2.4.tgz#02c43274129ffe0ac42b348f7c8c4a9a4e127c8a" + version "4.2.5" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.2.5.tgz#a6fc921f1008567eae35244e30f34f5f7655d5f0" dependencies: "@types/history" "*" "@types/react" "*" "@types/react-router" "*" "@types/react-router@*": - version "4.0.22" - resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.22.tgz#2b97336eddfdf5886973539539b8ce7037cf629b" + version "4.0.23" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.23.tgz#d0509dcbdb1c686aed8f3d5cb186f42e5fbe7c2a" dependencies: "@types/history" "*" "@types/react" "*" @@ -291,13 +296,9 @@ version "0.0.30" resolved "https://registry.yarnpkg.com/@types/react-tap-event-plugin/-/react-tap-event-plugin-0.0.30.tgz#123f35080412f489b6770c5a65c159ff96654cb5" -"@types/react@*": - version "16.0.40" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9" - -"@types/react@^15.0.15": - version "15.6.14" - resolved "https://registry.yarnpkg.com/@types/react/-/react-15.6.14.tgz#fe176209b9de3514f9782fa41a239bffd26a3b56" +"@types/react@*", "@types/react@^16.0.34": + version "16.0.41" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.41.tgz#72146737f4d439dc95a53315de4bfb43ac8542ca" "@types/redux@^3.6.0": version "3.6.0" @@ -324,6 +325,13 @@ version "1.2.0" resolved "https://registry.yarnpkg.com/@types/require-from-string/-/require-from-string-1.2.0.tgz#c18cfc8a2c1a0259e5841d1fef2b5e9d01c64242" +"@types/rimraf@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e" + dependencies: + "@types/glob" "*" + "@types/node" "*" + "@types/semver@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" @@ -426,7 +434,7 @@ abstract-leveldown@~2.6.0: dependencies: xtend "~4.0.0" -accepts@~1.3.4: +accepts@~1.3.4, accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" dependencies: @@ -480,12 +488,13 @@ ajv@^5.1.0: json-schema-traverse "^0.3.0" ajv@^6.1.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.1.tgz#28a6abc493a2abe0fb4c8507acaedb43fa550671" + version "6.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.4.0.tgz#d3aff78e9277549771daf0164cff48482b754fc6" dependencies: fast-deep-equal "^1.0.0" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" + uri-js "^3.0.2" align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" @@ -509,9 +518,13 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" +ansi-escapes@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + ansi-escapes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" ansi-gray@^0.1.1: version "0.1.1" @@ -545,11 +558,19 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" + ansi-wrap@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" -any-promise@^1.0.0, any-promise@^1.3.0: +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + +any-promise@1.3.0, any-promise@^1.0.0, any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -674,7 +695,7 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -716,6 +737,14 @@ assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" +ast-types@0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.1.tgz#f52fca9715579a14f841d67d7f8d25432ab6a3dd" + +ast-types@0.11.3: + version "0.11.3" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.3.tgz#c20757fe72ee71278ea0ff3d87e5c2ca30d9edf8" + async-child-process@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/async-child-process/-/async-child-process-1.1.1.tgz#27d0a598b5738707f9898c048bd231340583747b" @@ -732,7 +761,7 @@ async-eventemitter@^0.2.2: dependencies: async "^2.4.0" -async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c: +"async-eventemitter@github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c": version "0.2.3" resolved "https://codeload.github.com/ahultgren/async-eventemitter/tar.gz/fa06e39e56786ba541c180061dbf2c0a5bbf951c" dependencies: @@ -746,7 +775,7 @@ async@1.x, async@^1.4.0, async@^1.4.2, async@^1.5.0, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@2.6.0, async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0: +async@2.6.0, async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" dependencies: @@ -768,10 +797,6 @@ atob@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" -attempt-x@^1.1.0, attempt-x@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/attempt-x/-/attempt-x-1.1.3.tgz#9ac844c75bca2c4e9e30d8d5c01f41eeb481a8b7" - autoprefixer@^6.3.1: version "6.7.7" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014" @@ -878,6 +903,14 @@ babel-generator@^6.11.4, babel-generator@^6.18.0, babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" +babel-helper-bindify-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" @@ -920,6 +953,15 @@ babel-helper-explode-assignable-expression@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" +babel-helper-explode-class@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + dependencies: + babel-helper-bindify-decorators "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babel-helper-function-name@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" @@ -1003,10 +1045,34 @@ babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-constructor-call@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + babel-plugin-syntax-flow@^6.18.0, babel-plugin-syntax-flow@^6.3.13: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" @@ -1019,11 +1085,23 @@ babel-plugin-syntax-jsx@~6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.13.0.tgz#e741ff3992c578310be45c571bcd90a2f9c5586e" +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + babel-plugin-syntax-trailing-function-commas@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-to-generator@^6.22.0: +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" dependencies: @@ -1031,6 +1109,33 @@ babel-plugin-transform-async-to-generator@^6.22.0: babel-plugin-syntax-async-functions "^6.8.0" babel-runtime "^6.22.0" +babel-plugin-transform-class-constructor-call@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9" + dependencies: + babel-plugin-syntax-class-constructor-call "^6.18.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + dependencies: + babel-helper-explode-class "^6.24.1" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + babel-plugin-transform-es2015-arrow-functions@^6.22.0, babel-plugin-transform-es2015-arrow-functions@^6.3.13: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" @@ -1043,7 +1148,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0, babel-plugin-trans dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.9.0: +babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1, babel-plugin-transform-es2015-block-scoping@^6.9.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" dependencies: @@ -1053,7 +1158,7 @@ babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es20 babel-types "^6.26.0" lodash "^4.17.4" -babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.9.0: +babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" dependencies: @@ -1067,33 +1172,33 @@ babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-cla babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.3.13: +babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1, babel-plugin-transform-es2015-computed-properties@^6.3.13: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-destructuring@^6.23.0, babel-plugin-transform-es2015-destructuring@^6.9.0: +babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0, babel-plugin-transform-es2015-destructuring@^6.9.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.6.0: +babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1, babel-plugin-transform-es2015-duplicate-keys@^6.6.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-plugin-transform-es2015-for-of@^6.23.0, babel-plugin-transform-es2015-for-of@^6.6.0: +babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0, babel-plugin-transform-es2015-for-of@^6.6.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.9.0: +babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1, babel-plugin-transform-es2015-function-name@^6.9.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" dependencies: @@ -1124,7 +1229,7 @@ babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-e babel-template "^6.26.0" babel-types "^6.26.0" -babel-plugin-transform-es2015-modules-systemjs@^6.12.0, babel-plugin-transform-es2015-modules-systemjs@^6.23.0: +babel-plugin-transform-es2015-modules-systemjs@^6.12.0, babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" dependencies: @@ -1132,7 +1237,7 @@ babel-plugin-transform-es2015-modules-systemjs@^6.12.0, babel-plugin-transform-e babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.12.0, babel-plugin-transform-es2015-modules-umd@^6.23.0: +babel-plugin-transform-es2015-modules-umd@^6.12.0, babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" dependencies: @@ -1140,14 +1245,14 @@ babel-plugin-transform-es2015-modules-umd@^6.12.0, babel-plugin-transform-es2015 babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.3.13: +babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1, babel-plugin-transform-es2015-object-super@^6.3.13: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.9.0: +babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1, babel-plugin-transform-es2015-parameters@^6.9.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" dependencies: @@ -1158,7 +1263,7 @@ babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015- babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.3.13: +babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1, babel-plugin-transform-es2015-shorthand-properties@^6.3.13: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" dependencies: @@ -1171,7 +1276,7 @@ babel-plugin-transform-es2015-spread@^6.22.0, babel-plugin-transform-es2015-spre dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.3.13: +babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1, babel-plugin-transform-es2015-sticky-regex@^6.3.13: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" dependencies: @@ -1185,13 +1290,13 @@ babel-plugin-transform-es2015-template-literals@^6.22.0, babel-plugin-transform- dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.23.0, babel-plugin-transform-es2015-typeof-symbol@^6.6.0: +babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0, babel-plugin-transform-es2015-typeof-symbol@^6.6.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.3.13: +babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1, babel-plugin-transform-es2015-unicode-regex@^6.3.13: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" dependencies: @@ -1199,7 +1304,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es20 babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.22.0: +babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" dependencies: @@ -1207,13 +1312,27 @@ babel-plugin-transform-exponentiation-operator@^6.22.0: babel-plugin-syntax-exponentiation-operator "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-flow-strip-types@^6.3.13: +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.3.13, babel-plugin-transform-flow-strip-types@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" dependencies: babel-plugin-syntax-flow "^6.18.0" babel-runtime "^6.22.0" +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + babel-plugin-transform-react-display-name@^6.3.13: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" @@ -1242,7 +1361,7 @@ babel-plugin-transform-react-jsx@^6.3.13: babel-plugin-syntax-jsx "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.9.0: +babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1, babel-plugin-transform-regenerator@^6.9.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" dependencies: @@ -1296,6 +1415,35 @@ babel-preset-es2015-loose@~7.0.0: dependencies: modify-babel-preset "^1.0.0" +babel-preset-es2015@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + babel-preset-es2015@~6.13.2: version "6.13.2" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.13.2.tgz#006c469a7528bd066f2917c8b4955309dcd53cfb" @@ -1337,6 +1485,33 @@ babel-preset-react@~6.11.0: babel-plugin-transform-react-jsx-self "^6.11.0" babel-plugin-transform-react-jsx-source "^6.3.13" +babel-preset-stage-1@^6.5.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0" + dependencies: + babel-plugin-transform-class-constructor-call "^6.24.1" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.24.1" + +babel-preset-stage-2@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators "^6.24.1" + babel-preset-stage-3 "^6.24.1" + +babel-preset-stage-3@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.24.1" + babel-plugin-transform-async-to-generator "^6.24.1" + babel-plugin-transform-exponentiation-operator "^6.24.1" + babel-plugin-transform-object-rest-spread "^6.22.0" + babel-register@^6.26.0, babel-register@^6.9.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" @@ -1396,10 +1571,14 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@^6.18.0, babylon@^6.7.0: +babylon@^6.17.3, babylon@^6.18.0, babylon@^6.7.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" +babylon@^7.0.0-beta.30: + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.42.tgz#67cfabcd4f3ec82999d29031ccdea89d0ba99657" + bail@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.2.tgz#f7d6c1731630a9f9f0d4d35ed1f962e2074a1764" @@ -1514,14 +1693,14 @@ big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" -"bignumber.js@git+https://github.com/debris/bignumber.js#master": - version "2.0.7" - resolved "git+https://github.com/debris/bignumber.js#c7a38de919ed75e6fb6ba38051986e294b328df9" - "bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2": version "2.0.7" resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" +"bignumber.js@git+https://github.com/debris/bignumber.js.git#master": + version "2.0.7" + resolved "git+https://github.com/debris/bignumber.js.git#c7a38de919ed75e6fb6ba38051986e294b328df9" + "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git": version "2.0.7" resolved "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" @@ -1534,6 +1713,10 @@ binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" +binaryextensions@2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.1.1.tgz#3209a51ca4a4ad541a3b8d3d6a6d5b83a2485935" + bindings@^1.2.1, bindings@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" @@ -1569,10 +1752,11 @@ bip66@^1.1.3: safe-buffer "^5.0.1" bl@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e" + version "1.2.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" dependencies: - readable-stream "^2.0.5" + readable-stream "^2.3.5" + safe-buffer "^5.1.1" bl@~0.8.1: version "0.8.2" @@ -1596,10 +1780,6 @@ blockies@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/blockies/-/blockies-0.0.2.tgz#22ad58da4f6b382bc79bf4386c5820c70047e4ed" -bluebird@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.3.1.tgz#f97ae1970f41d85177283053e9a120160e66c61d" - bluebird@^2.6.2, bluebird@^2.9.34: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" @@ -1665,8 +1845,8 @@ boom@5.x.x: hoek "4.x.x" bowser@^1.7.3: - version "1.9.2" - resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.2.tgz#d66fc868ca5f4ba895bee1363c343fe7b37d3394" + version "1.9.3" + resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.3.tgz#6643ae4d783f31683f6d23156976b74183862162" boxen@^1.2.1: version "1.3.0" @@ -1818,10 +1998,12 @@ buffer-crc32@~0.2.3: resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" buffer-from@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.1.tgz#57b18b1da0a19ec06f33837a5275a242351bd75e" - dependencies: - is-array-buffer-x "^1.0.13" + version "0.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.2.tgz#15f4b9bcef012044df31142c14333caf6e0260d0" + +buffer-from@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" buffer-indexof@^1.0.0: version "1.1.1" @@ -1919,9 +2101,17 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cached-constructors-x@^1.0.0, cached-constructors-x@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cached-constructors-x/-/cached-constructors-x-1.0.2.tgz#d8a7b79b43fdcf13fd861bb763f38b627b0ccf91" +cacheable-request@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" + dependencies: + clone-response "1.0.2" + get-stream "3.0.0" + http-cache-semantics "3.8.1" + keyv "3.0.0" + lowercase-keys "1.0.0" + normalize-url "2.0.1" + responselike "1.0.2" cachedown@^1.0.0: version "1.0.0" @@ -1979,12 +2169,12 @@ caniuse-api@^1.5.2: lodash.uniq "^4.5.0" caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: - version "1.0.30000813" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000813.tgz#e0a1c603f8880ad787b2a35652b2733f32a5e29a" + version "1.0.30000820" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000820.tgz#7c20e25cea1768b261b724f82e3a6a253aaa1468" caniuse-lite@^1.0.30000792: - version "1.0.30000813" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000813.tgz#7b25e27fdfb8d133f3c932b01f77452140fcc6c9" + version "1.0.30000820" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000820.tgz#6e36ee75187a2c83d26d6504a1af47cc580324d2" capture-stack-trace@^1.0.0: version "1.0.0" @@ -2001,12 +2191,6 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chai-as-promised-typescript-typings@^0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/chai-as-promised-typescript-typings/-/chai-as-promised-typescript-typings-0.0.10.tgz#fad2fd48b1a1c1ad53ef7204fe9e3ffaa877d0e2" - dependencies: - chai-typescript-typings "^0.0.4" - chai-as-promised@^7.1.0: version "7.1.1" resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" @@ -2017,10 +2201,6 @@ chai-bignumber@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/chai-bignumber/-/chai-bignumber-2.0.2.tgz#de6c219c690b2d66b646ad6930096f9ba2199643" -chai-typescript-typings@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/chai-typescript-typings/-/chai-typescript-typings-0.0.4.tgz#f4d4057b4b1b89d9bd0e35862fc4761ae76cc94b" - chai@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" @@ -2044,7 +2224,7 @@ chain-function@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -2054,7 +2234,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" dependencies: @@ -2062,6 +2242,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" + dependencies: + ansi-styles "~1.0.0" + has-color "~0.1.0" + strip-ansi "~0.1.0" + change-emitter@^0.1.2: version "0.1.6" resolved "https://registry.yarnpkg.com/change-emitter/-/change-emitter-0.1.6.tgz#e8b2fe3d7f1ab7d69a32199aff91ea6931409515" @@ -2097,8 +2285,8 @@ checkpoint-store@^1.1.0: functional-red-black-tree "^1.0.1" chokidar@^2.0.0, chokidar@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7" + version "2.0.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.3.tgz#dcbd4f6cbb2a55b4799ba8a840ac527e5f4b1176" dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -2112,15 +2300,15 @@ chokidar@^2.0.0, chokidar@^2.0.2: readdirp "^2.0.0" upath "^1.0.0" optionalDependencies: - fsevents "^1.0.0" + fsevents "^1.1.2" chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" ci-info@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" + version "1.1.3" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" @@ -2156,6 +2344,12 @@ cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" +cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -2168,6 +2362,10 @@ cli-progress@1.7.0: dependencies: colors "^1.1.2" +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" + cli-table2@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/cli-table2/-/cli-table2-0.2.0.tgz#2d1ef7f218a0e786e214540562d4bd177fe32d97" @@ -2177,6 +2375,19 @@ cli-table2@0.2.0: optionalDependencies: colors "^1.1.2" +cli-table@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" + dependencies: + colors "1.0.3" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + cli-width@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-1.1.1.tgz#a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d" @@ -2213,6 +2424,12 @@ clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" +clone-response@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" @@ -2226,16 +2443,16 @@ clone@^0.2.0: resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" clone@^1.0.0, clone@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" clone@^2.0.0, clone@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" cloneable-readable@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.1.tgz#c27a4f3a943ca37bed9b01c7d572ee61b1302b15" + version "1.1.2" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.2.tgz#d591dee4a8f8bc15da43ce97dceeba13d43e2a65" dependencies: inherits "^2.0.1" process-nextick-args "^2.0.0" @@ -2316,10 +2533,18 @@ colormin@^1.0.5: css-color-names "0.0.4" has "^1.0.1" -colors@1.1.2, colors@^1.1.2, colors@~1.1.2: +colors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + +colors@1.1.2, colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +colors@^1.1.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.1.tgz#f4a3d302976aaf042356ba1ade3b1a2c62d9d794" + columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -2364,8 +2589,8 @@ commander@2.9.0: graceful-readlink ">= 1.0.0" commander@^2.12.1, commander@^2.8.1, commander@^2.9.0: - version "2.15.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.0.tgz#ad2a23a1c3b036e392469b8012cec6b33b4c1322" + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" commander@~2.8.1: version "2.8.1" @@ -2431,7 +2656,7 @@ compressible@~2.0.13: compression@^1.5.2: version "1.7.2" - resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.2.tgz#aaffbcd6aaf854b44ebb280353d5ad1651f59a69" + resolved "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz#aaffbcd6aaf854b44ebb280353d5ad1651f59a69" dependencies: accepts "~1.3.4" bytes "3.0.0" @@ -2446,16 +2671,17 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" concat-stream@^1.4.10, concat-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: + buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^2.2.2" typedarray "^0.0.6" configstore@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.1.tgz#094ee662ab83fad9917678de114faaea8fcdca90" + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" dependencies: dot-prop "^4.1.0" graceful-fs "^4.1.2" @@ -2501,39 +2727,39 @@ conventional-changelog-angular@^1.6.6: compare-func "^1.3.1" q "^1.5.1" -conventional-changelog-atom@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.2.4.tgz#4917759947f4db86073f9d3838a2d54302d5843d" +conventional-changelog-atom@^0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.2.7.tgz#1cb4e9d79576734d187fa10662212652644686fd" dependencies: q "^1.5.1" conventional-changelog-cli@^1.3.13: - version "1.3.16" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.16.tgz#69acdcc4b68b4d123c5945868dffe394960cea9d" + version "1.3.20" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.20.tgz#f2b5ad8f73334879b645721c11292032c0b93a88" dependencies: add-stream "^1.0.0" - conventional-changelog "^1.1.18" + conventional-changelog "^1.1.22" lodash "^4.2.1" meow "^4.0.0" tempfile "^1.1.1" -conventional-changelog-codemirror@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.3.4.tgz#debc43991d487d7964e65087fbbe034044bd51fb" +conventional-changelog-codemirror@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.3.7.tgz#1e911361ebe6f96b1966a623c2bf52065114eda5" dependencies: q "^1.5.1" -conventional-changelog-core@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz#45b6347c4c6512e1f163f7ff55c9f5bcb88fd990" +conventional-changelog-core@^2.0.9: + version "2.0.9" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.9.tgz#74fd7ccfce349267a878bf2ff470c315fc6db38e" dependencies: - conventional-changelog-writer "^3.0.4" - conventional-commits-parser "^2.1.5" + conventional-changelog-writer "^3.0.8" + conventional-commits-parser "^2.1.7" dateformat "^3.0.0" get-pkg-repo "^1.0.0" - git-raw-commits "^1.3.4" + git-raw-commits "^1.3.6" git-remote-origin-url "^2.0.0" - git-semver-tags "^1.3.4" + git-semver-tags "^1.3.6" lodash "^4.2.1" normalize-package-data "^2.3.5" q "^1.5.1" @@ -2541,21 +2767,21 @@ conventional-changelog-core@^2.0.5: read-pkg-up "^1.0.1" through2 "^2.0.0" -conventional-changelog-ember@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.3.6.tgz#f3825d7434168f3d9211b5532dc1d5769532b668" +conventional-changelog-ember@^0.3.10: + version "0.3.10" + resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.3.10.tgz#aa42b1f6d73df14a7bc9c20f2726884934e03164" dependencies: q "^1.5.1" -conventional-changelog-eslint@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz#8bae05ebbf574e6506caf7b37dc51ca21b74d220" +conventional-changelog-eslint@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.8.tgz#3046276acafcd6c9403605439f16164b46bb21b6" dependencies: q "^1.5.1" -conventional-changelog-express@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.3.4.tgz#812a9cf778677e12f978ac9c40d85297c0bfcca9" +conventional-changelog-express@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.3.6.tgz#4a6295cb11785059fb09202180d0e59c358b9c2c" dependencies: q "^1.5.1" @@ -2571,23 +2797,23 @@ conventional-changelog-jscs@^0.1.0: dependencies: q "^1.4.1" -conventional-changelog-jshint@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.3.4.tgz#b2de33cd0870d9af804ac6a4fded0ee25b69c9bb" +conventional-changelog-jshint@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.3.7.tgz#f59d591042dec607a65816686191700611f684bd" dependencies: compare-func "^1.3.1" q "^1.5.1" -conventional-changelog-preset-loader@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz#b29af6332f9313857be36427623c9016bfeeaf33" +conventional-changelog-preset-loader@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.8.tgz#40bb0f142cd27d16839ec6c74ee8db418099b373" -conventional-changelog-writer@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz#705b46a8b8277bd7fd79cad8032095b5d803864c" +conventional-changelog-writer@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.8.tgz#e772ab261960f0bc849893ee843c0949d8e942dc" dependencies: compare-func "^1.3.1" - conventional-commits-filter "^1.1.5" + conventional-commits-filter "^1.1.6" dateformat "^3.0.0" handlebars "^4.0.2" json-stringify-safe "^5.0.1" @@ -2597,32 +2823,32 @@ conventional-changelog-writer@^3.0.4: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.18: - version "1.1.18" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.18.tgz#ffe28798e4ddef5f6e2f74398e8248bcb233360b" +conventional-changelog@^1.1.22: + version "1.1.22" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.22.tgz#3aa0395525ac5903e48b6ed0ecf41957bc10819c" dependencies: conventional-changelog-angular "^1.6.6" - conventional-changelog-atom "^0.2.4" - conventional-changelog-codemirror "^0.3.4" - conventional-changelog-core "^2.0.5" - conventional-changelog-ember "^0.3.6" - conventional-changelog-eslint "^1.0.5" - conventional-changelog-express "^0.3.4" + conventional-changelog-atom "^0.2.7" + conventional-changelog-codemirror "^0.3.7" + conventional-changelog-core "^2.0.9" + conventional-changelog-ember "^0.3.10" + conventional-changelog-eslint "^1.0.8" + conventional-changelog-express "^0.3.6" conventional-changelog-jquery "^0.1.0" conventional-changelog-jscs "^0.1.0" - conventional-changelog-jshint "^0.3.4" - conventional-changelog-preset-loader "^1.1.6" + conventional-changelog-jshint "^0.3.7" + conventional-changelog-preset-loader "^1.1.8" -conventional-commits-filter@^1.1.1, conventional-commits-filter@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz#77aac065e3de9c1a74b801e8e25c9affb3184f65" +conventional-commits-filter@^1.1.1, conventional-commits-filter@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.6.tgz#4389cd8e58fe89750c0b5fb58f1d7f0cc8ad3831" dependencies: is-subset "^0.1.1" modify-values "^1.0.0" -conventional-commits-parser@^2.1.1, conventional-commits-parser@^2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz#9ac3a4ab221c0c3c9e9dd2c09ae01e6d1e1dabe0" +conventional-commits-parser@^2.1.1, conventional-commits-parser@^2.1.7: + version "2.1.7" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz#eca45ed6140d72ba9722ee4132674d639e644e8e" dependencies: JSONStream "^1.0.4" is-text-path "^1.0.0" @@ -2644,7 +2870,7 @@ conventional-recommended-bump@^1.2.1: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.3.0, convert-source-map@^1.5.0: +convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -2705,7 +2931,7 @@ core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" -core-js@^2.4.0, core-js@^2.5.0: +core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0: version "2.5.3" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" @@ -2786,6 +3012,16 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -2798,7 +3034,7 @@ cryptiles@3.x.x: dependencies: boom "5.x.x" -crypto-browserify@^3.11.0, crypto-browserify@^3.12.0: +crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" dependencies: @@ -2853,8 +3089,8 @@ css-loader@0.23.x: source-list-map "^0.1.4" css-loader@^0.28.9: - version "0.28.10" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.10.tgz#40282e79230f7bcb4e483efa631d670b735ebf42" + version "0.28.11" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.11.tgz#c3f9864a700be2711bb5a2462b2389b1a392dab7" dependencies: babel-code-frame "^6.26.0" css-selector-tokenizer "^0.7.0" @@ -2971,12 +3207,20 @@ dargs@^4.0.1: dependencies: number-is-nan "^1.0.0" +dargs@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-5.1.0.tgz#ec7ea50c78564cd36c9d5ec18f66329fade27829" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" dependencies: assert-plus "^1.0.0" +date-fns@^1.27.2: + version "1.29.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" @@ -2985,7 +3229,7 @@ dateformat@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" -dateformat@^3.0.0: +dateformat@^3.0.0, dateformat@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -3120,7 +3364,7 @@ deep-equal@^1.0.0, deep-equal@^1.0.1, deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" -deep-extend@~0.4.0: +deep-extend@^0.4.0, deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -3205,7 +3449,7 @@ depd@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" -depd@~1.1.1: +depd@~1.1.1, depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -3224,6 +3468,10 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +detect-conflict@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/detect-conflict/-/detect-conflict-1.0.1.tgz#088657a66a961c05019db7c4230883b1c6b4176e" + detect-file@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" @@ -3266,7 +3514,7 @@ diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" -diff@^3.1.0, diff@^3.2.0: +diff@^3.1.0, diff@^3.2.0, diff@^3.3.1, diff@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -3406,6 +3654,10 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" +editions@^1.3.3: + version "1.3.4" + resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" + editor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" @@ -3414,9 +3666,17 @@ ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" +ejs@^2.3.1: + version "2.5.8" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.8.tgz#2ab6954619f225e6193b7ac5f7c39c48fefe4380" + electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30: - version "1.3.36" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.36.tgz#0eabf71a9ebea9013fb1cc35a390e068624f27e8" + version "1.3.40" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.40.tgz#1fbd6d97befd72b8a6f921dc38d22413d2f6fddf" + +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: version "6.4.0" @@ -3434,7 +3694,7 @@ emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" -encodeurl@~1.0.1: +encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3474,6 +3734,14 @@ enhanced-resolve@^3.4.0: object-assign "^4.0.1" tapable "^0.2.7" +enhanced-resolve@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz#e34a6eaa790f62fccd71d93959f56b2b432db10a" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + entities@^1.1.1, entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" @@ -3490,9 +3758,16 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +error@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/error/-/error-7.0.2.tgz#a5f75fff4d9926126ddac0ea5dc38e689153cb02" + dependencies: + string-template "~0.2.1" + xtend "~4.0.0" + es-abstract@^1.4.3, es-abstract@^1.5.0, es-abstract@^1.7.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" + version "1.11.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681" dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -3509,11 +3784,12 @@ es-to-primitive@^1.1.1: is-symbol "^1.0.1" es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.40" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.40.tgz#ab3d2179b943008c5e9ef241beb25ef41424c774" + version "0.10.41" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.41.tgz#bab3e982d750f0112f0cb9e6abed72c59eb33eb2" dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" + next-tick "1" es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" @@ -3610,7 +3886,7 @@ esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@^4.0.0: +esprima@^4.0.0, esprima@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -3653,15 +3929,7 @@ eth-block-tracker@^2.2.2: pify "^2.3.0" tape "^4.6.3" -eth-lib@0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - dependencies: - bn.js "^4.11.6" - elliptic "^6.4.0" - xhr-request-promise "^0.1.2" - -eth-lib@^0.1.26, eth-lib@^0.1.27: +eth-lib@0.1.27, eth-lib@^0.1.26: version "0.1.27" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.27.tgz#f0b0fd144f865d2d6bf8257a40004f2e75ca1dd6" dependencies: @@ -3673,6 +3941,14 @@ eth-lib@^0.1.26, eth-lib@^0.1.27: ws "^3.0.0" xhr-request-promise "^0.1.2" +eth-lib@0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + eth-query@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" @@ -3680,7 +3956,7 @@ eth-query@^2.1.0: json-rpc-random-id "^1.0.0" xtend "^4.0.1" -eth-sig-util@^1.3.0: +eth-sig-util@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" dependencies: @@ -3708,10 +3984,10 @@ ethereumjs-abi@^0.6.4: "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": version "0.6.5" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#71f123b676f2b2d81bc20f343670d90045a3d3d8" + resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#09c3c48fd3bed143df7fa8f36f6f164205e23796" dependencies: bn.js "^4.10.0" - ethereumjs-util "^4.3.0" + ethereumjs-util "^5.0.0" ethereumjs-account@^2.0.3, ethereumjs-account@~2.0.4: version "2.0.4" @@ -3748,11 +4024,12 @@ ethereumjs-blockstream@^2.0.6: source-map-support "0.4.14" uuid "3.0.1" -ethereumjs-testrpc-sc@6.0.7: - version "6.0.7" - resolved "https://registry.yarnpkg.com/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.0.7.tgz#580a5b4dfb00d27fa6f4f9126aca56e0c722b2bf" +ethereumjs-testrpc-sc@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.2.tgz#bd1d8306abb2d51481f3f01538fa71fb7fd44a4d" dependencies: - webpack "^3.0.0" + source-map-support "^0.5.3" + webpack-cli "^2.0.9" ethereumjs-testrpc@^6.0.3: version "6.0.3" @@ -3863,7 +4140,7 @@ event-emitter@~0.3.5: event-stream@~3.3.0: version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" dependencies: duplexer "~0.1.1" from "~0" @@ -3885,10 +4162,14 @@ eventemitter3@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.0.0.tgz#fc29ecf233bd19fbd527bb4089bbf665dc90c1e3" -events@^1.0.0, events@^1.1.1: +events@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" +events@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/events/-/events-2.0.0.tgz#cbbb56bf3ab1ac18d71c43bb32c86255062769f2" + eventsource@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232" @@ -3930,6 +4211,10 @@ exenv@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -3972,10 +4257,10 @@ exports-loader@0.6.x: source-map "0.5.x" express@^4.14.0, express@^4.15.2, express@^4.16.2: - version "4.16.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" + version "4.16.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" dependencies: - accepts "~1.3.4" + accepts "~1.3.5" array-flatten "1.1.1" body-parser "1.18.2" content-disposition "0.5.2" @@ -3983,26 +4268,26 @@ express@^4.14.0, express@^4.15.2, express@^4.16.2: cookie "0.3.1" cookie-signature "1.0.6" debug "2.6.9" - depd "~1.1.1" - encodeurl "~1.0.1" + depd "~1.1.2" + encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.1.0" + finalhandler "1.1.1" fresh "0.5.2" merge-descriptors "1.0.1" methods "~1.1.2" on-finished "~2.3.0" parseurl "~1.3.2" path-to-regexp "0.1.7" - proxy-addr "~2.0.2" + proxy-addr "~2.0.3" qs "6.5.1" range-parser "~1.2.0" safe-buffer "5.1.1" - send "0.16.1" - serve-static "1.13.1" + send "0.16.2" + serve-static "1.13.2" setprototypeof "1.1.0" - statuses "~1.3.1" - type-is "~1.6.15" + statuses "~1.4.0" + type-is "~1.6.16" utils-merge "1.0.1" vary "~1.1.2" @@ -4023,7 +4308,7 @@ extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" -external-editor@^2.0.4: +external-editor@^2.0.4, external-editor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" dependencies: @@ -4132,7 +4417,7 @@ fetch-ponyfill@^4.0.0: dependencies: node-fetch "~1.7.1" -figures@^1.3.5: +figures@^1.3.5, figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: @@ -4184,16 +4469,16 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" +finalhandler@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" dependencies: debug "2.6.9" - encodeurl "~1.0.1" + encodeurl "~1.0.2" escape-html "~1.0.3" on-finished "~2.3.0" parseurl "~1.3.2" - statuses "~1.3.1" + statuses "~1.4.0" unpipe "~1.0.0" find-cache-dir@^0.1.1: @@ -4265,6 +4550,12 @@ first-chunk-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" +first-chunk-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70" + dependencies: + readable-stream "^2.0.2" + flagged-respawn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.0.tgz#4e79ae9b2eb38bf86b3bb56bf3e0a56aa5fcabd7" @@ -4273,9 +4564,13 @@ flatten@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" +flow-parser@^0.*: + version "0.68.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.68.0.tgz#9cc96620a102e316a314b6bcd56205ceace862d8" + flush-write-stream@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417" + version "1.0.3" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" dependencies: inherits "^2.0.1" readable-stream "^2.0.4" @@ -4347,7 +4642,7 @@ fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" -from2@^2.1.0: +from2@^2.1.0, from2@^2.1.1: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" dependencies: @@ -4413,7 +4708,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" dependencies: @@ -4536,6 +4831,10 @@ get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" +get-stream@3.0.0, get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" @@ -4543,10 +4842,6 @@ get-stream@^2.2.0: object-assign "^4.0.1" pinkie-promise "^2.0.0" -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -4557,6 +4852,13 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +gh-got@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gh-got/-/gh-got-6.0.0.tgz#d74353004c6ec466647520a10bd46f7299d268d0" + dependencies: + got "^7.0.0" + is-plain-obj "^1.1.0" + ghauth@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/ghauth/-/ghauth-2.0.1.tgz#79b7d68b0bcf8e7d0852a23b147539dfd314acf6" @@ -4567,9 +4869,9 @@ ghauth@^2.0.0: read "~1.0.5" xtend "~4.0.0" -git-raw-commits@^1.3.0, git-raw-commits@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.4.tgz#442c3df5985b4f5689e9e43597f5194736aac001" +git-raw-commits@^1.3.0, git-raw-commits@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.6.tgz#27c35a32a67777c1ecd412a239a6c19d71b95aff" dependencies: dargs "^4.0.1" lodash.template "^4.0.2" @@ -4584,9 +4886,9 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^1.3.0, git-semver-tags@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.3.4.tgz#2ceb2a355c6d7514c123c35e297067d08caf3a92" +git-semver-tags@^1.3.0, git-semver-tags@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.3.6.tgz#357ea01f7280794fe0927f2806bee6414d2caba5" dependencies: meow "^4.0.0" semver "^5.5.0" @@ -4607,6 +4909,19 @@ github-url-to-object@^1.4.2: dependencies: is-url "^1.1.0" +github-username@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/github-username/-/github-username-4.1.0.tgz#cbe280041883206da4212ae9e4b5f169c30bf417" + dependencies: + gh-got "^6.0.0" + +glob-all@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab" + dependencies: + glob "^7.0.5" + yargs "~1.2.6" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -4793,7 +5108,7 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -got@7.1.0, got@^7.1.0: +got@7.1.0, got@^7.0.0, got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" dependencies: @@ -4828,6 +5143,28 @@ got@^6.7.1: unzip-response "^2.0.1" url-parse-lax "^1.0.0" +got@^8.2.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/got/-/got-8.3.0.tgz#6ba26e75f8a6cc4c6b3eb1fe7ce4fec7abac8533" + dependencies: + "@sindresorhus/is" "^0.7.0" + cacheable-request "^2.1.1" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + into-stream "^3.1.0" + is-retry-allowed "^1.1.0" + isurl "^1.0.0-alpha5" + lowercase-keys "^1.0.0" + mimic-response "^1.0.0" + p-cancelable "^0.4.0" + p-timeout "^2.0.1" + pify "^3.0.0" + safe-buffer "^5.1.1" + timed-out "^4.0.1" + url-parse-lax "^3.0.0" + url-to-options "^1.0.1" + graceful-fs@^3.0.0: version "3.0.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" @@ -4846,6 +5183,12 @@ graceful-fs@~1.2.0: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +grouped-queue@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/grouped-queue/-/grouped-queue-0.3.3.tgz#c167d2a5319c5a0e0964ef6a25b7c2df8996c85c" + dependencies: + lodash "^4.17.2" + growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" @@ -4953,6 +5296,10 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-color@~0.1.0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" + has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" @@ -4975,19 +5322,11 @@ has-localstorage@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-localstorage/-/has-localstorage-1.0.1.tgz#fe62406c4767fbd6d784dac6905928108b82971b" -has-own-property-x@^3.1.1: - version "3.2.0" - resolved "https://registry.yarnpkg.com/has-own-property-x/-/has-own-property-x-3.2.0.tgz#1c4b112a577c8cb5805469556e54b6e959e4ded9" - dependencies: - cached-constructors-x "^1.0.0" - to-object-x "^1.5.0" - to-property-key-x "^2.0.2" - -has-symbol-support-x@^1.4.1, has-symbol-support-x@^1.4.2: +has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" -has-to-string-tag-x@^1.2.0, has-to-string-tag-x@^1.4.1: +has-to-string-tag-x@^1.2.0: version "1.4.1" resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" dependencies: @@ -5170,6 +5509,10 @@ htmlparser2@^3.9.0: inherits "^2.0.1" readable-stream "^2.0.2" +http-cache-semantics@3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + http-deceiver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" @@ -5283,8 +5626,8 @@ icss-utils@^2.1.0: postcss "^6.0.1" ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + version "1.1.11" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455" iferr@^0.1.5: version "0.1.5" @@ -5350,10 +5693,6 @@ indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -infinity-x@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/infinity-x/-/infinity-x-1.0.2.tgz#374a4d5c8a9b98d2f61b782fc63892598de2f14c" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -5397,7 +5736,7 @@ inquirer@^0.8.2: rx "^2.4.3" through "^2.3.6" -inquirer@^3.2.2: +inquirer@^3.2.2, inquirer@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" dependencies: @@ -5416,6 +5755,24 @@ inquirer@^3.2.2: strip-ansi "^4.0.0" through "^2.3.6" +inquirer@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.1.0" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^5.5.2" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + intel@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/intel/-/intel-1.2.0.tgz#11d1147eb6b3f4582bdf5337b37d541584e9e41e" @@ -5433,13 +5790,20 @@ internal-ip@1.2.0: dependencies: meow "^3.3.0" -interpret@^1.0.0: +interpret@^1.0.0, interpret@^1.0.4: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + invariant@^2.0.0, invariant@^2.2.1, invariant@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.3.tgz#1a827dfde7dcbd7c323f0ca826be8fa7c5e9d688" + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" @@ -5493,16 +5857,6 @@ is-alphanumerical@^1.0.0: is-alphabetical "^1.0.0" is-decimal "^1.0.0" -is-array-buffer-x@^1.0.13: - version "1.7.0" - resolved "https://registry.yarnpkg.com/is-array-buffer-x/-/is-array-buffer-x-1.7.0.tgz#4b0b10427b64aa3437767adf4fc07702c59b2371" - dependencies: - attempt-x "^1.1.0" - has-to-string-tag-x "^1.4.1" - is-object-like-x "^1.5.1" - object-get-own-property-descriptor-x "^3.2.0" - to-string-tag-x "^1.4.1" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -5597,19 +5951,6 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" -is-falsey-x@^1.0.0, is-falsey-x@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-falsey-x/-/is-falsey-x-1.0.3.tgz#d8bb6d77c15fb2b99d81d10a7351641495fb36e2" - dependencies: - to-boolean-x "^1.0.2" - -is-finite-x@^3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/is-finite-x/-/is-finite-x-3.0.4.tgz#320c97bab8aacc7e3cfa34aa58c432762c491b4e" - dependencies: - infinity-x "^1.0.1" - is-nan-x "^1.0.2" - is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -5630,19 +5971,6 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-function-x@^3.2.0, is-function-x@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/is-function-x/-/is-function-x-3.3.0.tgz#7d16bc113853db206d5e40a8b32caf99bd4ff7c0" - dependencies: - attempt-x "^1.1.1" - has-to-string-tag-x "^1.4.1" - is-falsey-x "^1.0.1" - is-primitive "^2.0.0" - normalize-space-x "^3.0.0" - replace-comments-x "^2.0.0" - to-boolean-x "^1.0.1" - to-string-tag-x "^1.4.2" - is-function@^1.0.1, is-function@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" @@ -5673,16 +6001,6 @@ is-hexadecimal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" -is-index-x@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-index-x/-/is-index-x-1.1.0.tgz#43dac97b3a04f30191530833f45ac35001682ee2" - dependencies: - math-clamp-x "^1.2.0" - max-safe-integer "^1.0.1" - to-integer-x "^3.0.0" - to-number-x "^2.0.0" - to-string-symbols-supported-x "^1.0.0" - is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" @@ -5694,21 +6012,10 @@ is-mobile@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-0.2.2.tgz#0e2e006d99ed2c2155b761df80f2a3619ae2ad9f" -is-nan-x@^1.0.1, is-nan-x@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-nan-x/-/is-nan-x-1.0.3.tgz#1c7fca40fc1b830a36e8800b37513a81f91fcc58" - is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" -is-nil-x@^1.4.1, is-nil-x@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/is-nil-x/-/is-nil-x-1.4.2.tgz#a45e798d1e490d38db4570f2457245da21493e97" - dependencies: - lodash.isnull "^3.0.0" - validate.io-undefined "^1.0.3" - is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" @@ -5733,17 +6040,16 @@ is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" -is-object-like-x@^1.5.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/is-object-like-x/-/is-object-like-x-1.7.1.tgz#f440ce811fb31278e4ed0b34f2d5a277d87b4481" - dependencies: - is-function-x "^3.3.0" - is-primitive "^3.0.0" - is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + is-odd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" @@ -5755,8 +6061,8 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" dependencies: is-path-inside "^1.0.0" @@ -5784,10 +6090,6 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-primitive@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-3.0.0.tgz#ddc27a9f9ebe7bed4b4f308acc9abb1c7a025757" - is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -5808,18 +6110,20 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" -is-retry-allowed@^1.0.0: +is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" +is-scoped@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-scoped/-/is-scoped-1.0.0.tgz#449ca98299e713038256289ecb2b540dc437cb30" + dependencies: + scoped-regex "^1.0.0" + is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" -is-string@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" - is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" @@ -5851,8 +6155,8 @@ is-unc-path@^1.0.0: unc-path-regex "^0.1.2" is-url@^1.1.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.2.tgz#498905a593bf47cc2d9e7f738372bbf7696c7f26" + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" is-utf8@^0.2.0: version "0.2.1" @@ -5911,9 +6215,9 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.1.1, istanbul-lib-coverage@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz#4113c8ff6b7a40a1ef7350b01016331f63afde14" +istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" istanbul-lib-hook@^1.1.0: version "1.1.0" @@ -5921,19 +6225,19 @@ istanbul-lib-hook@^1.1.0: dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.9.1: - version "1.9.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz#84905bf47f7e0b401d6b840da7bad67086b4aab6" +istanbul-lib-instrument@^1.10.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.18.0" - istanbul-lib-coverage "^1.1.2" + istanbul-lib-coverage "^1.2.0" semver "^5.3.0" -istanbul-lib-report@^1.1.2: +istanbul-lib-report@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz#2df12188c0fa77990c0d2176d2d0ba3394188259" dependencies: @@ -5942,7 +6246,7 @@ istanbul-lib-report@^1.1.2: path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.2: +istanbul-lib-source-maps@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz#20fb54b14e14b3fb6edb6aca3571fd2143db44e6" dependencies: @@ -5952,9 +6256,9 @@ istanbul-lib-source-maps@^1.2.2: rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.4.tgz#5ccba5e22b7b5a5d91d5e0a830f89be334bf97bd" +istanbul-reports@^1.1.4: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" dependencies: handlebars "^4.0.3" @@ -5977,6 +6281,14 @@ istanbul@^0.4.5: which "^1.1.1" wordwrap "^1.0.0" +istextorbinary@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/istextorbinary/-/istextorbinary-2.2.1.tgz#a5231a08ef6dd22b268d0895084cf8d58b5bec53" + dependencies: + binaryextensions "2" + editions "^1.3.3" + textextensions "2" + isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" @@ -6046,6 +6358,46 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jscodeshift@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.4.1.tgz#da91a1c2eccfa03a3387a21d39948e251ced444a" + dependencies: + async "^1.5.0" + babel-plugin-transform-flow-strip-types "^6.8.0" + babel-preset-es2015 "^6.9.0" + babel-preset-stage-1 "^6.5.0" + babel-register "^6.9.0" + babylon "^6.17.3" + colors "^1.1.2" + flow-parser "^0.*" + lodash "^4.13.1" + micromatch "^2.3.7" + node-dir "0.1.8" + nomnom "^1.8.1" + recast "^0.12.5" + temp "^0.8.1" + write-file-atomic "^1.2.0" + +jscodeshift@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.5.0.tgz#bdb7b6cc20dd62c16aa728c3fa2d2fe66ca7c748" + dependencies: + babel-plugin-transform-flow-strip-types "^6.8.0" + babel-preset-es2015 "^6.9.0" + babel-preset-stage-1 "^6.5.0" + babel-register "^6.9.0" + babylon "^7.0.0-beta.30" + colors "^1.1.2" + flow-parser "^0.*" + lodash "^4.13.1" + micromatch "^2.3.7" + neo-async "^2.5.0" + node-dir "0.1.8" + nomnom "^1.8.1" + recast "^0.14.1" + temp "^0.8.1" + write-file-atomic "^1.2.0" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -6054,6 +6406,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" @@ -6166,8 +6522,14 @@ keccakjs@^0.2.0, keccakjs@^0.2.1: sha3 "^1.1.0" keycode@^2.1.8: - version "2.1.9" - resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.1.9.tgz#964a23c54e4889405b4861a5c9f0480d45141dfa" + version "2.2.0" + resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04" + +keyv@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" + dependencies: + json-buffer "3.0.0" killable@^1.0.0: version "1.0.0" @@ -6209,12 +6571,6 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lazy-cache@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" - dependencies: - set-getter "^0.1.0" - lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -6239,6 +6595,10 @@ lcov-result-merger@^2.0.0: vinyl "^2.0.0" vinyl-fs "^2.4.3" +lerna-get-packages@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lerna-get-packages/-/lerna-get-packages-1.0.0.tgz#60fa309a71cf2e34eec63224368de2fe8f61ba65" + lerna@^2.5.1: version "2.9.0" resolved "https://registry.yarnpkg.com/lerna/-/lerna-2.9.0.tgz#303f70bc50b1c4541bdcf54eda13c36fe54401f3" @@ -6400,6 +6760,54 @@ liquid-json@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/liquid-json/-/liquid-json-0.3.1.tgz#9155a18136d8a6b2615e5f16f9a2448ab6b50eea" +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-observable "^0.2.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.4.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + p-map "^1.1.1" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" + strip-ansi "^3.0.1" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -6588,10 +6996,6 @@ lodash.isequal@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" -lodash.isnull@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash.isnull/-/lodash.isnull-3.0.0.tgz#fafbe59ea1dca27eed786534039dd84c2e07c56e" - lodash.isplainobject@~4.0.4: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" @@ -6692,6 +7096,25 @@ log-driver@^1.2.5: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-symbols@^2.1.0, log-symbols@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" @@ -6725,10 +7148,14 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lowercase-keys@^1.0.0: +lowercase-keys@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + lru-cache@2: version "2.7.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" @@ -6755,8 +7182,8 @@ ltcdr@^2.2.1: resolved "https://registry.yarnpkg.com/ltcdr/-/ltcdr-2.2.1.tgz#5ab87ad1d4c1dab8e8c08bbf037ee0c1902287cf" ltgt@^2.1.2, ltgt@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.0.tgz#b65ba5fcb349a29924c8e333f7c6a5562f2e4842" + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" ltgt@~2.1.1: version "2.1.3" @@ -6766,7 +7193,7 @@ macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" -make-dir@^1.0.0: +make-dir@^1.0.0, make-dir@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" dependencies: @@ -6805,8 +7232,8 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.1.tgz#1994df2d3af4811de59a6714934c2b2292734518" marked@^0.3.12, marked@^0.3.5: - version "0.3.17" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.17.tgz#607f06668b3c6b1246b28f13da76116ac1aa2d2b" + version "0.3.19" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" material-ui@^0.17.1: version "0.17.4" @@ -6825,27 +7252,10 @@ material-ui@^0.17.1: simple-assign "^0.1.0" warning "^3.0.0" -math-clamp-x@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/math-clamp-x/-/math-clamp-x-1.2.0.tgz#8b537be0645bbba7ee73ee16091e7d6018c5edcf" - dependencies: - to-number-x "^2.0.0" - math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" -math-sign-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/math-sign-x/-/math-sign-x-3.0.0.tgz#d5286022b48e150c384729a86042e0835264c3ed" - dependencies: - is-nan-x "^1.0.1" - to-number-x "^2.0.0" - -max-safe-integer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/max-safe-integer/-/max-safe-integer-1.0.1.tgz#f38060be2c563d8c02e6d48af39122fd83b6f410" - md5-hex@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" @@ -6867,6 +7277,29 @@ media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" +mem-fs-editor@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/mem-fs-editor/-/mem-fs-editor-3.0.2.tgz#dd0a6eaf2bb8a6b37740067aa549eb530105af9f" + dependencies: + commondir "^1.0.1" + deep-extend "^0.4.0" + ejs "^2.3.1" + glob "^7.0.3" + globby "^6.1.0" + mkdirp "^0.5.0" + multimatch "^2.0.0" + rimraf "^2.2.8" + through2 "^2.0.0" + vinyl "^2.0.1" + +mem-fs@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/mem-fs/-/mem-fs-1.1.3.tgz#b8ae8d2e3fcb6f5d3f9165c12d4551a065d989cc" + dependencies: + through2 "^2.0.0" + vinyl "^1.1.0" + vinyl-file "^2.0.0" + mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -6941,8 +7374,8 @@ merge-stream@^1.0.0: readable-stream "^2.0.1" merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.0.tgz#84c606232ef343f1b96fc972e697708754f08573" + version "2.3.1" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.1.tgz#7d4e7263a9c85c1679187cad4a6d71f48d524c71" dependencies: async "^1.4.2" ethereumjs-util "^5.0.0" @@ -6975,9 +7408,9 @@ micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.0.3, micromatch@^3.0.4, micromatch@^3.1.4: - version "3.1.9" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" +micromatch@^3.0.3, micromatch@^3.0.4, micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -6991,7 +7424,7 @@ micromatch@^3.0.3, micromatch@^3.0.4, micromatch@^3.1.4: object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" - to-regex "^3.0.1" + to-regex "^3.0.2" miller-rabin@^4.0.0: version "4.0.1" @@ -7200,8 +7633,8 @@ modify-babel-preset@^1.0.0: require-relative "^0.8.7" modify-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" + version "1.0.1" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" moment@*, moment@^2.18.1, moment@^2.6.0: version "2.21.0" @@ -7245,6 +7678,15 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" +multimatch@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" + dependencies: + array-differ "^1.0.0" + array-union "^1.0.1" + arrify "^1.0.0" + minimatch "^3.0.0" + multipipe@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" @@ -7267,13 +7709,9 @@ mz@^2.6.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan-x@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nan-x/-/nan-x-1.0.2.tgz#5f34e9d3115242486219eee3c8bc49fd2425b19a" - nan@^2.0.5, nan@^2.0.8, nan@^2.2.1, nan@^2.3.0, nan@^2.3.3, nan@^2.6.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866" + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" nano-json-stream-parser@^0.1.2: version "0.1.2" @@ -7297,8 +7735,8 @@ nanomatch@^1.2.9: to-regex "^3.0.1" natives@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.1.tgz#011acce1f7cbd87f7ba6b3093d6cd9392be1c574" + version "1.1.2" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.2.tgz#4437ca1ed8a7f047531ccdfaf2792853df4efa1c" negotiator@0.6.1: version "0.6.1" @@ -7335,9 +7773,17 @@ newman@^3.9.3: word-wrap "1.2.3" xmlbuilder "9.0.4" +next-tick@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + +nice-try@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + nise@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/nise/-/nise-1.3.0.tgz#7d6d506e64a0e37959495157f30a799c0436df72" + version "1.3.2" + resolved "https://registry.yarnpkg.com/nise/-/nise-1.3.2.tgz#fd6fd8dc040dfb3c0a45252feb6ff21832309b14" dependencies: "@sinonjs/formatio" "^2.0.0" just-extend "^1.1.27" @@ -7365,6 +7811,10 @@ node-abi@^2.2.0: dependencies: semver "^5.4.1" +node-dir@0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.8.tgz#55fb8deb699070707fb67f91a460f0448294c77d" + node-fetch@^1.0.1, node-fetch@^1.3.3, node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -7439,8 +7889,8 @@ node-uuid@^1.4.7: resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" nodemon@^1.11.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.17.1.tgz#cdb4bc53d7a86d6162143a1a44d7adf927d8652f" + version "1.17.2" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.17.2.tgz#17c0062629610e03dd01241c576f1c4068da9fdd" dependencies: chokidar "^2.0.2" debug "^3.1.0" @@ -7453,6 +7903,13 @@ nodemon@^1.11.0: undefsafe "^2.0.2" update-notifier "^2.3.0" +nomnom@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" + dependencies: + chalk "~0.4.0" + underscore "~1.6.0" + noms@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" @@ -7502,13 +7959,13 @@ normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" -normalize-space-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-space-x/-/normalize-space-x-3.0.0.tgz#17907d6c7c724a4f9567471cbb319553bc0f8882" +normalize-url@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" dependencies: - cached-constructors-x "^1.0.0" - trim-x "^3.0.0" - white-space-x "^3.0.0" + prepend-http "^2.0.0" + query-string "^5.0.1" + sort-keys "^2.0.0" normalize-url@^1.4.0: version "1.9.1" @@ -7564,25 +8021,25 @@ number-to-bn@1.7.0: strip-hex-prefix "1.0.0" nyc@^11.0.1: - version "11.4.1" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.4.1.tgz#13fdf7e7ef22d027c61d174758f6978a68f4f5e5" + version "11.6.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.6.0.tgz#d9c7b51ffceb6bba099a4683a6adc1b331b98853" dependencies: archy "^1.0.0" arrify "^1.0.1" caching-transform "^1.0.0" - convert-source-map "^1.3.0" + convert-source-map "^1.5.1" debug-log "^1.0.1" default-require-extensions "^1.0.0" find-cache-dir "^0.1.1" find-up "^2.1.0" foreground-child "^1.5.3" glob "^7.0.6" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" istanbul-lib-hook "^1.1.0" - istanbul-lib-instrument "^1.9.1" - istanbul-lib-report "^1.1.2" - istanbul-lib-source-maps "^1.2.2" - istanbul-reports "^1.1.3" + istanbul-lib-instrument "^1.10.0" + istanbul-lib-report "^1.1.3" + istanbul-lib-source-maps "^1.2.3" + istanbul-reports "^1.1.4" md5-hex "^1.2.0" merge-source-map "^1.0.2" micromatch "^2.3.11" @@ -7591,8 +8048,8 @@ nyc@^11.0.1: rimraf "^2.5.4" signal-exit "^3.0.1" spawn-wrap "^1.4.2" - test-exclude "^4.1.1" - yargs "^10.0.3" + test-exclude "^4.2.0" + yargs "11.1.0" yargs-parser "^8.0.0" oauth-sign@~0.8.1, oauth-sign@~0.8.2: @@ -7615,24 +8072,9 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-get-own-property-descriptor-x@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/object-get-own-property-descriptor-x/-/object-get-own-property-descriptor-x-3.2.0.tgz#464585ad03e66108ed166c99325b8d2c5ba93712" - dependencies: - attempt-x "^1.1.0" - has-own-property-x "^3.1.1" - has-symbol-support-x "^1.4.1" - is-falsey-x "^1.0.0" - is-index-x "^1.0.0" - is-primitive "^2.0.0" - is-string "^1.0.4" - property-is-enumerable-x "^1.1.0" - to-object-x "^1.4.1" - to-property-key-x "^2.0.1" - object-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.2.0.tgz#e96af0e96981996a1d47f88ead8f74f1ebc4422b" + version "1.3.0" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.0.tgz#76d9ba6ff113cf8efc0d996102851fe6723963e2" object-inspect@~1.5.0: version "1.5.0" @@ -7688,8 +8130,8 @@ oboe@2.1.3: http-https "^1.0.0" obuf@^1.0.0, obuf@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.1.tgz#104124b6c602c6796881a042541d36db43a5264e" + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" on-finished@~2.3.0: version "2.3.0" @@ -7713,6 +8155,10 @@ once@~1.3.0: dependencies: wrappy "1" +onetime@^1.0.0: + version "1.1.0" + resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" @@ -7737,8 +8183,8 @@ opn@^4.0.0: pinkie-promise "^2.0.0" opn@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.2.0.tgz#71fdf934d6827d676cecbea1531f95d354641225" + version "5.3.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" dependencies: is-wsl "^1.1.0" @@ -7760,6 +8206,15 @@ optionator@^0.8.1: type-check "~0.3.2" wordwrap "~1.0.0" +ora@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + object-assign "^4.0.1" + orchestrator@^0.3.0: version "0.3.8" resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" @@ -7822,10 +8277,28 @@ p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" +p-cancelable@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.4.0.tgz#bcb41d35bf6097fc4367a065b6eb84b9b124eff0" + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + dependencies: + p-reduce "^1.0.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + +p-lazy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-lazy/-/p-lazy-1.0.0.tgz#ec53c802f2ee3ac28f166cc82d0b2b02de27a835" + p-limit@^1.0.0, p-limit@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" @@ -7842,12 +8315,22 @@ p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" dependencies: p-finally "^1.0.0" +p-timeout@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" + dependencies: + p-finally "^1.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -7922,15 +8405,6 @@ parse-headers@^2.0.0: for-each "^0.3.2" trim "0.0.1" -parse-int-x@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parse-int-x/-/parse-int-x-2.0.0.tgz#9f979d4115930df2f4706a41810b9c712405552f" - dependencies: - cached-constructors-x "^1.0.0" - nan-x "^1.0.0" - to-string-x "^1.4.2" - trim-left-x "^3.0.0" - parse-json@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" @@ -7996,7 +8470,7 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -8377,12 +8851,12 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 supports-color "^3.2.3" postcss@^6.0.1: - version "6.0.19" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.19.tgz#76a78386f670b9d9494a655bf23ac012effd1555" + version "6.0.21" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.21.tgz#8265662694eddf9e9a5960db6da33c39e4cd069d" dependencies: - chalk "^2.3.1" + chalk "^2.3.2" source-map "^0.6.1" - supports-color "^5.2.0" + supports-color "^5.3.0" postman-collection-transformer@2.5.4: version "2.5.4" @@ -8529,11 +9003,15 @@ prepend-http@^1.0.0, prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.11.1: +prettier@^1.11.1, prettier@^1.5.3: version "1.11.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" @@ -8544,6 +9022,10 @@ pretty-bytes@^1.0.4: get-stdin "^4.0.1" meow "^3.1.0" +pretty-bytes@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" + pretty-hrtime@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -8555,7 +9037,7 @@ pretty-ms@3.1.0: parse-ms "^1.0.0" plur "^2.1.2" -private@^0.1.6, private@^0.1.7: +private@^0.1.6, private@^0.1.7, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -8603,6 +9085,10 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +promisify-child-process@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/promisify-child-process/-/promisify-child-process-1.0.5.tgz#817ad1aec92c013d83bb37e1f143e9b4033d9669" + prop-types@^15.0.0, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1: version "15.6.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" @@ -8615,14 +9101,7 @@ propagate@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/propagate/-/propagate-1.0.0.tgz#00c2daeedda20e87e3782b344adba1cddd6ad709" -property-is-enumerable-x@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/property-is-enumerable-x/-/property-is-enumerable-x-1.1.0.tgz#7ca48917476cd0914b37809bfd05776a0d942f6f" - dependencies: - to-object-x "^1.4.1" - to-property-key-x "^2.0.1" - -proxy-addr@~2.0.2: +proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" dependencies: @@ -8709,8 +9188,8 @@ pull-pushable@^2.0.0: resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.4.5: - version "3.6.2" - resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.2.tgz#1ea14c6f13174e6ac4def0c2a4e76567b7cb0c5c" + version "3.6.3" + resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.6.3.tgz#8010864c1d9d99e8539d5a487ca7583131c499b8" pull-window@^2.1.4: version "2.1.4" @@ -8748,6 +9227,10 @@ punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + q@^1.1.2, q@^1.4.1, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -8768,8 +9251,8 @@ query-string@^4.1.0: strict-uri-encode "^1.0.0" query-string@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.0.tgz#9583b15fd1307f899e973ed418886426a9976469" + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -8837,8 +9320,8 @@ raw-loader@^0.5.1: resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: - version "1.2.5" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.5.tgz#275cd687f6e3b36cc756baa26dfee80a790301fd" + version "1.2.6" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -9071,6 +9554,13 @@ react@^15.5.4: object-assign "^4.1.1" prop-types "^15.6.0" +read-chunk@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/read-chunk/-/read-chunk-2.1.0.tgz#6a04c0928005ed9d42e1a6ac5600e19cbc7ff655" + dependencies: + pify "^3.0.0" + safe-buffer "^5.1.1" + read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" @@ -9174,6 +9664,25 @@ readline2@^0.1.1: mute-stream "0.0.4" strip-ansi "^2.0.1" +recast@^0.12.5: + version "0.12.9" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.12.9.tgz#e8e52bdb9691af462ccbd7c15d5a5113647a15f1" + dependencies: + ast-types "0.10.1" + core-js "^2.4.1" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + +recast@^0.14.1: + version "0.14.7" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.14.7.tgz#4f1497c2b5826d42a66e8e3c9d80c512983ff61d" + dependencies: + ast-types "0.11.3" + esprima "~4.0.0" + private "~0.1.5" + source-map "~0.6.1" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -9332,13 +9841,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -replace-comments-x@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/replace-comments-x/-/replace-comments-x-2.0.0.tgz#a5cec18efd912aad78a7c3c4b69d01768556d140" - dependencies: - require-coercible-to-string-x "^1.0.0" - to-string-x "^1.4.2" - replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" @@ -9405,8 +9907,8 @@ request@2.81.0: uuid "^3.0.0" request@^2.54.0, request@^2.67.0, request@^2.79.0, request@^2.81.0: - version "2.83.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + version "2.85.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" dependencies: aws-sign2 "~0.7.0" aws4 "^1.6.0" @@ -9431,13 +9933,6 @@ request@^2.54.0, request@^2.67.0, request@^2.79.0, request@^2.81.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -require-coercible-to-string-x@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/require-coercible-to-string-x/-/require-coercible-to-string-x-1.0.2.tgz#b8c96ab42962ab7b28f3311fc6b198124c56f9f6" - dependencies: - require-object-coercible-x "^1.4.3" - to-string-x "^1.4.5" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -9454,12 +9949,6 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -require-object-coercible-x@^1.4.1, require-object-coercible-x@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/require-object-coercible-x/-/require-object-coercible-x-1.4.3.tgz#783719a23a5c0ce24e845fcc50cd55b6421ea4bb" - dependencies: - is-nil-x "^1.4.2" - require-relative@^0.8.7: version "0.8.7" resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" @@ -9505,12 +9994,31 @@ resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2, resolve@~1.5.0: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +resolve@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" +responselike@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -9568,7 +10076,7 @@ rollbar@^0.6.5: optionalDependencies: decache "^3.0.5" -run-async@^2.2.0: +run-async@^2.0.0, run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" dependencies: @@ -9598,6 +10106,12 @@ rx@^2.4.3: version "2.5.3" resolved "https://registry.yarnpkg.com/rx/-/rx-2.5.3.tgz#21adc7d80f02002af50dae97fd9dbf248755f566" +rxjs@^5.4.2, rxjs@^5.5.2: + version "5.5.8" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.8.tgz#b2b0809a57614ad6254c03d7446dea0d83ca3791" + dependencies: + symbol-observable "1.0.1" + safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -9632,6 +10146,10 @@ schema-utils@^0.4.5: ajv "^6.1.0" ajv-keywords "^3.1.0" +scoped-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-1.0.0.tgz#a346bb1acd4207ae70bd7c0c7ca9e566b6baddb8" + scroll-to-element@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/scroll-to-element/-/scroll-to-element-2.0.0.tgz#3467330e3384743b7295ac64b30279990c5ac164" @@ -9738,14 +10256,14 @@ semver@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.1.1.tgz#a3292a373e6f3e0798da0b20641b9a9c5bc47e19" -send@0.16.1: - version "0.16.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" +send@0.16.2: + version "0.16.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" dependencies: debug "2.6.9" - depd "~1.1.1" + depd "~1.1.2" destroy "~1.0.4" - encodeurl "~1.0.1" + encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" @@ -9754,7 +10272,7 @@ send@0.16.1: ms "2.0.0" on-finished "~2.3.0" range-parser "~1.2.0" - statuses "~1.3.1" + statuses "~1.4.0" sequencify@~0.0.7: version "0.0.7" @@ -9784,14 +10302,14 @@ serve-index@^1.7.2: mime-types "~2.1.17" parseurl "~1.3.2" -serve-static@1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.1.tgz#4c57d53404a761d8f2e7c1e8a18a47dbf278a719" +serve-static@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" dependencies: - encodeurl "~1.0.1" + encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.2" - send "0.16.1" + send "0.16.2" servify@^0.1.12: version "0.1.12" @@ -9807,12 +10325,6 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" -set-getter@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" - dependencies: - to-object-path "^0.3.0" - set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" @@ -9848,8 +10360,8 @@ setprototypeof@1.1.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.10" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b" + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -9903,7 +10415,7 @@ shelljs@^0.7.0, shelljs@^0.7.3, shelljs@^0.7.4: interpret "^1.0.0" rechoir "^0.6.2" -shelljs@^0.8.1: +shelljs@^0.8.0, shelljs@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.1.tgz#729e038c413a2254c4078b95ed46e0397154a9f1" dependencies: @@ -9948,8 +10460,8 @@ single-line-log@^0.4.1: resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-0.4.1.tgz#87a55649f749d783ec0dcd804e8140d9873c7cee" sinon@^4.0.0: - version "4.4.2" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.4.2.tgz#c4c41d4bd346e1d33594daec2d5df0548334fc65" + version "4.4.9" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.4.9.tgz#0792a2a5171eb0cf242edacb0eba3898b8b4297f" dependencies: "@sinonjs/formatio" "^2.0.0" diff "^3.1.0" @@ -9963,6 +10475,10 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + slide@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -9982,8 +10498,8 @@ snapdragon-util@^3.0.1: kind-of "^3.2.0" snapdragon@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370" + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" dependencies: base "^0.11.1" debug "^2.2.0" @@ -9992,7 +10508,7 @@ snapdragon@^0.8.1: map-cache "^0.2.2" source-map "^0.5.6" source-map-resolve "^0.5.0" - use "^2.0.0" + use "^3.1.0" sntp@1.x.x: version "1.0.9" @@ -10049,26 +10565,26 @@ solc@^0.4.18, solc@^0.4.2: yargs "^4.7.1" solidity-coverage@^0.4.10: - version "0.4.11" - resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.4.11.tgz#021ccd146e19bb84c4d6ecd3f31b64d78844e90f" + version "0.4.14" + resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.4.14.tgz#fe0eb49233196b1b9ec900a41ca9c3de526983a6" dependencies: death "^1.1.0" - ethereumjs-testrpc-sc "6.0.7" + ethereumjs-testrpc-sc "6.1.2" istanbul "^0.4.5" keccakjs "^0.2.1" req-cwd "^1.0.1" shelljs "^0.7.4" sol-explore "^1.6.2" - solidity-parser-sc "0.4.5" + solidity-parser-sc "0.4.6" web3 "^0.18.4" solidity-parser-antlr@^0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.2.7.tgz#4c72e5f052fdd54fec363f1156533703e84a8325" + version "0.2.8" + resolved "https://registry.yarnpkg.com/solidity-parser-antlr/-/solidity-parser-antlr-0.2.8.tgz#8eb8547a88dfeaf6cf4c7811e3824084214244d4" -solidity-parser-sc@0.4.5, solidity-parser-sc@^0.4.4: - version "0.4.5" - resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.5.tgz#dab766567edc690bb7c3fa987b04982609d5cae5" +solidity-parser-sc@0.4.6, solidity-parser-sc@^0.4.4: + version "0.4.6" + resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.6.tgz#e3a8d2ac887b89992582cbb20794eaa9b299e6a0" dependencies: mocha "^2.4.5" pegjs "^0.10.0" @@ -10133,8 +10649,8 @@ source-map-support@^0.4.15: source-map "^0.5.6" source-map-support@^0.5.0, source-map-support@^0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76" + version "0.5.4" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.4.tgz#54456efa89caa9270af7cd624cc2f123e51fbae8" dependencies: source-map "^0.6.0" @@ -10206,8 +10722,8 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" spdy-transport@^2.0.18: - version "2.0.20" - resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.0.20.tgz#735e72054c486b2354fe89e702256004a39ace4d" + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.1.0.tgz#4bbb15aaffed0beefdd56ad61dbdc8ba3e2cb7a1" dependencies: debug "^2.6.8" detect-node "^2.0.3" @@ -10268,8 +10784,8 @@ srcset@^1.0.0: number-is-nan "^1.0.0" sshpk@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + version "1.14.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -10282,8 +10798,8 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.2.4.tgz#9985e14041e65fc397af96542be35724ac11da52" + version "5.3.0" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" dependencies: safe-buffer "^5.1.1" @@ -10306,14 +10822,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.3.1 < 2": +"statuses@>= 1.3.1 < 2", statuses@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" @@ -10343,8 +10855,8 @@ stream-each@^1.1.0: stream-shift "^1.0.0" stream-http@^2.7.2: - version "2.8.0" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10" + version "2.8.1" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.1.tgz#d0441be1a457a73a733a8a7b53570bebd9ef66a4" dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" @@ -10362,6 +10874,12 @@ stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" + stream-to-pull-stream@^1.7.1: version "1.7.2" resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.2.tgz#757609ae1cebd33c7432d4afbe31ff78650b9dde" @@ -10383,6 +10901,10 @@ string-editor@^0.1.0: dependencies: editor "^1.0.0" +string-template@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -10452,6 +10974,10 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" + strip-bom-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" @@ -10459,6 +10985,13 @@ strip-bom-stream@^1.0.0: first-chunk-stream "^1.0.0" strip-bom "^2.0.0" +strip-bom-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" + dependencies: + first-chunk-stream "^2.0.0" + strip-bom "^2.0.0" + strip-bom@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" @@ -10609,6 +11142,14 @@ swarm-js@0.1.37: tar.gz "^1.0.5" xhr-request-promise "^0.1.2" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" + symbol-observable@^1.0.3, symbol-observable@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" @@ -10621,6 +11162,10 @@ tapable@^0.2.5, tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" +tapable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" + tape@^4.4.0, tape@^4.6.3: version "4.9.0" resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.0.tgz#855c08360395133709d34d3fbf9ef341eb73ca6a" @@ -10714,7 +11259,7 @@ temp-write@^3.3.0: temp-dir "^1.0.0" uuid "^3.0.1" -temp@^0.8.3: +temp@^0.8.1, temp@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" dependencies: @@ -10734,12 +11279,12 @@ term-size@^1.2.0: dependencies: execa "^0.7.0" -test-exclude@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.0.tgz#07e3613609a362c74516a717515e13322ab45b3c" +test-exclude@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" dependencies: arrify "^1.0.1" - micromatch "^2.3.11" + micromatch "^3.1.8" object-assign "^4.1.0" read-pkg-up "^1.0.1" require-main-filename "^1.0.1" @@ -10752,6 +11297,14 @@ text-extensions@^1.0.0: version "1.7.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +textextensions@2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.2.0.tgz#38ac676151285b658654581987a0ce1a4490d286" + thenby@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/thenby/-/thenby-1.2.3.tgz#62465b07e3d8b9466f01026df837f738e0faaa69" @@ -10854,23 +11407,10 @@ to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" -to-boolean-x@^1.0.1, to-boolean-x@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-boolean-x/-/to-boolean-x-1.0.3.tgz#cbe15e38a85d09553f29869a9b3e3b54ceef5af0" - to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -to-integer-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/to-integer-x/-/to-integer-x-3.0.0.tgz#9f3b80e668c7f0ae45e6926b40d95f52c1addc74" - dependencies: - is-finite-x "^3.0.2" - is-nan-x "^1.0.1" - math-sign-x "^3.0.0" - to-number-x "^2.0.0" - to-iso-string@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1" @@ -10879,50 +11419,12 @@ to-no-case@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/to-no-case/-/to-no-case-1.0.2.tgz#c722907164ef6b178132c8e69930212d1b4aa16a" -to-number-x@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-number-x/-/to-number-x-2.0.0.tgz#c9099d7ded8fd327132a2987df2dcc8baf36df4d" - dependencies: - cached-constructors-x "^1.0.0" - nan-x "^1.0.0" - parse-int-x "^2.0.0" - to-primitive-x "^1.1.0" - trim-x "^3.0.0" - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" dependencies: kind-of "^3.0.2" -to-object-x@^1.4.1, to-object-x@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/to-object-x/-/to-object-x-1.5.0.tgz#bd69dd4e104d77acc0cc0d84f5ac48f630aebe3c" - dependencies: - cached-constructors-x "^1.0.0" - require-object-coercible-x "^1.4.1" - -to-primitive-x@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/to-primitive-x/-/to-primitive-x-1.1.0.tgz#41ce2c13e3e246e0e5d0a8829a0567c6015833f8" - dependencies: - has-symbol-support-x "^1.4.1" - is-date-object "^1.0.1" - is-function-x "^3.2.0" - is-nil-x "^1.4.1" - is-primitive "^2.0.0" - is-symbol "^1.0.1" - require-object-coercible-x "^1.4.1" - validate.io-undefined "^1.0.3" - -to-property-key-x@^2.0.1, to-property-key-x@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/to-property-key-x/-/to-property-key-x-2.0.2.tgz#b19aa8e22faa0ff7d1c102cfbc657af73413cfa1" - dependencies: - has-symbol-support-x "^1.4.1" - to-primitive-x "^1.1.0" - to-string-x "^1.4.2" - to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" @@ -10930,7 +11432,7 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" -to-regex@^3.0.1: +to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" dependencies: @@ -10951,28 +11453,6 @@ to-space-case@^1.0.0: dependencies: to-no-case "^1.0.0" -to-string-symbols-supported-x@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-string-symbols-supported-x/-/to-string-symbols-supported-x-1.0.2.tgz#73f5e17963520b2b365559f05e3864addaab7f1e" - dependencies: - cached-constructors-x "^1.0.2" - has-symbol-support-x "^1.4.2" - is-symbol "^1.0.1" - -to-string-tag-x@^1.4.1, to-string-tag-x@^1.4.2: - version "1.4.3" - resolved "https://registry.yarnpkg.com/to-string-tag-x/-/to-string-tag-x-1.4.3.tgz#3aed2edec9343be3c76e338161f85d6864c692b1" - dependencies: - lodash.isnull "^3.0.0" - validate.io-undefined "^1.0.3" - -to-string-x@^1.4.2, to-string-x@^1.4.5: - version "1.4.5" - resolved "https://registry.yarnpkg.com/to-string-x/-/to-string-x-1.4.5.tgz#b86dad14df68ca4df52ca4cb011a25e0bf5d9ca1" - dependencies: - cached-constructors-x "^1.0.0" - is-symbol "^1.0.1" - toggle-selection@^1.0.3: version "1.0.6" resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" @@ -10993,14 +11473,6 @@ traverse-chain@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1" -trim-left-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/trim-left-x/-/trim-left-x-3.0.0.tgz#356cf055896726b9754425e841398842e90b4cdf" - dependencies: - cached-constructors-x "^1.0.0" - require-coercible-to-string-x "^1.0.0" - white-space-x "^3.0.0" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -11013,14 +11485,6 @@ trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" -trim-right-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/trim-right-x/-/trim-right-x-3.0.0.tgz#28c4cd37d5981f50ace9b52e3ce9106f4d2d22c0" - dependencies: - cached-constructors-x "^1.0.0" - require-coercible-to-string-x "^1.0.0" - white-space-x "^3.0.0" - trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -11029,13 +11493,6 @@ trim-trailing-lines@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684" -trim-x@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/trim-x/-/trim-x-3.0.0.tgz#24efdcd027b748bbfc246a0139ad1749befef024" - dependencies: - trim-left-x "^3.0.0" - trim-right-x "^3.0.0" - trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" @@ -11173,7 +11630,7 @@ type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" -type-is@~1.6.15: +type-is@~1.6.15, type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" dependencies: @@ -11339,6 +11796,10 @@ underscore@1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" +underscore@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + underscore@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" @@ -11453,6 +11914,10 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +untildify@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" @@ -11462,19 +11927,26 @@ upath@^1.0.0: resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" update-notifier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.3.0.tgz#4e8827a6bb915140ab093559d7014e3ebb837451" + version "2.4.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.4.0.tgz#f9b4c700fbfd4ec12c811587258777d563d8c866" dependencies: boxen "^1.2.1" chalk "^2.0.1" configstore "^3.0.0" import-lazy "^2.1.0" + is-ci "^1.0.10" is-installed-globally "^0.1.0" is-npm "^1.0.0" latest-version "^3.0.0" semver-diff "^2.0.0" xdg-basedir "^3.0.0" +uri-js@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-3.0.2.tgz#f90b858507f81dea4dcfbb3c4c3dbfa2b557faaa" + dependencies: + punycode "^2.1.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -11485,6 +11957,12 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + dependencies: + prepend-http "^2.0.0" + url-parse@1.0.x: version "1.0.5" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.0.5.tgz#0854860422afdcfefeb6c965c662d4800169927b" @@ -11526,13 +12004,11 @@ urllite@~0.5.0: dependencies: xtend "~4.0.0" -use@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" +use@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.0.tgz#14716bf03fdfefd03040aef58d8b4b85f3a7c544" dependencies: - define-property "^0.2.5" - isobject "^3.0.0" - lazy-cache "^2.0.2" + kind-of "^6.0.2" user-home@^1.1.1: version "1.1.1" @@ -11593,6 +12069,10 @@ uvm@1.7.0: lodash "4.17.4" uuid "3.0.1" +v8-compile-cache@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-1.1.2.tgz#8d32e4f16974654657e676e0e467a348e89b0dc4" + v8flags@^2.0.2: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" @@ -11614,10 +12094,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validate.io-undefined@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/validate.io-undefined/-/validate.io-undefined-1.0.3.tgz#7e27fcbb315b841e78243431897671929e20b7f4" - value-equal@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7" @@ -11657,6 +12133,17 @@ vfile@^2.0.0: unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" +vinyl-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-2.0.0.tgz#a7ebf5ffbefda1b7d18d140fcb07b223efb6751a" + dependencies: + graceful-fs "^4.1.2" + pify "^2.3.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + strip-bom-stream "^2.0.0" + vinyl "^1.1.0" + vinyl-fs@^0.3.0: version "0.3.14" resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" @@ -11707,7 +12194,7 @@ vinyl@^0.5.0: clone-stats "^0.0.1" replace-ext "0.0.1" -vinyl@^1.0.0: +vinyl@^1.0.0, vinyl@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" dependencies: @@ -11715,7 +12202,7 @@ vinyl@^1.0.0: clone-stats "^0.0.1" replace-ext "0.0.1" -vinyl@^2.0.0: +vinyl@^2.0.0, vinyl@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c" dependencies: @@ -11747,8 +12234,8 @@ watchpack@^1.4.0: neo-async "^2.5.0" wbuf@^1.1.0, wbuf@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.2.tgz#d697b99f1f59512df2751be42769c1580b5801fe" + version "1.7.3" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" dependencies: minimalistic-assert "^1.0.0" @@ -11758,153 +12245,153 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" -web3-bzz@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.30.tgz#2434da183c239aaaa5c013f62307429ea91dd706" +web3-bzz@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.0.0-beta.33.tgz#31500f699b7e70edf51490c55effb427bfbb3b01" dependencies: got "7.1.0" swarm-js "0.1.37" underscore "1.8.3" -web3-core-helpers@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.30.tgz#a000cee3f0a09eea13d74b5730335d4635fe1f2f" +web3-core-helpers@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.33.tgz#2af733e504db05e7c3648c1dacf577b0ec15dc43" dependencies: underscore "1.8.3" - web3-eth-iban "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-eth-iban "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-core-method@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.30.tgz#8dd6ff789e8d1563b8786d13a78c7facefae471c" +web3-core-method@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.0.0-beta.33.tgz#ed8ec4c4afab21dc0989de3583684466522b6e86" dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" - web3-core-promievent "1.0.0-beta.30" - web3-core-subscriptions "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" + web3-core-promievent "1.0.0-beta.33" + web3-core-subscriptions "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-core-promievent@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.30.tgz#6205192bfb097441132226a5939ec5aed3a8a291" +web3-core-promievent@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.33.tgz#d1f5ebb601527dd496562c362176e558d972d358" dependencies: - bluebird "3.3.1" + any-promise "1.3.0" eventemitter3 "1.1.1" -web3-core-requestmanager@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.30.tgz#6ee56fb8a6cb85fd01b3080854f50d64e52240c6" +web3-core-requestmanager@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.33.tgz#7a36c40354002dfb179ca2dbdb6a6012c9f719eb" dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" - web3-providers-http "1.0.0-beta.30" - web3-providers-ipc "1.0.0-beta.30" - web3-providers-ws "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" + web3-providers-http "1.0.0-beta.33" + web3-providers-ipc "1.0.0-beta.33" + web3-providers-ws "1.0.0-beta.33" -web3-core-subscriptions@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.30.tgz#31652c75356c3f67e5a19cd14b8d314bad4e2127" +web3-core-subscriptions@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.33.tgz#602875c9f4d5f4d0e1621462b5fc1ec19b35bde3" dependencies: eventemitter3 "1.1.1" underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" -web3-core@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.30.tgz#f75f4d3b85be74c7674637921c3e013bc5d27679" +web3-core@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.0.0-beta.33.tgz#f82ed525f5b66aecda95eeced3cad2bd695f7839" dependencies: - web3-core-helpers "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-core-requestmanager "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-core-requestmanager "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-eth-abi@1.0.0-beta.30, web3-eth-abi@^1.0.0-beta.24: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.30.tgz#6ea52c999a8505b47c2f88ba61d2a680a1066409" +web3-eth-abi@1.0.0-beta.33, web3-eth-abi@^1.0.0-beta.24: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.33.tgz#2221f7151643660032a4df340f612349168c824a" dependencies: bn.js "4.11.6" underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-eth-accounts@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.30.tgz#8f0a1b342c4283812372242a6e2df268887b3b70" +web3-eth-accounts@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.33.tgz#25a8d7f4e58e1e993b92f0695482cccdc9212f91" dependencies: - bluebird "3.3.1" - crypto-browserify "^3.12.0" + any-promise "1.3.0" + crypto-browserify "3.12.0" eth-lib "0.2.7" scrypt.js "0.2.0" underscore "1.8.3" uuid "2.0.1" - web3-core "1.0.0-beta.30" - web3-core-helpers "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core "1.0.0-beta.33" + web3-core-helpers "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-eth-contract@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.30.tgz#d7eba2385084dff3c75aac48235af2c8d2d6a258" +web3-eth-contract@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.33.tgz#9e5919f2917a3c67b4fb6569d49c5e3038925bce" dependencies: underscore "1.8.3" - web3-core "1.0.0-beta.30" - web3-core-helpers "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-core-promievent "1.0.0-beta.30" - web3-core-subscriptions "1.0.0-beta.30" - web3-eth-abi "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" - -web3-eth-iban@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.30.tgz#3b080a5c4da1fa37477b17e4c900781b92150645" + web3-core "1.0.0-beta.33" + web3-core-helpers "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-core-promievent "1.0.0-beta.33" + web3-core-subscriptions "1.0.0-beta.33" + web3-eth-abi "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" + +web3-eth-iban@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.33.tgz#1d73d0c5288a4565b1754a75b5fb3ea0b77a532f" dependencies: - bn.js "^4.11.6" - web3-utils "1.0.0-beta.30" + bn.js "4.11.6" + web3-utils "1.0.0-beta.33" -web3-eth-personal@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.30.tgz#8bd4ef40b3b5f841dd3a8b97873d9dc791caf748" +web3-eth-personal@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.33.tgz#b4e48587cc4e7eb018da26fde3b4f3ba5f9b98ef" dependencies: - web3-core "1.0.0-beta.30" - web3-core-helpers "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-net "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core "1.0.0-beta.33" + web3-core-helpers "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-net "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" -web3-eth@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.30.tgz#029b15e14cb608b9cfe02603b504d651870f0501" +web3-eth@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.0.0-beta.33.tgz#84a9f94da965527c92d838ad4e570df02589849f" dependencies: underscore "1.8.3" - web3-core "1.0.0-beta.30" - web3-core-helpers "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-core-subscriptions "1.0.0-beta.30" - web3-eth-abi "1.0.0-beta.30" - web3-eth-accounts "1.0.0-beta.30" - web3-eth-contract "1.0.0-beta.30" - web3-eth-iban "1.0.0-beta.30" - web3-eth-personal "1.0.0-beta.30" - web3-net "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" - -web3-net@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.30.tgz#0a352ede296e6d4b7f88b67aa474e49703de73bf" - dependencies: - web3-core "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + web3-core "1.0.0-beta.33" + web3-core-helpers "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-core-subscriptions "1.0.0-beta.33" + web3-eth-abi "1.0.0-beta.33" + web3-eth-accounts "1.0.0-beta.33" + web3-eth-contract "1.0.0-beta.33" + web3-eth-iban "1.0.0-beta.33" + web3-eth-personal "1.0.0-beta.33" + web3-net "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" + +web3-net@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.0.0-beta.33.tgz#b6c90d1a0e1626eaae8b3d922ac153672fd56445" + dependencies: + web3-core "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" web3-provider-engine@^13.0.1, web3-provider-engine@^13.6.5: - version "13.6.5" - resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.6.5.tgz#ef1c1d09f8bca329030c256e93ff6663ffd6fed4" + version "13.6.6" + resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-13.6.6.tgz#7d8972ffcd31e103bd2ce8a521b1b7da08cb173f" dependencies: async "^2.5.0" clone "^2.0.0" eth-block-tracker "^2.2.2" - eth-sig-util "^1.3.0" + eth-sig-util "^1.4.2" ethereumjs-block "^1.2.2" ethereumjs-tx "^1.2.0" ethereumjs-util "^5.1.1" @@ -11940,37 +12427,43 @@ web3-provider-engine@^8.4.0: xhr "^2.2.0" xtend "^4.0.1" -web3-providers-http@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.30.tgz#cda8d9133c6f31d1a812dc5a42af00cbea98cd86" +web3-providers-http@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.0.0-beta.33.tgz#3b35ae00ee7df5b96b4934962ad4a86f2a5599c1" dependencies: - web3-core-helpers "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" xhr2 "0.1.4" -web3-providers-ipc@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.30.tgz#ee2d8d18a3f120b777044a56e67e0aee20854587" +web3-providers-ipc@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.33.tgz#4f0adc9afe9d12c066e4be5c3c536f5073cb07c6" dependencies: oboe "2.1.3" underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" -web3-providers-ws@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.30.tgz#9ae69a9ead8a8761f86379fa347b6db5ae44b12d" +web3-providers-ws@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.33.tgz#8fddea42e19bbf2521ec879546457a623a9dc9ef" dependencies: underscore "1.8.3" - web3-core-helpers "1.0.0-beta.30" + web3-core-helpers "1.0.0-beta.33" websocket "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible" -web3-shh@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.30.tgz#2bfe3220d958ff4ca592017790852bc57b7b0ca7" +web3-shh@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.0.0-beta.33.tgz#f99e26573f6e099321af0d9f2bfcfe3ded3550a1" dependencies: - web3-core "1.0.0-beta.30" - web3-core-method "1.0.0-beta.30" - web3-core-subscriptions "1.0.0-beta.30" - web3-net "1.0.0-beta.30" + web3-core "1.0.0-beta.33" + web3-core-method "1.0.0-beta.33" + web3-core-subscriptions "1.0.0-beta.33" + web3-net "1.0.0-beta.33" + +web3-typescript-typings@^0.10.2: + version "0.10.2" + resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.10.2.tgz#a9903815d2a8a0dbd73fd5db374070de0bd30497" + dependencies: + bignumber.js "~4.1.0" web3-typescript-typings@^0.9.11: version "0.9.11" @@ -11978,12 +12471,12 @@ web3-typescript-typings@^0.9.11: dependencies: bignumber.js "~4.1.0" -web3-utils@1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.30.tgz#eae408cc8d6d6fecc8d5097cfead51773f231ff9" +web3-utils@1.0.0-beta.33: + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.33.tgz#e091b7994f09b714b0198a4057d3ad2eb8cbe238" dependencies: bn.js "4.11.6" - eth-lib "^0.1.27" + eth-lib "0.1.27" ethjs-unit "0.1.6" number-to-bn "1.7.0" randomhex "0.1.5" @@ -12010,8 +12503,8 @@ web3@^0.18.0, web3@^0.18.2, web3@^0.18.4: xmlhttprequest "*" web3@^0.20.0: - version "0.20.5" - resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.5.tgz#c5048d35f7bf4e2c4c280ce51fbbbc951290b165" + version "0.20.6" + resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.6.tgz#3e97306ae024fb24e10a3d75c884302562215120" dependencies: bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" @@ -12020,16 +12513,52 @@ web3@^0.20.0: xmlhttprequest "*" web3@^1.0.0-beta.30: - version "1.0.0-beta.30" - resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.30.tgz#ad3e761845aeb2f40a7760cde75793773a431ecd" + version "1.0.0-beta.33" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.33.tgz#c6021b5769927726371c184b868445311b139295" + dependencies: + web3-bzz "1.0.0-beta.33" + web3-core "1.0.0-beta.33" + web3-eth "1.0.0-beta.33" + web3-eth-personal "1.0.0-beta.33" + web3-net "1.0.0-beta.33" + web3-shh "1.0.0-beta.33" + web3-utils "1.0.0-beta.33" + +webpack-addons@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/webpack-addons/-/webpack-addons-1.1.5.tgz#2b178dfe873fb6e75e40a819fa5c26e4a9bc837a" dependencies: - web3-bzz "1.0.0-beta.30" - web3-core "1.0.0-beta.30" - web3-eth "1.0.0-beta.30" - web3-eth-personal "1.0.0-beta.30" - web3-net "1.0.0-beta.30" - web3-shh "1.0.0-beta.30" - web3-utils "1.0.0-beta.30" + jscodeshift "^0.4.0" + +webpack-cli@^2.0.9: + version "2.0.13" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-2.0.13.tgz#6e2bd9ef91345344737217e22e29001ad8537518" + dependencies: + chalk "^2.3.2" + cross-spawn "^6.0.5" + diff "^3.5.0" + enhanced-resolve "^4.0.0" + glob-all "^3.1.0" + global-modules "^1.0.0" + got "^8.2.0" + inquirer "^5.1.0" + interpret "^1.0.4" + jscodeshift "^0.5.0" + listr "^0.13.0" + loader-utils "^1.1.0" + lodash "^4.17.5" + log-symbols "^2.2.0" + mkdirp "^0.5.1" + p-each-series "^1.0.0" + p-lazy "^1.0.0" + prettier "^1.5.3" + resolve-cwd "^2.0.0" + supports-color "^5.3.0" + v8-compile-cache "^1.1.2" + webpack-addons "^1.1.5" + yargs "^11.0.0" + yeoman-environment "^2.0.0" + yeoman-generator "^2.0.3" webpack-dev-middleware@1.12.2, webpack-dev-middleware@^1.10.0: version "1.12.2" @@ -12166,10 +12695,6 @@ which@^1.1.1, which@^1.2.14, which@^1.2.9, which@^1.3.0: dependencies: isexe "^2.0.0" -white-space-x@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/white-space-x/-/white-space-x-3.0.1.tgz#81a82d5432da725aba5ca671624bb579c9e66d4f" - wide-align@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" @@ -12217,7 +12742,7 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^1.1.4: +write-file-atomic@^1.1.4, write-file-atomic@^1.2.0: version "1.3.4" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" dependencies: @@ -12377,6 +12902,29 @@ yargs-parser@^8.0.0, yargs-parser@^8.1.0: dependencies: camelcase "^4.1.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + +yargs@11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@6.6.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" @@ -12412,6 +12960,23 @@ yargs@^10.0.3: y18n "^3.2.1" yargs-parser "^8.1.0" +yargs@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@^4.6.0, yargs@^4.7.1, yargs@~4.8.0: version "4.8.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" @@ -12467,6 +13032,12 @@ yargs@^8.0.2: y18n "^3.2.1" yargs-parser "^7.0.0" +yargs@~1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b" + dependencies: + minimist "^0.1.0" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -12482,3 +13053,51 @@ yauzl@^2.4.2: dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.0.1" + +yeoman-environment@^2.0.0, yeoman-environment@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/yeoman-environment/-/yeoman-environment-2.0.5.tgz#84f22bafa84088971fe99ea85f654a3a3dd2b693" + dependencies: + chalk "^2.1.0" + debug "^3.1.0" + diff "^3.3.1" + escape-string-regexp "^1.0.2" + globby "^6.1.0" + grouped-queue "^0.3.3" + inquirer "^3.3.0" + is-scoped "^1.0.0" + lodash "^4.17.4" + log-symbols "^2.1.0" + mem-fs "^1.1.0" + text-table "^0.2.0" + untildify "^3.0.2" + +yeoman-generator@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/yeoman-generator/-/yeoman-generator-2.0.3.tgz#19426ed22687ffe05d31526c3f1c2cf67ba768f3" + dependencies: + async "^2.6.0" + chalk "^2.3.0" + cli-table "^0.3.1" + cross-spawn "^5.1.0" + dargs "^5.1.0" + dateformat "^3.0.2" + debug "^3.1.0" + detect-conflict "^1.0.0" + error "^7.0.2" + find-up "^2.1.0" + github-username "^4.0.0" + istextorbinary "^2.1.0" + lodash "^4.17.4" + make-dir "^1.1.0" + mem-fs-editor "^3.0.2" + minimist "^1.2.0" + pretty-bytes "^4.0.2" + read-chunk "^2.1.0" + read-pkg-up "^3.0.0" + rimraf "^2.6.2" + run-async "^2.0.0" + shelljs "^0.8.0" + text-table "^0.2.0" + through2 "^2.0.0" + yeoman-environment "^2.0.5" -- cgit v1.2.3 From ec06d8d6067488b53183db392b4da91be0cc219e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Mar 2018 15:05:05 +0200 Subject: Add typeRoots --- .circleci/config.yml | 1 - package.json | 1 - packages/monorepo-scripts/src/test_installation.ts | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d4ffe62ea..615980e88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,6 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn lerna:exec 'yarn pack --filename package.tgz' - run: yarn test:installation test-0xjs: docker: diff --git a/package.json b/package.json index 1a2d917c0..457268454 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "report_coverage": "lcov-result-merger 'packages/*/coverage/lcov.info' | coveralls", "test:installation": "node ./packages/monorepo-scripts/lib/test_installation.js", "lerna:run": "lerna run", - "lerna:exec": "lerna exec", "lerna:rebuild": "lerna run clean; lerna run build;", "lerna:publish": "yarn install; lerna run clean; lerna run build; lerna publish --registry=https://registry.npmjs.org/" diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index 116b70f3a..195b64b2a 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -34,6 +34,7 @@ import { utils } from './utils'; fs.writeFileSync(indexFilePath, `import * as Package from '${packageName}'`); const tsConfig = { compilerOptions: { + typeRoots: ['node_modules/@0xproject/typescript-typings/types', 'node_modules/@types'], module: 'commonjs', target: 'es5', lib: ['es2017', 'dom'], -- cgit v1.2.3 From eb89ef79eba3d044e10b8e52e20927bb88241ac2 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 27 Mar 2018 16:49:19 +0100 Subject: Add monorepo_scripts to npmignore --- packages/0x.js/.npmignore | 1 + packages/abi-gen/.npmignore | 1 + packages/assert/.npmignore | 1 + packages/base-contract/.npmignore | 1 + packages/chai-as-promised-typescript-typings/.npmignore | 1 + packages/chai-typescript-typings/.npmignore | 1 + packages/connect/.npmignore | 1 + packages/deployer/.npmignore | 1 + packages/dev-utils/.npmignore | 1 + packages/ethers-typescript-typings/.npmignore | 1 + packages/json-schemas/.npmignore | 1 + packages/react-docs/.npmignore | 1 + packages/react-shared/.npmignore | 1 + packages/sol-cov/.npmignore | 1 + packages/sra-report/.npmignore | 1 + packages/subproviders/.npmignore | 1 + packages/tslint-config/.npmignore | 1 + packages/types/.npmignore | 1 + packages/utils/.npmignore | 1 + packages/web3-typescript-typings/.npmignore | 1 + packages/web3-wrapper/.npmignore | 1 + 21 files changed, 21 insertions(+) diff --git a/packages/0x.js/.npmignore b/packages/0x.js/.npmignore index 7fd911797..6a3eb57bd 100644 --- a/packages/0x.js/.npmignore +++ b/packages/0x.js/.npmignore @@ -8,3 +8,4 @@ test/ /contract_templates/ /generated_docs/ /scripts/ +/lib/src/monorepo_scripts/ diff --git a/packages/abi-gen/.npmignore b/packages/abi-gen/.npmignore index 87bc30436..d645458f6 100644 --- a/packages/abi-gen/.npmignore +++ b/packages/abi-gen/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /src/ /scripts/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/assert/.npmignore b/packages/assert/.npmignore index 05fa23a59..44df80fad 100644 --- a/packages/assert/.npmignore +++ b/packages/assert/.npmignore @@ -4,3 +4,4 @@ yarn-error.log /scripts/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/base-contract/.npmignore b/packages/base-contract/.npmignore index ad5ffcd56..24e65ad5b 100644 --- a/packages/base-contract/.npmignore +++ b/packages/base-contract/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /scripts/ /src/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/chai-as-promised-typescript-typings/.npmignore b/packages/chai-as-promised-typescript-typings/.npmignore index 104d718ed..53eb3e269 100644 --- a/packages/chai-as-promised-typescript-typings/.npmignore +++ b/packages/chai-as-promised-typescript-typings/.npmignore @@ -1,3 +1,4 @@ .* yarn-error.log /scripts/ +/lib/monorepo_scripts/ diff --git a/packages/chai-typescript-typings/.npmignore b/packages/chai-typescript-typings/.npmignore index 104d718ed..53eb3e269 100644 --- a/packages/chai-typescript-typings/.npmignore +++ b/packages/chai-typescript-typings/.npmignore @@ -1,3 +1,4 @@ .* yarn-error.log /scripts/ +/lib/monorepo_scripts/ diff --git a/packages/connect/.npmignore b/packages/connect/.npmignore index a9d200050..9db6e838d 100644 --- a/packages/connect/.npmignore +++ b/packages/connect/.npmignore @@ -5,3 +5,4 @@ yarn-error.log /generated_docs/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/deployer/.npmignore b/packages/deployer/.npmignore index 05fa23a59..44df80fad 100644 --- a/packages/deployer/.npmignore +++ b/packages/deployer/.npmignore @@ -4,3 +4,4 @@ yarn-error.log /scripts/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/dev-utils/.npmignore b/packages/dev-utils/.npmignore index 05fa23a59..44df80fad 100644 --- a/packages/dev-utils/.npmignore +++ b/packages/dev-utils/.npmignore @@ -4,3 +4,4 @@ yarn-error.log /scripts/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/ethers-typescript-typings/.npmignore b/packages/ethers-typescript-typings/.npmignore index 104d718ed..53eb3e269 100644 --- a/packages/ethers-typescript-typings/.npmignore +++ b/packages/ethers-typescript-typings/.npmignore @@ -1,3 +1,4 @@ .* yarn-error.log /scripts/ +/lib/monorepo_scripts/ diff --git a/packages/json-schemas/.npmignore b/packages/json-schemas/.npmignore index e14c0cba7..5333847e7 100644 --- a/packages/json-schemas/.npmignore +++ b/packages/json-schemas/.npmignore @@ -5,3 +5,4 @@ yarn-error.log /schemas/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/react-docs/.npmignore b/packages/react-docs/.npmignore index 87bc30436..d645458f6 100644 --- a/packages/react-docs/.npmignore +++ b/packages/react-docs/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /src/ /scripts/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/react-shared/.npmignore b/packages/react-shared/.npmignore index 87bc30436..d645458f6 100644 --- a/packages/react-shared/.npmignore +++ b/packages/react-shared/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /src/ /scripts/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/sol-cov/.npmignore b/packages/sol-cov/.npmignore index 87bc30436..037786e46 100644 --- a/packages/sol-cov/.npmignore +++ b/packages/sol-cov/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /src/ /scripts/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/sra-report/.npmignore b/packages/sra-report/.npmignore index 87bc30436..d645458f6 100644 --- a/packages/sra-report/.npmignore +++ b/packages/sra-report/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /src/ /scripts/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/subproviders/.npmignore b/packages/subproviders/.npmignore index 05fa23a59..44df80fad 100644 --- a/packages/subproviders/.npmignore +++ b/packages/subproviders/.npmignore @@ -4,3 +4,4 @@ yarn-error.log /scripts/ test/ tsconfig.json +/lib/src/monorepo_scripts/ diff --git a/packages/tslint-config/.npmignore b/packages/tslint-config/.npmignore index 1767d198e..c46793a87 100644 --- a/packages/tslint-config/.npmignore +++ b/packages/tslint-config/.npmignore @@ -4,3 +4,4 @@ node_modules/ /scripts/ /rules/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/types/.npmignore b/packages/types/.npmignore index ad5ffcd56..24e65ad5b 100644 --- a/packages/types/.npmignore +++ b/packages/types/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /scripts/ /src/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/utils/.npmignore b/packages/utils/.npmignore index ad5ffcd56..24e65ad5b 100644 --- a/packages/utils/.npmignore +++ b/packages/utils/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /scripts/ /src/ tsconfig.json +/lib/monorepo_scripts/ diff --git a/packages/web3-typescript-typings/.npmignore b/packages/web3-typescript-typings/.npmignore index 104d718ed..53eb3e269 100644 --- a/packages/web3-typescript-typings/.npmignore +++ b/packages/web3-typescript-typings/.npmignore @@ -1,3 +1,4 @@ .* yarn-error.log /scripts/ +/lib/monorepo_scripts/ diff --git a/packages/web3-wrapper/.npmignore b/packages/web3-wrapper/.npmignore index ad5ffcd56..24e65ad5b 100644 --- a/packages/web3-wrapper/.npmignore +++ b/packages/web3-wrapper/.npmignore @@ -3,3 +3,4 @@ yarn-error.log /scripts/ /src/ tsconfig.json +/lib/monorepo_scripts/ -- cgit v1.2.3 From d72b7299c66ea6d63eb14595b06456c02b2ad99b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Mar 2018 15:19:23 +0200 Subject: Move common types out of web3 types --- .../src/contract_wrappers/contract_wrapper.ts | 18 +- .../src/contract_wrappers/exchange_wrapper.ts | 4 +- packages/0x.js/src/globals.d.ts | 5 +- packages/0x.js/src/index.ts | 2 +- packages/0x.js/src/order_watcher/event_watcher.ts | 10 +- packages/0x.js/src/types.ts | 11 +- packages/0x.js/src/utils/filter_utils.ts | 24 +- packages/0x.js/test/event_watcher_test.ts | 13 +- packages/abi-gen/package.json | 2 +- packages/abi-gen/src/index.ts | 8 +- packages/abi-gen/src/types.ts | 6 +- packages/abi-gen/src/utils.ts | 11 +- packages/base-contract/package.json | 3 +- packages/base-contract/src/index.ts | 13 +- packages/contract_templates/contract.handlebars | 4 +- .../partials/callAsync.handlebars | 19 +- packages/contract_templates/partials/tx.handlebars | 27 +- packages/contracts/util/multi_sig_wrapper.ts | 5 +- packages/contracts/util/types.ts | 6 +- packages/deployer/src/compiler.ts | 4 +- packages/deployer/src/deployer.ts | 6 +- packages/deployer/src/globals.d.ts | 1 - packages/deployer/src/utils/contract.ts | 17 +- packages/deployer/src/utils/encoder.ts | 8 +- packages/deployer/src/utils/types.ts | 4 +- packages/monorepo-scripts/tsconfig.json | 1 + packages/react-docs-example/ts/docs.tsx | 27 +- packages/sol-cov/package.json | 9 +- packages/sol-cov/src/coverage_subprovider.ts | 14 +- packages/subproviders/src/globals.d.ts | 8 +- packages/subproviders/src/index.ts | 2 +- .../src/subproviders/empty_wallet_subprovider.ts | 4 +- .../subproviders/fake_gas_estimate_subprovider.ts | 4 +- packages/subproviders/src/subproviders/ganache.ts | 3 +- .../subproviders/src/subproviders/injected_web3.ts | 3 +- packages/subproviders/src/subproviders/ledger.ts | 4 +- .../subproviders/src/subproviders/nonce_tracker.ts | 17 +- .../subproviders/src/subproviders/redundant_rpc.ts | 6 +- .../subproviders/src/subproviders/subprovider.ts | 5 +- packages/subproviders/src/types.ts | 7 +- .../test/integration/ledger_subprovider_test.ts | 11 +- .../test/unit/ledger_subprovider_test.ts | 17 +- .../test/unit/redundant_rpc_subprovider_test.ts | 5 +- packages/tslint-config/tsconfig.json | 1 + packages/types/package.json | 5 +- packages/types/src/index.ts | 201 +++++++++++++- packages/types/tsconfig.json | 1 + packages/typescript-typings/package.json | 1 + packages/typescript-typings/types/web3/index.d.ts | 305 ++++----------------- packages/utils/src/abi_decoder.ts | 27 +- packages/web3-wrapper/src/index.ts | 36 ++- .../ts/containers/web3_wrapper_documentation.ts | 27 +- packages/website/ts/globals.d.ts | 4 +- yarn.lock | 15 - 54 files changed, 489 insertions(+), 512 deletions(-) diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts index ad7727de5..6c96428ed 100644 --- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts @@ -1,4 +1,4 @@ -import { BlockParamLiteral, LogWithDecodedArgs, RawLog } from '@0xproject/types'; +import { BlockParamLiteral, ContractAbi, FilterObject, LogEntry, LogWithDecodedArgs, RawLog } from '@0xproject/types'; import { AbiDecoder, intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { Block, BlockAndLogStreamer } from 'ethereumjs-blockstream'; @@ -35,7 +35,7 @@ export class ContractWrapper { private _abiDecoder?: AbiDecoder; private _blockAndLogStreamerIfExists?: BlockAndLogStreamer; private _blockAndLogStreamIntervalIfExists?: NodeJS.Timer; - private _filters: { [filterToken: string]: Web3.FilterObject }; + private _filters: { [filterToken: string]: FilterObject }; private _filterCallbacks: { [filterToken: string]: EventCallback; }; @@ -75,7 +75,7 @@ export class ContractWrapper { address: string, eventName: ContractEvents, indexFilterValues: IndexedFilterValues, - abi: Web3.ContractAbi, + abi: ContractAbi, callback: EventCallback, ): string { const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi); @@ -92,7 +92,7 @@ export class ContractWrapper { eventName: ContractEvents, blockRange: BlockRange, indexFilterValues: IndexedFilterValues, - abi: Web3.ContractAbi, + abi: ContractAbi, ): Promise>> { const filter = filterUtils.getFilter(address, eventName, indexFilterValues, abi, blockRange); const logs = await this._web3Wrapper.getLogsAsync(filter); @@ -100,7 +100,7 @@ export class ContractWrapper { return logsWithDecodedArguments; } protected _tryToDecodeLogOrNoop( - log: Web3.LogEntry, + log: LogEntry, ): LogWithDecodedArgs | RawLog { if (_.isUndefined(this._abiDecoder)) { throw new Error(InternalZeroExError.NoAbiDecoder); @@ -111,7 +111,7 @@ export class ContractWrapper { protected async _getContractAbiAndAddressFromArtifactsAsync( artifact: Artifact, addressIfExists?: string, - ): Promise<[Web3.ContractAbi, string]> { + ): Promise<[ContractAbi, string]> { let contractAddress: string; if (_.isUndefined(addressIfExists)) { if (_.isUndefined(artifact.networks[this._networkId])) { @@ -125,7 +125,7 @@ export class ContractWrapper { if (!doesContractExist) { throw new Error(CONTRACT_NAME_TO_NOT_FOUND_ERROR[artifact.contract_name]); } - const abiAndAddress: [Web3.ContractAbi, string] = [artifact.abi, contractAddress]; + const abiAndAddress: [ContractAbi, string] = [artifact.abi, contractAddress]; return abiAndAddress; } protected _getContractAddress(artifact: Artifact, addressIfExists?: string): string { @@ -139,8 +139,8 @@ export class ContractWrapper { return addressIfExists; } } - private _onLogStateChanged(isRemoved: boolean, log: Web3.LogEntry): void { - _.forEach(this._filters, (filter: Web3.FilterObject, filterToken: string) => { + private _onLogStateChanged(isRemoved: boolean, log: LogEntry): void { + _.forEach(this._filters, (filter: FilterObject, filterToken: string) => { if (filterUtils.matchesFilter(log, filter)) { const decodedLog = this._tryToDecodeLogOrNoop(log) as LogWithDecodedArgs; const logEvent = { diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 59bd4db6b..6b5a75a9a 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -3,6 +3,7 @@ import { BlockParamLiteral, DecodedLogArgs, ECSignature, + LogEntry, LogWithDecodedArgs, Order, SignedOrder, @@ -10,7 +11,6 @@ import { import { AbiDecoder, BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import { artifacts } from '../artifacts'; import { @@ -863,7 +863,7 @@ export class ExchangeWrapper extends ContractWrapper { * Checks if logs contain LogError, which is emitted by Exchange contract on transaction failure. * @param logs Transaction logs as returned by `zeroEx.awaitTransactionMinedAsync` */ - public throwLogErrorsAsErrors(logs: Array | Web3.LogEntry>): void { + public throwLogErrorsAsErrors(logs: Array | LogEntry>): void { const errLog = _.find(logs, { event: ExchangeEvents.LogError, }); diff --git a/packages/0x.js/src/globals.d.ts b/packages/0x.js/src/globals.d.ts index e2c321f38..3e8ea21bc 100644 --- a/packages/0x.js/src/globals.d.ts +++ b/packages/0x.js/src/globals.d.ts @@ -37,12 +37,13 @@ declare module 'ethereumjs-abi' { // truffle-hdwallet-provider declarations declare module 'truffle-hdwallet-provider' { + import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types'; import * as Web3 from 'web3'; class HDWalletProvider implements Web3.Provider { constructor(mnemonic: string, rpcUrl: string); public sendAsync( - payload: Web3.JSONRPCRequestPayload, - callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void, + payload: JSONRPCRequestPayload, + callback: (err: Error, result: JSONRPCResponsePayload) => void, ): void; } export = HDWalletProvider; diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts index 7885fb82a..e353a1d3d 100644 --- a/packages/0x.js/src/index.ts +++ b/packages/0x.js/src/index.ts @@ -16,7 +16,6 @@ export { MethodOpts, OrderTransactionOpts, TransactionOpts, - FilterObject, LogEvent, DecodedLogEvent, EventWatcherCallback, @@ -28,6 +27,7 @@ export { export { BlockParamLiteral, + FilterObject, BlockParam, ContractEventArg, LogWithDecodedArgs, diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index e67b93251..246ab8292 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -1,9 +1,7 @@ +import { BlockParamLiteral, LogEntry } from '@0xproject/types'; import { intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; - -import { BlockParamLiteral } from '@0xproject/types'; import { EventWatcherCallback, ZeroExError } from '../types'; import { assert } from '../utils/assert'; @@ -23,7 +21,7 @@ export class EventWatcher { private _web3Wrapper: Web3Wrapper; private _pollingIntervalMs: number; private _intervalIdIfExists?: NodeJS.Timer; - private _lastEvents: Web3.LogEntry[] = []; + private _lastEvents: LogEntry[] = []; constructor(web3Wrapper: Web3Wrapper, pollingIntervalIfExistsMs: undefined | number) { this._web3Wrapper = web3Wrapper; this._pollingIntervalMs = _.isUndefined(pollingIntervalIfExistsMs) @@ -69,7 +67,7 @@ export class EventWatcher { await this._emitDifferencesAsync(newEvents, LogEventState.Added, callback); this._lastEvents = pendingEvents; } - private async _getEventsAsync(): Promise { + private async _getEventsAsync(): Promise { const eventFilter = { fromBlock: BlockParamLiteral.Pending, toBlock: BlockParamLiteral.Pending, @@ -78,7 +76,7 @@ export class EventWatcher { return events; } private async _emitDifferencesAsync( - logs: Web3.LogEntry[], + logs: LogEntry[], logEventState: LogEventState, callback: EventWatcherCallback, ): Promise { diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 65342b694..38cfb6306 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -3,7 +3,10 @@ import { BigNumber } from '@0xproject/utils'; import { BlockParam, BlockParamLiteral, + ContractAbi, ContractEventArg, + FilterObject, + LogEntryEvent, LogWithDecodedArgs, Order, SignedOrder, @@ -48,7 +51,7 @@ export type OrderAddresses = [string, string, string, string, string]; export type OrderValues = [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber]; -export type LogEvent = Web3.LogEntryEvent; +export type LogEvent = LogEntryEvent; export interface DecodedLogEvent { isRemoved: boolean; log: LogWithDecodedArgs; @@ -197,7 +200,7 @@ export type ArtifactContractName = 'ZRX' | 'TokenTransferProxy' | 'TokenRegistry export interface Artifact { contract_name: ArtifactContractName; - abi: Web3.ContractAbi; + abi: ContractAbi; networks: { [networkId: number]: { address: string; @@ -222,7 +225,7 @@ export interface ValidateOrderFillableOpts { * flag when running Parity). */ export interface MethodOpts { - defaultBlock?: Web3.BlockParam; + defaultBlock?: BlockParam; } /* @@ -242,8 +245,6 @@ export interface OrderTransactionOpts extends TransactionOpts { shouldValidate?: boolean; } -export type FilterObject = Web3.FilterObject; - export enum TradeSide { Maker = 'maker', Taker = 'taker', diff --git a/packages/0x.js/src/utils/filter_utils.ts b/packages/0x.js/src/utils/filter_utils.ts index 97205ace3..c5df7321e 100644 --- a/packages/0x.js/src/utils/filter_utils.ts +++ b/packages/0x.js/src/utils/filter_utils.ts @@ -1,8 +1,16 @@ +import { + ConstructorAbi, + ContractAbi, + EventAbi, + FallbackAbi, + FilterObject, + LogEntry, + MethodAbi, +} from '@0xproject/types'; import * as ethUtil from 'ethereumjs-util'; import * as jsSHA3 from 'js-sha3'; import * as _ from 'lodash'; import * as uuid from 'uuid/v4'; -import * as Web3 from 'web3'; import { BlockRange, ContractEvents, IndexedFilterValues } from '../types'; @@ -16,15 +24,15 @@ export const filterUtils = { address: string, eventName: ContractEvents, indexFilterValues: IndexedFilterValues, - abi: Web3.ContractAbi, + abi: ContractAbi, blockRange?: BlockRange, - ): Web3.FilterObject { - const eventAbi = _.find(abi, { name: eventName }) as Web3.EventAbi; + ): FilterObject { + const eventAbi = _.find(abi, { name: eventName }) as EventAbi; const eventSignature = filterUtils.getEventSignatureFromAbiByName(eventAbi, eventName); const topicForEventSignature = ethUtil.addHexPrefix(jsSHA3.keccak256(eventSignature)); const topicsForIndexedArgs = filterUtils.getTopicsForIndexedArgs(eventAbi, indexFilterValues); const topics = [topicForEventSignature, ...topicsForIndexedArgs]; - let filter: Web3.FilterObject = { + let filter: FilterObject = { address, topics, }; @@ -36,12 +44,12 @@ export const filterUtils = { } return filter; }, - getEventSignatureFromAbiByName(eventAbi: Web3.EventAbi, eventName: ContractEvents): string { + getEventSignatureFromAbiByName(eventAbi: EventAbi, eventName: ContractEvents): string { const types = _.map(eventAbi.inputs, 'type'); const signature = `${eventAbi.name}(${types.join(',')})`; return signature; }, - getTopicsForIndexedArgs(abi: Web3.EventAbi, indexFilterValues: IndexedFilterValues): Array { + getTopicsForIndexedArgs(abi: EventAbi, indexFilterValues: IndexedFilterValues): Array { const topics: Array = []; for (const eventInput of abi.inputs) { if (!eventInput.indexed) { @@ -60,7 +68,7 @@ export const filterUtils = { } return topics; }, - matchesFilter(log: Web3.LogEntry, filter: Web3.FilterObject): boolean { + matchesFilter(log: LogEntry, filter: FilterObject): boolean { if (!_.isUndefined(filter.address) && log.address !== filter.address) { return false; } diff --git a/packages/0x.js/test/event_watcher_test.ts b/packages/0x.js/test/event_watcher_test.ts index 93ee9cd1c..2fa6c0580 100644 --- a/packages/0x.js/test/event_watcher_test.ts +++ b/packages/0x.js/test/event_watcher_test.ts @@ -1,4 +1,5 @@ import { web3Factory } from '@0xproject/dev-utils'; +import { LogEntry } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; import * as _ from 'lodash'; @@ -21,7 +22,7 @@ describe('EventWatcher', () => { let stubs: Sinon.SinonStub[] = []; let eventWatcher: EventWatcher; let web3Wrapper: Web3Wrapper; - const logA: Web3.LogEntry = { + const logA: LogEntry = { address: '0x71d271f8b14adef568f8f28f1587ce7271ac4ca5', blockHash: null, blockNumber: null, @@ -31,7 +32,7 @@ describe('EventWatcher', () => { transactionHash: '0x004881d38cd4a8f72f1a0d68c8b9b8124504706041ff37019c1d1ed6bfda8e17', transactionIndex: 0, }; - const logB: Web3.LogEntry = { + const logB: LogEntry = { address: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819', blockHash: null, blockNumber: null, @@ -41,7 +42,7 @@ describe('EventWatcher', () => { transactionHash: '0x01ef3c048b18d9b09ea195b4ed94cf8dd5f3d857a1905ff886b152cfb1166f25', transactionIndex: 0, }; - const logC: Web3.LogEntry = { + const logC: LogEntry = { address: '0x1d271f8b174adef58f1587ce68f8f27271ac4ca5', blockHash: null, blockNumber: null, @@ -64,7 +65,7 @@ describe('EventWatcher', () => { eventWatcher.unsubscribe(); }); it('correctly emits initial log events', (done: DoneCallback) => { - const logs: Web3.LogEntry[] = [logA, logB]; + const logs: LogEntry[] = [logA, logB]; const expectedLogEvents = [ { removed: false, @@ -89,8 +90,8 @@ describe('EventWatcher', () => { eventWatcher.subscribe(callback); }); it('correctly computes the difference and emits only changes', (done: DoneCallback) => { - const initialLogs: Web3.LogEntry[] = [logA, logB]; - const changedLogs: Web3.LogEntry[] = [logA, logC]; + const initialLogs: LogEntry[] = [logA, logB]; + const changedLogs: LogEntry[] = [logA, logC]; const expectedLogEvents = [ { removed: false, diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index 2fdf19320..3c20249dd 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md", "dependencies": { "@0xproject/utils": "^0.4.3", + "@0xproject/types": "^0.4.1", "@0xproject/typescript-typings": "^0.0.1", "chalk": "^2.3.0", "glob": "^7.1.2", @@ -31,7 +32,6 @@ "lodash": "^4.17.4", "mkdirp": "^0.5.1", "to-snake-case": "^1.0.0", - "web3": "^0.20.0", "yargs": "^10.0.3" }, "devDependencies": { diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 8932e4045..942bb12db 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node +import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from '@0xproject/types'; import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; import * as fs from 'fs'; @@ -10,7 +11,6 @@ import * as mkdirp from 'mkdirp'; import * as yargs from 'yargs'; import toSnakeCase = require('to-snake-case'); -import * as Web3 from 'web3'; import { ContextData, ContractsBackend, ParamKind } from './types'; import { utils } from './utils'; @@ -120,12 +120,12 @@ for (const abiFileName of abiFileNames) { process.exit(1); } - let ctor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi; + let ctor = ABI.find((abi: AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as ConstructorAbi; if (_.isUndefined(ctor)) { ctor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition } - const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; + const methodAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_METHOD) as MethodAbi[]; const methodsData = _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, (input, i: number) => { if (_.isEmpty(input.name)) { @@ -142,7 +142,7 @@ for (const abiFileName of abiFileNames) { return methodData; }); - const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.EventAbi[]; + const eventAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_EVENT) as EventAbi[]; const contextData = { contractName: namedContent.name, diff --git a/packages/abi-gen/src/types.ts b/packages/abi-gen/src/types.ts index deddb1857..df5b1feaf 100644 --- a/packages/abi-gen/src/types.ts +++ b/packages/abi-gen/src/types.ts @@ -1,4 +1,4 @@ -import * as Web3 from 'web3'; +import { EventAbi, MethodAbi } from '@0xproject/types'; export enum ParamKind { Input = 'input', @@ -17,7 +17,7 @@ export enum ContractsBackend { Ethers = 'ethers', } -export interface Method extends Web3.MethodAbi { +export interface Method extends MethodAbi { singleReturnValue: boolean; hasReturnValue: boolean; } @@ -25,5 +25,5 @@ export interface Method extends Web3.MethodAbi { export interface ContextData { contractName: string; methods: Method[]; - events: Web3.EventAbi[]; + events: EventAbi[]; } diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index c4520ade0..755fbc71a 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -1,17 +1,12 @@ +import { ConstructorAbi, DataItem } from '@0xproject/types'; import * as fs from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; -import * as Web3 from 'web3'; import { AbiType, ContractsBackend, ParamKind } from './types'; export const utils = { - solTypeToTsType( - paramKind: ParamKind, - backend: ContractsBackend, - solType: string, - components?: Web3.DataItem[], - ): string { + solTypeToTsType(paramKind: ParamKind, backend: ContractsBackend, solType: string, components?: DataItem[]): string { const trailingArrayRegex = /\[\d*\]$/; if (solType.match(trailingArrayRegex)) { const arrayItemSolType = solType.replace(trailingArrayRegex, ''); @@ -89,7 +84,7 @@ export const utils = { throw new Error(`Failed to read ${filename}: ${err}`); } }, - getEmptyConstructor(): Web3.ConstructorAbi { + getEmptyConstructor(): ConstructorAbi { return { type: AbiType.Constructor, stateMutability: 'nonpayable', diff --git a/packages/base-contract/package.json b/packages/base-contract/package.json index 554f0a41c..e9015713c 100644 --- a/packages/base-contract/package.json +++ b/packages/base-contract/package.json @@ -34,8 +34,7 @@ "@0xproject/web3-wrapper": "^0.3.1", "@0xproject/typescript-typings": "^0.0.1", "ethers-contracts": "^2.2.1", - "lodash": "^4.17.4", - "web3": "^0.20.0" + "lodash": "^4.17.4" }, "publishConfig": { "access": "public" diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index cc1e16a13..961da8842 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -1,16 +1,15 @@ -import { TxData, TxDataPayable } from '@0xproject/types'; +import { ContractAbi, DataItem, TxData, TxDataPayable } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as ethersContracts from 'ethers-contracts'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; export class BaseContract { protected _ethersInterface: ethersContracts.Interface; protected _web3Wrapper: Web3Wrapper; - public abi: Web3.ContractAbi; + public abi: ContractAbi; public address: string; protected static _transformABIData( - abis: Web3.DataItem[], + abis: DataItem[], values: any[], transformation: (type: string, value: any) => any, ): any { @@ -46,20 +45,20 @@ export class BaseContract { // 2. Global config passed in at library instantiation // 3. Gas estimate calculation + safety margin const removeUndefinedProperties = _.pickBy; - const txDataWithDefaults = { + const txDataWithDefaults = ({ to: this.address, ...removeUndefinedProperties(this._web3Wrapper.getContractDefaults()), ...removeUndefinedProperties(txData as any), // HACK: TS can't prove that T is spreadable. // Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged - }; + } as any) as TxData; if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) { const estimatedGas = await estimateGasAsync(txData); txDataWithDefaults.gas = estimatedGas; } return txDataWithDefaults; } - constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) { + constructor(web3Wrapper: Web3Wrapper, abi: ContractAbi, address: string) { this._web3Wrapper = web3Wrapper; this.abi = abi; this.address = address; diff --git a/packages/contract_templates/contract.handlebars b/packages/contract_templates/contract.handlebars index 132cd60cc..08310c8f2 100644 --- a/packages/contract_templates/contract.handlebars +++ b/packages/contract_templates/contract.handlebars @@ -5,7 +5,7 @@ // tslint:disable:no-consecutive-blank-lines // tslint:disable-next-line:no-unused-variable import { BaseContract } from '@0xproject/base-contract'; -import { TxData, TxDataPayable } from '@0xproject/types'; +import { BlockParam, BlockParamLiteral, CallData, ContractAbi, DataItem, MethodAbi, TxData, TxDataPayable } from '@0xproject/types'; import { BigNumber, classUtils, promisify } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as ethersContracts from 'ethers-contracts'; @@ -40,7 +40,7 @@ export class {{contractName}}Contract extends BaseContract { {{> tx contractName=../contractName}} {{/this.constant}} {{/each}} - constructor(web3Wrapper: Web3Wrapper, abi: Web3.ContractAbi, address: string) { + constructor(web3Wrapper: Web3Wrapper, abi: ContractAbi, address: string) { super(web3Wrapper, abi, address); classUtils.bindAll(this, ['_ethersInterface', 'address', 'abi', '_web3Wrapper']); } diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index 93d347145..2d9028ad5 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -1,27 +1,22 @@ {{#hasReturnValue}} async callAsync( {{> typed_params inputs=inputs}} -{{#this.payable}} - txData: TxDataPayable = {}, -{{/this.payable}} -{{^this.payable}} - txData: TxData = {}, -{{/this.payable}} - defaultBlock?: Web3.BlockParam, + callData: Partial = {}, + defaultBlock?: BlockParam, ): Promise<{{> return_type outputs=outputs}}> { const self = this as {{contractName}}Contract; - const inputAbi = _.find(this.abi, {name: '{{this.name}}'}).inputs; - [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this)); + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; + [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} ).data; - const callData = await self._applyDefaultsToTxDataAsync( + const callDataWithDefaults = await self._applyDefaultsToTxDataAsync( { data: encodedData, } ) - const rawCallResult = await self._web3Wrapper.callAsync(callData, defaultBlock); - const outputAbi = _.find(this.abi, {name: '{{this.name}}'}).outputs as Web3.DataItem[]; + const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); + const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs as DataItem[]; const outputParamsTypes = _.map(outputAbi, 'type'); let resultArray = ethersContracts.Interface.decodeParams(outputParamsTypes, rawCallResult) as any; resultArray = BaseContract._transformABIData(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); diff --git a/packages/contract_templates/partials/tx.handlebars b/packages/contract_templates/partials/tx.handlebars index d517a9f7f..f76de3a70 100644 --- a/packages/contract_templates/partials/tx.handlebars +++ b/packages/contract_templates/partials/tx.handlebars @@ -2,16 +2,16 @@ public {{this.name}} = { async sendTransactionAsync( {{> typed_params inputs=inputs}} {{#this.payable}} - txData: TxDataPayable = {}, + txData: Partial = {}, {{/this.payable}} {{^this.payable}} - txData: TxData = {}, + txData: Partial = {}, {{/this.payable}} ): Promise { const self = this as {{contractName}}Contract; - const inputAbi = _.find(this.abi, {name: '{{this.name}}'}).inputs; - [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this)); - const encodedData = this._ethersInterface.functions.{{this.name}}( + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; + [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); + const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} ).data const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( @@ -24,17 +24,17 @@ public {{this.name}} = { {{> params inputs=inputs}} ), ); - const txHash = await this._web3Wrapper.sendTransactionAsync(txDataWithDefaults); + const txHash = await self._web3Wrapper.sendTransactionAsync(txDataWithDefaults); return txHash; }, async estimateGasAsync( {{> typed_params inputs=inputs}} - txData: TxData = {}, + txData: Partial = {}, ): Promise { const self = this as {{contractName}}Contract; - const inputAbi = _.find(this.abi, {name: '{{this.name}}'}).inputs; + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this)); - const encodedData = this._ethersInterface.functions.{{this.name}}( + const encodedData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} ).data const txDataWithDefaults = await self._applyDefaultsToTxDataAsync( @@ -43,17 +43,16 @@ public {{this.name}} = { data: encodedData, } ); - const gas = await this._web3Wrapper.estimateGasAsync(txDataWithDefaults); + const gas = await self._web3Wrapper.estimateGasAsync(txDataWithDefaults); return gas; }, getABIEncodedTransactionData( {{> typed_params inputs=inputs}} - txData: TxData = {}, ): string { const self = this as {{contractName}}Contract; - const inputAbi = _.find(this.abi, {name: '{{this.name}}'}).inputs; - [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(this)); - const abiEncodedTransactionData = this._ethersInterface.functions.{{this.name}}( + const inputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).inputs; + [{{> params inputs=inputs}}] = BaseContract._transformABIData(inputAbi, [{{> params inputs=inputs}}], BaseContract._bigNumberToString.bind(self)); + const abiEncodedTransactionData = self._ethersInterface.functions.{{this.name}}( {{> params inputs=inputs}} ).data return abiEncodedTransactionData; diff --git a/packages/contracts/util/multi_sig_wrapper.ts b/packages/contracts/util/multi_sig_wrapper.ts index 3b83ccb7b..9f6dcec52 100644 --- a/packages/contracts/util/multi_sig_wrapper.ts +++ b/packages/contracts/util/multi_sig_wrapper.ts @@ -1,3 +1,4 @@ +import { AbiDefinition, MethodAbi } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import ABI = require('ethereumjs-abi'); import ethUtil = require('ethereumjs-util'); @@ -10,8 +11,8 @@ import { TransactionDataParams } from './types'; export class MultiSigWrapper { private _multiSig: MultiSigWalletContract; - public static encodeFnArgs(name: string, abi: Web3.AbiDefinition[], args: any[]) { - const abiEntity = _.find(abi, { name }) as Web3.MethodAbi; + public static encodeFnArgs(name: string, abi: AbiDefinition[], args: any[]) { + const abiEntity = _.find(abi, { name }) as MethodAbi; if (_.isUndefined(abiEntity)) { throw new Error(`Did not find abi entry for name: ${name}`); } diff --git a/packages/contracts/util/types.ts b/packages/contracts/util/types.ts index 61a19acb4..321084c42 100644 --- a/packages/contracts/util/types.ts +++ b/packages/contracts/util/types.ts @@ -1,5 +1,5 @@ +import { AbiDefinition, ContractAbi } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; -import * as Web3 from 'web3'; export interface BalancesByOwner { [ownerAddress: string]: { @@ -51,7 +51,7 @@ export interface DefaultOrderParams { export interface TransactionDataParams { name: string; - abi: Web3.AbiDefinition[]; + abi: AbiDefinition[]; args: any[]; } @@ -105,7 +105,7 @@ export interface Artifact { contract_name: ContractName; networks: { [networkId: number]: { - abi: Web3.ContractAbi; + abi: ContractAbi; solc_version: string; keccak256: string; optimizer_enabled: number; diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 1f521dca1..4741a9086 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -1,3 +1,4 @@ +import { ContractAbi } from '@0xproject/types'; import { logUtils, promisify } from '@0xproject/utils'; import * as ethUtil from 'ethereumjs-util'; import * as fs from 'fs'; @@ -7,7 +8,6 @@ import * as path from 'path'; import * as requireFromString from 'require-from-string'; import * as semver from 'semver'; import solc = require('solc'); -import * as Web3 from 'web3'; import { binPaths } from './solc/bin_paths'; import { @@ -189,7 +189,7 @@ export class Compiler { `Contract ${contractName} not found in ${fileName}. Please make sure your contract has the same name as it's file name`, ); } - const abi: Web3.ContractAbi = JSON.parse(compiled.contracts[contractIdentifier].interface); + const abi: ContractAbi = JSON.parse(compiled.contracts[contractIdentifier].interface); const bytecode = `0x${compiled.contracts[contractIdentifier].bytecode}`; const runtimeBytecode = `0x${compiled.contracts[contractIdentifier].runtimeBytecode}`; const sourceMap = compiled.contracts[contractIdentifier].srcmap; diff --git a/packages/deployer/src/deployer.ts b/packages/deployer/src/deployer.ts index 68518a931..7ee45fed5 100644 --- a/packages/deployer/src/deployer.ts +++ b/packages/deployer/src/deployer.ts @@ -1,4 +1,4 @@ -import { AbiType, TxData } from '@0xproject/types'; +import { AbiType, ConstructorAbi, ContractAbi, TxData } from '@0xproject/types'; import { logUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -71,7 +71,7 @@ export class Deployer { gas, }; const abi = contractNetworkDataIfExists.abi; - const constructorAbi = _.find(abi, { type: AbiType.Constructor }) as Web3.ConstructorAbi; + const constructorAbi = _.find(abi, { type: AbiType.Constructor }) as ConstructorAbi; const constructorArgs = _.isUndefined(constructorAbi) ? [] : constructorAbi.inputs; if (constructorArgs.length !== args.length) { const constructorSignature = `constructor(${_.map(constructorArgs, arg => `${arg.type} ${arg.name}`).join( @@ -107,7 +107,7 @@ export class Deployer { * @param txData Tx options used for deployment. * @return Promise that resolves to a web3 contract instance. */ - private async _deployFromAbiAsync(abi: Web3.ContractAbi, args: any[], txData: Web3.TxData): Promise { + private async _deployFromAbiAsync(abi: ContractAbi, args: any[], txData: TxData): Promise { const contract: Web3.Contract = this.web3Wrapper.getContractFromAbi(abi); const deployPromise = new Promise((resolve, reject) => { /** diff --git a/packages/deployer/src/globals.d.ts b/packages/deployer/src/globals.d.ts index 83db346f9..5b0d495d5 100644 --- a/packages/deployer/src/globals.d.ts +++ b/packages/deployer/src/globals.d.ts @@ -2,7 +2,6 @@ declare module 'dirty-chai'; // tslint:disable:completed-docs declare module 'solc' { - import * as Web3 from 'web3'; export interface ContractCompilationResult { srcmap: string; srcmapRuntime: string; diff --git a/packages/deployer/src/utils/contract.ts b/packages/deployer/src/utils/contract.ts index 9c57751ff..9b7baac11 100644 --- a/packages/deployer/src/utils/contract.ts +++ b/packages/deployer/src/utils/contract.ts @@ -1,4 +1,5 @@ import { schemas, SchemaValidator } from '@0xproject/json-schemas'; +import { ContractAbi, EventAbi, FunctionAbi, MethodAbi, TxData } from '@0xproject/types'; import { promisify } from '@0xproject/utils'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -7,14 +8,14 @@ import { AbiType } from './types'; export class Contract implements Web3.ContractInstance { public address: string; - public abi: Web3.ContractAbi; + public abi: ContractAbi; private _contract: Web3.ContractInstance; - private _defaults: Partial; + private _defaults: Partial; private _validator: SchemaValidator; // This class instance is going to be populated with functions and events depending on the ABI // and we don't know their types in advance [name: string]: any; - constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial) { + constructor(web3ContractInstance: Web3.ContractInstance, defaults: Partial) { this._contract = web3ContractInstance; this.address = web3ContractInstance.address; this.abi = web3ContractInstance.abi; @@ -24,8 +25,8 @@ export class Contract implements Web3.ContractInstance { this._validator = new SchemaValidator(); } private _populateFunctions(): void { - const functionsAbi = _.filter(this.abi, abiPart => abiPart.type === AbiType.Function) as Web3.FunctionAbi[]; - _.forEach(functionsAbi, (functionAbi: Web3.MethodAbi) => { + const functionsAbi = _.filter(this.abi, abiPart => abiPart.type === AbiType.Function) as FunctionAbi[]; + _.forEach(functionsAbi, (functionAbi: MethodAbi) => { if (functionAbi.constant) { const cbStyleCallFunction = this._contract[functionAbi.name].call; this[functionAbi.name] = promisify(cbStyleCallFunction, this._contract); @@ -42,8 +43,8 @@ export class Contract implements Web3.ContractInstance { }); } private _populateEvents(): void { - const eventsAbi = _.filter(this.abi, abiPart => abiPart.type === AbiType.Event) as Web3.EventAbi[]; - _.forEach(eventsAbi, (eventAbi: Web3.EventAbi) => { + const eventsAbi = _.filter(this.abi, abiPart => abiPart.type === AbiType.Event) as EventAbi[]; + _.forEach(eventsAbi, (eventAbi: EventAbi) => { this[eventAbi.name] = this._contract[eventAbi.name]; }); } @@ -51,7 +52,7 @@ export class Contract implements Web3.ContractInstance { const promisifiedWithDefaultParams = async (...args: any[]) => { const promise = new Promise((resolve, reject) => { const lastArg = args[args.length - 1]; - let txData: Partial = {}; + let txData: Partial = {}; if (this._isTxData(lastArg)) { txData = args.pop(); } diff --git a/packages/deployer/src/utils/encoder.ts b/packages/deployer/src/utils/encoder.ts index e3acde252..4f62662e1 100644 --- a/packages/deployer/src/utils/encoder.ts +++ b/packages/deployer/src/utils/encoder.ts @@ -1,15 +1,15 @@ +import { AbiDefinition, ContractAbi, DataItem } from '@0xproject/types'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import * as web3Abi from 'web3-eth-abi'; import { AbiType } from './types'; export const encoder = { - encodeConstructorArgsFromAbi(args: any[], abi: Web3.ContractAbi): string { + encodeConstructorArgsFromAbi(args: any[], abi: ContractAbi): string { const constructorTypes: string[] = []; - _.each(abi, (element: Web3.AbiDefinition) => { + _.each(abi, (element: AbiDefinition) => { if (element.type === AbiType.Constructor) { - _.each(element.inputs, (input: Web3.DataItem) => { + _.each(element.inputs, (input: DataItem) => { constructorTypes.push(input.type); }); } diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index 540b31aff..7cb3958cb 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -1,4 +1,4 @@ -import { TxData } from '@0xproject/types'; +import { ContractAbi, TxData } from '@0xproject/types'; import * as Web3 from 'web3'; import * as yargs from 'yargs'; @@ -23,7 +23,7 @@ export interface ContractNetworkData { optimizer_enabled: boolean; keccak256: string; source_tree_hash: string; - abi: Web3.ContractAbi; + abi: ContractAbi; bytecode: string; runtime_bytecode: string; address?: string; diff --git a/packages/monorepo-scripts/tsconfig.json b/packages/monorepo-scripts/tsconfig.json index c56d255d5..5ec2db5e0 100644 --- a/packages/monorepo-scripts/tsconfig.json +++ b/packages/monorepo-scripts/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig", "compilerOptions": { + "typeRoots": ["node_modules/@types"], "outDir": "lib" }, "include": ["./src/**/*"] diff --git a/packages/react-docs-example/ts/docs.tsx b/packages/react-docs-example/ts/docs.tsx index 68db66b60..eef331813 100644 --- a/packages/react-docs-example/ts/docs.tsx +++ b/packages/react-docs-example/ts/docs.tsx @@ -46,26 +46,25 @@ const docsInfoConfig: DocsInfoConfig = { 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'], + 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', - BigNumber: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L127', - LogEntryEvent: 'http://mikemcl.github.io/bignumber.js', - CallData: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L348', - BlockWithoutTransactionData: - 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L314', - LogEntry: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L366', - FilterObject: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L109', - ['Web3.BlockParam']: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L278', - ['Web3.ContractAbi']: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L47', + BigNumber: 'http://mikemcl.github.io/bignumber.js', }, typeNameToPrefix: { Provider: 'Web3', - CallData: 'Web3', - BlockWithoutTransactionData: 'Web3', - LogEntry: 'Web3', - FilterObject: 'Web3', }, typeNameToDocSection: { Web3Wrapper: docSections.web3Wrapper, diff --git a/packages/sol-cov/package.json b/packages/sol-cov/package.json index 6b5183ff2..1e3124822 100644 --- a/packages/sol-cov/package.json +++ b/packages/sol-cov/package.json @@ -39,8 +39,9 @@ "homepage": "https://github.com/0xProject/0x.js/packages/sol-cov/README.md", "dependencies": { "@0xproject/subproviders": "^0.8.2", - "@0xproject/utils": "^0.3.4", + "@0xproject/utils": "^0.4.3", "@0xproject/typescript-typings": "^0.0.1", + "@0xproject/types": "^0.4.1", "ethereumjs-util": "^5.1.1", "glob": "^7.1.2", "istanbul": "^0.4.5", @@ -48,8 +49,7 @@ "semaphore-async-await": "^1.5.1", "solidity-coverage": "^0.4.10", "solidity-parser-antlr": "^0.2.7", - "solidity-parser-sc": "^0.4.4", - "web3": "^0.20.0" + "solidity-parser-sc": "^0.4.4" }, "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.14", @@ -67,8 +67,7 @@ "sinon": "^4.0.0", "tslint": "5.8.0", "typedoc": "0xProject/typedoc", - "typescript": "2.7.1", - "web3-typescript-typings": "^0.9.11" + "typescript": "2.7.1" }, "publishConfig": { "access": "public" diff --git a/packages/sol-cov/src/coverage_subprovider.ts b/packages/sol-cov/src/coverage_subprovider.ts index 37682c45f..1c80dca7b 100644 --- a/packages/sol-cov/src/coverage_subprovider.ts +++ b/packages/sol-cov/src/coverage_subprovider.ts @@ -1,14 +1,14 @@ import { Callback, ErrorCallback, NextCallback, Subprovider } from '@0xproject/subproviders'; +import { BlockParam, CallData, JSONRPCRequestPayload, TransactionTrace, TxData } from '@0xproject/types'; import { promisify } from '@0xproject/utils'; import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; -import * as Web3 from 'web3'; import { constants } from './constants'; import { CoverageManager } from './coverage_manager'; import { TraceInfoExistingContract, TraceInfoNewContract } from './types'; -interface MaybeFakeTxData extends Web3.TxData { +interface MaybeFakeTxData extends TxData { isFakeTransaction?: boolean; } @@ -58,7 +58,7 @@ export class CoverageSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method - public handleRequest(payload: Web3.JSONRPCRequestPayload, next: NextCallback, end: ErrorCallback) { + public handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, end: ErrorCallback) { switch (payload.method) { case 'eth_sendTransaction': const txData = payload.params[0]; @@ -110,8 +110,8 @@ export class CoverageSubprovider extends Subprovider { cb(); } private async _onCallExecutedAsync( - callData: Partial, - blockNumber: Web3.BlockParam, + callData: Partial, + blockNumber: BlockParam, err: Error | null, callResult: string, cb: Callback, @@ -125,7 +125,7 @@ export class CoverageSubprovider extends Subprovider { params: [txHash, { disableMemory: true, disableStack: true, disableStorage: true }], // TODO For now testrpc just ignores those parameters https://github.com/trufflesuite/ganache-cli/issues/489 }; const jsonRPCResponsePayload = await this.emitPayloadAsync(payload); - const trace: Web3.TransactionTrace = jsonRPCResponsePayload.result; + const trace: TransactionTrace = jsonRPCResponsePayload.result; const coveredPcs = _.map(trace.structLogs, log => log.pc); if (address === constants.NEW_CONTRACT) { const traceInfo: TraceInfoNewContract = { @@ -147,7 +147,7 @@ export class CoverageSubprovider extends Subprovider { this._coverageManager.appendTraceInfo(traceInfo); } } - private async _recordCallTraceAsync(callData: Partial, blockNumber: Web3.BlockParam): Promise { + private async _recordCallTraceAsync(callData: Partial, blockNumber: BlockParam): Promise { // We don't want other transactions to be exeucted during snashotting period, that's why we lock the // transaction execution for all transactions except our fake ones. await this._lock.acquire(); diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts index 2c86346f5..ebc4efe86 100644 --- a/packages/subproviders/src/globals.d.ts +++ b/packages/subproviders/src/globals.d.ts @@ -73,11 +73,11 @@ declare module 'web3-provider-engine/subproviders/subprovider' { export = Subprovider; } declare module 'web3-provider-engine/subproviders/rpc' { - import * as Web3 from 'web3'; + import { JSONRPCRequestPayload } from '@0xproject/types'; class RpcSubprovider { constructor(options: { rpcUrl: string }); public handleRequest( - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: () => void, end: (err: Error | null, data?: any) => void, ): void; @@ -102,11 +102,11 @@ declare module 'web3-provider-engine/util/rpc-cache-utils' { export = ProviderEngineRpcUtils; } declare module 'web3-provider-engine/subproviders/fixture' { - import * as Web3 from 'web3'; + import { JSONRPCRequestPayload } from '@0xproject/types'; class FixtureSubprovider { constructor(staticResponses: any); public handleRequest( - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: () => void, end: (err: Error | null, data?: any) => void, ): void; diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts index d88792fd0..9786347e6 100644 --- a/packages/subproviders/src/index.ts +++ b/packages/subproviders/src/index.ts @@ -1,5 +1,6 @@ import Eth from '@ledgerhq/hw-app-eth'; import TransportU2F from '@ledgerhq/hw-transport-u2f'; +export { ECSignature } from '@0xproject/types'; import { LedgerEthereumClient } from './types'; @@ -15,7 +16,6 @@ export { Callback, ErrorCallback, NextCallback, - ECSignature, LedgerWalletSubprovider, LedgerCommunicationClient, NonceSubproviderErrors, diff --git a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts index dc570b152..595ec654d 100644 --- a/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts +++ b/packages/subproviders/src/subproviders/empty_wallet_subprovider.ts @@ -1,4 +1,4 @@ -import * as Web3 from 'web3'; +import { JSONRPCRequestPayload } from '@0xproject/types'; import { Callback, ErrorCallback } from '../types'; @@ -18,7 +18,7 @@ export class EmptyWalletSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method - public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { + public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { switch (payload.method) { case 'eth_accounts': end(null, []); diff --git a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts index a6f978db1..966c37d8a 100644 --- a/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts +++ b/packages/subproviders/src/subproviders/fake_gas_estimate_subprovider.ts @@ -1,4 +1,4 @@ -import * as Web3 from 'web3'; +import { JSONRPCRequestPayload } from '@0xproject/types'; import { Callback, ErrorCallback } from '../types'; @@ -32,7 +32,7 @@ export class FakeGasEstimateSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method - public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { + public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { switch (payload.method) { case 'eth_estimateGas': end(null, this._constantGasAmount); diff --git a/packages/subproviders/src/subproviders/ganache.ts b/packages/subproviders/src/subproviders/ganache.ts index fc0b9c3d2..785de792d 100644 --- a/packages/subproviders/src/subproviders/ganache.ts +++ b/packages/subproviders/src/subproviders/ganache.ts @@ -1,3 +1,4 @@ +import { JSONRPCRequestPayload } from '@0xproject/types'; import * as Ganache from 'ganache-core'; import * as Web3 from 'web3'; @@ -28,7 +29,7 @@ export class GanacheSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method - public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { + public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { this._ganacheProvider.sendAsync(payload, (err: Error | null, result: any) => { end(err, result && result.result); }); diff --git a/packages/subproviders/src/subproviders/injected_web3.ts b/packages/subproviders/src/subproviders/injected_web3.ts index cd9b0b603..edecd8bf6 100644 --- a/packages/subproviders/src/subproviders/injected_web3.ts +++ b/packages/subproviders/src/subproviders/injected_web3.ts @@ -1,3 +1,4 @@ +import { JSONRPCRequestPayload } from '@0xproject/types'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -30,7 +31,7 @@ export class InjectedWeb3Subprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:prefer-function-over-method - public handleRequest(payload: Web3.JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { + public handleRequest(payload: JSONRPCRequestPayload, next: Callback, end: ErrorCallback) { switch (payload.method) { case 'web3_clientVersion': this._injectedWeb3.version.getNode(end); diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts index 8bc70d8b6..95784a391 100644 --- a/packages/subproviders/src/subproviders/ledger.ts +++ b/packages/subproviders/src/subproviders/ledger.ts @@ -1,11 +1,11 @@ import { assert } from '@0xproject/assert'; +import { JSONRPCRequestPayload } from '@0xproject/types'; import { addressUtils } from '@0xproject/utils'; import EthereumTx = require('ethereumjs-tx'); import ethUtil = require('ethereumjs-util'); import HDNode = require('hdkey'); import * as _ from 'lodash'; import { Lock } from 'semaphore-async-await'; -import * as Web3 from 'web3'; import { Callback, @@ -208,7 +208,7 @@ export class LedgerSubprovider extends Subprovider { */ // tslint:disable-next-line:async-suffix public async handleRequest( - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: Callback, end: (err: Error | null, result?: any) => void, ) { diff --git a/packages/subproviders/src/subproviders/nonce_tracker.ts b/packages/subproviders/src/subproviders/nonce_tracker.ts index 249f16199..907330111 100644 --- a/packages/subproviders/src/subproviders/nonce_tracker.ts +++ b/packages/subproviders/src/subproviders/nonce_tracker.ts @@ -1,9 +1,8 @@ import * as _ from 'lodash'; -import { BlockParamLiteral } from '@0xproject/types'; +import { BlockParamLiteral, JSONRPCRequestPayload } from '@0xproject/types'; import EthereumTx = require('ethereumjs-tx'); import ethUtil = require('ethereumjs-util'); -import * as Web3 from 'web3'; import providerEngineUtils = require('web3-provider-engine/util/rpc-cache-utils'); import { Callback, ErrorCallback, NextCallback, NonceSubproviderErrors } from '../types'; @@ -19,7 +18,7 @@ const NONCE_TOO_LOW_ERROR_MESSAGE = 'Transaction nonce is too low'; */ export class NonceTrackerSubprovider extends Subprovider { private _nonceCache: { [address: string]: string } = {}; - private static _reconstructTransaction(payload: Web3.JSONRPCRequestPayload): EthereumTx { + private static _reconstructTransaction(payload: JSONRPCRequestPayload): EthereumTx { const raw = payload.params[0]; if (_.isUndefined(raw)) { throw new Error(NonceSubproviderErrors.EmptyParametersFound); @@ -28,7 +27,7 @@ export class NonceTrackerSubprovider extends Subprovider { const transaction = new EthereumTx(rawData); return transaction; } - private static _determineAddress(payload: Web3.JSONRPCRequestPayload): string { + private static _determineAddress(payload: JSONRPCRequestPayload): string { let address: string; switch (payload.method) { case 'eth_getTransactionCount': @@ -55,11 +54,7 @@ export class NonceTrackerSubprovider extends Subprovider { * @param end Callback to call if subprovider handled the request and wants to pass back the request. */ // tslint:disable-next-line:async-suffix - public async handleRequest( - payload: Web3.JSONRPCRequestPayload, - next: NextCallback, - end: ErrorCallback, - ): Promise { + public async handleRequest(payload: JSONRPCRequestPayload, next: NextCallback, end: ErrorCallback): Promise { switch (payload.method) { case 'eth_getTransactionCount': const requestDefaultBlock = providerEngineUtils.blockTagForPayload(payload); @@ -92,7 +87,7 @@ export class NonceTrackerSubprovider extends Subprovider { return next(); } } - private _handleSuccessfulTransaction(payload: Web3.JSONRPCRequestPayload): void { + private _handleSuccessfulTransaction(payload: JSONRPCRequestPayload): void { const address = NonceTrackerSubprovider._determineAddress(payload); const transaction = NonceTrackerSubprovider._reconstructTransaction(payload); // Increment the nonce from the previous successfully submitted transaction @@ -105,7 +100,7 @@ export class NonceTrackerSubprovider extends Subprovider { const nextPrefixedHexNonce = `0x${nextHexNonce}`; this._nonceCache[address] = nextPrefixedHexNonce; } - private _handleSendTransactionError(payload: Web3.JSONRPCRequestPayload, err: Error): void { + private _handleSendTransactionError(payload: JSONRPCRequestPayload, err: Error): void { const address = NonceTrackerSubprovider._determineAddress(payload); if (this._nonceCache[address] && _.includes(err.message, NONCE_TOO_LOW_ERROR_MESSAGE)) { delete this._nonceCache[address]; diff --git a/packages/subproviders/src/subproviders/redundant_rpc.ts b/packages/subproviders/src/subproviders/redundant_rpc.ts index ace2ed3c8..f8ff0915d 100644 --- a/packages/subproviders/src/subproviders/redundant_rpc.ts +++ b/packages/subproviders/src/subproviders/redundant_rpc.ts @@ -1,6 +1,6 @@ +import { JSONRPCRequestPayload } from '@0xproject/types'; import { promisify } from '@0xproject/utils'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import RpcSubprovider = require('web3-provider-engine/subproviders/rpc'); import { Callback } from '../types'; @@ -16,7 +16,7 @@ export class RedundantRPCSubprovider extends Subprovider { private _rpcs: RpcSubprovider[]; private static async _firstSuccessAsync( rpcs: RpcSubprovider[], - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: Callback, ): Promise { let lastErr: Error | undefined; @@ -55,7 +55,7 @@ export class RedundantRPCSubprovider extends Subprovider { */ // tslint:disable-next-line:async-suffix public async handleRequest( - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: Callback, end: (err: Error | null, data?: any) => void, ): Promise { diff --git a/packages/subproviders/src/subproviders/subprovider.ts b/packages/subproviders/src/subproviders/subprovider.ts index 4fa351e11..26ce19305 100644 --- a/packages/subproviders/src/subproviders/subprovider.ts +++ b/packages/subproviders/src/subproviders/subprovider.ts @@ -1,3 +1,4 @@ +import { JSONRPCRequestPayload, JSONRPCResponsePayload } from '@0xproject/types'; import promisify = require('es6-promisify'); import * as Web3 from 'web3'; @@ -37,9 +38,7 @@ export class Subprovider { * @param payload JSON RPC payload * @returns JSON RPC response payload */ - public async emitPayloadAsync( - payload: Partial, - ): Promise { + public async emitPayloadAsync(payload: Partial): Promise { const finalPayload = Subprovider._createFinalPayload(payload); const response = await promisify(this._engine.sendAsync, this._engine)(finalPayload); return response; diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts index 9bb9ff696..a1fec1882 100644 --- a/packages/subproviders/src/types.ts +++ b/packages/subproviders/src/types.ts @@ -1,8 +1,5 @@ -import { ECSignature } from '@0xproject/types'; +import { ECSignature, JSONRPCRequestPayload } from '@0xproject/types'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; - -export { ECSignature } from '@0xproject/types'; export interface LedgerCommunicationClient { close: () => Promise; @@ -116,6 +113,6 @@ export type Callback = () => void; export type OnNextCompleted = (err: Error | null, result: any, cb: Callback) => void; export type NextCallback = (callback?: OnNextCompleted) => void; -export interface JSONRPCRequestPayloadWithMethod extends Web3.JSONRPCRequestPayload { +export interface JSONRPCRequestPayloadWithMethod extends JSONRPCRequestPayload { method: string; } diff --git a/packages/subproviders/test/integration/ledger_subprovider_test.ts b/packages/subproviders/test/integration/ledger_subprovider_test.ts index a94cfbe3a..969081ad5 100644 --- a/packages/subproviders/test/integration/ledger_subprovider_test.ts +++ b/packages/subproviders/test/integration/ledger_subprovider_test.ts @@ -1,3 +1,4 @@ +import { JSONRPCResponsePayload } from '@0xproject/types'; import Eth from '@ledgerhq/hw-app-eth'; // HACK: This depdency is optional and tslint skips optional depdencies // tslint:disable-next-line:no-implicit-dependencies @@ -97,7 +98,7 @@ describe('LedgerSubprovider', () => { params: [], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(10); done(); @@ -115,7 +116,7 @@ describe('LedgerSubprovider', () => { params: [signer, messageHex], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(132); expect(response.result.substr(0, 2)).to.be.equal('0x'); @@ -135,7 +136,7 @@ describe('LedgerSubprovider', () => { params: [messageHex, signer], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(132); expect(response.result.substr(0, 2)).to.be.equal('0x'); @@ -155,7 +156,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.raw.length).to.be.equal(206); expect(response.result.raw.substr(0, 2)).to.be.equal('0x'); @@ -193,7 +194,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); const result = response.result; expect(result.length).to.be.equal(66); diff --git a/packages/subproviders/test/unit/ledger_subprovider_test.ts b/packages/subproviders/test/unit/ledger_subprovider_test.ts index 4c0803a29..3cb487f02 100644 --- a/packages/subproviders/test/unit/ledger_subprovider_test.ts +++ b/packages/subproviders/test/unit/ledger_subprovider_test.ts @@ -1,3 +1,4 @@ +import { JSONRPCResponsePayload } from '@0xproject/types'; import * as chai from 'chai'; import * as ethUtils from 'ethereumjs-util'; import * as _ from 'lodash'; @@ -112,7 +113,7 @@ describe('LedgerSubprovider', () => { params: [], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(10); expect(response.result[0]).to.be.equal(FAKE_ADDRESS); @@ -128,7 +129,7 @@ describe('LedgerSubprovider', () => { params: ['0x0000000000000000000000000000000000000000', messageHex], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result).to.be.equal( '0xa6cc284bff14b42bdf5e9286730c152be91719d478605ec46b3bebcd0ae491480652a1a7b742ceb0213d1e744316e285f41f878d8af0b8e632cbca4c279132d001', @@ -145,7 +146,7 @@ describe('LedgerSubprovider', () => { params: [messageHex, '0x0000000000000000000000000000000000000000'], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result).to.be.equal( '0xa6cc284bff14b42bdf5e9286730c152be91719d478605ec46b3bebcd0ae491480652a1a7b742ceb0213d1e744316e285f41f878d8af0b8e632cbca4c279132d001', @@ -168,7 +169,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.raw.length).to.be.equal(192); expect(response.result.raw.substr(0, 2)).to.be.equal('0x'); @@ -186,7 +187,7 @@ describe('LedgerSubprovider', () => { params: ['0x0000000000000000000000000000000000000000', nonHexMessage], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -201,7 +202,7 @@ describe('LedgerSubprovider', () => { params: [nonHexMessage, '0x0000000000000000000000000000000000000000'], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal('Expected data to be of type HexString, encountered: hello world'); done(); @@ -219,7 +220,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(LedgerSubproviderErrors.SenderInvalidOrNotSupplied); done(); @@ -238,7 +239,7 @@ describe('LedgerSubprovider', () => { params: [tx], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.not.be.a('null'); expect(err.message).to.be.equal(LedgerSubproviderErrors.SenderInvalidOrNotSupplied); done(); diff --git a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts index c3170745c..a347ab765 100644 --- a/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts +++ b/packages/subproviders/test/unit/redundant_rpc_subprovider_test.ts @@ -1,3 +1,4 @@ +import { JSONRPCResponsePayload } from '@0xproject/types'; import * as chai from 'chai'; import * as _ from 'lodash'; import Web3 = require('web3'); @@ -26,7 +27,7 @@ describe('RedundantRpcSubprovider', () => { params: [], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(10); done(); @@ -46,7 +47,7 @@ describe('RedundantRpcSubprovider', () => { params: [], id: 1, }; - const callback = reportCallbackErrors(done)((err: Error, response: Web3.JSONRPCResponsePayload) => { + const callback = reportCallbackErrors(done)((err: Error, response: JSONRPCResponsePayload) => { expect(err).to.be.a('null'); expect(response.result.length).to.be.equal(10); done(); diff --git a/packages/tslint-config/tsconfig.json b/packages/tslint-config/tsconfig.json index 85c88035a..fd9b23316 100644 --- a/packages/tslint-config/tsconfig.json +++ b/packages/tslint-config/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig", "compilerOptions": { + "typeRoots": ["node_modules/@types"], "outDir": "lib" }, "include": ["./rules/**/*", "./monorepo_scripts/**/*"] diff --git a/packages/types/package.json b/packages/types/package.json index 1142d252a..16737f5ea 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -22,15 +22,14 @@ "devDependencies": { "@0xproject/monorepo-scripts": "^0.1.14", "@0xproject/tslint-config": "^0.4.12", + "@types/node": "^8.0.53", "copyfiles": "^1.2.0", "shx": "^0.2.2", "tslint": "5.8.0", "typescript": "2.7.1" }, "dependencies": { - "@0xproject/typescript-typings": "^0.0.1", - "bignumber.js": "~4.1.0", - "web3": "^0.20.0" + "bignumber.js": "~4.1.0" }, "publishConfig": { "access": "public" diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 2147a3edb..57b14e230 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,14 +1,195 @@ import { BigNumber } from 'bignumber.js'; -import * as Web3 from 'web3'; -export interface TxData { +export type ContractAbi = AbiDefinition[]; + +export type AbiDefinition = FunctionAbi | EventAbi; + +export type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi; + +export type ConstructorStateMutability = 'nonpayable' | 'payable'; +export type StateMutability = 'pure' | 'view' | ConstructorStateMutability; + +export interface MethodAbi { + type: AbiType.Function; + name: string; + inputs: DataItem[]; + outputs: DataItem[]; + constant: boolean; + stateMutability: StateMutability; + payable: boolean; +} + +export interface ConstructorAbi { + type: AbiType.Constructor; + inputs: DataItem[]; + payable: boolean; + stateMutability: ConstructorStateMutability; +} + +export interface FallbackAbi { + type: AbiType.Fallback; + payable: boolean; +} + +export interface EventParameter extends DataItem { + indexed: boolean; +} + +export interface EventAbi { + type: AbiType.Event; + name: string; + inputs: EventParameter[]; + anonymous: boolean; +} + +export interface DataItem { + name: string; + type: string; + components: DataItem[]; +} + +export type OpCode = string; + +export interface StructLog { + depth: number; + error: string; + gas: number; + gasCost: number; + memory: string[]; + op: OpCode; + pc: number; + stack: string[]; + storage: { [location: string]: string }; +} + +export interface TransactionTrace { + gas: number; + returnValue: any; + structLogs: StructLog[]; +} + +export type Unit = + | 'kwei' + | 'ada' + | 'mwei' + | 'babbage' + | 'gwei' + | 'shannon' + | 'szabo' + | 'finney' + | 'ether' + | 'kether' + | 'grand' + | 'einstein' + | 'mether' + | 'gether' + | 'tether'; + +export interface JSONRPCRequestPayload { + params: any[]; + method: string; + id: number; + jsonrpc: string; +} + +export interface JSONRPCResponsePayload { + result: any; + id: number; + jsonrpc: string; +} + +export interface AbstractBlock { + number: number | null; + hash: string | null; + parentHash: string; + nonce: string | null; + sha3Uncles: string; + logsBloom: string | null; + transactionsRoot: string; + stateRoot: string; + miner: string; + difficulty: BigNumber; + totalDifficulty: BigNumber; + extraData: string; + size: number; + gasLimit: number; + gasUsed: number; + timestamp: number; + uncles: string[]; +} + +export interface BlockWithoutTransactionData extends AbstractBlock { + transactions: string[]; +} + +export interface BlockWithTransactionData extends AbstractBlock { + transactions: Transaction[]; +} + +export interface Transaction { + hash: string; + nonce: number; + blockHash: string | null; + blockNumber: number | null; + transactionIndex: number | null; + from: string; + to: string | null; + value: BigNumber; + gasPrice: BigNumber; + gas: number; + input: string; +} + +export interface CallTxDataBase { + to?: string; + value?: number | string | BigNumber; + gas?: number | string | BigNumber; + gasPrice?: number | string | BigNumber; data?: string; - from?: string; - gas?: number; - gasPrice?: BigNumber; nonce?: number; } +export interface TxData extends CallTxDataBase { + from: string; +} + +export interface CallData extends CallTxDataBase { + from?: string; +} + +export interface FilterObject { + fromBlock?: number | string; + toBlock?: number | string; + address?: string; + topics?: LogTopic[]; +} + +export type LogTopic = null | string | string[]; + +export interface DecodedLogEntry extends LogEntry { + event: string; + args: A; +} + +export interface DecodedLogEntryEvent extends DecodedLogEntry { + removed: boolean; +} + +export interface LogEntryEvent extends LogEntry { + removed: boolean; +} + +export interface LogEntry { + logIndex: number | null; + transactionIndex: number | null; + transactionHash: string; + blockHash: string | null; + blockNumber: number | null; + address: string; + data: string; + topics: string[]; +} + export interface TxDataPayable extends TxData { value?: BigNumber; } @@ -20,11 +201,11 @@ export interface TransactionReceipt { transactionIndex: number; from: string; to: string; - status: null | 0 | 1; + status: null | string | 0 | 1; cumulativeGasUsed: number; gasUsed: number; contractAddress: string | null; - logs: Web3.LogEntry[]; + logs: LogEntry[]; } export enum AbiType { @@ -40,8 +221,8 @@ export interface DecodedLogArgs { [argName: string]: ContractEventArg; } -export interface LogWithDecodedArgs extends Web3.DecodedLogEntry {} -export type RawLog = Web3.LogEntry; +export interface LogWithDecodedArgs extends DecodedLogEntry {} +export type RawLog = LogEntry; export enum SolidityTypes { Address = 'address', Uint256 = 'uint256', @@ -50,7 +231,7 @@ export enum SolidityTypes { } export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt { - logs: Array | Web3.LogEntry>; + logs: Array | LogEntry>; } // Earliest is omitted by design. It is simply an alias for the `0` constant and diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index c56d255d5..5ec2db5e0 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig", "compilerOptions": { + "typeRoots": ["node_modules/@types"], "outDir": "lib" }, "include": ["./src/**/*"] diff --git a/packages/typescript-typings/package.json b/packages/typescript-typings/package.json index 8fce84272..c38ebf1f7 100644 --- a/packages/typescript-typings/package.json +++ b/packages/typescript-typings/package.json @@ -20,6 +20,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme", "dependencies": { + "@0xproject/types": "^0.4.1", "bignumber.js": "~4.1.0" }, "devDependencies": { diff --git a/packages/typescript-typings/types/web3/index.d.ts b/packages/typescript-typings/types/web3/index.d.ts index cbe067b37..f4ebd41b9 100644 --- a/packages/typescript-typings/types/web3/index.d.ts +++ b/packages/typescript-typings/types/web3/index.d.ts @@ -1,5 +1,21 @@ declare module 'web3' { import * as BigNumber from 'bignumber.js'; + import { + AbiDefinition, + BlockWithTransactionData, + BlockWithoutTransactionData, + BlockParam, + CallData, + Unit, + TxData, + Transaction, + ContractAbi, + TransactionReceipt, + FilterObject, + LogEntryEvent, + JSONRPCRequestPayload, + JSONRPCResponsePayload, + } from '@0xproject/types'; type MixedData = string | number | object | any[] | BigNumber.BigNumber; @@ -22,10 +38,10 @@ declare module 'web3' { public fromAscii(ascii: string, padding?: number): string; public toDecimal(hex: string): number; public fromDecimal(value: number | string): string; - public fromWei(value: number | string, unit: Web3.Unit): string; - public fromWei(value: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; - public toWei(amount: number | string, unit: Web3.Unit): string; - public toWei(amount: BigNumber.BigNumber, unit: Web3.Unit): BigNumber.BigNumber; + public fromWei(value: number | string, unit: Unit): string; + public fromWei(value: BigNumber.BigNumber, unit: Unit): BigNumber.BigNumber; + public toWei(amount: number | string, unit: Unit): string; + public toWei(amount: BigNumber.BigNumber, unit: Unit): BigNumber.BigNumber; public toBigNumber(value: number | string): BigNumber.BigNumber; public isAddress(address: string): boolean; public isChecksumAddress(address: string): boolean; @@ -36,71 +52,16 @@ declare module 'web3' { class HttpProvider implements Web3.Provider { constructor(url?: string, timeout?: number, username?: string, password?: string); public sendAsync( - payload: Web3.JSONRPCRequestPayload, - callback: (err: Error, result: Web3.JSONRPCResponsePayload) => void, + payload: JSONRPCRequestPayload, + callback: (err: Error, result: JSONRPCResponsePayload) => void, ): void; } } namespace Web3 { - type ContractAbi = AbiDefinition[]; - - type AbiDefinition = FunctionAbi | EventAbi; - - type FunctionAbi = MethodAbi | ConstructorAbi | FallbackAbi; - - enum AbiType { - Function = 'function', - Constructor = 'constructor', - Event = 'event', - Fallback = 'fallback', - } - - type ConstructorStateMutability = 'nonpayable' | 'payable'; - type StateMutability = 'pure' | 'view' | ConstructorStateMutability; - - interface MethodAbi { - type: AbiType.Function; - name: string; - inputs: DataItem[]; - outputs: DataItem[]; - constant: boolean; - stateMutability: StateMutability; - payable: boolean; - } - - interface ConstructorAbi { - type: AbiType.Constructor; - inputs: DataItem[]; - payable: boolean; - stateMutability: ConstructorStateMutability; - } - - interface FallbackAbi { - type: AbiType.Fallback; - payable: boolean; - } - - interface EventParameter extends DataItem { - indexed: boolean; - } - - interface EventAbi { - type: AbiType.Event; - name: string; - inputs: EventParameter[]; - anonymous: boolean; - } - - interface DataItem { - name: string; - type: string; - components: DataItem[]; - } - interface ContractInstance { address: string; - abi: Web3.ContractAbi; + abi: ContractAbi; [name: string]: any; } @@ -110,66 +71,12 @@ declare module 'web3' { 'new'(...args: any[]): A; } - interface FilterObject { - fromBlock?: number | string; - toBlock?: number | string; - address?: string; - topics?: LogTopic[]; - } - - type LogTopic = null | string | string[]; - - interface DecodedLogEntry extends LogEntry { - event: string; - args: A; - } - - interface DecodedLogEntryEvent extends DecodedLogEntry { - removed: boolean; - } - - interface LogEntryEvent extends LogEntry { - removed: boolean; - } - interface FilterResult { get(callback: () => void): void; watch(callback: (err: Error, result: LogEntryEvent) => void): void; stopWatching(callback?: () => void): void; } - export interface JSONRPCRequestPayload { - params: any[]; - method: string; - id: number; - jsonrpc: string; - } - - export interface JSONRPCResponsePayload { - result: any; - id: number; - jsonrpc: string; - } - - export type OpCode = string; - - export interface StructLog { - depth: number; - error: string; - gas: number; - gasCost: number; - memory: string[]; - op: OpCode; - pc: number; - stack: string[]; - storage: { [location: string]: string }; - } - export interface TransactionTrace { - gas: number; - returnValue: any; - structLogs: StructLog[]; - } - interface Provider { sendAsync( payload: JSONRPCRequestPayload, @@ -189,7 +96,7 @@ declare module 'web3' { accounts: string[]; blockNumber: number; defaultAccount?: string; - defaultBlock: Web3.BlockParam; + defaultBlock: BlockParam; syncing: Web3.SyncingResult; compile: { solidity(sourceString: string, cb?: (err: Error, result: any) => void): object; @@ -202,55 +109,46 @@ declare module 'web3' { getSyncing(cd: (err: Error, syncing: Web3.SyncingResult) => void): void; isSyncing(cb: (err: Error, isSyncing: boolean, syncingState: Web3.SyncingState) => void): Web3.IsSyncing; - getBlock(hashStringOrBlockNumber: string | Web3.BlockParam): Web3.BlockWithoutTransactionData; + getBlock(hashStringOrBlockNumber: string | BlockParam): BlockWithoutTransactionData; getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - callback: (err: Error, blockObj: Web3.BlockWithoutTransactionData) => void, + hashStringOrBlockNumber: string | BlockParam, + callback: (err: Error, blockObj: BlockWithoutTransactionData) => void, ): void; getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, + hashStringOrBlockNumber: string | BlockParam, returnTransactionObjects: true, - ): Web3.BlockWithTransactionData; + ): BlockWithTransactionData; getBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, + hashStringOrBlockNumber: string | BlockParam, returnTransactionObjects: true, - callback: (err: Error, blockObj: Web3.BlockWithTransactionData) => void, + callback: (err: Error, blockObj: BlockWithTransactionData) => void, ): void; - getBlockTransactionCount(hashStringOrBlockNumber: string | Web3.BlockParam): number; + getBlockTransactionCount(hashStringOrBlockNumber: string | BlockParam): number; getBlockTransactionCount( - hashStringOrBlockNumber: string | Web3.BlockParam, + hashStringOrBlockNumber: string | BlockParam, callback: (err: Error, blockTransactionCount: number) => void, ): void; // TODO returnTransactionObjects + getUncle(hashStringOrBlockNumber: string | BlockParam, uncleNumber: number): BlockWithoutTransactionData; getUncle( - hashStringOrBlockNumber: string | Web3.BlockParam, - uncleNumber: number, - ): Web3.BlockWithoutTransactionData; - getUncle( - hashStringOrBlockNumber: string | Web3.BlockParam, + hashStringOrBlockNumber: string | BlockParam, uncleNumber: number, - callback: (err: Error, uncle: Web3.BlockWithoutTransactionData) => void, + callback: (err: Error, uncle: BlockWithoutTransactionData) => void, ): void; - getTransaction(transactionHash: string): Web3.Transaction; - getTransaction( - transactionHash: string, - callback: (err: Error, transaction: Web3.Transaction) => void, - ): void; + getTransaction(transactionHash: string): Transaction; + getTransaction(transactionHash: string, callback: (err: Error, transaction: Transaction) => void): void; + getTransactionFromBlock(hashStringOrBlockNumber: string | BlockParam, indexNumber: number): Transaction; getTransactionFromBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, + hashStringOrBlockNumber: string | BlockParam, indexNumber: number, - ): Web3.Transaction; - getTransactionFromBlock( - hashStringOrBlockNumber: string | Web3.BlockParam, - indexNumber: number, - callback: (err: Error, transaction: Web3.Transaction) => void, + callback: (err: Error, transaction: Transaction) => void, ): void; - contract(abi: Web3.AbiDefinition[]): Web3.Contract; + contract(abi: AbiDefinition[]): Web3.Contract; // TODO block param getBalance(addressHexString: string): BigNumber.BigNumber; @@ -264,10 +162,10 @@ declare module 'web3' { getCode(addressHexString: string): string; getCode(addressHexString: string, callback: (err: Error, code: string) => void): void; - filter(value: string | Web3.FilterObject): Web3.FilterResult; + filter(value: string | FilterObject): Web3.FilterResult; - sendTransaction(txData: Web3.TxData): string; - sendTransaction(txData: Web3.TxData, callback: (err: Error, value: string) => void): void; + sendTransaction(txData: TxData): string; + sendTransaction(txData: TxData, callback: (err: Error, value: string) => void): void; sendRawTransaction(rawTxData: string): string; sendRawTransaction(rawTxData: string, callback: (err: Error, value: string) => void): void; @@ -275,18 +173,18 @@ declare module 'web3' { sign(address: string, data: string): string; sign(address: string, data: string, callback: (err: Error, signature: string) => void): void; - getTransactionReceipt(txHash: string): Web3.TransactionReceipt | null; + getTransactionReceipt(txHash: string): TransactionReceipt | null; getTransactionReceipt( txHash: string, - callback: (err: Error, receipt: Web3.TransactionReceipt | null) => void, + callback: (err: Error, receipt: TransactionReceipt | null) => void, ): void; // TODO block param - call(callData: Web3.CallData): string; - call(callData: Web3.CallData, callback: (err: Error, result: string) => void): void; + call(callData: CallData): string; + call(callData: CallData, callback: (err: Error, result: string) => void): void; - estimateGas(callData: Web3.CallData): number; - estimateGas(callData: Web3.CallData, callback: (err: Error, gas: number) => void): void; + estimateGas(callData: CallData): number; + estimateGas(callData: CallData, callback: (err: Error, gas: number) => void): void; // TODO defaultBlock getTransactionCount(address: string): number; @@ -321,25 +219,6 @@ declare module 'web3' { getPeerCount(cd: (err: Error, peerCount: number) => void): void; } - type BlockParam = number | 'earliest' | 'latest' | 'pending'; - - type Unit = - | 'kwei' - | 'ada' - | 'mwei' - | 'babbage' - | 'gwei' - | 'shannon' - | 'szabo' - | 'finney' - | 'ether' - | 'kether' - | 'grand' - | 'einstein' - | 'mether' - | 'gether' - | 'tether'; - interface SyncingState { startingBlock: number; currentBlock: number; @@ -351,88 +230,6 @@ declare module 'web3' { addCallback(cb: (err: Error, isSyncing: boolean, syncingState: SyncingState) => void): void; stopWatching(): void; } - - interface AbstractBlock { - number: number | null; - hash: string | null; - parentHash: string; - nonce: string | null; - sha3Uncles: string; - logsBloom: string | null; - transactionsRoot: string; - stateRoot: string; - miner: string; - difficulty: BigNumber.BigNumber; - totalDifficulty: BigNumber.BigNumber; - extraData: string; - size: number; - gasLimit: number; - gasUsed: number; - timestamp: number; - uncles: string[]; - } - interface BlockWithoutTransactionData extends AbstractBlock { - transactions: string[]; - } - interface BlockWithTransactionData extends AbstractBlock { - transactions: Transaction[]; - } - - interface Transaction { - hash: string; - nonce: number; - blockHash: string | null; - blockNumber: number | null; - transactionIndex: number | null; - from: string; - to: string | null; - value: BigNumber.BigNumber; - gasPrice: BigNumber.BigNumber; - gas: number; - input: string; - } - - interface CallTxDataBase { - to?: string; - value?: number | string | BigNumber.BigNumber; - gas?: number | string | BigNumber.BigNumber; - gasPrice?: number | string | BigNumber.BigNumber; - data?: string; - nonce?: number; - } - - interface TxData extends CallTxDataBase { - from: string; - } - - interface CallData extends CallTxDataBase { - from?: string; - } - - interface TransactionReceipt { - blockHash: string; - blockNumber: number; - transactionHash: string; - transactionIndex: number; - from: string; - to: string; - status: null | string | 0 | 1; - cumulativeGasUsed: number; - gasUsed: number; - contractAddress: string | null; - logs: LogEntry[]; - } - - interface LogEntry { - logIndex: number | null; - transactionIndex: number | null; - transactionHash: string; - blockHash: string | null; - blockNumber: number | null; - address: string; - data: string; - topics: string[]; - } } /* tslint:disable */ export = Web3; diff --git a/packages/utils/src/abi_decoder.ts b/packages/utils/src/abi_decoder.ts index 2b496eb17..d49906cfb 100644 --- a/packages/utils/src/abi_decoder.ts +++ b/packages/utils/src/abi_decoder.ts @@ -1,13 +1,22 @@ -import { AbiType, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes } from '@0xproject/types'; +import { + AbiDefinition, + AbiType, + DecodedLogArgs, + EventAbi, + EventParameter, + LogEntry, + LogWithDecodedArgs, + RawLog, + SolidityTypes, +} from '@0xproject/types'; import * as ethersContracts from 'ethers-contracts'; import * as _ from 'lodash'; -import * as Web3 from 'web3'; import { BigNumber } from './configured_bignumber'; export class AbiDecoder { - private _savedABIs: Web3.AbiDefinition[] = []; - private _methodIds: { [signatureHash: string]: Web3.EventAbi } = {}; + private _savedABIs: AbiDefinition[] = []; + private _methodIds: { [signatureHash: string]: EventAbi } = {}; private static _padZeros(address: string) { let formatted = address; if (_.startsWith(formatted, '0x')) { @@ -17,11 +26,11 @@ export class AbiDecoder { formatted = _.padStart(formatted, 40, '0'); return `0x${formatted}`; } - constructor(abiArrays: Web3.AbiDefinition[][]) { + constructor(abiArrays: AbiDefinition[][]) { _.forEach(abiArrays, this._addABI.bind(this)); } // This method can only decode logs from the 0x & ERC20 smart contracts - public tryToDecodeLogOrNoop(log: Web3.LogEntry): LogWithDecodedArgs | RawLog { + public tryToDecodeLogOrNoop(log: LogEntry): LogWithDecodedArgs | RawLog { const methodId = log.topics[0]; const event = this._methodIds[methodId]; if (_.isUndefined(event)) { @@ -37,7 +46,7 @@ export class AbiDecoder { const decodedData = ethersInterface.events[event.name].parse(log.data); let failedToDecode = false; - _.forEach(event.inputs, (param: Web3.EventParameter, i: number) => { + _.forEach(event.inputs, (param: EventParameter, i: number) => { // Indexed parameters are stored in topics. Non-indexed ones in decodedData let value: BigNumber | string | number = param.indexed ? log.topics[topicsIndex++] : decodedData[i]; if (_.isUndefined(value)) { @@ -64,12 +73,12 @@ export class AbiDecoder { }; } } - private _addABI(abiArray: Web3.AbiDefinition[]): void { + private _addABI(abiArray: AbiDefinition[]): void { if (_.isUndefined(abiArray)) { return; } const ethersInterface = new ethersContracts.Interface(abiArray); - _.map(abiArray, (abi: Web3.AbiDefinition) => { + _.map(abiArray, (abi: AbiDefinition) => { if (abi.type === AbiType.Event) { const topic = ethersInterface.events[abi.name].topic; this._methodIds[topic] = abi; diff --git a/packages/web3-wrapper/src/index.ts b/packages/web3-wrapper/src/index.ts index 2ce2580ee..87c69b269 100644 --- a/packages/web3-wrapper/src/index.ts +++ b/packages/web3-wrapper/src/index.ts @@ -1,4 +1,16 @@ -import { RawLogEntry, TransactionReceipt, TxData } from '@0xproject/types'; +import { + BlockParam, + BlockWithoutTransactionData, + CallData, + ContractAbi, + FilterObject, + JSONRPCRequestPayload, + JSONRPCResponsePayload, + LogEntry, + RawLogEntry, + TransactionReceipt, + TxData, +} from '@0xproject/types'; import { BigNumber, promisify } from '@0xproject/utils'; import * as _ from 'lodash'; import * as Web3 from 'web3'; @@ -157,8 +169,8 @@ export class Web3Wrapper { * @param blockParam The block you wish to fetch (blockHash, blockNumber or blockLiteral) * @returns The requested block without transaction data */ - public async getBlockAsync(blockParam: string | Web3.BlockParam): Promise { - const block = await promisify(this._web3.eth.getBlock)(blockParam); + public async getBlockAsync(blockParam: string | BlockParam): Promise { + const block = await promisify(this._web3.eth.getBlock)(blockParam); return block; } /** @@ -166,7 +178,7 @@ export class Web3Wrapper { * @param blockParam The block you wish to fetch (blockHash, blockNumber or blockLiteral) * @returns The block's timestamp */ - public async getBlockTimestampAsync(blockParam: string | Web3.BlockParam): Promise { + public async getBlockTimestampAsync(blockParam: string | BlockParam): Promise { const { timestamp } = await this.getBlockAsync(blockParam); return timestamp; } @@ -214,7 +226,7 @@ export class Web3Wrapper { * @param filter Parameters by which to filter which logs to retrieve * @returns The corresponding log entries */ - public async getLogsAsync(filter: Web3.FilterObject): Promise { + public async getLogsAsync(filter: FilterObject): Promise { let fromBlock = filter.fromBlock; if (_.isNumber(fromBlock)) { fromBlock = this._web3.toHex(fromBlock); @@ -243,7 +255,7 @@ export class Web3Wrapper { * @param abi Smart contract ABI * @returns Web3 contract factory which can create Web3 Contract instances from the supplied ABI */ - public getContractFromAbi(abi: Web3.ContractAbi): Web3.Contract { + public getContractFromAbi(abi: ContractAbi): Web3.Contract { const web3Contract = this._web3.eth.contract(abi); return web3Contract; } @@ -252,7 +264,7 @@ export class Web3Wrapper { * @param txData Transaction data * @returns Estimated gas cost */ - public async estimateGasAsync(txData: Partial): Promise { + public async estimateGasAsync(txData: Partial): Promise { const gas = await promisify(this._web3.eth.estimateGas)(txData); return gas; } @@ -262,7 +274,7 @@ export class Web3Wrapper { * @param defaultBlock Block height at which to make the call. Defaults to `latest` * @returns The raw call result */ - public async callAsync(callData: Web3.CallData, defaultBlock?: Web3.BlockParam): Promise { + public async callAsync(callData: CallData, defaultBlock?: BlockParam): Promise { const rawCallResult = await promisify(this._web3.eth.call)(callData, defaultBlock); return rawCallResult; } @@ -271,13 +283,13 @@ export class Web3Wrapper { * @param txData Transaction data * @returns Transaction hash */ - public async sendTransactionAsync(txData: Web3.TxData): Promise { + public async sendTransactionAsync(txData: TxData): Promise { const txHash = await promisify(this._web3.eth.sendTransaction)(txData); return txHash; } - private async _sendRawPayloadAsync(payload: Partial): Promise { + private async _sendRawPayloadAsync(payload: Partial): Promise { const sendAsync = this._web3.currentProvider.sendAsync.bind(this._web3.currentProvider); - const response = await promisify(sendAsync)(payload); + const response = await promisify(sendAsync)(payload); const result = response.result; return result; } @@ -295,7 +307,7 @@ export class Web3Wrapper { return status; } } - private _formatLog(rawLog: RawLogEntry): Web3.LogEntry { + private _formatLog(rawLog: RawLogEntry): LogEntry { const formattedLog = { ...rawLog, logIndex: this._hexToDecimal(rawLog.logIndex), diff --git a/packages/website/ts/containers/web3_wrapper_documentation.ts b/packages/website/ts/containers/web3_wrapper_documentation.ts index 0a0911b80..289006f10 100644 --- a/packages/website/ts/containers/web3_wrapper_documentation.ts +++ b/packages/website/ts/containers/web3_wrapper_documentation.ts @@ -48,26 +48,25 @@ const docsInfoConfig: DocsInfoConfig = { 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'], + publicTypes: [ + 'TxData', + 'TransactionReceipt', + 'RawLogEntry', + 'ContractAbi', + 'BlockParam', + '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', - BigNumber: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L127', - LogEntryEvent: 'http://mikemcl.github.io/bignumber.js', - CallData: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L348', - BlockWithoutTransactionData: - 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L314', - LogEntry: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L366', - FilterObject: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L109', - ['Web3.BlockParam']: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L278', - ['Web3.ContractAbi']: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L47', + BigNumber: 'http://mikemcl.github.io/bignumber.js', }, typeNameToPrefix: { Provider: 'Web3', - CallData: 'Web3', - BlockWithoutTransactionData: 'Web3', - LogEntry: 'Web3', - FilterObject: 'Web3', }, typeNameToDocSection: { Web3Wrapper: docSections.web3Wrapper, diff --git a/packages/website/ts/globals.d.ts b/packages/website/ts/globals.d.ts index ef276519c..3791b3269 100644 --- a/packages/website/ts/globals.d.ts +++ b/packages/website/ts/globals.d.ts @@ -115,11 +115,11 @@ declare module 'web3-provider-engine/subproviders/subprovider' { export = Subprovider; } declare module 'web3-provider-engine/subproviders/rpc' { - import * as Web3 from 'web3'; + import { JSONRPCRequestPayload } from '@0xproject/types'; class RpcSubprovider { constructor(options: { rpcUrl: string }); public handleRequest( - payload: Web3.JSONRPCRequestPayload, + payload: JSONRPCRequestPayload, next: () => void, end: (err: Error | null, data?: any) => void, ): void; diff --git a/yarn.lock b/yarn.lock index abc80e324..106548195 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13,15 +13,6 @@ lodash "^4.17.4" tslint-react "^3.2.0" -"@0xproject/utils@^0.3.4": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@0xproject/utils/-/utils-0.3.4.tgz#263ac7a5ef0b4c65ce893d3e6d1e9b1c2cf75b0b" - dependencies: - bignumber.js "~4.1.0" - js-sha3 "^0.7.0" - lodash "^4.17.4" - web3 "^0.20.0" - "@ledgerhq/hw-app-eth@^4.3.0": version "4.7.3" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.7.3.tgz#d352e19658ae296532e522c53c8ec2a1a77b64e5" @@ -12465,12 +12456,6 @@ web3-typescript-typings@^0.10.2: dependencies: bignumber.js "~4.1.0" -web3-typescript-typings@^0.9.11: - version "0.9.11" - resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.9.11.tgz#2f5464e572843b0853f47a1a0801029d6dfb5793" - dependencies: - bignumber.js "~4.1.0" - web3-utils@1.0.0-beta.33: version "1.0.0-beta.33" resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.0.0-beta.33.tgz#e091b7994f09b714b0198a4057d3ad2eb8cbe238" -- cgit v1.2.3 From 0b09cc36b06f1c51eac95fc6ad851a14800658b2 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 28 Mar 2018 10:26:56 +0200 Subject: Remove redundant cast --- packages/contract_templates/partials/callAsync.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contract_templates/partials/callAsync.handlebars b/packages/contract_templates/partials/callAsync.handlebars index 2d9028ad5..e3fc2bdf9 100644 --- a/packages/contract_templates/partials/callAsync.handlebars +++ b/packages/contract_templates/partials/callAsync.handlebars @@ -16,7 +16,7 @@ async callAsync( } ) const rawCallResult = await self._web3Wrapper.callAsync(callDataWithDefaults, defaultBlock); - const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs as DataItem[]; + const outputAbi = (_.find(self.abi, {name: '{{this.name}}'}) as MethodAbi).outputs; const outputParamsTypes = _.map(outputAbi, 'type'); let resultArray = ethersContracts.Interface.decodeParams(outputParamsTypes, rawCallResult) as any; resultArray = BaseContract._transformABIData(outputAbi, resultArray, BaseContract._lowercaseAddress.bind(this)); -- cgit v1.2.3 From 01e27426d643b525661e044dbb8c8f27734329e7 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 28 Mar 2018 10:43:42 +0200 Subject: Fix stubbing of a non-existent property --- packages/0x.js/test/0x.js_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/0x.js/test/0x.js_test.ts b/packages/0x.js/test/0x.js_test.ts index 8ba2e53f7..70e85aa52 100644 --- a/packages/0x.js/test/0x.js_test.ts +++ b/packages/0x.js/test/0x.js_test.ts @@ -237,7 +237,7 @@ describe('ZeroEx library', () => { s: '0x2dea66f25a608bbae457e020fb6decb763deb8b7192abab624997242da248960', }; stubs = [ - Sinon.stub((zeroEx as any)._web3Wrapper, 'signTransactionAsync').returns(Promise.resolve(signature)), + Sinon.stub((zeroEx as any)._web3Wrapper, 'signMessageAsync').returns(Promise.resolve(signature)), Sinon.stub(ZeroEx, 'isValidSignature').returns(true), ]; -- cgit v1.2.3 From defd249565ba48d5cb264edd4305f089ae3159dd Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 29 Mar 2018 12:49:39 +0200 Subject: Standardize changelog dates and format --- packages/0x.js/CHANGELOG.md | 28 ++++++++++++++-------------- packages/tslint-config/CHANGELOG.md | 2 +- packages/web3-wrapper/CHANGELOG.md | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index 820c25449..f4f5f415b 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -237,11 +237,11 @@ * Added `zeroEx.token.setUnlimitedAllowanceAsync` (#137) * Added `zeroEx.token.UNLIMITED_ALLOWANCE_IN_BASE_UNITS` (#137) -## v0.10.4 - _Aug 24, 2017_ +## v0.10.4 - _August 24, 2017_ * Fixed a bug where checksummed addresses were being pulled from artifacts and not lower-cased. (#135) -## v0.10.1 - _Aug 24, 2017_ +## v0.10.1 - _August 24, 2017_ * Added `zeroEx.exchange.validateFillOrderThrowIfInvalidAsync` (#128) * Added `zeroEx.exchange.validateFillOrKillOrderThrowIfInvalidAsync` (#128) @@ -256,20 +256,20 @@ * Added clear error message when checksummed address is passed to a public method (#124) * Fixes the description of `shouldThrowOnInsufficientBalanceOrAllowance` in docs (#127) -## v0.9.3 - _Aug 22, 2017_ +## v0.9.3 - _August 22, 2017_ * Update contract artifacts to include latest Kovan and Mainnet deploys (#118) -## v0.9.2 - _Aug 21, 2017_ +## v0.9.2 - _August 21, 2017_ * *This version was unpublished because of a publishing issue.* * Update contract artifacts to include latest Kovan and Mainnet deploys (#118) -## v0.9.1 - _Aug. 16, 2017_ +## v0.9.1 - _August 16, 2017_ * Fixed the bug causing `zeroEx.token.getBalanceAsync()` to fail if no addresses available (#120) -## v0.9.0 - _Jul. 26, 2017_ +## v0.9.0 - _July 26, 2017_ * Migrated to the new version of smart contracts (#101) * Removed the ability to call methods on multiple authorized Exchange smart contracts (#106) @@ -280,7 +280,7 @@ * Updated to typescript v2.4 (#104) * Fixed an issue with incorrect balance/allowance validation when ZRX is one of the tokens traded (#109) -## v0.8.0 - _Jul. 4, 2017_ +## v0.8.0 - _July 4, 2017_ * Added the ability to call methods on different authorized versions of the Exchange smart contract (#82) * Updated contract artifacts to reflect latest changes to the smart contracts (0xproject/contracts#59) @@ -293,35 +293,35 @@ * `zeroEx.tokenRegistry.invalidateContractInstance` * Fixed the bug where `zeroEx.setProviderAsync` didn't invalidate etherToken contract's instance -## v0.7.1 - _Jun. 26, 2017_ +## v0.7.1 - _June 26, 2017_ * Added the ability to convert Ether to wrapped Ether tokens and back via `zeroEx.etherToken.depostAsync` and `zeroEx.etherToken.withdrawAsync` (#81) -## v0.7.0 - _Jun. 22, 2017_ +## v0.7.0 - _June 22, 2017_ * Added Kovan smart contract artifacts (#78) * Started returning fillAmount from `fillOrderAsync` and `fillUpToAsync` (#72) * Started returning cancelledAmount from `cancelOrderAsync` (#72) * Renamed type `LogCancelArgs` to `LogCancelContractEventArgs` and `LogFillArgs` to `LogFillContractEventArgs` -## v0.6.2 - _Jun. 21, 2017_ +## v0.6.2 - _June 21, 2017_ * Reduced bundle size * Improved documentation -## v0.6.1 - _Jun. 19, 2017_ +## v0.6.1 - _June 19, 2017_ * Improved documentation -## v0.6.0 - _Jun. 19, 2017_ +## v0.6.0 - _June 19, 2017_ * Made `ZeroEx` class accept `Web3Provider` instance instead of `Web3` instance * Added types for contract event arguments -## v0.5.2 - _Jun. 15, 2017_ +## v0.5.2 - _June 15, 2017_ * Fixed the bug in `postpublish` script that caused that only unminified UMD bundle was uploaded to release page -## v0.5.1 - _Jun. 15, 2017_ +## v0.5.1 - _June 15, 2017_ * Added `postpublish` script to publish to Github Releases with assets. diff --git a/packages/tslint-config/CHANGELOG.md b/packages/tslint-config/CHANGELOG.md index 18e4980e7..f6454d67c 100644 --- a/packages/tslint-config/CHANGELOG.md +++ b/packages/tslint-config/CHANGELOG.md @@ -21,7 +21,7 @@ * Added rules for unused imports, variables and Async suffixes (#265) -## v0.1.0 - _Nov. 14, 2017_ +## v0.1.0 - _November 14, 2017_ * Re-published TsLintConfig previously published under NPM package `tslint-config-0xproject` * Updated to TSLint v5.8.0, requiring several rule additions to keep our conventions aligned. diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 9fbc9021c..d86a759a8 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -1,22 +1,22 @@ # CHANGELOG -## v0.4.0 _TBD_ +## v0.4.0 - _TBD_ * Rename `signTransactionAsync` to `signMessageAsync` for clarity (#465) -## v0.3.0 _March 18, 2018_ +## v0.3.0 - _March 18, 2018_ * Add `web3Wrapper.takeSnapshotAsync`, `web3Wrapper.revertSnapshotAsync`, `web3Wrapper.mineBlockAsync`, `web3Wrapper.increaseTimeAsync` (#426) * Add `web3Wrapper.isZeroExWeb3Wrapper` for runtime instanceOf checks (#426) * Add a `getProvider` method (#444) -## v0.2.0 _March 4, 2018_ +## v0.2.0 - _March 4, 2018_ * Ensure all returned user addresses are lowercase (#373) * Add `web3Wrapper.callAsync` (#413) * Make `web3Wrapper.estimateGas` accept whole `txData` instead of `data` (#413) * Remove `web3Wrapper.getContractInstance` (#413) -## v0.1.12 _February 9, 2018_ +## v0.1.12 - _February 9, 2018_ * Fix publishing issue where .npmignore was not properly excluding undesired content (#389) -- cgit v1.2.3 From 1337b6928a78ab53d7f3971fe9c809900fa356db Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 29 Mar 2018 17:17:41 +0200 Subject: Update Yarn.lock --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 106548195..f5e4729c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -752,7 +752,7 @@ async-eventemitter@^0.2.2: dependencies: async "^2.4.0" -"async-eventemitter@github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c": +async-eventemitter@ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c: version "0.2.3" resolved "https://codeload.github.com/ahultgren/async-eventemitter/tar.gz/fa06e39e56786ba541c180061dbf2c0a5bbf951c" dependencies: @@ -1684,13 +1684,13 @@ big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" -"bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2": +"bignumber.js@git+https://github.com/debris/bignumber.js#master": version "2.0.7" - resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + resolved "git+https://github.com/debris/bignumber.js#c7a38de919ed75e6fb6ba38051986e294b328df9" -"bignumber.js@git+https://github.com/debris/bignumber.js.git#master": +"bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2": version "2.0.7" - resolved "git+https://github.com/debris/bignumber.js.git#c7a38de919ed75e6fb6ba38051986e294b328df9" + resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" "bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git": version "2.0.7" -- cgit v1.2.3 From c4dd9658e791a9f821ea3b6eb4326bcba53b081a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 29 Mar 2018 17:44:50 +0200 Subject: Fix CHANGELOG --- packages/0x.js/CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/0x.js/CHANGELOG.md b/packages/0x.js/CHANGELOG.md index f4f5f415b..ca6b985d3 100644 --- a/packages/0x.js/CHANGELOG.md +++ b/packages/0x.js/CHANGELOG.md @@ -41,10 +41,7 @@ ## v0.31.0 - _January 30, 2018_ - * Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the - caller can decide on whether to add the personalMessage prefix before relaying the request - to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects - it to have already been added. (#349) + * Add the `shouldAddPersonalMessagePrefix` parameter to `signOrderHashAsync` so that the caller can decide on whether to add the personalMessage prefix before relaying the request to the signer. Parity Signer, Ledger and TestRPC add the prefix themselves, Metamask expects it to have already been added. (#349) ## v0.30.2 - _January 29, 2018_ -- cgit v1.2.3